Section 11.10. Where We Are So Far...


11.10. Where We Are So Far...

So far, we've used the method arrow syntax:

 Class->method(@args); 

or the equivalent:

 my $beast = 'Class'; $beast->method(@args); 

which constructs an argument list of:

 ('Class', @args) 

and attempts to invoke:

 Class::method('Class', @args); 

However, if Perl doesn't find Class::method, it examines @Class::ISA (recursively) to locate a package that does indeed contain method and then invokes that version instead.

Chapter 12 shows how to distinguish the individual animals by giving them associated properties, called instance variables.




Intermediate Perl
Intermediate Perl
ISBN: 0596102062
EAN: 2147483647
Year: N/A
Pages: 238

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net