On Tue, Dec 22, 2009 at 02:29:53PM +0200, Shlomi Fish wrote: > Hi Dr. Ruud! (and all). > > See below for my response. > > On Monday 21 Dec 2009 22:03:07 Dr.Ruud wrote: <snip> > > > > perl -wle' > > my @x = 0 .. 3; > > print "@x"; > > ++$_ for grep $_, @x; > > print "@x"; > > ++$_ for map $_, @x; > > print "@x"; > > ' > > I appreciate all your help on the channel. However, I noticed that you keep > giving examples as one big perl -wle '....' block (with single-quotes). This > is: > > --> > 1. Error prone. What if someone changes the program to include a single-quote? > 2. Won't work properly on Win32's CMD.EXE , which we may unfortunately still > need to accommodate for. > 3. Very hard to experiment with on the shell, due to scrolling between such > large numbers. > 4. Doesn't follow best practices of using "use strict;", "use warnings;", etc. > <-- > > As a result, I believe it would set a bad example, and that people may mis- > interpret it. > > I suggest that instead you (or whoever) delimit a block using <<<< and >>>> > or > {{{{ and }}}} or whatever you want and include a Perl program that you've > tested inside a file. E.g: >
<snip> > > Regards, > Shlomi Fish Dr. Ruud, I disagree with Mr. Fish's suggestion that you quit using command line scripts for your examples. I often find them very helpful. I can cut/paste them from mutt to the command line and see how they work on my system, tweak them, break them and learn from them without the necessity of creating a file. I personally find it very easy to experiment from the shell and do so often. I only use strict and warnings on the CLI if something doesn't work and the reason is not immediately evident. His second objection is certainly true but I've never seen a requirement here that 'one size fit all'. I have saved many snippets of your code and find your additions to the list most worthwhile. Please don't let the critics and nitpickers limit the valuable help you dispense here. Thanks, Mike McClain -- Satisfied user of Linux since 1997. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/