Travis Hervey wrote:
How do you Create an array of a struct in perl?  Is this even possible
in perl?

So far I have...

struct Carrier_Info => {
        name    => '$',
        abbrev  => '$'
};

That looks like a hash so:

my %Carrier_Info = (
        name    => '$',
        abbrev  => '$',
        );

Or:

my $Carrier_Info = {
        name    => '$',
        abbrev  => '$',
        };



my @carriers = Carrier_Info->new();

I have tried several different methods of loading data into the struct
but none have been successful so far.  I've tried:

$carriers{$x} = [$temp1, $temp2];

@carriers is an array so you probably want:

push @carriers, [ $temp1, $temp2 ];




John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

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


Reply via email to