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

Re^2: return $paths only if ...

by cesapun (Acolyte)
on Aug 20, 2012 at 15:13 UTC ( #988461=note: print w/ replies, xml ) Need Help??


in reply to Re: return $paths only if ...
in thread return $paths only if ...

Before if (defined $paths){

i have

 my $paths = [];

so that's not the problem. :(


Comment on Re^2: return $paths only if ...
Select or Download Code
Replies are listed 'Best First'.
Re^3: return $paths only if ...
by Athanasius (Abbot) on Aug 20, 2012 at 15:34 UTC

    No, toolic wasn’t referring to the $paths in your

    if (defined $paths){

    test, but rather to the two “paths” variables in scope at sub dir_listing@paths and $paths, which are entirely separate variables (except that they happen to share the same name after the sigil). The first is an array, which is never used; the second is a scalar, which you are treating as an array reference.

    See the code by Anonymous Monk, below, for the correct way of declaring and using these variables.

    Athanasius <°(((><contra mundum

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2015-07-30 09:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls