Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Problem with ampersand and regex

by ikegami (Pope)
on Dec 19, 2012 at 23:24 UTC ( #1009660=note: print w/replies, xml ) Need Help??


in reply to Problem with ampersand and regex

Always use use strict; use warnings;!

my $line = "mail: asdf@123.com";
should be
my $line = 'mail: asdf@123.com';

Then you can simply use

if (my ($mail) = $line =~ /mail: (.*)/) { print "mail=$mail\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1009660]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2016-12-04 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (61 votes). Check out past polls.