#!/usr/bin/perl -T # include standard library modules use 5.004; use strict; # declare public constants # declare const string constants my $const = {}; $const->{author} = 'Gerald Charles Wagner'; $const->{data} = '.css'; $const->{filename} = 'public'; $const->{mime} = 'text/css'; $const->{regex} = '\-\.0-9A-Z_a-z'; $const->{release} = 'May 2000'; $const->{style} = ''; $const->{version} = '2.0'; my $constStyle = { Macintosh => 'MAC', }; # declare public variables # declare param client/server variables my $param = {}; # declare subroutines # access: execute MAIN procedure # source: GET QUERY_STRING and POST CONTENT_LENGTH # target: true/false MAIN: { local *SOURCE; $param->{script} = $ENV{SCRIPT_NAME}; $param->{script} =~ s{^.*/(.*)$}{$1}ox; $param->{script} =~ m{^([$const->{regex}]+)$}o; $param->{script} = $1; # parse QUERY_STRING variable into filename, options, login, and file structure ($param->{filename}, $param->{options}) = split (/\+/, $ENV{QUERY_STRING}); $param->{filename} = $const->{filename} unless (length ($param->{filename})); $param->{filename} =~ m{^([$const->{regex}]+)$}o; $param->{filename} = $1; # update the client browser with the platform-specific stylesheet print ("Content-type: $const->{mime}\n\n"); USER: foreach (%{$constStyle}) { if ($ENV{HTTP_USER_AGENT} =~ m{$_}) { $param->{base} = $constStyle->{$_}; last USER; } } $param->{base} = '' unless (-e "$const->{style}$param->{filename}$param->{script}$param->{base}$const->{data}"); open (SOURCE, "<$const->{style}$param->{filename}$param->{script}$param->{base}$const->{data}"); while () { print; } close (SOURCE); } exit (0);