Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: File ext number

by snopal (Pilgrim)
on Mar 19, 2010 at 23:06 UTC ( #829720=note: print w/replies, xml ) Need Help??

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

    If one does not, it will return an undef value.

    No, m// never returns undef. (It could, it just doesn't.)

    because it doesn't convert to zero.

    No, undef DOES convert to zero when used as a number.

    In fact, when undef is or would be converted to a string ("") or number (0) is when you get that and similar warnings.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://829720]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2022-01-21 23:48 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (59 votes). Check out past polls.