omg it works!
thank you! I'd buy you a digital beer.
Anyway I think I found out the reason.
my $text="../files/jack/2012/derpone.pdf"; $text = basename($text); my $cgi = CGI->new; #Instantiate a CGI class print $cgi->header, # First we create a header $cgi->start_html('My first Perl website'), # Begin HTML page $cgi->h1('Success'), # create the Tag <h1>TEXT</h1> $cgi->p($text),
This code works, the second one doesn't
my $cgi = CGI->new; #Instantiate a CGI class print $cgi->header, # First we create a header $cgi->start_html('My first Perl website'), # Begin HTML page $cgi->h1('Success'), # create the Tag <h1>TEXT</h1> my $text="../files/jack/2012/derpone.pdf"; $text = basename($text); $cgi->p($text),
It seems I can't initialize variables while printing HTML
In reply to Re^4: Why can't I use s///
by njack
in thread Why can't I use s///
by njack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |