XML::Literal - Syntax suppor for XML literals


XML-Literal documentation  | view source Contained in the XML-Literal distribution.

Index


NAME

Top

XML::Literal - Syntax suppor for XML literals

SYNOPSIS

Top

    # This is not a source filter: it just augments glob().
    use XML::Simple;
    use XML::Literal \&XMLin;

    # Simple element
    my $xml1 = <hr/>;

    # With variable interpolation
    my $xml2 = <input value='$ARGV[0]' />;

    # With an extra pair of angle brackets
    my $xml3 = < <a href='/'> Some Text </a> >;

    # With escaped angle brackets 
    my $xml4 = <a href='/'\> Some Text \</a>;

    # Direct call to the xml-building glob'' constructor
    my $xml5 = glob'
        <p><em>
            Some Text
        </em></p>
    ';

    # This does not look like XML, so it's still shell glob
    my @files = <*.*>;

DESCRIPTION

Top

This module takes one function at its use line. Afterwards, all single-line <...> calls that looks like a XML literal will be processed with that function, instead of the built-in shell glob.

Support for qx<...> overriding for multiline XML literals is planned for Perl 5.10.

AUTHORS

Top

Audrey Tang <cpan@audreyt.org>

COPYRIGHT (The "MIT" License)

Top


XML-Literal documentation  | view source Contained in the XML-Literal distribution.