in reply to Not a HASH reference

my $tree = $parser->XMLin($in);
$in is not being opened. Check the return value. Check for errors.

Replies are listed 'Best First'.
Re^2: Not a HASH reference
by haukex (Archbishop) on Mar 22, 2017 at 16:53 UTC
    $in is not being opened.

    That seems to be very unlikely. Based on dir(...), ->children and ->openr, I am guessing this is Path::Class. Its openr throws an error if the file couldn't be opened. Even if $in were undef, there would need to be a file named tocsvfd.xml in the same path as the script, otherwise XMLin would throw an error.

Re^2: Not a HASH reference
by pdahal (Acolyte) on Mar 22, 2017 at 16:19 UTC
    how do I open $in?