# File: controlWhileLast.pl # Title: Remove last character till string is Null. USE last # Author: Mihaela Malita # pascal # pasca # pasc # pas # pa # p # Bye $s = 'pascal'; # S is a string while ( true ) { # loops for ever print "$s\n"; chop($s); # remove last letter #if ( $s eq '') {last;} # check if string is empty same as: if (! $s ) { last; } # check if string is empty } print "\nBye"; exit;