Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: spliting new lines and spaces

by krusty (Hermit)
on May 07, 2004 at 15:57 UTC ( #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
Node Status?
node history
Node Type: note [id://351503]
help
Chatterbox?
[abner]: can someone give me a hint about how to query a mysql table based on matches in two columns?
[atcroft]: abner: Do you mean something like SELECT `foo`, `bar` FROM `table_name' WHERE (( `foo` = "asdf" ) OR ( `bar` = 'asdw' )); Or something else?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-01-24 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (201 votes). Check out past polls.