>>>>> "KJ" == Kelly Jones <[email protected]> writes:

  KJ> According to "man perlrun", the "-0777" option sets $/ to 0777 and
  KJ> slurps files whole. This works fine.

  KJ> However, when I did 'local $/="0777"' in a script, it usually worked,
  KJ> but sometimes failed and only slurped part of the file.

  KJ> Changing this to "local $/ = undef" worked fine.

and to slurp in a file cleanly and faster use File::Slurp from
cpan. setting $/ works but it needs more code and using a special
variable which makes your code harder to read and maintain.

uri

-- 
Uri Guttman  ------  [email protected]  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to