ArifS has asked for the wisdom of the Perl Monks concerning the following question:
Getting the following error-my $lines; my @lines; # read (1 line only). FOLDERZ. open INPUT, "<Output1.txt"; @lines = <INPUT>; close INPUT; foreach $lines (@lines){ print "Line: ", $lines, "\n"; my $linesA; #my @linesA = "c\:\\Other\\renamedir\\FOLDERZ"; my @linesA = "c\:\\Other\\renamedir\\$lines"; foreach $linesA (@linesA){ my $directory = "$linesA"; print ("Folder: ", $directory, "\n"); opendir (DIR, $directory) or die $!; while (my $fldr = readdir(DIR)) { print "Files & Folders: ", $fldr, "\n"; } closedir(DIR); } }
Line 22: opendir (DIR, $directory) or die $!;Line: FOLDERZ Folder: c:\Other\renamedir\FOLDERZ Invalid argument at c:\temp\dir4E63.tmp\lineAF.pl line 22. Press any key to continue . . .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Doesn't like a Scalar, as a folder path
by McA (Priest) on Oct 27, 2014 at 18:47 UTC | |
by ArifS (Beadle) on Oct 27, 2014 at 18:55 UTC | |
by Corion (Patriarch) on Oct 27, 2014 at 21:52 UTC | |
|
Re: Doesn't like a Scalar, as a folder path
by Discipulus (Canon) on Oct 28, 2014 at 08:55 UTC | |
by ikegami (Patriarch) on Oct 28, 2014 at 13:21 UTC |