in reply to Syntax Error with Embedded Structs

I'm not a big fan of Class::Struct... I prefer Class::MethodMaker. But oh well, I would have done this:
# Insert my new Appt struct into the appts array push @{ $days[$dayCount]->appts }, $temp
but I would make sure that
ref($days[$dayCount]->appts) eq 'ARRAY';
before doing so.

Replies are listed 'Best First'.
(tye)Re: Syntax Error with Embedded Structs
by tye (Sage) on Apr 18, 2001 at 02:56 UTC

    'ARRAY' eq ref $x is a fragile construct. I think you (and more importantly, other people who want to use your code) will be better off if you use: UNIVERSAL::isa( $x, 'ARRAY' )

            - tye (but my friends call me "Tye")