in reply to Re: Code Blocks
in thread Code Blocks

Thanks for the help - "do" does the job I was looking for. My dirty ugly code was just knocked up to give a flavour of what I was trying to do - and I had missed a print verb before the "actual error" line - it's not real production code. The comma after the first print should be a semi-colon and there should be a semi-colon after the closing curly bracket, my missing a print verb before the Actual error string probably led to this omission and my confusion! Thanks for the help though I am wondering exactly, typo apart, what is dirty and ugly about it?
Many thanks
Ronnie

Replies are listed 'Best First'.
Re^3: Code Blocks
by Ieronim (Friar) on Jul 27, 2006 at 16:38 UTC
    typo apart, what is dirty and ugly about it
    IMHO:
    • The comment signs on empty lines are ugly
    • The spaces before semicolons are ugly
    • 2-column indent is ugly
    • Calling subs as &sub is ugly and often simply wrong
    And even,
    open ... or do { #blah blah blah };
    is more ugly than
    unless (open...) { #blah blah blah }
    Perl syntax is very flexible. It even allows to write the whole your program in one long line. But i recommend you to follow the more common coding standarts :) They are described, e.g. in perlstyle.

         s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print