| Next | February 2001 | Slide #19 |
Perl supports a second syntax for method calls
my $person = new Person (...);
name $person 'Fred';
This is equivalent to
my $person = Person->new(...);
$person->name('Fred');
Do not use this notation
It leads to maintenance problems
new Person (...);
This works until September 13, 2004
Then someone adds sub Person { ... } to the program
Then the line is parsed differently:
new(Person(...));
| Next | ![]() |
Copyright © 2001 M-J. Dominus |