Re: use variables in regex||solved

2002-05-22 Thread drieux
On Wednesday, May 22, 2002, at 03:26 , Sven Bentlage wrote: > ok, found out myself why it didn't work. > I am not sure if it's an elegant chunk of code, but it works. > Since the data is in the $_ variable, fooling around with $date_today in > the regex coulnd't work out. > (Omitted =~ since I

Re: use variables in regex||solved

2002-05-22 Thread Sven Bentlage
Hi Felix thanks for the tips. On Wednesday, May 22, 2002, at 01:20 PM, Felix Geerinckx wrote: > You have a precedence problem here, since '||' has higher precedence > than ','. You should either use > > open(FH, " open FH, " didn't know that yet. fixed it. > (Why are

Re: use variables in regex||solved

2002-05-22 Thread Felix Geerinckx
on Wed, 22 May 2002 10:26:34 GMT, [EMAIL PROTECTED] (Sven Bentlage) wrote: > my $date = `/bin/date +%d.%m.%y`; > $date =~ tr/./-/; > chomp $date; There is no need to fork here. You can accomplish the same from within Perl, by replacing the above lines with my ($d, $m, $y) = (localtime)[3,

Re: use variables in regex||solved

2002-05-22 Thread Sven Bentlage
ok, found out myself why it didn't work. I am not sure if it's an elegant chunk of code, but it works. Since the data is in the $_ variable, fooling around with $date_today in the regex coulnd't work out. (Omitted =~ since I use $_.) Sven my $date = `/bin/date +%d.%m.%y`; $date =~ tr/./-/; cho

use variables in regex

2002-05-22 Thread Sven Bentlage
Hi I'l looking for a way to use a scalar in a regex. The snibblet below shows in about what it is supposed to do. if someone has a better idea how to compare the date value with the $date_today value I extract from the text file, I'd be really happy about any hints.. The snibblet doesn't work,