Re: Bareword and strict subs

2012-05-31 Thread Shawn H Corey
On 12-05-31 06:28 PM, Mark Haney wrote: sub insert_shift { my $self = shift; my $attrs = @_; Should this be: my %attrs = @_; my $m = $self->schema->resultset('Shifts')->new(attrs); my $m = $self->schema->resultset('Shifts')->new(%attrs); $m->insert; }

RE: Bareword and strict subs

2012-05-31 Thread Michael Brader
A bareword is an unquoted string appearing in Perl source. Depending on context it is treated as a sub call or a string (or a filehandle and a few other things I'd imagine). Barewords that are not sub calls are generally not permitted under "use strict" (specifically "use strict 'subs'"), with

Re: Bareword and strict subs

2012-05-31 Thread Chris Nehren
On Thu, May 31, 2012 at 18:35:21 -0400 , Shawn H Corey wrote: > On 12-05-31 06:28 PM, Mark Haney wrote: > >sub insert_shift { > > my $self = shift; > > my $attrs = @_; > > Should this be: > my %attrs = @_; As Mark seems to be using DBIx::Class, and the new method on ::ResultSet cl

Re: Bareword and strict subs

2012-05-31 Thread Shawn H Corey
On 12-05-31 08:26 PM, Chris Nehren wrote: On Thu, May 31, 2012 at 18:35:21 -0400 , Shawn H Corey wrote: On 12-05-31 06:28 PM, Mark Haney wrote: sub insert_shift { my $self = shift; my $attrs = @_; Should this be: my %attrs = @_; As Mark seems to be using DBIx::Class, and

Re: Bareword and strict subs

2012-05-31 Thread Chris Nehren
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

Re: Bareword and strict subs

2012-05-31 Thread Shawn H Corey
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 wil