in reply to Perl Data Language Question

You need to initialitze your array_ref
my $array_ref = [];

--
I'm not belgian but I play one on TV.

Replies are listed 'Best First'.
Re: Re: Perl Data Language Question
by graff (Chancellor) on Apr 01, 2003 at 03:29 UTC
    It would make for good hygiene/habits to initialize that way, but it's not mandatory (and probably won't make a difference in this case); the following works with no sweat:
    use strict; use PDL; my $arref; while(<DATA>) { push @$arref, $_; } my $p = pdl($arref); print $p,$/; __DATA__ 1.0 2.2 3.1 4.0 5.5 10.0 20.0
      Doh, yeah... so used to -w

      --
      I'm not belgian but I play one on TV.