in reply to Globbing for file in an unkown directory path only works first time in foreach loop?
#!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; use File::Find::Rule qw/ find rule /; path( "goner/day_of_year/$_/data/desired_file.txt" )->touchpath for 1 +.. 3; print "$_\n" for find( file => name => 'desired_file.txt', in => 'gone +r' ); path( "goner" )->remove_tree; print "$_\n" for find( file => name => 'desired_file.txt', in => 'gone +r' ); __END__ goner/day_of_year/1/data/desired_file.txt goner/day_of_year/2/data/desired_file.txt goner/day_of_year/3/data/desired_file.txt
|
|---|