Luis - This was due to something that Perl let pass for a long time. Then it was changed to produce this error. We discussed this with the Perl5 Porters, and they decided to switch it back. I believe (though have not tested myself) that under the current blead Perl, this should no longer be an issue. (This was fixed roughly a week ago.)
Do you still get this error with the latest Perl from git? David On Thu, Mar 8, 2012 at 4:27 PM, Luis Mochan <[email protected]> wrote: > I have a related problem with pdl2. If I do > bash:~$ pdl2 > pdl> $a=zeroes(5,5); $a(2,2).=1; print $a; > only zeroes get printed. The same happens if I do $a->nslice(2,2).=1, > but if I do $a->slice('2,2').=1 then the 1 does get printed. > Regards, > Luis > > > On Thu, Mar 08, 2012 at 04:18:17PM -0600, Luis Mochan wrote: > > Today I tried to run an old program using my new perl (5.15.7) and my > > new PDL (2.4.10) and had an error regarding the use of subroutines as > > lvalues. A simple example is > > > > #!/usr/bin/env perl > > use strict; use warnings; > > use PDL; use PDL::NiceSlice; > > my $a=zeroes(5,5); > > $a(2,2).=1; > > > > The error message is "Can't modify non-lvalue subroutine call" at the > > last line. If I replace the line by "$a->nslice(2,2).=1;" the error > > remains. If I replace it by "$a->slice('2,2');" it goes away, as it > > does if I use a temporary variable. Nevertheless, I get a '1' if I "print > > PDL::Lvalue->subs('slice');" and also if I "print > > PDL::Lvalue->subs('nslice');". The code used to work. I wonder if > > something changed in PDL or in perl or if I made some mistake when > > configuring/compiling them. > > > > Thanks and best regards, > > Luis > > > > > > > > > > > > > > > > _______________________________________________ > > Perldl mailing list > > [email protected] > > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > > -- > > o > W. Luis Mochán, | tel:(52)(777)329-1734 /<(*) > Instituto de Ciencias Físicas, UNAM | fax:(52)(777)317-5388 `>/ /\ > Apdo. Postal 48-3, 62251 | (*)/\/ \ > Cuernavaca, Morelos, México | [email protected] /\_/\__/ > > O< ascii ribbon campaign - stop html mail - www.asciiribbon.org > > > > _______________________________________________ > Perldl mailing list > [email protected] > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
