Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re^5: check parameters

by hdb (Prior)
on Apr 08, 2013 at 14:41 UTC ( #1027524=note: print w/ replies, xml ) Need Help??

in reply to Re^4: check parameters
in thread check parameters

ag4ve, can you pls state what you want to achieve? Here is what happens step-wise:

my $pattern ="(".join('|', @{$opts->{params}}).")"; # pattern is now "(a|b)" my @test = grep { /^$pattern/i } keys %$format; # @test = ( "bar", "abc" )

!grep... puts grep into scalar context, ie it will return 2, the length of @test above. !2 is false therefore your "if" block will not be executed.

Comment on Re^5: check parameters
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2015-11-28 17:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls