| XML-XSH2 documentation | Contained in the XML-XSH2 distribution. |
XML::XSH2::Inline - Insert XSH commands directly into your Perl scripts
# perl code use XML::XSH2::Inline; # XSH Language commands (see L<XSH>) no XML::XSH2::Inline; # perl code
Filter::Simple, XML::XSH2
None.
Petr Pajas, pajas@matfyz.cz
xsh, XSH, XML::XSH2
| XML-XSH2 documentation | Contained in the XML-XSH2 distribution. |
# $Id: Inline.pm,v 2.3 2007-01-02 22:03:22 pajas Exp $ package XML::XSH2::Inline; use vars qw($VERSION $terminator); use strict; use XML::XSH2 qw(xsh_init); $VERSION='2.1.1'; # VERSION TEMPLATE $terminator = undef; use Filter::Simple; sub filter { my $t=defined($terminator) ? $terminator : '__END__'; s/$terminator\s*$// if defined($terminator); $_="XML::XSH2::xsh(<<'$t');\n".$_."$t\n"; $_; }; xsh_init(); FILTER(\&filter); 1;