Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Accessing CGI objects from within a 'require'-ed file?

by shmem (Chancellor)
on Jun 22, 2006 at 10:30 UTC ( #556873=note: print w/replies, xml ) Need Help??


in reply to Accessing CGI objects from within a 'require'-ed file?

Yes, it's permissions. Just one note for functions.pl:
use strict; our %GLOBAL; sub outputTest { print $GLOBAL{'test'}; } sub outputPOST { print $GLOBAL{'query'}->Vars; } 1;
use strict and declaring vars with our is good practice. Since %GLOBAL is declared with "our", both files share the same variable. That's what our is about. No need to fully qualify %GLOBAL with the package name.

cheers,
--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://556873]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2023-12-04 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (21 votes). Check out past polls.

    Notices?