On 4/15/2010 1:40 PM, Open Source wrote:
I'm getting this error:

Undefined subroutine&XML::Simple::XMLin called at ./sample.pl line 3.

Here's my code and input file:

use XML::Simple;
use Data::Dumper;
$data = XMLin("sample.xml");
print Dumper($data);

<?xml version='1.0'?>
<employee>
  <name>John</name>
  <age>43</age>
  <gender>M</gender>
  <department>Operations</department>
</employee>

There must be something else going on.
Works okay for me:

>> cat qt
#!/usr/local/bin/perl

use warnings;
use strict;

use XML::Simple;
use Data::Dumper;
my $data = XMLin("sample.xml");
print Dumper($data);

>> ./qt
$VAR1 = {
          'department' => 'Operations',
          'name' => 'John',
          'age' => '43',
          'gender' => 'M'
        };

--
Brad

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to