iLTC Home
Bookmark iLTC!
iLTC Google Boards

Google Groups
Receive The Code in Email!



Categories

Perl
  • Perl Tutorials Beginners

    Javascript
  • Javascript Tutorials
  • Javascript Tutorials Beginners

    HTML
  • HTML Tutorials



  • Perl with cheese...
    123,748

    iLoveTheCode.com
    Perl > Perl Tutorials How To Easy > Exit a Script or Subroutine in Perl

    Exit a Script or Subroutine in Perl



    To exit a script or subroutine in Perl place...

    exit;

    ...wherever you want the script to quit.

    -Anything placed after exit will not execute.
    -Handy for stopping a script if a condition is met.



    Copy and Paste Perl Code:

    #!/usr/bin/perl

    print "Content-type:text/html\n\n";

    print "Let's exit!<br>";

    $ji=42;

    if ($ji eq 33) {
    print "Not 42";
    }

    if ($ji eq 42) {
    print "IS 42";
    exit;
    }


    ### this code won't execute if $ji equals 42

    print "Happy Day!";


    ### End of Copy and Paste Perl Code



    Click HERE to comment or discuss at iLoveTheCode GOOGLE Group
    Previous Article: What Environmental Variables are Available
    Next Article: Finding the Length (Index Numbers) of an Array in Perl





    HTML & XHTMLHTML & XHTML

    Chuck Musciano, Bi...

    New $29.99

    New Perspectives on Crea...New Perspectives on Creating Web Pag...

    Patrick Carey

    New $69.26

    HTML, XHTML, and CSS, Si...HTML, XHTML, and CSS, Sixth Edition ...

    Elizabeth Castro

    New $23.09

    jQuery in ActionjQuery in Action

    Bear Bibeault, Yeh...

    New $26.39

    CSSCSS

    Eric Meyer

    New $29.69

    Dreamweaver CS3Dreamweaver CS3

    David McFarland

    New $29.69

    JavaScriptJavaScript

    David Flanagan

    New $31.49

    Creating Web SitesCreating Web Sites

    Matthew MacDonald

    New $19.77

    Learning Web DesignLearning Web Design

    Jennifer Niederst ...

    New $26.99


    Of Interest:
  • To Sort an Array in Perl
  • Renaming a File with Perl's RENAME Function
  • Get the Length of a Word or String in Perl
  • Getting Server Time in Perl
  • Reading Cookies using Javascript
  • Javascript Unshift - Use Unshift to Put Items on the Front of an Array in Javascript
  • Javascript Concat - Use Concat to Join Two Arrays in Javascript
  • Javascript Push - Use Push on an Array in Javascript
  • HTML Frames
  • HTML Codes
  • Make Italic Text Using HTML
  • HTML Color Codes

  • More Articles:
  • If, Elsif, and Else in Perl
  • Get the Length of a Word or String in Perl
  • Create an Array of Specific Numbers in Perl
  • Create a Subroutine in Perl
  • onClick Javascript
  • Focus a Window with self.focus in Javascript
  • Opening an Alert Box in Javascript
  • Match with a Regular Expression, REGEX, in Javascript
  • Substitute in Javascript Using replace Method
  • Make Text Bold Using HTML
  • HTML Body Tag
  • HTML Subscript Text
  • Make Strikethrough Text Using HTML

  • Search iLTC w/ Google





    Recent Articles

  • Javascript Focus Form Field
  • Javascript Lowercase Text
  • Javascript Uppercase Text
  • Javascript Superscript Text
  • Javascript Subscript Text
  • Make Text Blink Using Javascript
  • Make a String into a Link in Javascript
  • Javascript Italics Text
  • Javascript Bold Text
  • Javascript Redirect
  • HTML Frames
  • HTML Color Chart
  • HTML Link
  • Javascript Status Bar








  • Perl Programming - Javascript Programming - Maybe Some PHP - Free Scripts - ILoveTheCode
    All Content © 2006 iLoveTheCode.com


    Contact Chris | About this Site


    420,509
    Counter by iLoveTheCode.com


    Last Modified: Friday, 23-Jun-2006 07:23:13 EDT