Thread perlfaq 5 - slurp (16 answers)
Opened by Schlumpf at 2009-09-11 10:54

LanX-
 2009-09-11 13:09
#125639 #125639
User since
2008-07-15
1000 Artikel
BenutzerIn

user image
Guest Schlumpf
Hallo!

perlfaq 5

"How do I change, delete, or insert a line in a file, or append to the beginning of a file?"

7. Beispiel.

Für mich wäre es verständlicher wenn man statt:

Code (perl): (dl )
my @lines = do { local $/; <$in> }; # slurp!

Code (perl): (dl )
my $scalar = do { local $/; <$in> }; # slurp!

schreiben würde.


Guest Smurph
Subject: Error of Perlfaq?

Hello Brian!

Concerning perlfaq 5

"How do I change, delete, or insert a line in a file, or append to the beginning of a file?"

7th example:

Code (perl): (dl )
my @lines = do { local $/; <$in> }; # slurp!


which doesn't really make sense for me...

Wouldn't it make more sense to write

Code (perl): (dl )
my $scalar = do { local $/; <$in> }; # slurp!


instead?

Bye
Smurph

View full thread perlfaq 5 - slurp