Skip to content

Instantly share code, notes, and snippets.

@igable
Created April 17, 2012 21:34
Show Gist options
  • Save igable/2409230 to your computer and use it in GitHub Desktop.
Save igable/2409230 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use Net::RabbitMQ
my $mq = Net::RabbitMQ->new();
if(!$mq){
print "Constructor didn't return anything.\n";
}
print("Value of mq: $mq\n");
$mq->connect("elephant65.heprc.uvic.ca");
$mq->channel_open(1);
$mq->publish(1, "hello", "Hi from perl");
$mq->disconnect();
[igable@psdev ~]$ ./testmq.pl
Constructor didn't return anything.
Value of mq:
Can't call method "connect" on an undefined value at ./testmq.pl line 12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment