in reply to Re: subroutines and arguments
in thread subroutines and arguments
And while you're at it, don't pass a single argument to system, either. Especially if you're passing in stuff from a file. (I'd recommend checking the lines from the file, even with the following changes):
open (SERVERLST, '<', 'svr_daily.csv') or die "Can't read from server daily CSV: $!"; foreach my $svr (<SERVERLST>) { chomp $svr; ls_engine($svr); } sub ls_engine { my $ls_eng = shift; system qw(wdmlseng -e), $ls_eng; }
Update: per Fletch, fixed the mistake w/ qw(). Had previously been:
system qw(wdmlseng -e $ls_eng);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: subroutines and arguments
by Fletch (Bishop) on Apr 05, 2005 at 03:07 UTC |