in reply to File ext number
You are not accounting for the files with no '.' character. Your regex using '+' requires that at least one period characters will appear before the end of text. If one does not, it will return an undef value.
One or more files ends in a '.', which returns an undef match.
undef is your uninitialized value because it doesn't convert to zero.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: File ext number
by ikegami (Patriarch) on Mar 19, 2010 at 23:16 UTC |
In Section
Seekers of Perl Wisdom