Am Montag, 16. Mai 2005 06.03 schrieb Madhur Kashyap: > Have a look at the code snippet from the perl program I have written
Hello, > 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 Where is this coming from? The spaces in the path are here too. > Error: Cannot open netname cross-reference database, /tmp /crm_com/LVS > /svdb/ crm_com.nxf This error msg is not coming from the die() in loadNxfDB(), the text is different ("netname"). (Without the "\n" ending strings passed to die/warn, you get the file names and line numbers of errors/warnings) > 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. Non unlikely that the error is caused by code you have not posted. joe > > -- > 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>