in reply to Persistent Variable
Ok, on to your question:
You don't need a separate package for these variables. If you declare the variables in your script before declaring any subs then all the subs in main:: can see them. If you have them in a namespace other then main::, then you'll either want to use our (5.6+) or use vars($^V<5.6)
#!perl -w use strict; #Always! my $username=user; my $sessionid=1234; subone($comm); #in subroutines i could call subone { print "$comm->$username"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Persistent Variable
by Anonymous Monk on Jan 15, 2001 at 22:45 UTC | |
by Adam (Vicar) on Jan 16, 2001 at 03:30 UTC |