T
t13_e
For this code:
$x1 = "abcdefgh";
if(@vars = ($x1 =~ m/(b)/g))
{
$p = pos $x1;
print "pos is $p\n";
}
$x2 = "abcdefgh";
if($x2 =~ m/(b)/g)
{
$p = pos $x2;
print "pos is $p\n";
}
The following is displayed using perl v5.8.4:
pos is
pos is 2
Does someone know why pos is returning '' for the first regexp, and the
correct value, 2, for the second?
Thanks,
Tim
$x1 = "abcdefgh";
if(@vars = ($x1 =~ m/(b)/g))
{
$p = pos $x1;
print "pos is $p\n";
}
$x2 = "abcdefgh";
if($x2 =~ m/(b)/g)
{
$p = pos $x2;
print "pos is $p\n";
}
The following is displayed using perl v5.8.4:
pos is
pos is 2
Does someone know why pos is returning '' for the first regexp, and the
correct value, 2, for the second?
Thanks,
Tim