Perl Scope problem - Mailing list pgsql-general

From Dan Lyke
Subject Perl Scope problem
Date
Msg-id 15093.23789.888047.926319@wynand.flutterby.com
Whole thread Raw
In response to Perl Scope problem  (Randall Perry <rgp@systame.com>)
List pgsql-general
Randall Perry writes:
> I'm baffled by perl's scoping of variables.

You don't give exact error messages, but my guess is that this isn't a
scoping error, you're failing in get_cust_data(), so $cust_data is
undef and not a HASH ref. Imagine this rewritten as:

 > $cust_data = {};
 >
 > while ($condition) {
 >     ...
 >
 >     $cust_data = undef;
 >     print $cust_data->{'customer'};

Everyone else is right that all valid Perl programs start out:

   #!/usr/bin/perl -Tw
   use strict;

Dan

pgsql-general by date:

Previous
From: "Christian Marschalek"
Date:
Subject: Sessions, Connections ...
Next
From: Tom Lane
Date:
Subject: Re: I lost the pg_control file