Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Replacing whitespace with null

by mfriedman (Monk)
on Oct 11, 2002 at 18:01 UTC ( #204610=note: print w/replies, xml ) Need Help??


in reply to Replacing whitespace with null

Your problem is that you are using ^ in the beginning of your pattern. ^ matches the beginning of the string, but your whitespaces are not immediately after the beginning; there are letters in the way. Try something like:

$_ =~ s/\s+$//g;

That will remove all whitespace at the end of the string.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2021-06-23 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (121 votes). Check out past polls.

    Notices?