Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 pondering the Monastery: (13)
As of 2014-10-21 10:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (99 votes), past polls