Help for this page

Select Code to Download


  1. or download this
    print {$parser->{parameters}[( exists $attr->{':userID'} ? 0 : 1 )]} $
    +parser->ToXML( $tag, $attr);
    
  2. or download this
    print {$parser->{parameters}[( (exists $attr->{':contents'} and exists
    + $attr->{':contents'}{':userID'}) ? 0 : 1 )]} $parser->ToXML( $tag, $
    +attr);
    
  3. or download this
    use strict;
    use warnings;
    ...
    </start_element>
    
    </root>
    
  4. or download this
    my $FH;
    if (exists $attr->{':user_id'}) {
    ...
    </code></p>
    
    <p>The other script works differently. In the '^start_element' handler
    + it resets the flag (stored in $parser->{pad} which is an attribute o
    +f the parser specificaly "to put anything you want to and access it i
    +n any handler"), then if the &lt;userID&gt; tag is encountered the fl
    +ag is set and then the 'start_element' handler selects one of the fil
    +ehandles passed to <c>$parser->parse()