in reply to Something like c++'s static?

you probably want something like this:
package baz; { my $static=1; sub new{return bless my $x;} }
But note that '$static' is completely hidden unless your class has an accessor method. Or you could just use a class global, in the form of '$baz::foo=12;'