On Dec 19, 2:29 am, [EMAIL PROTECTED] (Ravindra Ugaji) wrote:
> I am trying the following code to change the directory
>
> chdir ( '/opt/application') || die ("Can't change directory: $!\n");
> tried this also
> chdir "/opt/application" || die "Can't change directory: $!\n";
>
> But i am unable to change the directory to " /opt/application " from
> present working directory
What is your indication of that? How do you know the directory has
not changed? Do you get an error message, and if so, what is it? Do
you have some code below this later that proves you're not in /opt/
application?
Or do you mean that when your program exits, you are back where you
started the program from? That is, you are in /home/jsmith, you run
this program, and when the program exits, you're still in /home/
jsmith. If that's the "error" you're talking about, please read:
perldoc -q directory
Found in /usr/lib/perl5/5.8/pods/perlfaq8.pod
I {changed directory, modified my environment} in a perl
script. How
come the change disappeared when I exited the script? How do I
get my
changes to be visible?
Paul Lalli
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/