Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Perl subroutine to slurp up the contents of a text file
sub slurp {
my $f = shift;
open ( F, $f ) or die "Can't open $f: $!\n";
my $r = do { local $/; <F> };
close F;
return $r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.