but I'm not sure what's disturbing about it.

Some people dont like to make decisions. Choice mandates making decisions. So ditherers probably dither more with perl than with more restrictive languages just because of this. Its probably compounded by the fact that often there is little difference between the options, IME the less difference the harder the choice. As I said however I rejoice in the options. Id rather dither occasionally than have to fight the language to do something I want to do.

This is Perl; a statement is a block, yes?

Nope. :-) Read perlsyn: Simple statements and perlsyn: Compound statements. The following is a selection of what seemed to me to be relevent paragraphs.

Perl, a sequence of statements that defines a scope is called a block. Sometimes a block is delimited by the file containing it (in the case of a required file, or the program as a whole), and sometimes a block is delimited by the extent of a string (in the case of an eval).

But generally, a block is delimited by curly brackets, also known as braces. We will call this syntactic construct a BLOCK.

Modifiers are considered to be simple statements, as follows

STMT if EXPR STMT unless EXPR STMT while EXPR STMT until EXPR STMT foreach EXPR

Whereas compound statements are scoped as follows

if (EXPR) BLOCK if (EXPR) BLOCK else BLOCK if (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK LABEL while (EXPR) BLOCK LABEL while (EXPR) BLOCK continue BLOCK LABEL for (EXPR; EXPR; EXPR) BLOCK LABEL foreach VAR (LIST) BLOCK LABEL foreach VAR (LIST) BLOCK continue BLOCK LABEL BLOCK continue BLOCK
The clearest example I can think of is as follows
D:\Development>perl -Mstrict -wle "my $foo=1 if 0; print defined($foo) + ? $foo : 'undef'" undef D:\Development>perl -Mstrict -wle "if ( 0 ) { my $foo=1 } print defin +ed($foo) ? $foo : 'undef'" Global symbol "$foo" requires explicit package name at -e line 1. Global symbol "$foo" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors.
So the first example uses a simple statement with a modifier. The my declaration is at the highest scoped level (the eval block that the -e represents). Whereas in the second example the my declaration is scoped to the affirmative block in the if.

neither of us has ever used.)

Heh, or even heard of. :-) And i didnt see your qualifier. Sorry.

The other poster's point that the variety is disturbing is the one I disagree with really. Sorry for any confusion.

Me too. No prob. :-)

--- demerphq
my friends call me, usually because I'm late....


In reply to Re: Re: Self-improvement and TMTOWTDI by demerphq
in thread Self-improvement and TMTOWTDI by Tanalis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.