Skip to content

Instantly share code, notes, and snippets.

@macros
Created February 11, 2010 06:26
Show Gist options
  • Save macros/301277 to your computer and use it in GitHub Desktop.
Save macros/301277 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use Net::Stomp;
use Data::Dumper;
while(1) {
eval {
my $stomp = Net::Stomp->new( {hostname => 'localhost',
port => 61613,
});
$stomp->connect( {login => 'guest',
passcode => 'guest' },);
while (1) {
$stomp->send( { destination => 'conntest',
body => time() } ) or die "Couldn't send\n";
sleep(1);
}
};
print "Outside eval\n";
if ($@) {
print "In error handler\n";
print Dumper($@);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment