sub foo { if ( $_[ 0 ] % 3 } { return $_[ 0 ]; # argument divisible by 3 } return; } print join( ':', map foo( $_ ), 1..5 ), "\n"; __END__ 1:2:4:5