i want a third value to be printed out, so i set it up in the root

use strict; use warnings; use XML::Twig; use File::Spec; use POSIX qw(strftime); my $spec_text = qr/^SLD/; my $path_tmp = $0; (my $volume,my $directories,my $file) = File::Spec->splitpath( $path_t +mp ); my $path = $volume . $directories; opendir (DIRREN, $path) || die ; my @RENDIR = readdir (DIRREN); close (DIRREN); shift(@RENDIR); shift(@RENDIR); open(OUT,'>','out.txt'); foreach my $file (@RENDIR) { if ($file =~ $spec_text){ my $mode = (stat($file))[9]; my $file_date = strftime "%Y%m%d", (localtime($mode)); my $file_date_ref = \$file_date; my $file_ref = \$file; XML::Twig->new( # the twig will only contain PHONENO/ENTRY and + REASON/ENTRY elements # (plus the root or it would not be a tree) twig_roots => { 'BL_USER/PHONENO/ENTRY' => 1, 'BL_DPLI_RECORD/REASON/ENTRY' +=> \&reason, 'BL_DPLI_RECORD/BL_DP_DUNNED/M +ONETARYVALUE/V' => 2, } ) ->parsefile($file); sub reason { my( $t, $reason)= @_; foreach my $phone_no ($reason->prev_siblings) { print OUT $phone_no->text , ";" , $reason->text , "; +" , $$file_ref , ";" , $$file_date_ref ,";",$reason->next_siblings, " +\n"; } $t->purge; } } } close(OUT);

with next_siblings i want to access the value but didn't work
when i set the root tu => 1 its printet out like an element of phone number
so whats wrong in my mind, whats screwed up ?

kd ultibuzz


In reply to RE: Confusion ,XML::SIMPLE with DATA:DUMPER by ultibuzz
in thread Confusion ,XML::SIMPLE with DATA:DUMPER by ultibuzz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.