in reply to Re (tilly) 2: The Marcel Perl Questionnaire
in thread The Marcel Perl Questionnaire
As far as $_, I think that the problem of the many uses can be overcome by simply doing
.{ local $_; # stuff... }
I haven't seen this do anything too weird, and it provides a good way to overwrite $_ temporarily. It sort of reminds me of elisp's (save-excursion ...) Anyway, here's my answers to the questionnaire -- favorites are first.
| (Least) Favorite Perl Instruction | local; reset | See above. Why reset? Too dangerous, especially when you've got tons of single-char vars. |
| (Least) Favorite Looping Mechanism | {}; for | Naked blocks give you more flexibility. for just seems useless to me. |
| (Least) Favorite Module | Data::Dumper; | Dump those objects! No least favorite -- I sort of like them all. |
| (Least) Favorite Special Var | $_; $] | $_ is so useful. $] is not. |
| Favorite Var Type | typeglob | Very obfuscatable. |
| (Least) Favorite Command Line Switch | -e; -U | -e allows me to do one-liners. -U does unsafe things. |
| Favorite Pragma | use strict; no strict "refs"; | Good for bugcatching, except when I want to use symbolic references. |
| Favorite Regexp {Modifier,Metachar} | i; \Q | Yes to i! Too much work to manually decapitalize all the time. \Q useful for when arbitrary data comes in which you need to match. |
| Favorite Descriptive Var Name | %z | Not very descriptive, but I like it nonetheless. |
| Favorite HERE doc delimiter | print; | Or some other command... |
| Favorite Filehandle | FOO | Should be obvious why... |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 4: The Marcel Perl Questionnaire
by tilly (Archbishop) on Feb 26, 2001 at 02:12 UTC | |
by premchai21 (Curate) on Feb 27, 2001 at 07:04 UTC |