On Fri, 15 Sep 2000 20:13:34 -0700, Nathan Wiger <[EMAIL PROTECTED]> wrote:
> > I loathe the indirect object syntax.
> 
> Well that makes one of us! ;-)
> 
> > Easy. Put them in a subroutine:
> > 
> >         sub format1 { format $template1, @data };
> >         sub format2 { print STDERR format $template1, @data };
> >         # etc.
> 
> Gag! Cough! Ack!  :-}
> 
> Not trying to be mean, but this doesn't make things easy. As I mentioned
> in my previous email, being able to say:
> 
>    write STDOUT;

If write is to accept arguments, the format specifier should be the first. If
you are writing a report to the current filehandle - the way perl5 implements
it - the thing that is changing most is the format (reports build out of
several different blocks) not the file handle. If you wanna change the
filehandle, use the 'print filehandle format ...' syntax.

> is a *benefit*. It seems your proposal is 90% of the way there if it
> just followed suit with the other commonly-used printing functions:
> 
>    print $STDERR @stuff;
>    printf $STDERR $fmt, @stuff;
>    format $STDERR $fmt, @stuff;

print $STDERR format $fmt, @stuff
would be my choice.

> Looks pretty consistent to me, and makes things easy too.

Though I could live with both.

> Either that, or drop the printing in a void context altogether, and just
> tell people they have to say
> 
>    print format $fmt, @stuff;

Early brain-dump. This should be it.

> Which I'm ok with too. But partially supporting printing, only to the
> default filehandle, I don't think is a good idea. You're gonna end up
> with lots of nasty code that way, which this RFC would otherwise
> prevent.

-- 
H.Merijn Brand           Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
using perl-5.005.03, 5.6.0, 5.7.1 & 516 on HP-UX 10.20 & 11.00, AIX 4.2 & 4.3,
     DEC OSF/1 4.0 and WinNT 4.0 SP-6a,  often with Tk800.022 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/

Reply via email to