in reply to Loading all .txt files within current directory

@ARGV is not a lexical variable. Remove the my. See perlvar:

Perl identifiers that begin with digits, control characters, or punctuation characters are exempt from the effects of the package declaration and are always forced to be in package main; they are also exempt from strict vars errors. A few other names are also exempt in these ways:
ENV STDIN INC STDOUT ARGV STDERR ARGVOUT SIG
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Loading all .txt files within current directory
by TJCooper (Beadle) on Jan 31, 2016 at 13:34 UTC
    Thanks. So I can load in all .txt files simply using @ARGV = glob('*.SAM');? I have tried this, but as before - the script does not execute the commands (besides printing the headers) and I can't figure out why.