:@active = qx(
:sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID <<-!
:select count(distinct(process)) ACTIVE from ---> v$session <---
:where last_call_et < 60 and
:process in (select ltrim(rtrim(to_char(process_id) )) from 
:session_list);
:quit
:!
:);

Ok, so you're using qx(foo), which is the same (appx.) as `foo`, (with
backticks).  According to the perlop doc...

Customary  Generic        Meaning        Interpolates
``         qx{}           Command        yes (unless '' is delimiter)

When you use qx(), (pardon me if you already know this), you are telling
Perl that you want to use parentheses instead of backticks to delimit your
command.

        my @gotback = `foo`; #stores output from foo
                           # in @gotback
        my @output  = qx(foo); #does the same thing
                             # with @output

        You can use whatever you want with qx.  ^^, (), {}, [], whatever.
Evidently, if you use single quotes, qx'foo', it will run your 'foo' without
trying to translate $session into a value from a variable called $session.

@active = qx' #not '(' <---
sqlplus -S $RTDUSER/$RTDPASS\@$RTD_ORACLE_SID <<-!
select count(distinct(process)) ACTIVE from v$session
where last_call_et < 60 and
process in (select ltrim(rtrim(to_char(process_id) )) from session_list);
quit
!
'; #not ')' <---

        ...and I think that's what you want. Correct me if I'm wrong. :-)

Reply via email to