Do you know where your variables are? | |
PerlMonks |
Re: position of first matching regexby wjw (Priest) |
on May 16, 2014 at 23:35 UTC ( [id://1086405]=note: print w/replies, xml ) | Need Help?? |
If you know that your number will be in position 0 or position 1, and that is all you care about, use the '^' to determine if the
first character is a number or not. If it is, you will get a match, if it is not, then you know the first character is an non-number... if ($filename =~ /^[0-9]/) { .... } (untested) Hope that is helpful....
...the majority is always wrong, and always the last to know about it... Insanity: Doing the same thing over and over again and expecting different results...
In Section
Seekers of Perl Wisdom
|
|