Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re:{2} Adding Files in a directory to an array

by jeroenes (Priest)
on Oct 09, 2001 at 15:10 UTC ( #117693=note: print w/ replies, xml ) Need Help??

in reply to Re: Adding Files in a directory to an array
in thread Adding Files in a directory to an array

Not exactly.

While it is better (and I mean really, really better) to use the functional glob, you still can force perl to interpolate variables. Actually, only filehandles and simple scalars are not interpolated (see perlop). So these:

@dir=<$hash{$key}>; @dir=<$array[0]>; @dir=<$object->method>; @dir=<${foo}>; # and even @dir=<$structure{'filehandle'}>;
are interpreted as globs. Note that this is a caveat in the last case! Since you probably want the <> to do a readline in the last case, people really need to be aware that nested structures are always globbed. Only simple, straightforward variables like $foo result in readlines.

"We are not alone"(FZ)

Comment on Re:{2} Adding Files in a directory to an array
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://117693]
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: (6)
As of 2015-11-27 15:55 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls