Created
February 11, 2010 06:26
-
-
Save macros/301277 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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