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.