Dan Kogai > File-Glob-Slurp-0.02 > File::Glob::Slurp

Download:
File-Glob-Slurp-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

File::Glob::Slurp - Turns <> into a slurp operator

VERSION ^

$Id: Slurp.pm,v 0.2 2009/06/10 05:51:19 dankogai Exp dankogai $

SYNOPSIS ^

Quick summary of what the module does.

Perhaps a little code snippet.

  use File::Glob::Slurp;
  # slurps path/to/filename.ext
  my $home = <path/to/filename.ext>; 
  # you can do this if you have LWP::Simple
  my $away = <http://example.com/>;

EXPORT ^

tweaks CORE::GLOBAL::glob

DESCRIPTION ^

HACK #90 of PERL HACK proved that <*glob*> operator is a pretty good place to implement micro-DSL. This module turns ancient *glob* operator into modern slurp operator!

As shown in "SYNOPSIS", The overridden <> slurps not only local files but also URL if you have LWP::Simple installed.

CAVEAT

Unfortunately <> also acts as readline(). Therefore

  my $content = <$path>;

Does not work. In such cases simply add whitespece like:

  my $content = < $path >;

AUTHOR ^

Dan Kogai, <dankogai at dan.co.jp>

BUGS ^

Please report any bugs or feature requests to bug-file-glob-slurp at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Glob-Slurp. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc File::Glob::Slurp

You can also look for information at:

ACKNOWLEDGEMENTS ^

Hack #90 of Perl Hacks http://oreilly.com/catalog/9780596526740/

Perl6::Slurp

COPYRIGHT & LICENSE ^

Copyright 2009 Dan Kogai, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: