Thomas Kennll has asked for the wisdom of the Perl Monks concerning the following question:
I want to find a matching pattern field number/col number of a string.. For eg, if i have my code as below. Can someone help me to find the column number of a matching pattern..
my $data = "Region Item volume Month"
if ($data1 =~ /Item | volume/)
{
print "column number of item and volume";
}
I want to print the column number as 1 and 2
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: finding the field number of a matching pattern in perl
by Anonymous Monk on Sep 16, 2012 at 08:43 UTC | |
by Anonymous Monk on Sep 16, 2012 at 09:09 UTC | |
Re: finding the field number of a matching pattern in perl
by ww (Archbishop) on Sep 16, 2012 at 12:02 UTC | |
Re: finding the field number of a matching pattern in perl
by roboticus (Chancellor) on Sep 16, 2012 at 14:16 UTC | |
Re: finding the field number of a matching pattern in perl
by remiah (Hermit) on Sep 16, 2012 at 12:06 UTC |
Back to
Seekers of Perl Wisdom