Home: Perl Programming Help: Regular Expressions:
need help in running this VSM code



Tehmina Iqbal
Novice

Mar 25, 2011, 7:01 AM


Views: 3920
need help in running this VSM code

Hello

i need someones help in removing errors from the attached code of Vextro Space Model... i am a new user of perl so dont know much about it....



thanks in advance
Attachments: vsm.pl (3.58 KB)


miller
User

Mar 25, 2011, 2:07 PM


Views: 3913
Re: [Tehmina Iqbal] need help in running this VSM code

You're attempting to create a class without specifying a package name.

Read the following tutorial: http://perldoc.perl.org/perltoot.html


Code
my $engine = new( docs => \@docs, threshold => .04);     

...

# new
sub new {
my ( $class, %params ) = @_;


should probably be changed to


Code
my $engine = MyClassName->new( docs => \@docs, threshold => .04);     

...

package MyClassName;

# new
sub new {
my ( $class, %params ) = @_;


- Miller