Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Escaping white space with qw//

by thatguy (Parson)
on Aug 10, 2001 at 22:06 UTC ( #103974=note: print w/ replies, xml ) Need Help??


in reply to Escaping white space with qw//

what about assigning your values to an variable sepereated by a comma and then spliting it into an array?

my $values="one,two,three,four and a half,five"; my @array=split(/,/, $values);
more than one way and all that.

Update: as dga pointed out, this would run into the same problem you are having now should a comma ever make it's way into your data.

I think if you have a good idea of what your data will look like then use whatever you feel comfortable with as your delimiter.
-p


Comment on Re: Escaping white space with qw//
Download Code
Re: Re: Escaping white space with qw//
by dga (Hermit) on Aug 10, 2001 at 22:11 UTC

    Though same problem with a character in the input data which is special.

    Though maybe if having the values in a compact area is desired.

    my $values="one , two , three , four and a half , five"; my @array=split(' , ', $values);

    This would split on a series of characters unlikely to appear naturally.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2015-07-07 08:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls