hsmyers has asked for the wisdom of the Perl Monks concerning the following question:
I've finally figured out that the automatic testing for CPAN is a little less flawed than I thought. Lately I have run into email that I had taken to mean that the necessary module was not installed and dismissed the error reports as nonsense. Only to find out today that I get the same error. After bashing my head for too long, I've reduced it to a small test.
Given:I get:#!/usr/bin/perl # test.pl -- use strict; use warnings; use diagnostics; use DB_File; my %hash; my $db_path = './db/'; for (@INC) { if (-d "$_/Chess/PGN/db") { $db_path = "$_/Chess/PGN/db/"; last; } } my $filename = "${db_path}ECO"; open TEST, "<$filename" or die "Couldn't open $filename:$!"; close TEST; #-----line 19 follows----- tie (%hash, "DB_File", $filename) or die "Couldn't tie $filename: $!\n";
The file does exist on my box and for that matter if you set $file to 'test.pl', you still get the same failure. This suggests that I'm not using 'tie' correctly---which I'm perfectly willing to believe even though this example code came from the 3rd edition camel and matches code in 21 previously working distributions<sigh!>C:>test Uncaught exception from user code: Couldn't open C:/Perl/site/lib/Chess/PGN/db/ECO: No such file +or directory at C:\Perl_Dev\Openings for Russ\test.pl line 19
So fellow monks, any clues for the clueless?
Update: Added marker for line 19 and changed the die statement for the tie attempt.
--hsm
"Never try to teach a pig to sing...it wastes your time and it annoys the pig."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A problem with tie
by merlyn (Sage) on Mar 04, 2005 at 22:18 UTC | |
by hsmyers (Canon) on Mar 04, 2005 at 22:57 UTC | |
by fizbin (Chaplain) on Mar 05, 2005 at 14:15 UTC | |
|
Re: A problem with tie
by cowboy (Friar) on Mar 04, 2005 at 22:37 UTC | |
|
Re: A problem with tie
by fizbin (Chaplain) on Mar 05, 2005 at 04:57 UTC | |
by hsmyers (Canon) on Mar 06, 2005 at 06:08 UTC | |
|
Re: A problem with tie
by jdalbec (Deacon) on Mar 05, 2005 at 02:33 UTC | |
by hsmyers (Canon) on Mar 05, 2005 at 03:20 UTC | |
|
Re: A problem with tie
by nobull (Friar) on Mar 05, 2005 at 18:28 UTC |