RE: Perl Code help to clean files older than 7 days

2006-02-16 Thread Armin Geyer
try this: chdir $indir or die "chdir $indir: $!"; print "reading $indir, please wait...\n"; # alle files ins array einlesen @files = readdir(IDIR) or die "Error: Uable to read current dir:$!\n"; closedir(IDIR); # das A

Perl Code help to clean files older than 7 days

2006-02-16 Thread Farhan Rafiq
Hello everyone, I'm fairly new to perl and recently signed up. I need help, below is my script which is working but i really need to change my code, as I don't want to use -M (match operator) and glob funtion in my code below. Could you guys please correct my code below so I can use 'OPEND

Re: Regular expression ;-)

2006-02-16 Thread Williamawalters
In a message dated 2/16/2006 2:15:44 P.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > How about a slight variation :> > foreach ('123', '123.', '123.txt', '123.some.txt', '123.some.text.txt') {> /^(?:(.*)\.[^.]+|(.*)\.|([^.]+))$/;> print $1 || $2 || $3, "\n";> }   /^ (.+?)

Re: Regular expression ;-)

2006-02-16 Thread $Bill Luebkert
Mark Knoop wrote: > Howard wrote: > >>my ($basename) = $_ =~ / ^(.*)\.[^.]+$/; >> > > > I presume the space ^ there is an error. Even so this does not work on > 123 > > $bill wrote: > > >>I'd probably do it the easy way and just remove the ext: >> >>(my $file = $_) =~ s/\.[^.]*$//; >>p

Re: Regular expression ;-)

2006-02-16 Thread Petr Vileta
- Original Message - From: <[EMAIL PROTECTED]> To: Sent: Thursday, February 16, 2006 2:08 PM Subject: Regular expression ;-) Hello, a simple regular expression is needed to eliminate the file extension: $_="123"; /(XX)YY/; print "$1\n" ; # result: "123"; $_="123.txt"; /(XX)YY/; pri

RE: Regular expression ;-)

2006-02-16 Thread Bowie Bailey
Mark Knoop wrote: > > I would do it this way too... but I have got a bit sucked in to > trying to do it using the model that was initially suggested which > makes a neat little puzzle. I am stumped though! Can anyone find a > way using the > > > $_="123"; > > /(XX)YY/; > > print "$1\n" ; # resul

RE: Regular expression ;-)

2006-02-16 Thread Bullock, Howard A.
This also works…   my $a="123"; my @array = split /\./, $a; pop @array if scalar (@array) >1; print join(".", @array);   Howard A. Bullock Computer Security Tyco Electronics 717-810-3584 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 16,

RE: Regular expression ;-)

2006-02-16 Thread Dirk Bremer
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Mark Knoop > Sent: Thursday, February 16, 2006 09:11 > To: ActivePerl@listserv.ActiveState.com > Subject: RE: Regular expression ;-) > > Howard wrote: > > > > my ($basename) = $_ =~ / ^(.*)\.[^.]+$

Re: Regular expression ;-)

2006-02-16 Thread Josh . Perlmutter
Walter- Some people (more common with those who are used to linux) will have multiple . in the name, sometimes even using it as a way to differentiate. i have seen old. placed before, or after.. so this could become very complicated very fast. I suggest getting a book on perl's reg exp shorts,

Re: Regular expression ;-)

2006-02-16 Thread Williamawalters
In a message dated 2/16/2006 10:01:03 A.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > a simple regular _expression_ is needed to eliminate the file extension: > > $_="123"; > /(XX)YY/; > print "$1\n" ; # result: "123"; > > $_="123.txt"; > /(XX)YY/; > print "$1\n" ; # result: "123"

Re: Regular expression ;-)

2006-02-16 Thread Williamawalters
In a message dated 2/16/2006 8:38:41 A.M. Eastern Standard Time, [EMAIL PROTECTED] writes:   > a simple regular _expression_ is needed to eliminate the file extension: > > $_="123"; > /(XX)YY/; > print "$1\n" ; # result: "123"; > > $_="123.txt"; > /(XX)YY/; > print "$1\n" ; # result: "123"

RE: Regular expression ;-)

2006-02-16 Thread Mark Knoop
Howard wrote: > > my ($basename) = $_ =~ / ^(.*)\.[^.]+$/; > I presume the space ^ there is an error. Even so this does not work on 123 $bill wrote: > I'd probably do it the easy way and just remove the ext: > > (my $file = $_) =~ s/\.[^.]*$//; > print "$file\n"; > I

Re: Regular expression ;-)

2006-02-16 Thread $Bill Luebkert
[EMAIL PROTECTED] wrote: > > Hello, > > a simple regular expression is needed to eliminate the file extension: > > $_="123"; > /(XX)YY/; > print "$1\n" ; # result: "123"; > > $_="123.txt"; > /(XX)YY/; > print "$1\n" ; # result: "123" > > $_="123.txt.txt"; > /(XX)YY/; > print "$1\n" ; # result

RE: Regular expression ;-)

2006-02-16 Thread Dirk Bremer
s/\..{3}$//; # UNTESTED Dirk Bremer - Senior Systems Engineer - ESS/AMS - NISC Lake St. Louis MO - USA Central Time Zone 636-755-2652 fax 636-755-2503 [EMAIL PROTECTED] www.nisc.coop ___ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL P

RE: Regular expression ;-)

2006-02-16 Thread Bullock, Howard A.
a simple regular expression is needed to eliminate the file extension: $_="123"; /(XX)YY/; print "$1\n" ; # result: "123"; $_="123.txt"; /(XX)YY/; print "$1\n" ; # result: "123" $_="123.txt.txt"; /(XX)YY/; print "$1\n" ; # result: "123.txt"; Any suggestions for /(XX)YY/ ? Thanks.

Regular expression ;-)

2006-02-16 Thread Walter . Laub
Hello, a simple regular _expression_ is needed to eliminate the file extension: $_="123"; /(XX)YY/; print "$1\n" ; # result: "123"; $_="123.txt"; /(XX)YY/; print "$1\n" ; # result: "123" $_="123.txt.txt"; /(XX)YY/; print "$1\n" ; # result: "123.txt"; Any suggestions for /(XX)YY/ ? Thanks. Ki

PerlTray

2006-02-16 Thread Sky Blueshoes
Howdy all, I'm using PerlTray for the first time and I've got everything working fine except for one thing. My application displays output (), is there a way to raise the DOS window by click an option on the PerlTray menu? I didn't see anything about this in the documentation. SkyBlueshoes _