Common-CodingTools
view release on metacpan or search on metacpan
lib/Common/CodingTools.pm view on Meta::CPAN
my $string = slurp_file('/file/name');
=cut
sub slurp_file {
my $file = shift;
# Read in a text file without using open
if (-e $file) {
return (
do { local (@ARGV, $/) = $file; <> }
);
}
return (undef);
} ## end sub slurp_file
=head2 ltrim
Removes any spaces at the beginning of a string (the left side).
my $result = ltrim($string);
( run in 1.791 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )