On 8/17/2010 7:34 AM, [email protected] wrote:
> Greetings,
>
> I used to have
>
> {
> local $SIG{__DIE__} = undef;
> $pdl = PDL->zeroes( PDL->byte->type, $wid, $num );
> };
>
> which worked in 2.4.3 and 2.4.4 I think. Then I did a git
> pull (august 17) and get
>
> PDL: PDL::Core::new_pdl_from_string: string input='PDL', string
> output='[PDL]'
> eval '[PDL] ': Bareword "PDL" not allowed while "strict subs" in use at
> (eval 205) line 1.
byte is not a class method so what the above
does is something like this:
$pdl = PDL->zeroes( byte('PDL')->type, 3, 4)
which, since it is expecting a numeric argument
runs atof('PDL') which gives 0. If you add the
0 explicitly, it works:
pdl> $pdl = PDL->zeroes( PDL->byte->type, 3,4)
PDL: PDL::Core::new_pdl_from_string: string input='PDL', string
output='[PDL]'
eval '[PDL] ': Bareword "PDL" not allowed while "strict subs" in use at
(eval 97) line 1.
pdl> $pdl = PDL->zeroes( PDL->byte(0)->type, 3,4)
pdl> p $pdl
[
[0 0 0]
[0 0 0]
[0 0 0]
[0 0 0]
]
> Maybe I dont pass a type properly (could not tell from zeroes
> documentation, and I'm no good at pdl). How to feed it the
> byte type properly .. ?
It is a subtle error that was quietly did what
you expected so was not previously flagged.
Now that we have a string input for the pdl
constructor (i.e., PDL->new()), the bug was
fixed and now reports an error.
> (As a comment to the past install discussion: in my experience
> the ways that give the least platform trouble for any package
> in general is to either automate building from source code or
> try make an "appliance").
We're working towards that goal. The current
effort is to improve portability of PDL across
all perl/PDL platforms. Mostly it is getting
the various external dependencies sorted out,
especially for non-unix platforms.
Cheers,
Chris
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl