I was wondering if anyone can point me to newbie-type tutorials on any of the following (including but not limited to which perldocs I can read):
- Definition of 'lexical' and 'canonical' - Differences between 'my' and 'local' - Good overview of packages and namespaces - How to build modules - Effective re-use (building subroutines for efficiency and portability) - Why do I '@_ = shift;' on subroutines?
I already have:
- Learning Perl - Perl in a Nutshell - Teach Yourself Perl in 21 Days - The obvious: perldocs, CPAN, etc.
I'm not so good at grasping abstract data, I learn better by building, breaking, and fixing until I get it right. Thanks in advance for any pointers, especially for tutorial-type info with program building exercises.
For your first 3 questions absolute required reading is "Coping with Scoping"...
http://perl.plover.com/FAQs/Namespaces.html
For some other random thoughts and good pointers you should check out drieux's (frequent poster on this list) rants:
http://www.wetware.com/drieux/CS/lang/Perl/
Your 4 & 5 probably come best with experience, assuming you have looked at the perldoc's on references and object oriented Perl. perldoc perl for the full list, pay particular attention to any of the "tut's"...
6, when doing OOP in Perl the first argument passed to a method (subroutine) will either be the package name or the object instance, so it is common practice to shift that element off of the list so that you are left with merely the explicit arguments in @_. However I hope you are not setting @_ equal to shift as that is probably not what you want, I assume you mean something more like shifting @_,
my $self = shift;
or the verbose
my $self = shift(@_);
What you said, would clear and then populate @_ with only the first value, at least I think, that is really too scary to ponder....
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]