in reply to Re^2: $1 not getting applied to reg ex
in thread $1 not getting applied to reg ex

So I was right. You _are_ trying to reinvent File::Find :)

I think you want something a bit like this (but I haven't had a chance to test it)

#!/use/bin/perl use strict; use warnings; use File::Find; use File::Path; use File::Copy; @_ >= 2 or die "Usage: $0 <source_dir> <dest_dir>\n"; my ($src, $dest) = @_; find(\&do_this, $src); sub do_this { if (-d) { mkpath([$File::Find::name]); } else { my $new = $File::Find::name; $new =~ s|/$src/|/$dest/|; copy $_, $new; } }
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^4: $1 not getting applied to reg ex
by drum1981 (Novice) on Jul 26, 2005 at 15:30 UTC
    hello. i must appologize. i am just a novice. i am having trouble manipulating your code snipet here, and well, i am not sure i fully understand it. would you be able to send me some comments on it. if you like you can email it to me at rgdsouza@gmail.com. thanks once again.

      If you need private consultancy then I'm more than happy to send you my rate card. Otherwise, please post your questions here and we'll all do what we can to help you.

      --
      <http://www.dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg