Alfred Vahau wrote:
10   my ($me, %hash )= @_;
11   my $type = %hash->{base_type};


In 10, is the structure of the hash preserved? What happens if you pass the hash by reference?
In 11, you are using the hash as a reference. What you want is something like:

In which case you would also want to use

  my ($me, $hashref) = @_;

my $type = $hashref->{base_type};

alfred,

Siegfried Heintze wrote:

I'm getting a warning on line 10 or 11. The program works. I'd like to get
rid of the warnings however. When I change "%hash" to "$hash" on lines 10-11
then the program does not work at all then.


Thanks,
Siegfried


[snip]
9 sub mfr {
10 my ($me, %hash )= @_;
11 my $type = %hash->{base_type};
12 if ($type == &case_constants::btRankSuspects ){ 13 return RA->new($type, @_); }
14 elsif ($type == &case_constants::btCompareAssertions){ 15 return CA->new($type, @_); }
16 elsif ($type == &case_constants::btCriminal){ 17 return CR->new($type, @_); }
18 elsif ($type == &case_constants::btEvidenceEvaluation){ 19 return EV->new($type, @_); }
20 elsif ($type == &case_constants::btCivil){ 21 return CI->new($type, @_); }
22 else{ 23 return Case->new($type, @_); 24 }
25 }
26 sub new {
27 my $invocant = shift;
28 my $class = ref($invocant) || $invocant;
29 my $self = { @_ };
30 bless($self, $class);
31 return $self;
32 }



-- Scott R. Godin Laughing Dragon Services www.webdragon.net

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to