misconfiguration has asked for the wisdom of the Perl Monks concerning the following question:
my %systemcmd = ( add => "addqueue -h $add -q $add -i 3", remove => "removequeue -f -q $remove", status => "lpstat -p$status", cancel => "cancel -e $cancel", add_slurp => "addqueue -h $file -q $file -i 3" );
if ($file) { $file = lc($file); my $FH = "$file"; open my $file, "< $file", or print &reasons(); print "Please wait... Reading from the file... \n"; sleep 5; while (<$file>) { my @all_lines = <$file>; foreach my $file (@all_lines) { if ( -e "/var/spool/lp/request/$file" ) { die "This printer is already defined!\n"; } else { print "Adding queue \"$file\"\n"; sleep 1; system( $systemcmd {'add_slurp'} ); } } close($file); } exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing info from an array to a system call.
by Fletch (Bishop) on Jan 29, 2008 at 21:42 UTC | |
|
Re: Passing info from an array to a system call.
by GrandFather (Saint) on Jan 29, 2008 at 22:20 UTC | |
|
Re: Passing info from an array to a system call.
by jwkrahn (Abbot) on Jan 30, 2008 at 00:17 UTC | |
by misconfiguration (Sexton) on Jan 30, 2008 at 15:27 UTC | |
by misconfiguration (Sexton) on Jan 31, 2008 at 20:29 UTC |