FindBin cannot chdir back problem

FindBin cannot chdir back problem

am 13.07.2005 02:23:05 von Bri

We have Perl 5.6.1 installed. We're getting the message:

Cannot chdir back to
M:/MyComp_R16/Manufacturing/ToolsData/VisualStudioNet: No such file or
directory at C:/Perl/lib/FindBin.pm line 162.
BEGIN failed--compilation aborted at C:/Perl/lib/FindBin.pm line 166
Compilation failed in require at
\\myserver.ca.company.com\project-sw\prod\mytools\bin\trigge rs\bvb_trigger.pl
line 101
BEGIN failed--compilation aborted at
\\myserver.ca.company.com\project-sw\prod\mytools\bin\trigge rs\bvb_trigger.pl
line 101

This script worked when we had Visual Studio 6 installed but now fails
since we installed Visual Studio.NET. It is called from within Visual
Studio.

Any suggestions where to start looking to figure out how to fix this?

Brian Bygland

Re: FindBin cannot chdir back problem

am 13.07.2005 02:33:54 von Gunnar Hjalmarsson

bri@bygland.net wrote:
> We have Perl 5.6.1 installed. We're getting the message:
>
> Cannot chdir back to
> M:/MyComp_R16/Manufacturing/ToolsData/VisualStudioNet: No such file or
> directory



> This script worked when we had Visual Studio 6 installed but now fails
> since we installed Visual Studio.NET. It is called from within Visual
> Studio.
>
> Any suggestions where to start looking to figure out how to fix this?

The code?

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Re: FindBin cannot chdir back problem

am 13.07.2005 15:14:54 von bxb7668

"Gunnar Hjalmarsson" wrote in message
news:3jj5rnFqbdkuU1@individual.net...
> bri@bygland.net wrote:
>> We have Perl 5.6.1 installed. We're getting the message:
>>
>> Cannot chdir back to
>> M:/MyComp_R16/Manufacturing/ToolsData/VisualStudioNet: No such file
>> or
>> directory
>
>
>
>> This script worked when we had Visual Studio 6 installed but now
>> fails
>> since we installed Visual Studio.NET. It is called from within
>> Visual
>> Studio.
>>
>> Any suggestions where to start looking to figure out how to fix this?
>
> The code?
>
Here is a code snippet from my script that calls FindBin:

#!/bin/perl
use strict;
use File::Basename;
use Getopt::Long;
use Cwd;
use Cwd 'abs_path';
require 5.6.1;

# ------------------------------------------------
$ENV{PATH} = my $UT_MYPATH = my $UT_CCPATH = "";
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};

# In the original script, the following line is line 101
use FindBin qw($Bin);
BEGIN { # Untaint $Bin
if ( "$Bin" =~ /^(.*)$/ ) { $Bin = $1; } else { die "Tainted
Bin\n";};
}
use lib ("${Bin}/perllib","${Bin}/../perllib");

require 'bvb_include_common.pl';
bvb_set_PATH($Bin, $BVBDEBUG); # Set PATH to min. system libs

exit(0);

Brian Bygland

Re: FindBin cannot chdir back problem

am 13.07.2005 23:52:58 von Slaven Rezic

bri@bygland.net writes:

> We have Perl 5.6.1 installed. We're getting the message:
>
> Cannot chdir back to
> M:/MyComp_R16/Manufacturing/ToolsData/VisualStudioNet: No such file or
> directory at C:/Perl/lib/FindBin.pm line 162.
> BEGIN failed--compilation aborted at C:/Perl/lib/FindBin.pm line 166
> Compilation failed in require at
> \\myserver.ca.company.com\project-sw\prod\mytools\bin\trigge rs\bvb_trigger.pl
> line 101
> BEGIN failed--compilation aborted at
> \\myserver.ca.company.com\project-sw\prod\mytools\bin\trigge rs\bvb_trigger.pl
> line 101
>
> This script worked when we had Visual Studio 6 installed but now fails
> since we installed Visual Studio.NET. It is called from within Visual
> Studio.
>
> Any suggestions where to start looking to figure out how to fix this?
>

I think it has something to do with the path of the script. Maybe perl
is confused by the UNC path or the mapping of the M: drive.

Regards,
Slaven

--
Slaven Rezic - slaven rezic de

tksm - Perl/Tk program for searching and replacing in multiple files
http://ptktools.sourceforge.net/#tksm

Re: FindBin cannot chdir back problem

am 14.07.2005 03:17:20 von Sisyphus

"bxb7668"

> Here is a code snippet from my script that calls FindBin:
>
> #!/bin/perl
> use strict;
> use File::Basename;
> use Getopt::Long;
> use Cwd;
> use Cwd 'abs_path';
> require 5.6.1;
>
> # ------------------------------------------------
> $ENV{PATH} = my $UT_MYPATH = my $UT_CCPATH = "";
> delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};

Are the above 2 lines relevant to the problem ? If so, let us know. If not,
let us know. If you don't know, remove them and then check to see what
happens.

>
> # In the original script, the following line is line 101
> use FindBin qw($Bin);
> BEGIN { # Untaint $Bin
> if ( "$Bin" =~ /^(.*)$/ ) { $Bin = $1; } else { die "Tainted
> Bin\n";};
> }
> use lib ("${Bin}/perllib","${Bin}/../perllib");
>
> require 'bvb_include_common.pl';
> bvb_set_PATH($Bin, $BVBDEBUG); # Set PATH to min. system libs
>
> exit(0);

Not sure how you expect that to help us. Normally, when someone asks for
code, a minimal example is provided. Your script seems to be failing at
compile time - in which case, just about all the code that you have supplied
is superfluous. I suspect that the problem can be produced by running the
following script (if that script is in the same location as trigger.pl):

use FindBin qw($Bin);
__END__

The problem is probably as Slaven said.

Cheers,
Rob

Re: FindBin cannot chdir back problem

am 15.07.2005 16:46:17 von bxb7668

"Sisyphus" wrote in message
news:42d5bd45$0$3275$afc38c87@news.optusnet.com.au...
>
> "bxb7668"
>
>> Here is a code snippet from my script that calls FindBin:
>>
>> #!/bin/perl
>> use strict;
>> use File::Basename;
>> use Getopt::Long;
>> use Cwd;
>> use Cwd 'abs_path';
>> require 5.6.1;
>>
>> # ------------------------------------------------
>> $ENV{PATH} = my $UT_MYPATH = my $UT_CCPATH = "";
>> delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
>
> Are the above 2 lines relevant to the problem ? If so, let us know. If
> not,
> let us know. If you don't know, remove them and then check to see what
> happens.
>
>>
>> # In the original script, the following line is line 101
>> use FindBin qw($Bin);
>> BEGIN { # Untaint $Bin
>> if ( "$Bin" =~ /^(.*)$/ ) { $Bin = $1; } else { die "Tainted
>> Bin\n";};
>> }
>> use lib ("${Bin}/perllib","${Bin}/../perllib");
>>
>> require 'bvb_include_common.pl';
>> bvb_set_PATH($Bin, $BVBDEBUG); # Set PATH to min. system libs
>>
>> exit(0);
>
> Not sure how you expect that to help us. Normally, when someone asks
> for
> code, a minimal example is provided. Your script seems to be failing
> at
> compile time - in which case, just about all the code that you have
> supplied
> is superfluous. I suspect that the problem can be produced by running
> the
> following script (if that script is in the same location as
> trigger.pl):
>
> use FindBin qw($Bin);
> __END__
>
> The problem is probably as Slaven said.
>
Sorry if I provided too much information. I've more often had people
want to see the entire script. Anyway, I tried your suggested one-liner
and FindBin worked fine. In fact, after having my script fail every
time on Tuesday and Wednesday, today it has started working without any
problems. The use says that he didn't change anything. Go figure. I
hate intermittent and/or unreproducible problems.

Thank you for taking a look.
Brian