On 12-05-31 09:00 PM, Chris Nehren wrote:
On Thu, May 31, 2012 at 20:36:50 -0400 , Shawn H Corey wrote:
Should this be:
     my %attrs = @_;

As Mark seems to be using DBIx::Class, and the new method on ::ResultSet
classes is defined as taking \%attrs, probably not.


my $attrs = @_;

This will store the number of elements in the array @_ into $attrs.
Why do that when this is simpler:

$obj->insert_shift( scalar @array );

Probably because there's supposed to be () round the $attrs and we both
missed it. :)


That's why it's better to write it like this:

    my $attrs = shift @_;


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

        _Perl links_
official site   : http://www.perl.org/
beginners' help : http://learn.perl.org/faq/beginners.html
advance help    : http://perlmonks.org/
documentation   : http://perldoc.perl.org/
news            : http://perlsphere.net/
repository      : http://www.cpan.org/
blog            : http://blogs.perl.org/
regional groups : http://www.pm.org/

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to