Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Not able to execute perl subroutine

by Athanasius (Archbishop)
on Dec 03, 2016 at 07:16 UTC ( [id://1177123]=note: print w/replies, xml ) Need Help??


in reply to Not able to execute perl sub routine

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:

unzipping($brchid, $date);

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1177123]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-24 09:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found