Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Help with exercise

by Anonymous Monk
on Sep 23, 2017 at 00:02 UTC ( #1199940=note: print w/replies, xml ) Need Help??


in reply to Help with exercise

You didn't... actually... create the directories. Use mkdir. Also, it's not necessary to test -d and -e separately, because the former implies the latter.

Replies are listed 'Best First'.
Re^2: Help with exercise
by codeKnight (Initiate) on Sep 23, 2017 at 00:14 UTC
    I know I didn't create any. Right now, my script won't change into the directory given as an argument. For example, inside my ubuntu terminal I created a directory called test. then I tried to run the script with "test" as an argument. I expected to then be inside of test. Nothing happened.

      Any changes to what is the current directory made while running perl disapear when perl ends.

      in your perl script add

      use Cwd; print 'Cwd:'.getcwd."\n";
      after the
      chdir($Dir);
      and you will see that you did move to that directory while perl was running.

        Thanks. I wAS expecting a bash-type cd

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199940]
help
Chatterbox?
and !@monks...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-10-21 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (270 votes). Check out past polls.

    Notices?