LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-05-2014, 11:23 AM   #1
menylea
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Rep: Reputation: Disabled
perl script wont open the lib !


from some reason perl dont want to open the lib
( the first one). any idea?



#!/usr/intel/pkgs/perl/5.6.1/bin/perl
use strict;
use warnings;
my($element);
my($filename);
my($filename1);
my($filename2);
my(@lines);
my(@lines1);
my($intline);
my($aa);
my($indf)=0 ;
my($indff)=0;
my($indfff)=0;

open (FILE, "/nfs/iil/proj/ccd/wa/mlea/skl_tbt_4c/analog/skl_tbt_4c/User_libs/dir.list");
open(FINALREPORT, ">/nfs/iil/proj/ccd/wa/mlea/skl_tbt_4c/analog/skl_tbt_4c/User_libs/finalREport.list");
@lines = <FILE>;
close FILE;

foreach $element (@lines) {


$element="/nfs/iil/proj/ccd/wa/mlea/skl_tbt_4c/analog/skl_tbt_4c/User_libs/xor_results/$element" ;

# open the directory for reading
opendir(REP, $element) || die "Cannot open the directory $element" ;

while( $filename = readdir(REP)){

print("$filename\n");

if($filename =~ /xor/) {

print "found a xor lib on: $filename\n";

opendir(REPP,"/nfs/iil/proj/ccd/wa/mlea/skl_tbt_4c/analog/skl_tbt_4c/User_libs/xor_results/$element/$filename") || die "Cannot open the directory /nfs/iil/proj/ccd/wa/mlea/skl_tbt_4c/analog/skl_tbt_4c/User_libs/xor_results/$element/$filename \n" ;

while( $filename1 = readdir(REPP)){

print("$filename1\n");

if($filename1 =~ /rpt/) {

print FINALREPORT "cell name: $filename1\n";

print "found a report file on: $filename1\n";

open (FILEE, "/nfs/iil/proj/ccd/wa/mlea/skl_tbt_4c/analog/skl_tbt_4c/User_libs/xor_results/$element/$filename/$filename1");
print "open file: /nfs/iil/proj/ccd/wa/mlea/skl_tbt_4c/analog/skl_tbt_4c/User_libs/xor_results/$element/$filename/$filename1\n" ;
@lines1 = <FILEE>;
close FILEE;

$indf=0;


foreach $intline (@lines1) {



if($intline =~ /TOTAL Original Geometry Count = 1 \(1\)/ ) {
$indff=1;

print FINALREPORT " $intline \n";
$indf=1;

} #if
}#foreach

if($indf==0){ print FINALREPORT "cell name: $filename2 is clean!!! \n"}

}#if rpt


}#while

closedir(REPP);
}#if xor



}#while

closedir(REP);


}#foreach



close FINALREPORT;

Last edited by menylea; 02-05-2014 at 11:26 AM.
 
Old 02-05-2014, 01:02 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,860
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Please use [code] and [/code] tags.
Please quote the exact error message you got.
Please add error-handling to every open (see 'perldoc -f open' for examples).
 
Old 02-05-2014, 01:16 PM   #3
menylea
LQ Newbie
 
Registered: Mar 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
hmmm. not sure i understand this answer..
what exactly is this
Code:
 and
tags ?

the error msg i get is :

"Cannot open the directory /nfs/iil/proj/ccd/wa/mlea/skl_tbt_4c/analog/skl_tbt_4c/User_libs/xor_results/calibre.icsl0253.10072"

which is strange because that is exactly the place and the dir im trying to open.
 
Old 02-05-2014, 10:24 PM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,860
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
Read these:
What information to include in a post and how to use code tags
How To Ask Questions The Smart Way
perldoc: opendir readdir specially this part:

Code:
opendir(my $dh, $some_dir) || die "can't opendir $some_dir: $!";
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Perl script wont run - no error, no nothing (this *should* be easy!) Sly Phy Programming 1 08-08-2010 01:41 PM
[SOLVED] perl script tp open an xterm window and run a command. casperdaghost Linux - Newbie 2 07-25-2010 02:49 AM
Can we open a browser (firefox/IE) & enter URL in it via shell/PERL script. barde Linux - Newbie 6 02-18-2009 05:21 AM
You have chosen to open: installer.pl which is a perl Script? cucolin@ Linux - Server 3 03-27-2007 12:01 AM
Converting a Windows Perl script to a Linux Perl script. rubbercash Programming 2 07-19-2004 10:22 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration