in reply to Re^2: reading files from a directory
in thread reading files from a directory

There's no need to concatenate arguments to print as that function takes a list. In fact, you're actually requesting additional processing: do the concatenation and then do the print. Even worse, if you concatenate multiple arguments you're performing multiple operations; in sort of pseudocode: print A.B.C.D performs A.B, then AB.C, then ABC.D, then print ABCD, while print A,B,C,D is one operation.

As far as style is concerned, I'd say do whatever is easiest to read and maintain. print "X ", $_, "\n"; and print "X $_\n"; are equally valid but, as mentioned above, avoid print "X " . $_ . "\n";.

I note there's a few places where you haven't included a newline (\n) at the end of your print statement. In case you didn't know, print doesn't automatically add one for you; say, on the other hand, does.

-- Ken