-
Jan 4th, 2003, 02:34 AM
#1
Thread Starter
Hyperactive Member
PERL non-private variable
i knw if i want a private variable i can write:
but what if i want a variable to be availabel through-out a script?
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Jan 8th, 2003, 11:31 AM
#2
Black Cat
Scope it a "file level" (right at the top of your script, before any functions, etc) which puts it in the default "main" package. Else look into the Perl doc about the our keyword.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jan 8th, 2003, 02:21 PM
#3
Thread Starter
Hyperactive Member
thanks, but while looking at the "our" scope i found the "local" scope... can anyone telling the difference b/c the documentation is unclear on this point
ps: anyone know any good perl tutorials\books\references on-line?
i've got the ActiveState documentation that came with my perl interpreter and the "picking up PERL" pdf which is quite basic to say the least...
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
-
Jan 9th, 2003, 11:50 AM
#4
Black Cat
Changes are you want to stick with "my" unless you're working with your own packages. Basically, local is used within a function to decalre a variable with the same name as a global one with the function, but functions called from within the function don't get the global variable. I think local will probably be obsoleted sometime.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|