use Tk & use Hash::NoVivify

listmail <[email protected]> Mon, 30 Jul 2007 13:48:31 -0400
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
#!/usr/bin/perl -w
use strict;
use warnings;

use Tk;

#for the following use line, as is, will give the following warnings:
#Subroutine main::Exists redefined at C:/Perl/lib/Exporter.pm line 65.
# at C:\DATA\erpmon\testing\novivify_tests.pl line 6
#Prototype mismatch: sub main::Exists: none vs ($;@) at 
C:/Perl/lib/Exporter.pm line 65.
# at C:\DATA\erpmon\testing\novivify_tests.pl line 6
#
#now if it is changed to:
#use Hash::NoVivify;
#(thus removing qw (Exists Defined)
#or it is removed entirely (do not use Hash::NoVivify)
#it leads to the following error:
#Can't call method "IsWidget" on unblessed reference at 
C:/Perl/lib/Tk.pm line 197.
use Hash::NoVivify qw (Exists Defined);

my %TEST = (data1 => {
        v1 => 5,
        v2 => 6,
        },
        data2 => {
        v1 => 3,
        },
);

if (Exists(\%TEST, qw{ data1 v2 })) {
#if (Exists(\%TEST, qw{ data2 v2 })) {
    print "Found\n";
} else {
    print "Not found\n";
}

#is this redefining Tk::Exists which was has been exported as main::exists?
#if so, should I be doing something different so that
#"use Hash::NoVivify" will not redefine Tk::Exists?
--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk