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."In reply to A problem with tie by hsmyers
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |