CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



Tehmina Iqbal
Novice

Mar 25, 2011, 7:01 AM

Post #1 of 2 (1895 views)
need help in running this VSM code Can't Post

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

Post #2 of 2 (1888 views)
Re: [Tehmina Iqbal] need help in running this VSM code [In reply to] Can't Post

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

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives