Inline::XSH - Insert XSH commands directly into your Perl scripts


XML-XSH documentation Contained in the XML-XSH distribution.

Index


Code Index:

NAME

Top

Inline::XSH - Insert XSH commands directly into your Perl scripts

SYNOPSIS

Top

   # perl code

   use Inline::XSH;

   # XSH Language commands (see L<XSH>)

   no Inline::XSH;

   # perl code

REQUIRES

Top

Filter::Simple, XML::LibXML, XML::XUpdate::LibXML, XML::XSH

EXPORTS

Top

None.

AUTHOR

Top

Petr Pajas, pajas@matfyz.cz

SEE ALSO

Top

xsh, XSH, XML::XSH


XML-XSH documentation Contained in the XML-XSH distribution.

# $Id: XSH.pm,v 1.1 2003/09/08 15:53:09 pajas Exp $

package Inline::XSH;

use vars qw($VERSION $terminator);

use strict;
use XML::XSH qw();
$VERSION = '0.1';
$terminator = undef;

use Filter::Simple;

sub filter {
  my $t=defined($terminator) ? $terminator : '__END__';
  s/$terminator\s*$// if defined($terminator);
  $_="XML::XSH::xsh(<<'$t');\n".$_."$t\n";
  $_;
};

#sub import {
#  if (@_>1) {
#    $terminator = $_[1];
#    FILTER { filter() } $terminator;
#  }
#}

FILTER(\&filter);

1;