http://qs321.pair.com?node_id=359718


in reply to How to make Win32::API easy to use

Does this type of simplification come from thinking like "the users", or am I just strange? Does this seem like a huge improvement to others? Anyone else felt "from the beginning" that Win32::API should be creating code refs, like that was the "natural" interface to provide?

I totally agree. A similar example for me is this from DBI:

$rc = $sth->bind_col($col_num, \$col_variable); $rc = $sth->bind_columns(@list_of_refs_to_vars_to_bind);

Ive never understood why that isnt:

$rc = $sth->bind_col($col_num, $col_variable); $rc = $sth->bind_columns(@list_to_bind);
As inside it could easily be:
my ($col_num)=@_; my $col_variable=\$_[1];
or
my @refs=map { \$_ } @_;

---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi