No such thing as a small change | |
PerlMonks |
Re: Not able to execute perl subroutineby Athanasius (Archbishop) |
on Dec 03, 2016 at 07:16 UTC ( [id://1177123]=note: print w/replies, xml ) | Need Help?? |
Hello sachin raj aryan, and welcome to the Monastery! In the commented-out code, you have chdir($brchid); and chdir($date);, but you don’t change back to the original directory before calling the unzipping() function. My guess is that the unzipping function is unable to find the directory named by $brchid from within the current working directory (viz., $brchid/$date), so it does nothing. If you change the working directory back before calling unzipping(), it should work as it does when the code is commented out. BTW, in modern Perl it’s no longer a good idea to call functions with a leading ampersand — that circumvents prototypes (see perlsub). Just call the function like this:
Hope that helps,
In Section
Seekers of Perl Wisdom
|
|