in reply to Data::Table and defining $data
You're passing strings ($dates, $quan) instead of arrays (@dates, @quan) to the constructor:
Replace
my $dates = "20070410, 20070415, 20070417, 20070418"; my $quan = "10, 20, 15, 42"; my $table = new Data::Table( [ [$dates], [$quan] ], [ 'Dates', 'Values +' ], 1 );
with
and it should work (tested).my @dates = (20070410, 20070415, 20070417, 20070418); my @quan = (10, 20, 15, 42); my $table = new Data::Table( [ [@dates], [@quan] ], [ 'Dates', 'Values +' ], 1 );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Data::Table and defining $data
by GertMT (Hermit) on May 11, 2007 at 12:23 UTC |