Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by ikegami (Pope)
on Jan 11, 2006 at 19:32 UTC ( #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
Node Status?
node history
Node Type: note [id://522541]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2020-06-01 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?