use CGI qw/:standard :html3 :all/; use strict; sub check_login{ .... } sub display_header { my $disp_text=$_[0]; # Note that I have to create a new CGI object here in the sub my $query = new CGI; print $query->center; print $query->table( { -border=>0}, Tr([ td( {-align=>"center" },[ $query->img({-align=>"center", -src=>"logo.gif ", -border=>0 }), $query->font({-size=>'4'},$query->b( $disp_text)), ]), ]), ); } sub display_footer{ ... ... }