in reply to Determining new file

Another way of doing this (hey, this is TIMTOWTDIMonks after all) is to make use of the fact that $ARGV gets set to the current file:
my $file; while(<>) { print "Changing file to: $file\n" if ( qq/$file/ ne ( $file=$ARGV)); print; }

CU
Robartes-