#!/usr/bin/perl -w use strict; use warnings; sub step_1 { print "Programming step 1\n"; # do junk } sub step_2 { print "Programming step 2\n"; # more junk } sub step_3 { print "Programming step 3\n"; # lots more junk } my @STEPS = (\&step_1, \&step_2, \&step_3); my $SKIP=shift || 0; for my $ST (0 .. $#STEPS) { if ($ST < $SKIP) { print "Skipping step $ST\n"; } else { &{$STEPS[$ST]}; } }