mikael-g has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # # # # $filename='she.txt'; # use strict; use Tie::File; my $cnt = 0; open(FILE, "she.txt") or die "$!"; while(<FILE>) { if ($_ =~ /^she/) { &del($cnt); } $cnt++; } sub del { my $dex = $_[0]; tie my @file, "Tie::File", "she.txt"; splice @file, $dex, 1; $cnt--; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: my old robot
by fglock (Vicar) on Jun 14, 2003 at 20:54 UTC |