CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: How to check, if the script on current directory: Edit Log



digioleg54
User

Mar 29, 2017, 12:03 PM


Views: 3859
How to check, if the script on current directory

Perl script is working on different directories and at the end I want to clean working directory. I have a variable $path_to_cur_dir = /path/to/dir
What command to use to check if the script is on current directory, and if not, then change directory to current.

In my opinion it is supposed to be something like
if ( ! -z $path_to_cur_dir)
{
chdir $path_to_cur_dir
}


(This post was edited by digioleg54 on Mar 29, 2017, 12:10 PM)


Edit Log:
Post edited by digioleg54 (User) on Mar 29, 2017, 12:10 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives