I know there's a similar question out there, but it didn't help me. I'm trying to read a server list and perform actions on each server one at a time. However, I cannot access the variable. Here's some code:
open (SERVERLST, "< svr_daily.csv");
foreach my $svr (<SERVERLST>)
{
chomp $svr;
&ls_engine;
}
sub ls_engine {
my $ls_eng = $_[0];
system ("wdmlseng -e $ls_eng");
}
My problem line of code is passing the global var $svr into the sub. I've tried my $ls_eng = shift (@_) AND my $ls_eng = $_; also.........I'm sure it's something small.