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

Re: Help with a regex

by Kenosis (Priest)
on Dec 04, 2013 at 19:22 UTC ( #1065636=note: print w/ replies, xml ) Need Help??


in reply to Help with a regex

I get the following:

use warnings; use strict; use Data::Dumper; chomp( my @array = <DATA> ); for (@array) { chomp; if (/^lib$/) { print "Yes: $_\n"; } else { print "No : $_\n"; } } print "\n", Dumper \@array; __DATA__ nfcclib lib

Output:

No : nfcclib Yes: lib $VAR1 = [ 'nfcclib', 'lib' ];

Consider using Data::Dumper to examine the array's elements.

Hope this helps

Edit: Added Data::Dumper.


Comment on Re: Help with a 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://1065636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2015-07-07 19:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls