X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FBands.pm;h=9f44c09005d160851eed237cb4b2c893afdf5756;hb=f63d598af3f797b56b8d5e23ec4ff5254192eee9;hp=7e67a60e3fb70e63ddc71b46e552e6a2e7f6ca50;hpb=661d49731a7ac57ce2883ef5d757c7a8144fb6ff;p=spider.git diff --git a/perl/Bands.pm b/perl/Bands.pm index 7e67a60e..9f44c090 100644 --- a/perl/Bands.pm +++ b/perl/Bands.pm @@ -3,7 +3,7 @@ # # Copyright (c) 1998 - Dirk Koopman G1TLH # -# $Id$ +# # package Bands; @@ -11,7 +11,6 @@ package Bands; use DXUtil; use DXDebug; use DXVars; -use Carp; use strict; use vars qw(%bands %regions %aliases $bandsfn %valid); @@ -132,15 +131,18 @@ sub field_prompt return $valid{$ele}; } -no strict; +#no strict; sub AUTOLOAD { - my $self = shift; + no strict; my $name = $AUTOLOAD; return if $name =~ /::DESTROY$/; - $name =~ s/.*:://o; + $name =~ s/^.*:://o; - @_ ? $self->{$name} = shift : $self->{$name} ; + # this clever line of code creates a subroutine which takes over from autoload + # from OO Perl - Conway + *$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}}; + goto &$AUTOLOAD; } 1;