> Dan Muey wrote:
> >
> > I read in an earlier email that some people put _ in front
> > of variables/function/etc to show that they are "important 
> and should 
> > be handled by the program only" and it said that some 
> "modules enforce 
> > this"
> 
> Hi Dan.
> 
> This is historical stuff, and ugly too. When there was no 
> proper protection against invading foreign namespaces, people 
> decided to use 'unlikely' prefixes to their variable names to 
> try to stop them being used elsewhere. DEC (now Compaq), for 
> instance, decided to use dollar and double-dollar as prefixes 
> for their operating-system variables.
> 
> Perl is different in that you can't write, say, an interrupt 
> handler, which interfaces directly with the system. But 
> namespaces do exist (as packages) and there's no way that you 
> can prevent one package's software accessing another's.
> 
> Lexical variables are another matter, as they don't belong to 
> a given package but exist globally as long as there is a 
> reference to them. In my opinion this is a bit of a hack, but 
> access can be limited by creating data that is accessible 
> only by reference, so that code can reach that data only if 
> it has been given a reference to it.
> 
> All this is independent of the name of the variable, which 
> can be created with any name you like. This program creates a 
> scalar with the name "main::~" and prints it successfully.
> 
>   no strict;
>   ${"\x7E"} = 76;
>   print ${"main::~"}, "\n";
> 
> I can't hope that this will help, as it will probably raise 
> more questions than answers!

Lots of them too! 
Thanks for the info

Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to