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

Re: Dealing with '@' in Text Strings

by Rudolf (Pilgrim)
on Sep 10, 2012 at 19:29 UTC ( #992833=note: print w/replies, xml ) Need Help??


in reply to Dealing with '@' in Text Strings

To split this string into two seperate email values stored in an array, you can use the split() function which takes two arguemnts. The delimiter on which to seperate the original string ( in your case it looks like your using a comma ) and the string itself. To turn @ into a literal, use single quotes for $x or excape them with \@:

my $x = 'jdoe@somewhere.com,bdoakes@nowhere.com'; my @list = split(/,/,$x); # /,/ specifies the delimiter

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992833]
help
Chatterbox?
choroba tried to solve Week of Code 37
[choroba]: I was albe to solve the first two problems, plus hack the 5th
[choroba]: No idea how to solve the rest.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2018-04-21 19:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?