in reply to Subroutines within if statements
use strict; use warnings; print "Would you like to add or remove symbolic links?\n"; chomp( my $answer = <STDIN> ); if( $answer =~ m{^a(?:dd)?$} ) { addlinks(); } elsif( $answer =~ m{^r(?:emove)?$} ) { rmlinks() } else { exit( 0 ); }
Cheers,
JohnGG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Subroutines within if statements
by runrig (Abbot) on Feb 21, 2008 at 22:37 UTC | |
|
Re^2: Subroutines within if statements
by ikegami (Patriarch) on Feb 21, 2008 at 22:48 UTC |