File::Slurp::SmallFile - Slurps a file, omitting blank lines.
Version 0.02
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
Not exported by default, but you can export it by specifing its name as an argument to Exporter.
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.
$filename couldn't be opened due to an operating system error ($!).
Jonathan Rockway, <jon-cpan@jrock.us>
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 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.