Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: weird perl verion and/or OS problem with newlines

by asarih (Hermit)
on Sep 24, 2003 at 20:51 UTC ( #294012=note: print w/replies, xml ) Need Help??


in reply to weird perl verion and/or OS problem with newlines

How big are these attachments? It looks like you're putting the entire content of <STDIN> to $str, and this might be causing the seg faults. I think the following (untested) code does what the code does, without consuming too much memory. Comments welcome.
while (<>) { my $val=''; if (/^\#:lav/) { $_.=<>; $val.="$_\n"; while (/^#:eof/m) { $val.="$_\n"; $_.=<>; } } print $val; }
Update: fixed the bonehead error of using next inside the loops.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2022-08-08 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?