marto9 has asked for the wisdom of the Perl Monks concerning the following question:
edit: Sorry people. I just saw that I posted this in the wrong section. Can a mod please move this.#!/usr/bin/perl use warnings; use strict; use Term::ReadKey; print "[-] Enter the filename: "; chomp($file = <STDIN>); open(LIST,$file); @file1 = <LIST>; close(LIST); if (-e "cleaned.txt") { print "[-] Can cleaned.txt be deleted? "; $answer = <stdin>; if ($answer =~ /yes/i) { unlink "cleaned.txt"; } else { &exit } } print "[-] Cleaning...\n"; foreach $data (@file1) { ($w1) = split(/:/,$data); open(OUTPUT,">>cleaned.txt"); print OUTPUT $w1."\n" unless ($data =~ /-/); close(OUTPUT); } &exit; sub exit() { ReadMode 2; print "\n[-] Press ENTER to exit..."; <STDIN>; exit; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Increase speed script
by roboticus (Chancellor) on Jul 11, 2008 at 13:21 UTC | |
by marto9 (Beadle) on Jul 11, 2008 at 14:27 UTC | |
|
Re: Increase speed script
by karavelov (Monk) on Jul 11, 2008 at 16:57 UTC | |
by marto9 (Beadle) on Jul 11, 2008 at 18:07 UTC | |
by massa (Hermit) on Jul 11, 2008 at 19:48 UTC | |
|
Re: Increase speed script
by kyle (Abbot) on Jul 11, 2008 at 17:06 UTC |