Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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 "User@domain.com". 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 = 'User@domain.com'; ...

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\@domain.com";

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://863172]
help
Chatterbox?
[moritz]: with a big table of redirects to support the old links
[LanX]: do it
[holli]: well if you put some cleverness into the migration you can auto convert most of the links as well
[LanX]: Let's Make PerlMonks Great Again!
[holli]: but you know what? i don't think i'd fancy that. I like PM as it is.
[holli]: Alone the chatterbox and everybody writes his own cb client tradition
[LanX]: there was a guy who tried to steal the concept and build an own monastery ...
[LanX]: yeah PM is very emacsy ;-)
[LanX]: I think tobyink was on a good track with his redesign, pitty the pmdevs/gods didn't try to continue the approach of a modern responsive design
[holli]: *sigh* why has there to be drama in such a thread?

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2017-11-20 19:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (292 votes). Check out past polls.

    Notices?