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

Bareword and strict subs

Thread Next
Mark Haney
May 31, 2012 15:28
Bareword and strict subs
Message ID:
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);

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
Linux marius.homelinux 3.3.7-1.fc16.x86_64 GNU/Linux

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About