Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: what is the function should I need to use for trim white spaces ?

by ikegami (Patriarch)
on Jan 11, 2006 at 19:32 UTC ( [id://522541]=note: print w/replies, xml ) Need Help??


in reply to Re: what is the function should I need to use for trim white spaces ?
in thread what is the function should I need to use for trim white spaces ?

Assinging to $_ without localizing it is dangerous.
(local $_ = $before) =~ s/^\s+|\s+$//g;
or
(my $after = $before) =~ s/^\s+|\s+$//g;
should be used in just almost all cicumstances.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-23 06:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found