I thought that using 'local' would successfully scope those globals to within a sub, so you could,k for example, slurp an entire file by doing:
local $/ = undef; my $file = <FH>; Or am I wrong in that? I use it frequently, and don't seem to have any troubles. --Jon R. PGP Key fingerprint = 12 DA FC 06 AB 4C D6 A4 DE 03 E0 77 D6 DE E0 73 PGP public key available by fingering [EMAIL PROTECTED] On Fri, 3 May 2002, Bill Catlan wrote: > Hello, > > The online mod_perl guide > (http://thingy.kcilink.com/modperlguide/perl/The_Scope_of_the_Special_Perl_Va.ht > ml) states: > > "Special Perl variables like $| (buffering), $^T (script's start time), $^W > (warnings mode), $/ (input record separator), $\ (output record separator) and > many more are all true global variables; they do not belong to any particular > package (not even main::) and are universally available. This means that if you > change them, you change them anywhere across the entire program; furthermore you > cannot scope them with my()." > > My question pertains the CGI %ENV hash. First, I'm assumong that this is a > global variable in the sense of a Perl Special Variable, and not just a main:: > or other package global. My question is how is it the case that the %ENV > variable script instance might be working with doesn't get clobbered or "reset" > by the next incoming request. Are some variables, like %ENV treated differently > by mod_perl? > > Also, how can special variables be reliably initialized? For example, if one > request provides a certain attribute, such as HTTP_IDENT, but a subsequent > request does not, how do I know that the value of $ENV{HTTP_IDENT} on the second > request will indeed be undefined? > > Thanks. > > Bill > >