1. Perl From Ground level and Up Lecture 2 October 22 2007 By Shmuel Fomberg
2.
3.
4. Perl script life cycle October 22 2007 Shmuel Fomberg #!/usr/bin/perl -w use strict; BEGIN {print "one "} use A; END {print "two "} print "three "; package A; BEGIN {print "four "} END {print "five "} print "six "; 1; # <- note here Output: one four six three two five Test.pl A.pm
5.
6.
7.
8.
9. The SUPER meta class October 22 2007 Shmuel Fomberg A B C D E $class->func(...) $class->SUPER::func(...) package C; sub mysub { my $class = shift; # $class eq ‘E’ …..
10.
11.
12.
13.
14. Problems? October 22 2007 Shmuel Fomberg NOT SCALABLE Object variable are just keys in hash - spelling error will created bugs You have to know and hard-code the Class-variable package The new will not support multi-inheritance