Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: removing all whitespace but newlines

by ibanix (Hermit)
on Jan 28, 2003 at 19:34 UTC ( [id://230702]=note: print w/replies, xml ) Need Help??


in reply to removing all whitespace but newlines

How do you delete all whitespace but the newline?

A simple and probally inefficent way to do it, assuming you're processing one line at a time:

$line =~ s/\s+//g; # But this replaces \n too, so add it back on the end $line . "\n";

Cheers,
ibanix

$ echo '$0 & $0 &' > foo; chmod a+x foo; foo;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 08:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found