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:
#!/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";
I get:
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
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!>

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.