It doesn't work on the hash or array container, but does work with their scalar elements:
use warnings; use strict; my %hash = (one => 1, two => 2); for my $key (keys %hash){ print "$key\n" if $key =~ /one/; } my @array = qw(one two three); for my $elem (@array){ print "$elem\n" if $elem =~ /one/; }
In reply to Re^3: Problem in extracting alphanumeric string from file
by stevieb
in thread Problem in extracting alphanumeric string from file
by rahulme81
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |