Imagine you have to teach a bit of Perl. The first thing you'd probably say is "say". Yes, I hope you'd prefer to use 5.10 for teaching and at the first lesson wouldn't mention that there exist another 5x version which is not fully compatible with 5.10.
You can start teaching from print "Hello\n", having to explain the meaning of slash-n only, but it is rather boring to use "print" when you have working "say". But to run a programme with "say" you have to either use version or feature pragma, or use Modern::Perl. These are much more things to explain now.
Thus if you would like to demonstrate the brilliant short name "say", you have to bring with it odd and long instructions just to turn "say" on.
Re:Two alternatives
andy.sh on 2009-07-14T20:18:45
I thought about that during the day. These examples are good, and in fact I think that they may be used as the first examples of Perl code.
They slightly break the idea of showing pure Perl code, but it is better in that you don't need even a file to save the programme in. Just run it from the command line.