Extreme Wierdness with deferencing

Gareth Harper gareth at migcan.com
Mon Aug 13 13:57:18 BST 2007


Either I'm missing something which has changed in a recent version of 
perl, or something very strange is happening.

I have a structure as follows, created like so:

  my $params = {
            msisdn => \@numbers,
        };


which is passed as a parameter to a function, like so:

 $self->sendMtMessage( $params, 'SMS' );


Which the top of which is defined like:

sub sendMtMessage {
    my $self = shift;
    my $params = shift;
    my $type = shift;

A Dumper at the top gives:
$VAR2 = {
          'msisdn' => [
                        '14252836818'
                      ],
        };



The, when I try to get the msisdn arrayref, I don't get an arrayref:

my $arrayref = $params->{msisdn};
print Dumper($arrayref);
Gives :
$VAR1 = '14252836818';

There's no monkeying about with perl internals or anything like that 
going on, why am I losing an extra level of references suddenly (this 
doesn't happen on  the machines I usually run this on, and all the 
machines are running perl 5.8.7.


More information about the london.pm mailing list