@ARGV = glob('*.txt'); while (<>) { # Do some clever stuff with $_ # $ARGV contains the current file name print "$ARGV $_"; }