Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like it to print out without the startdirectory:/startdirectory/index.html /startdirectory/nextdir/here.html /startdirectory/anotherdir/home.html
My attempt but didnt work:/index.html /nextdir/here.html /anotherdir/home.html
use strict; use warnings; my $diry = '/startdirectory'; my $newname; $name = $File::Find::name; open ( DATA, $name ) || warn "Can\'t open File $name: $!\n"; while($hit = <DATA>) { if ($hit =~ /regexpressionhere/i) { ($newname) = $name =~ /$dir(\s+*)/i; print "$1\n"; } } close DATA;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: changing File Find name
by arden (Curate) on Mar 09, 2004 at 14:38 UTC | |
|
Re: changing File Find name
by skx (Parson) on Mar 09, 2004 at 15:07 UTC | |
by Anonymous Monk on Mar 09, 2004 at 15:19 UTC | |
|
Re: changing File Find name
by tinita (Parson) on Mar 09, 2004 at 15:25 UTC |