summaryrefslogtreecommitdiff
path: root/qpid/cpp
diff options
context:
space:
mode:
authorDarryl L. Pierce <mcpierce@apache.org>2014-04-29 15:46:34 +0000
committerDarryl L. Pierce <mcpierce@apache.org>2014-04-29 15:46:34 +0000
commit0d49f2fa419a414e1c9548001fcbde03d442f5c1 (patch)
tree55f142cebee2698923df1e4868f3fa720be79f30 /qpid/cpp
parent0b1e1a243550ccfc7376a163ff02b9fb2aa5a2bc (diff)
downloadqpid-python-0d49f2fa419a414e1c9548001fcbde03d442f5c1.tar.gz
QPID-5732: Perl examples getting the wrong cmdline arguments
The hello_world and map_receiver examples had a one-off error when getting command line arguments. This patch points them back to the correct arguments. Contributed by Zdenek Kraus <zkraus@redhat.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1591006 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
-rwxr-xr-xqpid/cpp/bindings/qpid/examples/perl/hello_world.pl6
-rwxr-xr-xqpid/cpp/bindings/qpid/examples/perl/map_receiver.pl4
2 files changed, 5 insertions, 5 deletions
diff --git a/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl b/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl
index 6ec7d52f1f..917038f0ef 100755
--- a/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl
+++ b/qpid/cpp/bindings/qpid/examples/perl/hello_world.pl
@@ -24,8 +24,8 @@ use Data::Dumper;
use qpid;
my $broker = ( @ARGV > 0 ) ? $ARGV[0] : "localhost:5672";
-my $address = ( @ARGV > 1 ) ? $ARGV[0] : "amq.topic";
-my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[1] : "";
+my $address = ( @ARGV > 1 ) ? $ARGV[1] : "amq.topic";
+my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[2] : "";
# create a connection
my $connection = new qpid::messaging::Connection( $broker, $connectionOptions );
@@ -43,7 +43,7 @@ eval {
$sender->send( new qpid::messaging::Message("Hello world!") );
# receive the message, fetching it directly from the broker
- my $message = $receiver->fetch(qpid::messaging::Duration::SECOND);
+ my $message = $receiver->fetch(qpid::messaging::Duration::SECOND, 1);
# output the message content, then acknowledge it
print $message->get_content() . "\n";
diff --git a/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl b/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl
index a538adf380..21b1cb09f2 100755
--- a/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl
+++ b/qpid/cpp/bindings/qpid/examples/perl/map_receiver.pl
@@ -24,8 +24,8 @@ use Data::Dumper;
use qpid;
my $url = ( @ARGV > 0 ) ? $ARGV[0] : "amqp:tcp:127.0.0.1:5672";
-my $address = ( @ARGV > 1 ) ? $ARGV[0] : "message_queue; {create: always}";
-my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[1] : "";
+my $address = ( @ARGV > 1 ) ? $ARGV[1] : "message_queue; {create: always}";
+my $connectionOptions = ( @ARGV > 2 ) ? $ARGV[2] : "";
# create a connection object
my $connection = new qpid::messaging::Connection( $url, $connectionOptions );