Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re^3: Problem with ampersand and regex

by davido (Archbishop)
on Dec 19, 2012 at 21:11 UTC ( #1009636=note: print w/replies, xml ) Need Help??

in reply to Re^2: Problem with ampersand and regex
in thread Problem with ampersand and regex

What do you get if you capture?

if( $line =~ /^mail:\s+([\S]+)$/ ) { my $mail = $1; print "mail=$mail\n"; }


Replies are listed 'Best First'.
Re^4: Problem with ampersand and regex
by Anonymous Monk on Dec 19, 2012 at 21:23 UTC
    I get ? ?

      Add the following to your script:

      use Data::Dumper;

      ...and then on the line immediately preceding your "for" loop, add, "print Dumper \@array;".

      There might be something broken in your input data, and that would be a simple means of identifying (or eliminating) it as a problem.


        Done and here is a sample of what I got back:
        ', 'sn: ThisUser ', 'mail: ', 'cn: This User ', 'uid: MyUID
        Now what?

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2017-06-26 17:53 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (584 votes). Check out past polls.