#!/usr/bin/perl use strict; use warnings; use 5.010; for my $count (0..4) { given ($count) { when (0) { say "Whoa, it's $count" } when (1) { say "Then it becomes $count" } when (2) { say "Then, $count" } when (3) { say "Only to further increase to $count" } when (4) { say "And eventualy stop at $count" } } }