Perl Scope problem

Поиск
Список
Период
Сортировка
От Dan Lyke
Тема Perl Scope problem
Дата
Msg-id 15093.23789.888047.926319@wynand.flutterby.com
обсуждение исходный текст
Ответ на Perl Scope problem  (Randall Perry <rgp@systame.com>)
Список 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 по дате отправления:

Предыдущее
От: "Christian Marschalek"
Дата:
Сообщение: Sessions, Connections ...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: I lost the pg_control file