Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: There is more than one way (and mine is not the best)

by Belgarion (Chaplain)
on May 25, 2004 at 21:22 UTC ( [id://356378]=note: print w/replies, xml ) Need Help??


in reply to There is more than one way (and mine is not the best)

If your code is being run in the same directory as the files you could always do something like this:

while (<*txt>) { # process the file ($_ will contain the name of the file) }

This would remove the need for the "qcode" file, since it's only doing what the file system already does---namely, maintain a list of file names.

As for the rest of the code: I think you're missing some braces in various places. If you tried to run your code through a good indenting text editor, you would notice that things are not lining up as you would expect. Also, doing a perl -cw ./yourprogram.pl says there are syntax errors with your script.

Finally, I'm not sure why you're processing the file twice. I'm assuming there is a good reason, but it's not apparent to me at the moment.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2025-07-11 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.