#!/usr/bin/perl use strict; use warnings; sub x { local$,=" "; print "$_[ 0 ]:", map( "[$_]", @_[ 1 .. $#_ ] ), "\n" } x "for", sub { for( 5 .. 7 ) { 1 } }->(); x "while(5)", sub { while( 5 ) { 1; last } }->(); x "while(0)", sub { while( 0 ) { 1 } }->(); x "if(5)", sub { if( 5 ) { 1 } }->(); x "if(0)", sub { if( 0 ) { 1 } }->(); x "do{}while(0)", sub { do { 1 } while 0 }->(); x "do{}until(5)", sub { do { 0 } until 5 }->(); __END__ for: [] while(5): while(0): if(5): [1] if(0): [0] do{}while(0): [1] do{}until(5): [0]