in reply to Re^2: Passing info from an array to a system call.
in thread Passing info from an array to a system call.

Here is the product of your guys' advice, thanks again!

if ($file) { lc($file); if ( -e "$file" ) { my $fh; open( $fh, '<', $file or die &reasons() ); my @lines = <$fh>; foreach my $q (@lines) { chomp($q); if ( -e "/var/spool/lp/request/$q" ) { die "Printer \"$q\" is already defined!\n"; } else { print "Adding queue \"$q\": "; # "addqueue -h QUEUENAME -q QUEUENAME -i 3" my %file_cmd = ("addqueue -h $q -q $q -i 3"); system( $file_cmd {'$file_cmd'} ); } } close($fh); } else { &reasons(); } }