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

Re: Re: Re: using symbol table lookup

by tachyon (Chancellor)
on Sep 25, 2001 at 20:29 UTC ( #114573=note: print w/replies, xml ) Need Help??


in reply to Re: Re: using symbol table lookup
in thread using symbol table lookup

Rather odd way to do it I would have thought. Is there something inherently wrong with this approach:

my $dir = 'c:/'; opendir DIR, $dir or die "Oops cna't open $dir $!\n"; my @files = grep { /\.pl$/ } readdir DIR; close DIR; $_ = $dir.$_ for @files; # add full path print "Here are all the files:\n"; print "$_\n" for @files;

This finds all the files in my root dir which end in .pl but I could use the regex in the grep to match anything. I don't see any reason to mess with the symbol table. Just wrap this sort of code in a sub that you can call from wherever....

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2021-10-17 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (71 votes). Check out past polls.

    Notices?