[ale] Perl question

Chris Coleman cdcoleman at bellsouth.net
Wed Apr 11 22:30:01 EDT 2007


Your script works fine for me.

 

Chris

 

   _____  

From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Terry
To: ale at ale.org
Bailey
Sent: Wednesday, April 11, 2007 8:38 PM
To: ale at ale.org
Subject: [ale] Perl question

 

Hi,

I want to use a Perl script to remove just the files that end in x, so I
wrote the following, but it deletes every file in the directory.  What am I
not seeing?   This afternoon, I got tired of using nano and started using
wordpad.  Do you think there is an embedded character that doesn't show?






$x = "x";
open(INPIPE, "ls /cygdrive/D/ftproot/abc -1pt | grep -v / |");
while ($hold = <INPIPE>){
chomp($hold);
$tmp = $hold;
$right = chop($hold);
if ($x eq $right){system("rm /cygdrive/d/ftproot/abc/$tmp");}
}
close(INPIPE);

Thanks,

Terry Bailey


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.0.0/754 - Release Date: 4/9/2007
10:59 PM



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.0.0/754 - Release Date: 4/9/2007
10:59 PM
 
-------------- next part --------------
An HTML attachment was scrubbed...




More information about the Ale mailing list