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

Re: Parsing an email address

by Corion (Pope)
on Oct 03, 2010 at 12:34 UTC ( #863172=note: print w/replies, xml ) Need Help??

in reply to Parsing an email address

strict would have prevented you from making the error of writing "". What Perl sees is the array @domain, which is empty and thus interpolates into an empty string. You want to use single quotes:

my $adr = ''; ...

Replies are listed 'Best First'.
Re^2: Parsing an email address
by fisher (Priest) on Oct 03, 2010 at 13:57 UTC
    ...or, alternatively, put a backslash in front of '@':

    my $adr= "User\";

Re^2: Parsing an email address
by halfcountplus (Hermit) on Oct 03, 2010 at 15:11 UTC

    Another thing that might help with this is using an editor with good syntax highlighting for perl -- one which will show special characters like @ when they are used inside double quotes, etc.

    Using an editor which does not have any syntax highlighting for the language you are coding in seems just plain silly.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2016-10-24 01:24 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.