in reply to selcting a specific file
For us to help you most effectively, you should post your actual code. We don't know what "it doesn't work out" means. Perhaps your file is not zero bytes but contains some whitespace or something?
non-Perl: Andy Ford
In Section
Seekers of Perl Wisdom