XML, the Perl Way

Processing XML with Perl Michel Rodriguez

What is Perl?

Control Structures

Data Structures

Scalars

  $var
  $var=1;
  $var= "toto";
  $var2= "a big $var here";

Arrays

  @array
  $array[0]
  $array[-1]    # last element in the array
  $var= @array  # number of elements in the array

Hashes

  %hash
  $hash{key}
  $hash{$key}
  @keys= keys( %hash);
  @values= values( %hash);

References

  $ref
  $ref= \@array;
  $ref=[]         # create an anonymous array
  $var= $ref->[0]
  $ref={};        # create an anonymous hash
  $var= $ref->{key}


What is Perl?

Control Structures