#!usr/bin/perl -w use strict; my @files=; foreach my $file(@files){ my @cmd=qw(lpr -S SYSTEMX -P QGPL/SPYVIEW -o l $file); system(@cmd)==0 or die "cannot do this"; }