sub ReadFile { #Declare Variables # my ($game, $file) = @_; my $dir = "$ENV{HOME}/settings/$game/$file"; #End if dir not exist # return unless -d $dir; #Read the file and create the array # open(FILE, $dir)||die("Cannot open file : $!"); my @contents = ; close(FILE); #Cut trailing \n # chomp (@contents); #Return the array # return @contents; } #### #!/usr/bin/perl5 use strict; use warnings; use HLDS; my @games = HLDS::ReadFile(HL1, HL1.txt); foreach my $game (@games) { print "$game\n"; } #### Bareword "HL1" not allowed while "strict subs" in use at ./games.pl line 8. Bareword "HL1" not allowed while "strict subs" in use at ./games.pl line 8. Bareword "txt" not allowed while "strict subs" in use at ./games.pl line 8. Execution of ./games.pl aborted due to compilation errors (#1) Uncaught exception from user code: Bareword "HL1" not allowed while "strict subs" in use at ./games.pl line 8. Bareword "HL1" not allowed while "strict subs" in use at ./games.pl line 8. Bareword "txt" not allowed while "strict subs" in use at ./games.pl line 8. Execution of ./games.pl aborted due to compilation errors.