Using HTML::TokeParser you can grab the SSI and then split it on the --s to grab the variable:
use diagnostics; use strict; use warnings; use HTML::TokeParser; my $p = HTML::TokeParser->new("ssi.html") || die $!; my $randomVar; while (my $token = $p->get_token) { my $tokenType = shift @{$token}; if ($tokenType eq "C") { # add another loop in to check if it's the right ssi my @parts = split /--/, shift(@{$token}); $randomVar = $parts[2]; } } print $randomVar, "\n";
Hope that helps.
In reply to Re: Parsing Server Side Includes
by cjf-II
in thread variable insertion
by wolverina
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |