in reply to Step through an array containing subroutines

my @routines = ( \&routine0, \&routine1, ); $routines[$input]->();

Replies are listed 'Best First'.
Re^2: Step through an array containing subroutines
by austin43 (Acolyte) on Feb 15, 2011 at 18:12 UTC
    Thanks! Here's what the finished code looks like.
    my @routines = ( \&routine0, \&routine1, ); $routines[$input]->($input = <>); sub routine0 { print "0"; } sub routine1 { print "1"; }