--- "Yacketta, Ronald" <[EMAIL PROTECTED]> wrote:
> ok, then why does this only print the 1 in 19?????
>
> #!/usr/bin/perl -w
>
>
> my $session = qx(
> sqlplus -S rtdiag/*****\@DBNAME <<-!
> SET HEA OFF;
> select count(*) from session_list;
> quit
> !
> );
> #rem leading carrage returns
> $session =~ tr/^\n//;
> #rem leading spaces
> $session =~ s/^\s+//;
> #get the error if we have one
> my ($sesserr,$seserrtxt) = ($session =~ /(.*): (.*)/);
> #get the session count
> my $sessions = ( $session =~ /^(\d+)/ );
> print "1 $session\n";
> print "2 $sessions\n";
>
>
> results in
> 1 19
>
>
> 2 1
Your problem is in this line:
my $sessions = ( $session =~ /^(\d+)/ );
You need parentheses around the left side of this expression:
my ( $sessions ) = ( $session =~ /^(\d+)/ );
Cheers,
Curtis Poe
=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]