From: [EMAIL PROTECTED] (Randal L. Schwartz)

> >>>>> "Jenda" == Jenda Krynicky <[EMAIL PROTECTED]> writes:
> 
> Jenda> I think the nicest example is
> 
> Jenda>        use File::Copy;
> Jenda>        copy $source => $destination;
> [edited slightly]
> 
> The big problem with using the big arrow there is when you have
> constants:
> 
>     use constant TEMPLATE => '/usr/lib/templates/foo.html';
>     use File::Copy;
>     copy TEMPLATE => $destination;

I usualy write constants with the &. So that when I make a typo I 
get the more understandeable

        Undefined subroutine &main::foo called at ...

instead of either

        Bareword "foo" not allowed while "strict subs" in use at ...    
                (requires use strict 'subs')
or even
        print() on unopened filehandle foo at ...
                (requires -w, happens if you write "print foo + ...")

Not speaking about the fact that when writing onetime-use scripts 
or oneliners I don't always use strict.
 
> So, in general, I actively discourage the use of fatarrow as a funny
> comma, unless that use is to explicitly quote the left argument.

One has to know the implications. But IMHO if it makes the code 
more readable and understandeable ...

Compare this:

        use Win32::FileOp;
        WriteToINI $inifile, 'main', 'Property file' => $propfile, 
                'Default width' => 300, 'Default height' => 200;

and

        use Win32::FileOp;
        WriteToINI $inifile, 'main', 'Property file', $propfile, 
                'Default width', 300, 'Default height', 200;

The => is not used to quote the names, but IMHO makes the code 
easier to understand.

Jenda

=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
                                        --- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to