RE: grep and regular exp.

2001-06-06 Thread Jeff 'japhy' Pinyan
On Jun 6, David Blevins said: >my @list1 = grep(/$year\_$month\_.*01\.txt/, @allFiles); >my @list2 = grep(/$year\_$month\_.*01a\.txt/, @allFiles); It is safer to use ${year} than $year\_ because there are some letters which, if backslashed, have entirely different meanings. -- Jeff "j

RE: grep and regular exp.

2001-06-06 Thread David Blevins
Ahhh. So this is more appropriate: my @list1 = grep(/$year\_$month\_.*01\.txt/, @allFiles); my @list2 = grep(/$year\_$month\_.*01a\.txt/, @allFiles); Note to self: I should be using the warnings. Maybe I should write that on my monitor in permanent marker so I don't forget. ;) Thank

Re: grep and regular exp.

2001-06-06 Thread John Joseph Trammell
On Wed, Jun 06, 2001 at 02:02:33PM -0500, David Blevins wrote: [snip] >my @list1 = grep(/$year_$month_.*01\.txt/, @allFiles); >my @list2 = grep(/$year_$month_.*01a\.txt/, @allFiles); [snip] These regexes look for variables $year_ and $month_. Let me guess -- you're not using warnings, r

grep and regular exp.

2001-06-06 Thread David Blevins
For some reason when I am grepping a list like this one, the regular expression doesn't seem to be working. The $year and $month seem to be ignored. The following code prints: 1999_12_stats_log_01.txt1998_07_stats_log_01a.txt It should print only: 1998_07_stats_log_01a.txt #---