my $line = "foo 123 bar";
if ($line =~ m{(\d+)}g) {
my $pos = pos($line) - length $1;
print "$pos\n\n";
}
my $line = "foo 123 bar";
if ($line =~ m{(\d+)}g) {
my $pos = length $`;
print "$pos\n";
}
if ($line =~ m{(\d+)}g) {
my $pos = pos($line) - length $1;
print "$pos\n\n";
}
my $line = "foo 123 bar";
if ($line =~ m{(\d+)}g) {
my $pos = length $`;
print "$pos\n";
}
No comments:
Post a Comment