SPUG: Problem deleting files

Brittingham, John john.brittingham at attws.com
Thu Nov 30 01:16:30 CST 2000


Sorry... Clicked before I should have .. Lets try this again..


Ok.. I'm having a problem deleting files. I have tried:

$oldfile="../html/wrt_archive/weekly_archive/*to$twodaysback*\.*";
		if ($week_day !~ /Mon/) 
		{
			print "$oldfile\n";
			rm ($oldfile) || warn "having trouble deleting
$oldfile: $!";
		}

 I have also tried:
	
$oldfile="../html/wrt_archive/weekly_archive/*to$twodaysback*\.*";
		if ($week_day !~ /Mon/) 
		{
			unlink <$oldfile> || warn "having trouble deleting
$oldfile: $!";
		}

I keep getting an error saying it can not find the file(s).
I can run rm ../html/wrt_archive/weekly_archive/*to$twodaysback*\.* from the
command line and it will work.

What am I doing wrong?


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
  Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/





More information about the spug-list mailing list