#!/usr/bin/perl -w use strict; use Math::Trig; if (@ARGV < 1) { die <) #load { if (/^\#/) {print $_; } #header line elsif (/^\s*$/) { } #empty line else { $line++; #data line s/^\s+//; #remove leading whitespace s/\s+^//; #remove trailing whitespace @_=split /\s+/; #break on space unshift @_,$line; #add as first column my $key=evalfunc2($eqs,@_); #evaluate row key $chain{$key}.=chr($f+ord('a')); #add key to chain $data->[$f]{$key} = [ @_ ]; #store row } } $mykey.=chr($f+ord('a')); #magic close FI; $f++; } #Evaluate equations for keys occuring in all files: foreach my $key (grep $chain{$_}=~/$mykey/, sort{$a<=>$b} keys %chain) { # print $key; foreach (@eqns) { my $x=evalfunc($_,$data,$key); if (defined $x) { print "$x\t"; } else { print "\tERR"; print STDERR "Error evaluating: $_\n";} } print "\n"; }