* John Douglas Porter <[EMAIL PROTECTED]> [2006-09-08 17:20]:
> I believe it's better to do
> 
>   ref $_ ? "$$_" : "$_"
> 
> than
> 
>   ref $_ eq 'SCALAR' ? "$$_" : "$_"
> 
> because, in the first case, you get an actual error in the
> exceptional case (a ref of the wrong type), whereas in the
> latter case you get a useless and wrong string in the value,
> which you might not catch until later, if ever.
> 
> If you really want to test the ref type, do so robustly using
> the methods in Scalar::Util.

Excellent points, both of them; I’ll make a mental note.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to