Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2018-03-24 21:52 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (299 votes). Check out past polls.