On Tue 26 Oct 2004 12:24, Elizabeth Mattijsen <[EMAIL PROTECTED]> wrote:
> >>  > sub statename {
> >>  >     my $name = 'david';
> >>  >     ${\$name} = 'liz';
> >>  >     return "hello, my name is $name";
> >>  > }
> >
> >But surely in this case the ${\$name} should itself be optimised to $name
> >first?
> 
> Well, possibly.  I just wrote it that way to be as succinct as 
> possible.  I seriously doubt whether spending the extra cycles for 
> checking for this particular type of situation are worth the 
> optimization.

This one would be a compile time optimilization, and would happen only once.
The de-ref would be done run-time, and the time gained is completely depending
on how often it would happen

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.8.3, & 5.9.x, and 809 on  HP-UX 10.20 & 11.00, 11i,
   AIX 4.3, SuSE 9.0, and Win2k.           http://www.cmve.net/~merijn/
http://archives.develooper.com/[EMAIL PROTECTED]/   [EMAIL PROTECTED]
send smoke reports to: [EMAIL PROTECTED], QA: http://qa.perl.org


Reply via email to