jreyesb has asked for the wisdom of the Perl Monks concerning the following question:
But!!! it just remove the content of the lines and my file looks like:#!/usr/bin/perl use strict; use Tie::File; my @parsedfiles; my $n_files; if (-e "last_processed.log") { tie @parsedfiles, 'Tie::File', "last_processed.log"; n_files = @parsedfiles; if($n_files>=10) { for(my $i=0; $i<5; $i++) { delete $parsedfiles[$i]; } } untie @parsedfiles;
Help please!!!! Thanks in advanced6chale 7chale 8chale 9chale 10chale 11chale 12chale
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remove Lines from file
by Corion (Patriarch) on Jul 14, 2009 at 19:37 UTC | |
by ikegami (Patriarch) on Jul 14, 2009 at 19:45 UTC | |
|
Re: Remove Lines from file
by ikegami (Patriarch) on Jul 14, 2009 at 19:44 UTC | |
|
Re: Remove Lines from file
by johngg (Canon) on Jul 14, 2009 at 22:06 UTC | |
|
Re: Remove Lines from file
by Utilitarian (Vicar) on Jul 14, 2009 at 19:45 UTC | |
|
Re: Remove Lines from file
by CountZero (Bishop) on Jul 14, 2009 at 19:45 UTC | |
|
Re: Remove Lines from file
by ambrus (Abbot) on Jul 15, 2009 at 16:09 UTC | |
|
Re: Remove Lines from file
by johngg (Canon) on Jul 15, 2009 at 09:13 UTC |