[tpm] How to find my class name

Shlomi Fish shlomif at iglu.org.il
Fri Mar 18 08:47:01 PDT 2011


Hi,

a few comments on your code.

On Friday 18 Mar 2011 16:42:27 Fulko Hew wrote:
> I have the following (simplified, and artificial) scenario:
> 
> package testClass;

1. A package should always start with an uppercase letter.

2. You should add "use strict;" and "use warnings;" somewhere.

Regards,

	Shlomi Fish
> 
> my $classvar = 'data';
> 
> sub getter {
>   my ($class, $mode) = @_;
> 
>   $classvar = '' if ($mode eq 'reset');
>   return $classvar;
> }
> 
> sub otherRoutine {
>   print "I got this from the reset getter: ", getter('reset'), "\n";
> }

[SNIPPED]

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Freecell Solver - http://fc-solve.berlios.de/

I don't believe in fairies. Oops! A fairy died.
I don't believe in fairies. Oops! Another fairy died.

Please reply to list if it's a mailing list post - http://shlom.in/reply .


More information about the toronto-pm mailing list