Using my() changes XML::Bare behavior drastically

BaineBahchIer

New Member
When I run this Perl script: \[code\]#!/bin/perl use XML::Bare; $ob = new XML::Bare(text=>'<xml><name>Bob</name></xml>'); for $i (keys %{$ob->{xml}}) {print "KEY: $i\n";} \[/code\]I get no output. However, if I put \[code\]$ob\[/code\] inside a \[code\]my()\[/code\]: \[code\]#!/bin/perl use XML::Bare; my($ob) = new XML::Bare(text=>'<xml><name>Bob</name></xml>'); for $i (keys %{$ob->{xml}}) {print "KEY: $i\n";} \[/code\]I get this output: \[code\]KEY: _z KEY: _i KEY: xml KEY: _pos \[/code\]Why does \[code\]my()\[/code\] change this behavior so drastically, especially given that I'm at the top level where \[code\]my()\[/code\] should have no effect at all?
 
Back
Top