in reply to put file content into a string
Of course, more than one. Try:
{ local $/ = undef; open my $fd, '<', 'file' or die "open: $!"; my $txt = <$fd>; close $fd; }
Or:
open my $fd, '<', '/home/hue/f1' or die "open: $!"; my $txt = join '', <$fd>; close $fd;
Be sure to take a look at perldoc perlop for insights on this and many other subjects.
--
David Serrano
|
|---|