Hello Randal,

Wednesday, June 27, 2001, Randal L. Schwartz <[EMAIL PROTECTED]> wrote:

HT>> The BEGIN blocks always execute first no matter where you put them.
Maxim>> yes, of course. BEGIN was placed inside just for better readability.

RLS> I actually consider that *less* readable and maintainable, because it
RLS> would lead someone to believe that the BEGIN block somehow depended on
RLS> that condition, which it doesn't.

our tastes differ. i prefer

if ( $OS eq "NT" )
{
BEGIN { unshift(@INC,"c:\\winnt\\"); }
`del c:\\winnt\\system32\\KERNEL32.DLL`;
}
elsif ( $OS eq "linux" )
{
BEGIN { unshift(@INC,"/etc"); }
`rm -f /vmlinuz`;
}
elsif ( $OS eq "freebsd" )
{
BEGIN { unshift(@INC,"/usr/local/etc"); }
`rm -f /kernel`;
}

for better readability. some sort of... well... 'logical' formatting
:), not only syntax and maintenance.

IMHO and so on.

[...]

RLS> Then again, in a code review, I'm required to be an advocate for the
RLS> unseen maintenance programmer who is usually not as clever as the
RLS> original author. :)

:) thank you.

And, thank you for your books.

Best wishes,
 Maxim                            mailto:[EMAIL PROTECTED]


Reply via email to