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

Re: Re: split and join

by Albannach (Prior)
on Apr 22, 2002 at 23:42 UTC ( #161181=note: print w/ replies, xml ) Need Help??


in reply to Re: split and join
in thread split and join

split takes a pattern (more or less a regular expression, though there are special cases you might want to read up on), not a static string to separate chunks in the input string, and it happens that the '+' character is special, so you just need to escape it like so:

@array = split '\+', 'abc+def'; print "@array";
gives abc def
By the way, you might want to provide the actual error message in future if you need assistance, as "chucking a spazz" covers a lot of bases!

--
I'd like to be able to assign to an luser


Comment on Re: Re: split and join
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (13)
As of 2014-09-18 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (111 votes), past polls