in reply to Opening multiple log files
G'day hahazeeq,
Welcome to the Monastery.
"From this I am getting nothing."
You've added checks throughout for failed I/O - this is good. If files weren't created, you would have received messages from these checks. Not posting these is less good: we can't see what went wrong.
The first problem that leaps out at me is @output.
This should probably be a scalar, not an array. A lexical variable (my) would probably be better than an alias to a package variable (our).
Then later in the code
@output = $timestamp .'.sql'; open(my $fh, '>', @output) or die "Could not create file '@output': $! +";
becomes
$output = $timestamp .'.sql'; open(my $fh, '>', $output) or die "Could not create file '$output': $! +";
There's also potential problems with
open(my $fn, '<', $filename) ...
which possibly needs to be
open(my $fn, '<', "$directory/$filename") ...
Add temporary print statements to your code to perform your own troubleshooting. Check if you're reading and writing to the correct pathname, as opposed to the correct filename.
Without seeing your error messages, I'm really just guessing at problems. If you need further assistance, please see these guidelines for what to post such that we can help you most effectively.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Opening multiple log files
by hahazeeq (Novice) on Jun 15, 2015 at 07:10 UTC | |
by kcott (Archbishop) on Jun 15, 2015 at 07:47 UTC | |
by hahazeeq (Novice) on Jun 15, 2015 at 08:06 UTC | |
by kcott (Archbishop) on Jun 15, 2015 at 08:33 UTC | |
by hahazeeq (Novice) on Jun 15, 2015 at 09:17 UTC | |
| |
by Anonymous Monk on Jun 15, 2015 at 09:14 UTC |