in reply to Re: perl PDL question
in thread perl PDL question

Interestingly, this works fine from the perldl console, but in a scrip I get an error....
my $time = rcols "testdata.txt"; my $tsearch = $time -> dummy; print $tsearch,"\n";
produces:
[njs@localhost]$ ./testcode Use of uninitialized value in numeric lt (<) at /usr/lib64/perl5/site_ +perl/5.8.8/x86_64-linux-thread-multi/PDL/Core.pm line 936. Use of uninitialized value in numeric lt (<) at /usr/lib64/perl5/site_ +perl/5.8.8/x86_64-linux-thread-multi/PDL/Core.pm line 939. Use of uninitialized value in numeric gt (>) at /usr/lib64/perl5/site_ +perl/5.8.8/x86_64-linux-thread-multi/PDL/Core.pm line 942. Use of uninitialized value in repeat (x) at /usr/lib64/perl5/site_perl +/5.8.8/x86_64-linux-thread-multi/PDL/Core.pm line 942. Use of uninitialized value in subtraction (-) at /usr/lib64/perl5/site +_perl/5.8.8/x86_64-linux-thread-multi/PDL/Core.pm line 943. [ [ 50093.199] [ 50094.308] [ 50954.953] [ 51767.383] [ 51958.219] [ 52005.696] [ 52005.763] [ 52142.188] [ 52422.043] [ 52459.414] [ 52482.509] [ 52693.953] [ 52752.918] [ 52836.803] [ 52837.198] [ 53107.974] [ 53125.429] [ 53141.53] [ 53198.495] [ 53243.578] [ 53489.381] [ 53603.709] [ 53661.37] [ 53724.982] [ 53724.983] [ 53864.724] [ 53882.002] [ 53969.248] [ 54224.674] [ 54225.636] [ 54304.474] [ 54304.539] [ 54366.513] ]
Clearly the dummy is being inserted, so I'm a bit confused as to the uninitiated value errors??

Replies are listed 'Best First'.
Re^3: perl PDL question
by Anonymous Monk on Nov 28, 2007 at 07:53 UTC
    dummy takes 2 mandatory arguments:
    1. the pdl
    2. the dimension number that will be the dummy dimension
    Somehow, the dimension is defaulting to 0.
    This error should go away if you use
    $tsearch = $time->dummy(0);
    which has the same effect and is more explicit
      Brilliant! Anonymous++