Hi experts,
I have a perl program, wherein i have declared array variable to match the regex and get the desired value but it working locally in strawbery perl but not in the server. can you please check and advise.
open(QUEUES, $queuecmd); my @lines=<QUEUES>; close QUEUES; my @queues = grep {s/.*count= *(\d+),.* Queue=or_event_queue\s*/$1/} @ +lines; print "$queues[0]\n";
In the above program @queues did not get the correct value. Below is the $queuecmd command output read in to @lines
Host 'server02' connected ============================================================ Hostname: 'server02' count= 0, delivering= 0, Queue=opr_action_launch_queue count= 0, delivering= 0, Queue=queue/alert_engine_notificat +ion count= 3079, delivering= 0, Queue=or_event_queue count= 0, delivering= 0, Queue=recipient_notification count= 0, delivering= 0, Queue=queue/alert_engine_alert count= 0, delivering= 0, Queue=failed_recipient_notificatio +n
@queues and $queues[0] should have value 3079
Thanks and regards,Discipulus added code tags where needed
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |