Hi,
Just starting out in PERL and hit a problem with how to form some code.
I am trying to get the Unless statement to read from an array. I guess I need something like :: or || to get the two functions to work together.
The following is my current solution with the error, fith line from the bottom:
Any assistance would be gratefully received.
Many thanks
Woter
Just starting out in PERL and hit a problem with how to form some code.
I am trying to get the Unless statement to read from an array. I guess I need something like :: or || to get the two functions to work together.
The following is my current solution with the error, fith line from the bottom:
Code:
#!usr/bin/perl
# JRun restart menu in Perl.
$platform = "Windows";
$env = "";
# $s = "";
$jrun_home="C:\\JRun4";
if ($platform = "Windows"){
$s="\\";
print "\nPlatform is $platform\n";
}
else
{
$s = "/";
}
@exclude=(".", "..", "admin", "samples", "template.zip", "cfusion");
# Get directory list
$dirtoget="$jrun_home\\servers\\";
opendir(IMD, $dirtoget) || die("Cannot open directory");
@thefiles= readdir(IMD);
closedir(IMD);
foreach $f (@thefiles){
unless (foreach $e (@exclude){){
print "$f\n\n";
}
}
}
Any assistance would be gratefully received.
Many thanks
Woter