On Mon, Jun 23, 2003 at 09:14:25PM +0200, [EMAIL PROTECTED] wrote: > hi, how can i use a real regex with this: > > File::Find::name if -x? > > the filetestops are working fine, but how can i filter things like > .gz$? i tried many ways, but all failed. any idea? thanks!! > > bye andreas
Andreas, I'm not quite clear on what it is you want to do. It sounds like you want to use File::Find to run some code on all files in a particular subtree, but you don't want to run the code on anything ending with .gz. If I'm correct, then you can do this: #!/usr/bin/perl use warnings; use strict; use File::Find; my $start_dir = "top of your subtree goes here"; find( \&my_func, "$start_dir" ); sub my_func { return if /\.gz$/; # ...do whatever you want here... } --Dks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]