aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/perl5/eg/example.newstyle
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/perl5/eg/example.newstyle')
-rw-r--r--src/interfaces/perl5/eg/example.newstyle15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/interfaces/perl5/eg/example.newstyle b/src/interfaces/perl5/eg/example.newstyle
index a64f144739e..04d2964df70 100644
--- a/src/interfaces/perl5/eg/example.newstyle
+++ b/src/interfaces/perl5/eg/example.newstyle
@@ -1,8 +1,8 @@
-#!/usr/local/bin/perl
+#!/usr/local/bin/perl -w
#-------------------------------------------------------
#
-# $Id: example.newstyle,v 1.1 1997/09/17 20:48:14 mergl Exp $
+# $Id: example.newstyle,v 1.2 1997/09/25 21:15:02 mergl Exp $
#
# Copyright (c) 1997 Edmund Mergl
#
@@ -88,7 +88,7 @@ $SIG{PIPE} = sub { print "broken pipe\n" };
######################### create and connect to test database
# 2-4
-$conn = Pg::connectdb("dbname = $dbmain");
+$conn = Pg::connectdb("dbname=$dbmain");
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
# might fail if $dbname doesn't exist => don't check resultStatus
@@ -97,7 +97,7 @@ $result = $conn->exec("DROP DATABASE $dbname");
$result = $conn->exec("CREATE DATABASE $dbname");
cmp_eq(PGRES_COMMAND_OK, $result->resultStatus);
-$conn = Pg::connectdb("dbname = $dbname");
+$conn = Pg::connectdb("dbname=$dbname");
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
######################### debug, PQtrace
@@ -141,7 +141,8 @@ for ($i = 1; $i <= 5; $i++) {
$result = $conn->exec("COPY person TO STDOUT");
cmp_eq(PGRES_COPY_OUT, $result->resultStatus);
-$i = 1;
+$i = 1;
+$ret = 0;
while (-1 != $ret) {
$ret = $conn->getline($string, 256);
last if $string eq "\\.";
@@ -217,7 +218,7 @@ if (! defined($pid = fork)) {
# i'm the child
sleep 2;
bless $conn;
- $conn = Pg::connectdb("dbname = $dbname");
+ $conn = Pg::connectdb("dbname=$dbname");
$result = $conn->exec("NOTIFY person");
exit;
}
@@ -277,7 +278,7 @@ if ($DEBUG) {
######################### disconnect and drop test database
# 60-61
-$conn = Pg::connectdb("dbname = $dbmain");
+$conn = Pg::connectdb("dbname=$dbmain");
cmp_eq(PGRES_CONNECTION_OK, $conn->status);
$result = $conn->exec("DROP DATABASE $dbname");