The following sub routine is part of a program that I'm working on.
When I attempt to run it through debug I get the following error when stepping
through this subroutine:
Undefined subroutine &main::__ANON__ called at /usr/local/lib/perl5/perl5db.pl
line 541, <WHOISFILE> line 12.
sub readusers{
my ($loadorder) = @_;
my ($uid,$host,$org,$last,$lastsndx,$first,$firstsndx,$rank);
if ( $loadorder eq 'firstonly' ){
$pushuser = sub { push @{$user{$first}{$last}{$host}},$uid };
}
elsif ( $loadorder eq 'lastnfirst' ){
$pushuser = sub { push @{$user{$last.$first}{$host}},$uid };
}
else {
$pushuser = sub { push @{$user{$last}{$first}{$host}},$uid };
}
open(WHOISFILE,"$whoisfile") || &gripe("$PROGRAM Error","Cannot open
$whoisfile");
while(<WHOISFILE>){
($uid,$host,$org,$last,$lastsndx,$first,$firstsndx,$rank)=split(/:/,);
if ( ($lastsndx ne 'Z000') && ($firstsndx ne 'Z000') ){
&$pushuser;
$userorgs{$uid} = "$org";
}
}
close(WHOISFILE);
}
The program executes without errors if I don't use the -d switch for perl.
I'm running this on AIX3.2.5 with perl 5.001m.
TIA,
Erich Markert
USMA Webmaster
When I attempt to run it through debug I get the following error when stepping
through this subroutine:
Undefined subroutine &main::__ANON__ called at /usr/local/lib/perl5/perl5db.pl
line 541, <WHOISFILE> line 12.
sub readusers{
my ($loadorder) = @_;
my ($uid,$host,$org,$last,$lastsndx,$first,$firstsndx,$rank);
if ( $loadorder eq 'firstonly' ){
$pushuser = sub { push @{$user{$first}{$last}{$host}},$uid };
}
elsif ( $loadorder eq 'lastnfirst' ){
$pushuser = sub { push @{$user{$last.$first}{$host}},$uid };
}
else {
$pushuser = sub { push @{$user{$last}{$first}{$host}},$uid };
}
open(WHOISFILE,"$whoisfile") || &gripe("$PROGRAM Error","Cannot open
$whoisfile");
while(<WHOISFILE>){
($uid,$host,$org,$last,$lastsndx,$first,$firstsndx,$rank)=split(/:/,);
if ( ($lastsndx ne 'Z000') && ($firstsndx ne 'Z000') ){
&$pushuser;
$userorgs{$uid} = "$org";
}
}
close(WHOISFILE);
}
The program executes without errors if I don't use the -d switch for perl.
I'm running this on AIX3.2.5 with perl 5.001m.
TIA,
Erich Markert
USMA Webmaster