Thread CGI.pm -style Frage (2 answers)
Opened by Kuerbis at 2011-08-21 18:06

topeg
 2011-08-21 18:25
#151722 #151722
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
-code musst du einen String Zuweisen. CSS ist kein Valides Perl, da kannst du keine Hashreferenz benutzen.
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/local/bin/perl
use warnings;
use 5.012;
use utf8;
use CGI;

my $cgi = CGI->new();

my $css=<<EOCSS;
body {
  margin:0;
  padding:0;
  /*background-color: #0080c0;*/
}
con_1 {
  position: relative;
  height: 300px;
}
EOCSS

print $cgi->header( -charset => 'UTF-8' );
print $cgi->start_html( 
   -style => { 
      -type => 'text/css',
      -code => $css,
   }
);
print $cgi->p( { -id => "con_1" }, 'Hello World' );
print $cgi->end_html; 

View full thread CGI.pm -style Frage