in reply to Embeded Data vs Data File
You can use splice instead of your multiple shifts. Replace
shift @dates; shift @dates; shift @dates; shift @dates;
with
splice @dates, 0, 4;
If you are reading a file that is supplied to your script on the command line you can read it by doing <> rather than having to explicitly say <STDIN>
When reading from the file you might be better off reading a line at a time, especially if the file is large.
... my @firstLine = <>; my @dates = split m{\|}, $firstLine; ... while ( my $line = <> ) { ... }
I hope this is of use,
Cheers,
JohnGG
|
|---|