SSI_Parser(3pm)

✨ NAME ✨

Okay bestie, welcome to a User Contributed Perl Documentation page πŸ’– β€” this one's called SSI_Parser, and it's all about CGI::SSI_Parser, which implements SSI for Perl CGI. That's the whole vibe. No cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the whole thing at a glance, copy-paste ready, exactly as written:

use CGI::SSI_Parser;

$CGI::SSI_Parser::recursive = 1;

fssi($filename);
sssi($string);

πŸ’œ DESCRIPTION πŸ’œ

So CGI::SSI_Parser is the module you reach for inside CGI scripts when you wanna parse SSI directives β€” whether they're chillin' in files or just vibing inside string variables. And it fully implements the functionality of apache's mod_include module. Like, full send. πŸ’…

It's an alternative to the famous Apache::SSI modules, except β€” plot twist β€” it doesn't require mod_perl. That's the glow-up for anyone stuck on public hosting services. πŸ‘‘

But bestie, we gotta talk about the downside 😭 β€” this module consumes much memory, and the author straight up says he doesn't recommend using it on heavy-loaded sites. Currently it's being used on a site with 10000 hits, and he considers that the limit. He hopes to get rid of this disadvantage by the time the release comes out (right now it's beta, so, y'know).

🌸 SSI Directives 🌸

This module supports the same directives as mod_include. For methods listed below but not documented, please see mod_include's online documentation at http://httpd.apache.org/docs/mod/mod_include.html β€” go read it, iykyk.

  • config β€” supported, go off ✨
  • echo β€” this directive is not fully supported in current version πŸ™ˆ
  • exec β€” supported
  • fsize β€” supported
  • flastmod β€” supported
  • include β€” supported
  • printenv β€” supported
  • set β€” this directive is not supported in current version πŸ’€
  • perl β€” this directive is not supported in current version πŸ’€
  • if β€” see the note below πŸ‘‡
  • elif β€” see the note below πŸ‘‡
  • else β€” see the note below πŸ‘‡
  • endif β€” see the note below πŸ‘‡
These four directives β€” if, elif, else, endif β€” are not supported in current version. Don't come for me, that's just what the page says 🫢

πŸŽ€ Outline Usage πŸŽ€

Step one, babe β€” load the CGI::SSI_Parser module:

use CGI::SSI_Parser;

Step two: if you need processing of all nested directives, you gotta specify this (and the default value is 0, so it's off unless you say otherwise):

$CGI::SSI_Parser::recursive = 1;

Step three: to parse a file or a string, you use:

fssi($filename);
sssi($string);

And the result? It gets printed to STDOUT. That's it, that's the whole ritual. 🌈


πŸ”₯ TO DO πŸ”₯

The author's manifesting list, fr fr:

  • Full implementation of all SSI directives.
  • Optimize memory consumption.

πŸ‘‘ AUTHOR πŸ‘‘

Vadim Y. Ponomarenko, vp@istc.kiev.ua β€” give him his flowers πŸ’


🌈 SEE ALSO 🌈


And that's a wrap, bestie πŸŽ€ This page came to you courtesy of perl v5.32.1, dated 2022-01-08, from the User Contributed Perl Documentation collection. Stan a well-documented module. Periodt. πŸ’–βœ¨πŸ¦‹