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.
In reply to Re: There is more than one way (and mine is not the best)
by Belgarion
in thread There is more than one way (and mine is not the best)
by NovMonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |