in reply to Perl Errors
my $directory = File::Spec->catfile(my @path, my $directoryTest);
to:
my $directory = File::Spec->catfile(@path, $directoryTest);
This compiles without warnings for me:
use strict; use warnings; use File::Spec::Functions; print "First Box in Disk?\n"; my $firstBox = <stdin>; print "Last Box in Disk?\n"; my $lastBox = <stdin>; print "Pick Directory\n"; my $directoryTest = <stdin>; my @path="/root/begperl/TestDirectory/"; my $directory = File::Spec->catfile(@path, $directoryTest); opendir DIR, $directory or die "cannot open dir $directory: $!"; my @file= readdir DIR; my @FinalDirectoryList; push (@FinalDirectoryList, @file); foreach my $file (@file) {print "$file\n";} closedir DIR; #close directory
diagnostics will give you a more verbose explanation of the warning messages.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Errors
by Hellhound4 (Novice) on Mar 27, 2012 at 20:09 UTC | |
by CountZero (Bishop) on Mar 27, 2012 at 20:15 UTC | |
by Hellhound4 (Novice) on Mar 27, 2012 at 20:47 UTC | |
by ww (Archbishop) on Mar 27, 2012 at 21:23 UTC | |
by CountZero (Bishop) on Mar 27, 2012 at 21:23 UTC | |
by Hellhound4 (Novice) on Mar 27, 2012 at 21:59 UTC | |
| |
by roboticus (Chancellor) on Mar 27, 2012 at 20:15 UTC |