in reply to Using the XMLin() method in XML::Simple not working

Did you put the use in a different package? What the use identical to what you posted, or did it have a list (empty or otherwise)? Did you use require (which doesn't import) instead of use?

#!/usr/bin/perl use XML::Simple (); BEGIN { print(__PACKAGE__->can('XMLin') ? 1 : 0, "\n"); } # 0 use XML::Simple; BEGIN { print(__PACKAGE__->can('XMLin') ? 1 : 0, "\n"); } # 1 package Other; BEGIN { print(__PACKAGE__->can('XMLin') ? 1 : 0, "\n"); } # 0 use XML::Simple; BEGIN { print(__PACKAGE__->can('XMLin') ? 1 : 0, "\n"); } # 1 package YetOther; BEGIN { print(__PACKAGE__->can('XMLin') ? 1 : 0, "\n"); } # 0 use XML::Simple qw( XMLout ); BEGIN { print(__PACKAGE__->can('XMLin') ? 1 : 0, "\n"); } # 0 use XML::Simple qw( XMLin ); BEGIN { print(__PACKAGE__->can('XMLin') ? 1 : 0, "\n"); } # 1 package main; # Back to first package. BEGIN { print(__PACKAGE__->can('XMLin') ? 1 : 0, "\n"); } # 1

Replies are listed 'Best First'.
Re^2: Using the XMLin() method in XML::Simple not working
by heigold1 (Acolyte) on May 31, 2005 at 20:07 UTC
    Hi, I didn't use the package, or require keywords anywhere. The use statement really was identical to what I posted, which was just copied and pasted from the script.