Stephan Hochhaus wrote: > > The while(<FILE>) reads a line into the $_ variable, but you're not > > printing that; you're printing the filename itself. So you'll get > > one line of (the same) output for each line in the file. > Ah, I should have seen that in the first place > > > Then to show just the 'perl.txt' part, use: > > > > print basename($filename), "\n"; > Great, this looks a lot nicer. Now I'll figure out a way to chop the > last 4 characters off if the filename has an extension, but I guess I > can do this by myself :-)
Now you need to learn how to use perldoc. Run 'perldoc File::Basename' to read the documentation and you'll see that the basename() function can remove extensions as well. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]