in reply to chdir fails

Hello jumk,

It is unnecessary and good practice not to put code tags around the whole text of your question. Only putting code tags around the code portion of your question is necessary. It makes it easier in case you have a lot of code for people to just d/l the code, and helps to visually seperate your code from plain text.

As for your question why not do something like the following instead:

my $active_directory = '/logg/'; my $working_file = $active_directory . "file_name"; open (FILE, $working_file) or die "Cannot open $working_file\n$!";
where the file_name is the name of the file you are working with in that directory, that is unless you have a reason you absolutely have to chdir.

-enlil

Replies are listed 'Best First'.
Re: Re: chdir
by dmitri (Priest) on Jan 24, 2003 at 18:19 UTC
    I think it's quite alright (maybe he likes the way fixed font looks), as long as there are newlines between code and text.