in reply to Re: Persistent Variable
in thread Persistent Variable

Okay, I was thinking of creating a package "Common" that would hold the state variables. Can you "set" a variable in a package and be able to retrive it later if you maintain the pointer to the package? For instance..
package Common; my $session; #main program $comm=new Common; $comm->session="1234"; $temp=$comm->session; print "$temp";
would this print out 1234 or can you not assign variables inside packages like this? Thanks.

Replies are listed 'Best First'.
Re: Re: Re: Persistent Variable
by Fastolfe (Vicar) on Jan 15, 2001 at 23:17 UTC
    $Common::variable = "value"; print $Common::variable; # 'value'