X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXUser.pm;h=adddce0a4cef1f5701536e8d361530cc303f6244;hb=b80b21be59cd48ebdee1ceeddd739114d6e9ab08;hp=3df7fc20b218e42a2afb90da8fa03d0dec82cbf7;hpb=9af2711cba6e2a1aa298580ba00d87594d623c30;p=spider.git diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 3df7fc20..adddce0a 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -212,17 +212,23 @@ sub finish # new - create a new user # -sub new +sub alloc { my $pkg = shift; my $call = uc shift; + my $self = bless {call => $call, 'sort'=>'U'}, $pkg; + return $self; +} + +sub new +{ + my $pkg = shift; + my $call = shift; # $call =~ s/-\d+$//o; # confess "can't create existing call $call in User\n!" if $u{$call}; - my $self = bless {}, $pkg; - $self->{call} = $call; - $self->{'sort'} = 'U'; + my $self = $pkg->alloc($call); $self->put; return $self; }