pajout has asked for the wisdom of the Perl Monks concerning the following question:
my $xml; #that variable should have the triple magic print $xml; #in scalar context, prints '<r><e1>t1</e1><e2></e2></r>' print $xml[0][1]; #prints the second child of root, '<e2></e2>' print $xml{r}{e1}; #prints '<e1>t1</e1>'
Is it possible to tie it in pure perl, without use xs and such perlguts? I think that read-only $xml variable could be very handy...
Edit: g0n - Added code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: tie and magic
by mirod (Canon) on Sep 21, 2005 at 10:45 UTC | |
by pajout (Curate) on Sep 21, 2005 at 12:57 UTC | |
|
Re: tie and magic
by dave_the_m (Monsignor) on Sep 21, 2005 at 12:23 UTC | |
by pajout (Curate) on Sep 21, 2005 at 13:03 UTC | |
by dave_the_m (Monsignor) on Sep 21, 2005 at 14:08 UTC | |
|
Re: tie and magic
by shady (Sexton) on Sep 21, 2005 at 11:37 UTC | |
by pajout (Curate) on Sep 21, 2005 at 12:34 UTC |