Advertisement

07.05.2007 at 04:45PM PDT, ID: 22678297
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.6

No such file or directory when trying to close a file handle.. urgent!!!

Asked by Redimido in Scripting Languages, Perl Programming Language

Tags: , ,

Hi

I am migrating a script that reads a file and appends the line on different archives based on the data in the input line.

Old perl version was 5.005 and new one is perl 5.8.3

my problem is I get the file and put it in a variable. open that file for append, write the input line then close the file. this in a loop until the input line finishes.

#!/usr/local/bin/perl
# Pragmas
use warnings;
use strict refs;
use diagnostics;
#require 5.002;
use vars qw($opt_d);
use Getopt::Std;
my $Self    = ($0 =~ m|/([^/]*)$|) ? $1 : $0;
... get the input file named $rawlog
open RAWLOG, "<$rawlog"
    while (<RAWLOG>) {
        my ($p,$day,$mon,$yr,$tz,$iso) = m|^([^\[]+)\[(\d\d)/(\w\w\w)/(\d\d\d\d)[^ ]+ (.\d\d\d\
d)[^/]+/c/(\w\w)|;
        my $file = "$iso/$yr$numMon{$mon}$day-24.c.$iso.apxlog";
        open OUT, ">>$file"  or die "$Self: Cannot append to $file\n$!\n";
        print OUT $_;
        close OUT  or warn "$Self: Cannot close $file\n$!\n";
    }
    close RAWLOG                           or warn "$Self: Cannot close $rawlog\n$!\n";
}

but I get this in the error screen:
splitcNchk.pl: Cannot close us/20070702-24.c.us.apxlog

splitcNchk.pl: Cannot close kr/20070702-24.c.kr.apxlog

s.pl: Cannot close de/20070702-24.c.de.apxlog

s.pl: Cannot close us/20070702-24.c.us.apxlog
No such file or directory
s.pl: Cannot close ca/20070702-24.c.ca.apxlog
No such file or directory
s.pl: Cannot close ca/20070702-24.c.ca.apxlog
No such file or directory
s.pl: Cannot close us/20070702-24.c.us.apxlog
No such file or directory
s.pl: Cannot close us/20070702-24.c.us.apxlog
No such file or directory
s.pl: Cannot close us/20070702-24.c.us.apxlog
No such file or directory


How can I get rid of this problem? As I understand the "or warn" part will not happen unless close OUT returns FALSE, right?
I tried to put
$1 =1;
but that do not change the behavior of this program...

pls any help will be appreciated

GabrielStart Free Trial
[+][-]07.05.2007 at 05:11PM PDT, ID: 19428591

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 07:11PM PDT, ID: 19429128

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Scripting Languages, Perl Programming Language
Tags: file, directory, perl
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 4
Solution Grade: A
 
 
[+][-]07.05.2007 at 07:40PM PDT, ID: 19429217

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.05.2007 at 11:01PM PDT, ID: 19429787

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 07:37AM PDT, ID: 19432080

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 14-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.06.2007 at 10:43AM PDT, ID: 19433543

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 10:51AM PDT, ID: 19433608

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 12:06PM PDT, ID: 19434192

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 12:18PM PDT, ID: 19434287

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 14-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.06.2007 at 12:34PM PDT, ID: 19434390

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 12:39PM PDT, ID: 19434410

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 01:24PM PDT, ID: 19434740

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 01:37PM PDT, ID: 19434858

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.06.2007 at 03:16PM PDT, ID: 19435428

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43