Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Parsing Server Side Includes

by cjf-II (Monk)
on Nov 22, 2002 at 04:11 UTC ( [id://215001]=note: print w/replies, xml ) Need Help??


in reply to variable insertion

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.

Replies are listed 'Best First'.
Re: Re: Parsing Server Side Includes
by wolverina (Beadle) on Nov 22, 2002 at 06:17 UTC
    thanx... it did. :) Lisa

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://215001]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-23 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found