Oh dear thats a while to wait! (I am on system perl 5.12.3)

Does anyone know if there is a perl file in the system tree I can go and 
butcher to remove this 'feature' ? Does anyone know what the patch changed?


Karl

On 13/04/2012, at 2:40 AM, Derek Lamb wrote:

> According to Luis Mochan's recent message to the perldl list (March 8th 
> 2012), this is fixed with Perl 5.15.8 and later.  So between Perl 5.10.1 (or 
> maybe .0) and 5.15.8 there's this problem (in the debugger only?).
> 
> Derek
> 
> On Apr 11, 2012, at 11:46 PM, Karl Glazebrook wrote:
> 
>> Hi everyone
>> 
>> I had some trusty old code start to behave weirdly in the latest PDL/perl
>> 
>> Quite simple:
>> 
>>  $iy = which($wav0<2000); 
>>  $dmags($iy) .= 1; 
>> 
>> 
>> "Can't return a temporary from lvalue subroutine"
>> 
>> It seems I have fallen in to this issue described in PDL::Indexing
>> 
>>> A nice feature in recent perl versions is lvalue subroutines (i.e., 
>>> versions 5.6.x and higher including all perls currently supported by PDL). 
>>> That allows one to use the slicing syntax on both sides of the assignment:
>>> 
>>> pdl> $im->slice(':,(2)') .= zeroes(5)->xvals->float
>>> Related to the lvalue sub assignment feature is a little trap for the 
>>> unwary: recent perls introduced a "feature" which breaks PDL's use of 
>>> lvalue subs for slice assignments when running under the perl debugger, 
>>> perl -d. Under the debugger, the above usage gives an error like: Can't 
>>> return a temporary from lvalue subroutine... So you must use syntax like 
>>> this:
>>> 
>>> pdl> ($pdl = $im->slice(':,(2)')) .= zeroes(5)->xvals->float
>>> which works both with and without the debugger but is arguably clumsy and 
>>> awkward to read.
>> 
>> What is this 'feature' and what idiot in the Perl community is responsible 
>> for this? To have the same code work fine when run normally and then fail in 
>> the debugger is scandalous!
>> 
>> Is there some way to fix this globally?  I see some traffic on the mailing 
>> list from 2010 about this - I can't believe it is still there.
>> 
>> Grr!
>> 
>> 
>> Karl
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> PDL-porters mailing list
>> [email protected]
>> http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters
>> 
> 


_______________________________________________
PDL-porters mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/pdl-porters

Reply via email to