it simply dies with tie : at t.pl line 9.#!/usr/bin/perl -w use strict; use DB_File; my %db; tie (%db,'DB_File',"mydb.db",O_RDONLY) or die "tie : $!"; untie %db;
I followed tye's suggestion and traced it with perl debugger. but I don't see anything wrong (still new to perl debugger) here is the trace if it helps
line 244: my (@arg) = @_ ; here @_ contains DB_File,mydb.db,0main::(t.pl:9): tie (%db,'DB_File',"movies.db",O_RDONLY) or die "tie : + $!"; DB<1> s Fcntl::AUTOLOAD(/usr/lib/perl5/5.6.0/i386-linux/Fcntl.pm:203): 203: (my $constname = $AUTOLOAD) =~ s/.*:://; DB<1> s Fcntl::AUTOLOAD(/usr/lib/perl5/5.6.0/i386-linux/Fcntl.pm:204): 204: my $val = constant($constname, 0); DB<1> s Fcntl::AUTOLOAD(/usr/lib/perl5/5.6.0/i386-linux/Fcntl.pm:205): 205: if ($! != 0) { DB<1> s Fcntl::AUTOLOAD(/usr/lib/perl5/5.6.0/i386-linux/Fcntl.pm:216): 216: *$AUTOLOAD = sub { $val }; DB<1> s Fcntl::AUTOLOAD(/usr/lib/perl5/5.6.0/i386-linux/Fcntl.pm:217): 217: goto &$AUTOLOAD; DB<1> s Fcntl::__ANON__[/usr/lib/perl5/5.6.0/i386-linux/Fcntl.pm:216](/usr/lib +/perl5/5.6.0/i386-linux/Fcntl.pm:216): 216: *$AUTOLOAD = sub { $val }; DB<1> s DB_File::TIEHASH(/usr/lib/perl5/5.6.0/i386-linux/DB_File.pm:264): 264: tie_hash_or_array(@_) ; DB<1> s DB_File::tie_hash_or_array(/usr/lib/perl5/5.6.0/i386-linux/DB_File.pm: +244): 244: my (@arg) = @_ ; DB<1> s DB_File::tie_hash_or_array(/usr/lib/perl5/5.6.0/i386-linux/DB_File.pm: +246): 246: my $tieHASH = ( (caller(1))[3] =~ /TIEHASH/ ) ; DB<1> s DB_File::tie_hash_or_array(/usr/lib/perl5/5.6.0/i386-linux/DB_File.pm: +249): 249: if @arg >= 5 && ref $arg[4] && $arg[4] =~ /=HASH/ && t +ied %{ $arg[4] } ; DB<1> s DB_File::tie_hash_or_array(/usr/lib/perl5/5.6.0/i386-linux/DB_File.pm: +252): 252: if ($db_version > 1 and defined $arg[4] and $arg[4] =~ /RE +CNO/ and 253: $arg[1] and ! -e $arg[1]) { DB<1> s DB_File::tie_hash_or_array(/usr/lib/perl5/5.6.0/i386-linux/DB_File.pm: +259): 259: DoTie_($tieHASH, @arg) ; DB<1> s tie : at t.pl line 9, <IN> line 14. Debugged program terminated. Use q to quit or R to restart,
In reply to DB_File tie failed by Qiang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |