Next statement : Next « Statement « Perl






Next statement

 


#!/usr/bin/perl -w

use strict;

print "Please enter some text:\n";
while (<STDIN>) {
    if ($_ eq "\n") {
        next;
    }
    chomp;
    print "You entered: [$_]\n";
}

   
  








Related examples in the same category

1.Using the next statement in a foreach structure.
2.Next if
3.Going onto the Next
4.A word-counting program that uses the next statement.
5.Using both next and continue
6.next with condition
7.Next statement with if statement