[rochester-pm-list] Web Site update, meeting reminder

Justin C. Sherrill webmaster at rochester.rr.com
Tue Feb 15 10:07:54 CST 2000


Well, if you like short scripts, this ought to work too.  I haven't tried
it, though I did check syntax.  I've always wanted to use a lazy &&.

#!/bin/perl

# read in whole file
open(IN,"remove.txt") || die "cannot open remove.txt for reading: $!\n";
$\ = undef; $file = <IN>; $\ = "\n";
close IN;

# get rid of unneeded characters
$file =~ s/  00//g;

# pull names out and delete/count
@filenames = split /\n/, $file;
foreach $file_to_delete (@filenames)
{
	unlink($file_to_delete) && $count++;
}

# results
print "$count of ", scalar(@filenames), " files deleted.\n";

----------
For information on unsubscribing from this list, please visit http://rochester.pm.org



More information about the Rochester-pm mailing list