Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 taking refuge in the Monastery: (10)
As of 2014-12-26 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls