Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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"; }


Comment on Re: Problem with ampersand and regex
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (14)
As of 2014-10-30 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (207 votes), past polls