File::Slurp::SmallFile - Slurps a file, omitting blank lines.


NAME

File::Slurp::SmallFile - Slurps a file, omitting blank lines.


VERSION

Version 0.02


SYNOPSIS

Slurps a file, omitting blank lines. In scalar context, only slurps the first non-blank line. In list context, slurps each line into an array. Each line is chomp'd and blank lines are ignored.

     use File::Slurp::SmallFile qw(slurp);
     
     my $first_line = slurp("/path/to/a/file");
     my @all_lines  = slurp("/path/to/another/file");
         
     =head1 EXPORT
     

slurp

Not exported by default, but you can export it by specifing its name as an argument to Exporter.


FUNCTIONS

slurp

Reads chomped, non-blank lines from a file. Returns the first in scalar context, or all of them in array context. Returns undef if there were no lines to return.

Dies if the file can't be opened. See DIAGNOSTICS.

"Couldn't open $filename: $!"

$filename couldn't be opened due to an operating system error ($!).


AUTHOR

Jonathan Rockway, <jon-cpan@jrock.us>


BUGS

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


COPYRIGHT & LICENSE

Copyright 2005 Jonathan Rockway, all rights reserved.

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