Solostian has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to recover the XML filename from its propagated XML::Simple object reference.
Here's a prototype script of the issue.
------------------------------------------ #!/usr/bin/perl use strict; use warnings; use XML::Simple; &main(@ARGV); exit; sub main { my $xml = XMLin(shift); &printName($xml); } sub printName { my $xml = shift; print $xml->{name}; # This is the line that needs help } ------------------------------------------
Looking at the implementation of the class, I know the filename is stored within the object. (I know, it's wrong to access private elements.)
I need to access the name in order to reduce the number of parameters I'm using between the program's routines.
Thanks,
Solostian
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple private members
by pg (Canon) on Sep 14, 2005 at 15:08 UTC | |
by Solostian (Beadle) on Sep 14, 2005 at 15:16 UTC | |
by pg (Canon) on Sep 14, 2005 at 15:25 UTC | |
|
Re: XML::Simple private members
by osunderdog (Deacon) on Sep 14, 2005 at 16:44 UTC | |
by Solostian (Beadle) on Sep 14, 2005 at 17:14 UTC | |
by Tanktalus (Canon) on Sep 14, 2005 at 20:40 UTC |