Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: perlrun -0777 option

by Anonymous Monk
on Jun 26, 2003 at 16:28 UTC ( [id://269296]=note: print w/replies, xml ) Need Help??


in reply to perlrun -0777 option

I've never dealt with Unicode so i can't help you there, but if you're looking to slurp a file into an array or scalar (something considered bad by most people, which i do a lot of ) why are you not using local?
my $var = ''; # or perhaps my @var = (); { local $/ = undef; open(FH,"<myfilepath/andname") or die "A horrible death $!"; $var = <FH> ; close(FH); }
Does unicode somehow thwart an undef'ed input record seperator ( $/ )?

Replies are listed 'Best First'.
Re: Re: perlrun -0777 option
by John M. Dlugosz (Monsignor) on Jun 26, 2003 at 16:53 UTC
    Because I want to do it with perl -pe. That is, the open, read, and print are all done in the stock set-up.
      So just do...
      perl -pe 'BEGIN { $/ = undef; } whatever'
      
Re: Re: perlrun -0777 option
by dataDrone (Acolyte) on Jun 26, 2003 at 16:29 UTC
    FYI... That was Me, forgot i logged out...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found