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: Intermediate:
Moose error

 



trysil
Novice

May 31, 2011, 1:41 AM

Post #1 of 1 (549 views)
Moose error Can't Post

Hi!
Just started to take a look at Moose and for a very simple example i get the following error:


Code
C:\Projekt\perl>perl point.pl 
Usage: has 'name' => ( key => value, ...) at C:/strawberry/perl/site/lib/Moose.pm line 72
Moose::has('Moose::Meta::Class=HASH(0x2b64194)','x','HASH(0x1df09d4)') called at c:/strawberry/perl/site/lib/Moose/Exporter.pm line 356
Moose::has('x','HASH(0x1df09d4)') called at point.pl line 4

The simple test script:

Code
package point; 
use Moose;

has 'x' => {
isa => 'Int',
is => 'rw',
};

has 'y' => {
isa => 'Int',
is => 'rw',
};

sub clear {
my $self = shift;
$self -> x(0);
$self -> y(0);
};
package point3d;
use Moose;
extends point;

has 'z' => {
isa => 'Int',
is => 'rw',
};

after clear => sub {
my $self = shift;
$self -> z(0);
};

package main;
my $obj = point3d -> new(x=>12, y=>23, z => 34);

print $obj -> x, " ", $obj -> y, " ", $obj -> z;'


Probably something obvious but it slips my eyes. Blush
Anyone see anything?

/T

 
 


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

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