F
fishfry
I can't remember the function that, given "abcdef" and "de" returns 3,
indicating the character position, starting from 0, where "de" is found
in "abcdef".
A secondary question is, how do I use perldoc and the other online docs
when I can't remember the name of the function I'm looking for? For
example I remembered substr(), but that goes the other way, returning
the string occurring at a particular character position.
And my third question is, how can I do this as part of a pattern match?
For example I want to do something like
if ($foo =~ /\d\d/) {
# do stuff
}
where what I really want to know is WHERE within $foo, a pair of digits
occurred.
Thank you all kindly in advance.
indicating the character position, starting from 0, where "de" is found
in "abcdef".
A secondary question is, how do I use perldoc and the other online docs
when I can't remember the name of the function I'm looking for? For
example I remembered substr(), but that goes the other way, returning
the string occurring at a particular character position.
And my third question is, how can I do this as part of a pattern match?
For example I want to do something like
if ($foo =~ /\d\d/) {
# do stuff
}
where what I really want to know is WHERE within $foo, a pair of digits
occurred.
Thank you all kindly in advance.