On Fri, Jun 29, 2001 at 02:24:56AM +0400, Maxim Berlin wrote:
> Thursday, June 28, 2001, Randal L. Schwartz <[EMAIL PROTECTED]> wrote:
> 
> RLS> NO NO.  That doesn't work.  All of those unshifts are executed REGARDLESS
> RLS> of the $OS type.
> [...]
> Randal, thank you for your patience and examples, but please do not
> explain how BEGIN works again. I know that.
> 
> RLS> So, Maxim, YOU are demonstrating the very reason I would flunk your
> RLS> code.  It *doesn't* work!
> my code is not absolytely correct, but it *works*. In
> *this* case form is more important than contents for *me*.

I don't understand, if you wanted all of those paths in @INC, why put them
in conditionals?  Why didn't you do something along the lines of:

    # I don't recall exactly what the original code was, so the specifics
    # may be a bit off.
    BEGIN { unshift(@INC, "C:\\winnt", "/usr/local", "/usr") }

    if ($OSNAME eq 'nt') {
        `del ...`;
    } elsif ($OSNAME eq 'linux') {
        `rm -rf ...`;
    } elsif ($OSNAME eq 'freebsd') {
        `rm -rf ...`;
    }

That is, effectively, what you achieve by having BEGIN blocks in each
conditional.  This certainly doesn't look like what you intended.


Michael    
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

Reply via email to