Blog Archive

Tuesday, December 7, 2010

perl goto example

#!/usr/bin/perl

#        http://www.tutorialspoint.com/perl/perl_goto.htm
$count = 0;

START:
$count = $count + 1;

if( $count > 4 ){
        print "Exiting program\n";
}else{
    print "Count = $count, Jumping to START:\n";
    goto START;
}

No comments:

Post a Comment