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:
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
1 package case;
2 our @EXPORT = qw( $crimhelp $evhelp $civhelp $rkhelp);
3 package CaseFactory;
4 require Exporter;
5 use case_constants qw(:DEFAULT btRankSuspects);
6 use strict;
7 use warnings;
8 #($crimhelp, $evhelp, $civhelp) = ("","","");
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 }
33
-- Perl is my reason for following the Sun;
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>