in reply to Re^4: XML::Simple troubles
in thread XML::Simple troubles

my $Document =$parser->XMLin('$foo');

So you're trying to open a file named $foo - that won't work. Remove the single quotes.