Skip to content

Instantly share code, notes, and snippets.

@paveljurca
Last active August 29, 2015 14:21
Show Gist options
  • Save paveljurca/883c1ca596b9e7c7070f to your computer and use it in GitHub Desktop.
Save paveljurca/883c1ca596b9e7c7070f to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use 5.010.1;
my $msg;
my $break = qr/^AMQ\d+/;
while (<DATA>) {
chomp;
if ($break .. $break) {
if (/($break)/) {
# $1 is now the ID
$msg .= 'the queue is ';
next;
}
/^QUEUE\(([^)]+)/
and $msg .= $1;
/^CURDEPTH\(([^)]+)/
and $msg .= " and depth is $1\n";
}
}
say for split /\n/, $msg;
__DATA__
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.QMGR.EVENT) TYPE(QLOCAL)
CURDEPTH(1)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.AUTH.DATA.QUEUE) TYPE(QLOCAL)
CURDEPTH(102)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment