Craig Inman wrote:
>
> Trying to get this script to 'claimsubmit' ONLY if the system call
> returns STDOUT, but I'm having a little trouble getting my script to
> verify that and act accordingly.
Do you mean you want to capture the output from claimsubmit? Use
back-quotes (``) or qx//.
> opendir DIRH, "$unknown" or die "Can't open: $!\n";
^ ^
Quotes aren't required.
opendir DIRH, $unknown or die "Can't open $unknown: $!\n";
> foreach my $files (sort readdir DIRH)
> {
> my @claims = (grep(!/^\.{1,2}$/, $files));
grep() reads from a LIST and returns a LIST. IOW grep is inappropriate
here
my @claims = sort grep !/^\.{1,2}$/, readdir DIRH;
foreach my $file ( @claims ) {
> if (system ("zowner $claims[0]"))
> {
if ( system( 'zowner', $file ) == 0 ) {
> # (system("claimsubmit $claims[0]")); <-- once it works, i'll use this
system( 'claimsubmit', $file ) == 0 or warn "claimsubmit $file
failed: $?";
> print "claimsubmitting $claims[0] \n";
print "claimsubmitting $file\n";
> }
> }
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]