Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: spliting new lines and spaces

by krusty (Hermit)
on May 07, 2004 at 15:57 UTC ( [id://351503]=note: print w/replies, xml ) Need Help??


in reply to spliting new lines and spaces

The sample code you have given only contains one element in the array. Is that what you really meant?

The following code should work to get rid of any whitespace characters (tab, newline, form feed, literal space, carraige return) in the elements of your array:
foreach (@test){ s/\s+//g; }
Good luck,
Kris

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-25 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found