![]() |
Jump Keywords![]() ![]() ![]() ![]() ![]()
Perl has four keywords that let you change the flow of your programs. Perl's Jump Keywords Keywords
last - Jumps out of the current statement block.
Last Keyword The last keyword is used to exit from a statement block. This ability is useful if you are searching an array for a value. When the value is found, you can stop the loop early. Next Keyword The next keyword lets you skip the rest of the statement block and start the next iteration. One use of this behavior could be to select 'specific array elements for processing and ignoring the rest. Redo Keyword The redo keyword causes Perl to restart the current statement block. Neither the increment/decrement expression nor the conditional expression is evaluated before restarting the block. This keyword is usually used when getting input from outside the program, either from the keyboard or from a file. It is essential that the conditions that caused the redo statement to execute can be changed so that an endless loop does not occur. The redo statement is rarely used. It is safe using 'last' to get out of a loop at the end or "next" to jump back up to the top. Goto Keyword The goto statement lets your program jump directly to any label. However, because Perl also provides the loop statements and other jump keywords, its use is looked down on by most programmers. Using the goto in your programs frequently causes your program logic to become convoluted. If you write a program that, you feel needs a goto in order to run, then use it but first, try to restructure the program to avoid it.
|
|
PERL Perl Program Data Types Types of Variables Operator Types Functions String Functions Array Functions Expressions Statement Blocks The if Statement Unless Statement While Loops Until Loop For Loop Foreach Loop Jump Keywords Subroutines Perl References Die Function Exit Function Localtime Function Standard Files File Test Operators File Functions Opening Files Reading into Hash Printing Revisited Globbing Splitting a Record into Fields Perl's Special Variables Regular Expression Simple True-False Searches Inexact Matches in Regular Expressions Matching Any Character Characters with Class Special Locations Quantifiers Greedy Matching Modifiers Localtime Function Subsituations Letter for Letter Translations Generating A Simple Report Defining a Report Template Specifying the Picture Line Specifying the Argument Line Adding a Header Writing the ReportDomain Names Home Importance of a domain name How does a web domain name work? Domain name syntax Choosing a domain name Domain Transfer Domain Parking IP AddressWeb Design HTML DHTML XML JAVASCRIPT VBSCRIPT PHOTOSHOPWeb Hosting Web Server Web Server Software Microsoft Internet Information Server Web hosting ISP Shared web hosting Virtual web hosting Dedicated web hosting Web hosting colocation Managed web hostingE Commerce Principles of E-Commerce E-Banking Electronic Payment System E-Security Credit Cards Smart Cards
The Mailbox POP Server SMTP Server IMAP Protocol |
| Home | Web Hosting | Web Design | Sitemap |
| Copyright (C) 2007. Web Domain design hosting. All rights reserved. |