in reply to Inappropriate I/O control operation

I'm a little puzzled -- what problem are you trying to solve here?

If you're just looking to see if the file exists (seeing as you just open and close the file), why not just test for the existence of the file with -e? You could also check for whether the file's empty with -z.

I see an opportunity to use join on both your input and output ..

my $f = join ( '-', 'round1', $c, $f ) . '.txt'; my $exists = ( -e $f ) ? 'exists' : 'doesn\'t exist'; my $zero = ( -z $f ) ? 'empty' " 'not empty'; print join ( '-', $f, $c ) . ": $exists / $zero\n";
Coded but not tested. :)

PS Yeah, the $zero value is meaningless if the file doesn't exist.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Edit: Fix inadvertent backslash in second paragraph.