Hello, Dear Monks,
I have make a script to go into some directories and perform some process here. But I think it is too complicated and I would like to use File::Find but I can't see how to apply it to my case ? Could you give me some advice ?
Here is the script (the path for the directories has been tested).
#! /usr/bin/perl -w use strict; use File::Find; BEGIN { open(STDERR, ">stderr.log") or die "Failed to open log file"; } sub process{ # to be completed } my @REGS = (LAR30, TYE68, SOK96); my $reg; my $date; my $week; # $date and $week are determined for each $reg via a hash foreach $reg(@REGS){ chdir("../ALL_WEEKS/semaine_${week}") or die; chdir("semaine_${week}_TACOT/day_${date}") or die; chdir("r_${date}") or die; chdir("${reg}") or die ; # I do not know how to apply find::file here &process{$dir}; } close STDERR;
update : simplification of the script
In reply to how to use file::Find ? by steph_bow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |