B
Bushido Hacks
Hello everyone,
I would like to know if I can create a work around to trick PERL into
processing a CSS stylesheet WITHOUT using the LINK tag.
I like to use "@import url(css_file.css);" inside the STYLE tags in the
header.
In the past, I figured out that if you tell PERL to read a text file
with various HTML tags, the HTML tags will proceess. My theory is,
that I think I can get away wthing this same trick if I tell PERL to
read a short text file that contains the string "@import" and nothing
more. This way PERL does not assume that "@import" is an array and
because "\@import" does not process because PERL assumes the "\@" to be
an escape character.
Useing the following examples, I would like to know if this will work
or not:
[file 1: css_import.txt: a short text file with the "@import" string]
@import
[file 2: read_css.pl: the perl file that will process css_import.txt]
#!/usr/bin/perl -w
$css_file = "bh_styles.css";
$import_css = "css_import.txt"; # just a text file that contains string
"@import".
open(CSS,$import_css) || die("ERROR! Could not open $import_css.");
$import_string = <CSS>;
close(CSS);
chomp($import_string);
$import_string .= " url($css_file);";
print "Content-type:text/html\n\n<html><head><style
type=\"text/css\">\n$import_string\n</style>\n";
print "</head><body>\n";
print "<table>\n";
print "<tr><th>r0c0</th><th>r0c1</th></tr>\n";
print "<tr><td>t1c0</td><td>r1c1</td></tr>\n";
print "</table>\n";
print "</body></html>\n";
I would like to know if I can create a work around to trick PERL into
processing a CSS stylesheet WITHOUT using the LINK tag.
I like to use "@import url(css_file.css);" inside the STYLE tags in the
header.
In the past, I figured out that if you tell PERL to read a text file
with various HTML tags, the HTML tags will proceess. My theory is,
that I think I can get away wthing this same trick if I tell PERL to
read a short text file that contains the string "@import" and nothing
more. This way PERL does not assume that "@import" is an array and
because "\@import" does not process because PERL assumes the "\@" to be
an escape character.
Useing the following examples, I would like to know if this will work
or not:
[file 1: css_import.txt: a short text file with the "@import" string]
@import
[file 2: read_css.pl: the perl file that will process css_import.txt]
#!/usr/bin/perl -w
$css_file = "bh_styles.css";
$import_css = "css_import.txt"; # just a text file that contains string
"@import".
open(CSS,$import_css) || die("ERROR! Could not open $import_css.");
$import_string = <CSS>;
close(CSS);
chomp($import_string);
$import_string .= " url($css_file);";
print "Content-type:text/html\n\n<html><head><style
type=\"text/css\">\n$import_string\n</style>\n";
print "</head><body>\n";
print "<table>\n";
print "<tr><th>r0c0</th><th>r0c1</th></tr>\n";
print "<tr><td>t1c0</td><td>r1c1</td></tr>\n";
print "</table>\n";
print "</body></html>\n";