Have a look at the code snippet from the perl program I have written
use strict;
use FileHandle;
use IPC::Open2;
use vars { ... $topCellName ...};
sub setup {
..
$topCellName="crm_com";
...
}
sub loadNxfDB {
print "$_[0]";
my $nxfDBFH=new FileHandle;
open ($nxfDBFH,$_[0]) or die "Error: Cannot open cross-reference
database, $_[0]\n";
....
return %nxfDB
}
sub updateNetPairsDB {
my %nxfDB=&loadnxfDB ("/tmp/$topCellName/LVS/svdb/$topCellName.nxf");
}
sub main {
.....
&updateNetPairsDB ();
}
&main ();
===================================================================
The program quits whenever it tries to open the file in &loadNxfDB ()
subroutine with this error
Package Installation directory
$BFE_INST_DIR=/mot/madhurk/meth1/dft/bridges/defect_bfault
Prepairing environment ...
Creating necessary directory structure ...
/tmp /crm_com/LVS /svdb/ crm_com.nxf
Error: Cannot open netname cross-reference database, /tmp /crm_com/LVS
/svdb/ crm_com.nxf
Notice the spaces in the file path which I don't know why
automatically gets inserted whenever I try to pass the file path
scalar to the subroutine.
===================================================================
Just to verify if I am not doing anything wrong, I tried to open the
same file in the same fashion in a very small program which I am
writing below and it worked.
use strict;
use FileHandle;
my $topCell="crm_com";
my $ret=&test ("/tmp/$topCell/LVS/svdb/$topCell.nxf");
sub test {
my $FH=new FileHandle;
open ($FH,$_[0]) or die "Error: Cannot open file, $_[0]\n";
print $FH->getline;
close ($FH);
return 0;
}
===================================================================
Can someone help me debug this issue .....its kinda urgent for me.
--
Regards
Madhur Kashyap
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>