ameezys has asked for the wisdom of the Perl Monks concerning the following question:
I tried to run this script but there's an error. Can someone explain what it means and how to fix it. Thankyou.
use Class::Struct; struct Person { name => '$', age => '$', peers => '@', }; my $p = Person->new(); $p->name("Jason Smythe"); $p->age(13); $p->peers( ["Wilbur", "Ralph", "Fred"] ) ; printf"At age %d, %s's first friend is %s.\n", $p->age, $p->name, $p-> +peers(0);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Struct class
by GrandFather (Saint) on Apr 03, 2019 at 04:19 UTC |