Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: New Line removal from both Unix & Win32

by Aristotle (Chancellor)
on Dec 30, 2002 at 17:07 UTC ( #223079=note: print w/replies, xml ) Need Help??


in reply to New Line removal from both Unix & Win32

Please, never never use $^O eq $foo. Do a pattern match instead: $^O =~ /Win32/i. But judging from your error message I'm guessing that your Linux box is using an older version of Perl (5.005 or earlier) which doesn't autovivify filehandles so it's barfing at the open with a lexical variable. You have to write it as follows:

use Symbol (); my $fh = Symbol::gensym(); open $fh, "+<", $Conf[1] or warn "$!";
And please please use the three-argument from of open (as shown in my snippet).

Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://223079]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (9)
As of 2023-12-11 11:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (41 votes). Check out past polls.

    Notices?