in reply to Re: Variable being saved as a list?
in thread Variable being saved as a list?
Another important change is to control flow logic and code organization
open ... or die Error(...);
open ... or return ErrorPage(...);
If you can't open the file, don't try to read from it or write to it, end the subroutine (the code should be in subroutines
Don't generate your pages by interleaving print statements, make subroutines, so your program is
Main( @ARGV ); exit( 0 ); sub Main { my $q = CGI->new; print SomeKindOfPages( $q ); } sub SomeKindOfPages { my( $q ) = @_; ... my( $headers, $body ) = ShippingEstimator( $q , ... ); return $headers, $body; }
|
---|