PerlBear has asked for the wisdom of the Perl Monks concerning the following question:
..or perhaps even less elegant...#!/usr/bin/perl -w use strict; use FileHandle; my $infile="T:/data.dat"; open(IN,"$infile") or die "CANNOT OPEN $infile !!\a\n"; my $c=0; while ($c<4){ my $junk=<IN>; $c++; }
I am basically curious what other perhaps better ways that this can be done.#!/usr/bin/perl -w use strict; use FileHandle; my $infile="T:/data.dat"; open(IN,"$infile") or die "CANNOT OPEN $infile !!\a\n"; my $junk=<IN>; $junk=<IN>; $junk=<IN>; $junk=<IN>;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Skipping the first 4 lines of a file:: Is there a better way?
by Joost (Canon) on Jun 03, 2005 at 12:26 UTC | |
Re: Skipping the first 4 lines of a file:: Is there a better way?
by mrborisguy (Hermit) on Jun 03, 2005 at 13:07 UTC | |
Re: Skipping the first 4 lines of a file:: Is there a better way?
by djohnston (Monk) on Jun 03, 2005 at 16:16 UTC | |
Re: Skipping the first 4 lines of a file:: Is there a better way?
by sh1tn (Priest) on Jun 03, 2005 at 14:15 UTC | |
by Fletch (Bishop) on Jun 03, 2005 at 14:22 UTC | |
| |
by fishbot_v2 (Chaplain) on Jun 03, 2005 at 15:02 UTC |