develooper Front page | perl.beginners | Postings from May 2012

Bareword and strict subs

Thread Next
From:
Mark Haney
Date:
May 31, 2012 15:28
Subject:
Bareword and strict subs
Message ID:
4FC7F088.4060902@abemblem.com
I'm getting this error in one of my packages (built by a previous coder):

> Bareword "%s" not allowed while "strict subs" in use

In this case the "%s" is attrs.  Here's the bit of code it's choking on:


sub insert_shift {
       my $self = shift;
       my $attrs = @_;

       my $m = $self->schema->resultset('Shifts')->new(attrs);
       $m->insert;
}

I've googled this error, but what I've found is not very informative.  I 
have no idea what a Bareword is in the Perl context.  Can someone 
explain what's going on?

-- 

Mark Haney
Software Developer/Consultant
AB Emblem
markh@abemblem.com
Linux marius.homelinux 3.3.7-1.fc16.x86_64 GNU/Linux

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About