Link to home
Start Free TrialLog in
Avatar of Pampa
Pampa

asked on

Perl and web pages

I would like to make a web page with perl.
In this page I want to include a table with results.
So First I want to create the procedures
I create a file.pl wich includes 3 generic procedures.

sub Create_table
sub Create_line
sub Close_table

example
Create_table(2,50)

$NL="<P>\n";

sub create_table {
    local($border,$ancho)=@_;
    print "<table border=\"$border\"  width=\"$ancho%\"> ";    
print "$NL";
}

Create_line(50,Hello)

sub create_line {
    local($ancho,$texto)=@_;
    print "<tr>\n";
    print "<td width=\"$ancho\%">$texto</td>\n";
    print "</tr>\n";
}

sub close_table {
    print "</table>";
print "$NL";
}

This Sub doen't works because of the " character, can antybody tell me how to correct this code.
ASKER CERTIFIED SOLUTION
Avatar of spiegei
spiegei

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ozo
create_line(50,"Hello");
sub create_line {
    local($ancho,$texto)=@_;
    print "<tr>\n";
    print "<td width=\"$ancho%\">$texto</td>\n";
}