10.07.2015 Views

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

272CHAPTER 13 ■ PERL WEB SITES WITH MASON% } else {it is nice of you <strong>to</strong> visit.% }The output from this example is shown in Figure 13-4.Figure 13-4. An example using a conditionalSince the variable was predefined as "Steve" in the example, the conditional in the if()statement matched. If the value of the $name variable is changed, then the else will take effect.Consider the modified code in Listing 13-4.Listing 13-4. A Slightly Modified Conditional <strong>With</strong>in a Mason Page% my $name = "sssSteve";Welcome <strong>to</strong> the page,% if ($name eq "Steve") {thank you for visiting again .% } else {it is nice of you <strong>to</strong> visit.% }The result of this code is shown in Figure 13-5.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!