abigail on Mon, 10 Jul 2000 18:44:58 -0400 (EDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: references


On Mon, Jul 10, 2000 at 04:22:47PM -0400, Robert Spier wrote:
> >>>>> "MCT" == Michael C Toren <mct@netaxs.com> writes:
> 
> >> Can you provide us an example of what you haven't seen?  I use
> >> references a lot, mostly implicitly.  I don't know what \VARIABLE
> >> is supposed to represent.
> MCT> I believe he's referring to something like:
> MCT> 	$foo = "xyzzy"; $bar = \$foo;
> MCT> $bar is then a reference to $foo.
> 
> In that case, the answer is relatively easy.
> 
> That's poor perl programming.
> 
> You never (with a 99.9952334% probability) will ever need to do that.
> 
> It is	a) bug prone
> 	b) often a security hole
> 	c) better solved with a hash or an array
> 
> The reason the syntax exists is buried somewhere in perl4 or earlier.
> (And perl rarely removes things from the langauge.)


What are you talking about? Why is it error phrone, a security hole
or better solved with a hash or an array?

If you think soft-references are being used in the above code, think
again. \ creates a hard reference, and is strict safe. I can't see
any security holes here, nor do I see how it's better solved with
a hash or an array. As for bug phrone, I disagree. Perhaps you could
show a better method?

I don't understand your reference (no pun intended) to perl4. Perl4
did not have references.



Abigail
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**