dbashyam has asked for the wisdom of the Perl Monks concerning the following question:
Hi Guys, I use the following code, I want to get the output as ORA-12505 in this scenario, but the number is dynamic, currently I am getting just numeric 1, how to get the output.
#!/usr/bin/perl my $org = ""; $Ora_code = 'Failed tthe following error: ORA-12505, TNS:listener does + not currently know of SID given in connect descriptor'; print $Ora_code; if ( my $out = $Ora_code =~ /ORA\-\d{5}/) { print "inside\n"; print "$out\n"; } else { print "(no match)\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to get output
by Util (Priest) on Feb 18, 2014 at 05:28 UTC | |
by dbashyam (Novice) on Feb 18, 2014 at 05:38 UTC | |
by Kenosis (Priest) on Feb 18, 2014 at 05:47 UTC | |
by dbashyam (Novice) on Feb 18, 2014 at 05:44 UTC |