Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by asarih (Hermit)
on Sep 24, 2003 at 20:51 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-15 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found