linux - My Perl module is found but not being applied -
i have created own perl module. reference file config.pm.
when take content perl module , copy config.pm, script triggered appropriately. when include this:
use severalnines; kernel::severalnines::config_severalnines($self);
it not triggered. sure file found because when try change name of file, errors (premature end of script headers: ).
this file (severalnines.pm) want include in config.pm:
package kernel::severalnines; sub config_severalnines { $self->{ticketacl}->{'acl-name-typer'} = { properties => {frontend => {action => ['customerticketmessage']}, # current ticket match properties customeruser => { group_rw => [ 'incident management severalnines', ], }, }, possible => { ticket => { type => ['incident',],}, }, }; } 1;
the severalnines.pm located in /usr/lib/perl5/5.12.3 listed when doing perl -v.
what problem be?
thank in advance!
your subroutine isn't doing parameter passed; instead setting package variable $kernel::severalnines::self
.
add:
my ($self) = @_;
at top of subroutine code.
also, add:
use strict; use warnings;
to top of module file (or perhaps after package ...;
). have alerted you using undeclared variable.
Comments
Post a Comment