in reply to Graphing basics..
Here is a simple way to get the given lines into @data (not tested). It's a lot like the one by Ovid but simpler because I don't have to sort file names.
use strict; sub split_file_line { my $file = shift; open(IN, "<".$file) || die "cannot open $file: $!"; my @items = split /,/,chomp($_ = <IN>); close IN; return \@items; } my @data = (); my @files = qw(header_data.dat); my $nfiles = 3; for (my $i = 1; $i <= $nfiles; $i++) { push @files,"daily_data${i}.dat"; } foreach my $file (@files) { push @data, split_file_line($file); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Graphing basics..
by Anonymous Monk on Mar 01, 2003 at 20:10 UTC |