that's ok!  thanks! 
my goal is to run the system app command only if the file handle OUT is 
greater than 0 bytes else create a runfile.  You say test @ftapes but you 
never said how?
is there a better way to just create a file rather than opening it and 
doing nothing.
currently I am stating 

 my $foo="/tmp/ftapes_runfile";
                open (RUNFILE, ">$foo") || die "could not open runfile: 
$!;"



       open (OUT, ">$foreigntapes") || die "could not open file:$!";
        my @ftapes = grep s/^barcode=//, `evmvol -w label_state=3`;
        select( (select(OUT), $|=1 ) [0] );
        print OUT "@ftapes"; 
        if ( -s OUT ) {
                .....
        }

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams
614-566-4145





Bob Showalter <[EMAIL PROTECTED]>
06/08/2004 11:40 AM

 
        To:     "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
        cc:     [EMAIL PROTECTED]
        Subject:        RE: if -s clause


[EMAIL PROTECTED] wrote:
> ok so here is what I did and it is now working.
> 
> one thing I do not fully understand is the diff between
> my $svsel = select; select OUT ; $|=1;
> and
> select (select(OUT), $| = 1 ) [0] );
> 
> the second line works while the first does not and
> from my understanding I am selecting OUT and never re-selecting the
> original filehandle?

My bad. I should have added select($svsel) to the first line in order to
reselect the previous handle (i.e. STDOUT).

But as I said before, this is NOT the right approach to your problem. Just
test your @ftapes array and be done with it.


Reply via email to