XP is just a number | |
PerlMonks |
Files and -fby mndoci (Scribe) |
on Dec 01, 2001 at 00:53 UTC ( [id://128739]=perlquestion: print w/replies, xml ) | Need Help?? |
mndoci has asked for the wisdom of the Perl Monks concerning the following question:
Hi folks
I am reading a list of names from a file in the format
abc def geh and so on the names are the prefix to a bunch of files which go like abc.txt def1.txt geh.txt What I want to do is go through the original list line by line and open the corresponding txt file. Easy enough. I wrote something like This is not working as in the else statement the "do stuff" includes an open statement and , e.g., the script tries to open abc1.txt which of course does not exist. In other words if I find a file I want to open it, perform some other actions and move on and so on. I am trying a if (!(-f $file)) type syntax as I write this, but does anyone have a better idea. Thanks mndoci "What you do in this world is a matter of no consequence. The question is, what can you make people believe that you have done?"-Sherlock Holmes in 'A study in scarlet'
Back to
Seekers of Perl Wisdom
|
|