http://qs1969.pair.com?node_id=114457


in reply to Another 'ode to backslash' ;-)


Asmo,

As others, i will commend your attempting to explore the perl language and learn it better. However, Learning perl through obfuscations is not a very good way to learn perl. This is in particular due to strict and warnings.

When first learning perl it might seem easier to ignore warnings and strict, when in fact this is false laziness. The path to true laziness would learn strict and warnings now so that they are easier to incorporate with knowledge later. With that in mind, if we were to rewrite your node with strict and warnings, we would only need to change code in two places*:

# change @a on first line to: my @a = ("... # change the for loop at the end so that $a is declared: foreach my $a (@a) {print chr(length $a)} # or change the for loop to use $_ instead of $a :) foreach (@a) {print chr length}
A better way to learn (AFAIK) would be to pick up the Llama book and read the chapters followed by doing the examples. To end with, here are some good nodes on learning perl:

jynx


* not counting the shebang line and the use strict; lines.