in reply to variables in modules

use vars would do the trick. I'd probably use our.

sub p1 { our $persistant; $persistant = "init" unless defined $persistant; $persistant .= "."; return $persistant. }

Of course, that's going to be global to the package namespace, so if you need more than one type of p1(), maybe bless can help too.

package niffty; sub new { bless { persistant => "init" } } sub p1 { my $this = shift; $this->{persistant} .= "."; return $this->[persistant}; }

-Paul