... sub func { print 'The Command Seperator is: ', $^O =~ /MSWin32/i ? '&' : ';', "\n" } func(); func(); ... #### sub func { print 'The Command Seperator is: ', qw(; &)[ $^O =~ /MSWin32/i ], "\n" }