$number = 1; print "$number\n"; $number++; print "$number\n";
Perl would send the following to standard output
You can also perform arithmetic such as:
$item_subtotal = $item_price * $quantity; $shipping_price = 39.99 * $quantity; $grand_total = $item_subtotal + $shipping_price;
Scalar variables are the meat and potatoes of CGI. After all, translating between the client and the Web server is essentially the formatting and the reformatting of variables. Be prepared to see them used a lot.
|Previous | Next | Table of Contents|