On Wed, Jul 15, 2009 at 09:31, Kelly Jones<[email protected]> wrote:
> According to "man perlrun", the "-0777" option sets $/ to 0777 and
> slurps files whole. This works fine.
>
> However, when I did 'local $/="0777"' in a script, it usually worked,
> but sometimes failed and only slurped part of the file.
>
> Changing this to "local $/ = undef" worked fine.
>
> Why?
snip

Because -0777 is a command line flag, not a valid value for $/.  See
the [docs for $/][1] for more information.

[1] : http://perldoc.perl.org/perlvar.html#$/

-- 
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

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


Reply via email to