Angharad has asked for the wisdom of the Perl Monks concerning the following question:
And all I actually want to do is to extract the values and push them into a PDL matrix ... Code so far ... (well the relevant bit anyway ..)-0.821,-0.247,0.001,-0.77 -1.045,-0.289,0.035,-0.962 -1.345,-0.345,0.048,-1.188 -1.674,-0.421,0.041,-1.428
In a nutshell, it doesnt work. I get the following error.#!/usr/bin/perl use PDL; use PDL::Matrix; $file = $ARGV[0]; open(DATA, "$file") || die "Error: Unable to open $file:$!\n"; my $d = [[],[], [], []]; while ( <DATA> ) { chomp; my @1 = split(/,/); push @{$d->[0]}, $l[0]; push @{$d->[1]}, $l[1]; push @{$d->[2]}, $l[2]; push @{$d->[3]}, $l[3]; } $d = PDL::Matrix->pdl($d);
Any help/suggestions much appreciated.Can't use global @1 in "my" at ./DSSP2CD_new.pl line (value here), nea +r "my @1 "
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem with split command
by holli (Abbot) on Sep 05, 2005 at 10:11 UTC | |
|
Re: problem with split command
by davis (Vicar) on Sep 05, 2005 at 10:13 UTC | |
|
Re: problem with split command
by calin (Deacon) on Sep 05, 2005 at 10:39 UTC | |
by Angharad (Pilgrim) on Sep 06, 2005 at 14:24 UTC | |
|
Re: problem with split command
by Angharad (Pilgrim) on Sep 05, 2005 at 10:26 UTC |