SPUG: Problem deleting files, last one
Brittingham, John
john.brittingham at attws.com
Fri Dec 1 13:10:20 CST 2000
Looks like y'all are getting tired of this one. So this will be my last post
on this question.
Anyway Thanks to all you help I managed to get it working.
This is what worked.
if ($week_day !~ /Mon/)
{
my
($oldfile)='../html/wrt_archive/monthly_archive/*to'.$today.'*.*';
print "inside if $weekday $oldfile\n";
my @filenames = eval "<$oldfile>";
print map {">>$_<<\n"} @filenames || warn "having trouble
finding $oldfile: $!";
foreach $filename (@filenames)
{
print "deleting filename=$filename\n" || warn
"having trouble with $filename: $!\n";
unlink $filename|| warn "having trouble deleting
$oldfile: $!\n";
}
}
Again Thanks,
jb
-----Original Message-----
From: Tim Maher/CONSULTIX [mailto:tim at consultix-inc.com]
Sent: Friday, December 01, 2000 10:27 AM
To: spug-list at pm.org
Subject: Re: SPUG: Problem deleting files
On Fri, Dec 01, 2000 at 10:14:44AM -0800, Matt Tucker wrote:
> Have we beat this one enough? ;-)
Yes!
I see now that my haphazardly-constructed test procedure fooled me,
because unlike you I hadn't incorporated the creating of the foo* files in
the script itself, and I attributed their failure to show up in the listing
of the next run to the wrong source!
Now if you'll excuse me, I've got to wipe all this egg off my face . . 8-}
(And I too am wondering if prior versions of Perl handled globbing
differently, which could help justify my contrary notions about how it
works.)
-Tim
*========================================================================*
| Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# |
| Email: tim at consultix-inc.com Web: http://www.consultix-inc.com |
|Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing |
|12/12: UNIX 1/15: Perl/DBI 2/20: Data Munging;Perl 2/22: Adv. OO Perl|
*========================================================================*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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