Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Help with $File:Find

by huck (Parson)
on Feb 14, 2018 at 18:32 UTC ( #1209162=note: print w/replies, xml ) Need Help??


in reply to Help with $File:Find

push @array, $File::Find::name if (defined $_ && (/^.*\.($TYPES)$/i) +);

Replies are listed 'Best First'.
Re^2: Help with $File:Find
by tinita (Parson) on Feb 14, 2018 at 19:27 UTC
    It would be interesting to find out, though, when $_ an actually be undef. I can't find anything about that in the File::Find documentation. I only see a case where $File::Find::fullname is documented to be undef.
Re^2: Help with $File:Find
by roperl (Beadle) on Feb 14, 2018 at 18:58 UTC
    Ok I was thinking that but I wasn't sure if needed to check if $File::Find::name was defined.
    So I can write it as:
    push @array, $File::Find::name if ( ($_) && (/^.*\.($TYPES)$/i) );

    that is they syntax I've been using to check for defined without actually using "defined"

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2018-11-17 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (202 votes). Check out past polls.

    Notices?