Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Help with $File:Find

by huck (Vicar)
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 surveying the Monastery: (3)
As of 2018-09-20 00:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (170 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!