Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Moose what am I doing wrong here?

Expand Messages
  • Wendell Hatcher
    yes, in-fact I took your code below and just added my name with no success. #!/usr/bin/perl use strict; use warnings; BEGIN { package Foo; use Moose; has name
    Message 1 of 9 , Oct 14, 2010
    • 0 Attachment
      yes, in-fact I took your code below and just added my name with no success.

      #!/usr/bin/perl
      use strict;
      use warnings;

      BEGIN {
      package Foo;
      use Moose;
      has name => (is => 'rw');
      }

      my $object = Foo->new(name => 'Dell');

      print $object->name, "\n";


      --- On Thu, 10/14/10, merlyn@... <merlyn@...> wrote:

      From: merlyn@... <merlyn@...>
      Subject: Re: [PBML] Moose what am I doing wrong here?
      To: "Wendell Hatcher" <wlh1074@...>
      Cc: perl-beginner@yahoogroups.com
      Date: Thursday, October 14, 2010, 12:15 PM







       









      >>>>> "Wendell" == Wendell Hatcher <wlh1074@...> writes:



      Wendell> Here is what I have and it doesn't work Have you tested this with positive results?

      Wendell> #!/usr/bin/perl

      Wendell> use strict;

      Wendell> use warnings;



      Wendell> BEGIN{



      Wendell> package FooClass;

      Wendell> use Moose;

      Wendell>    has name => (is =>'rw'); 

      Wendell>   

      Wendell> }



      Wendell> my $foo = FooClass->new( name => 'Dell');



      Wendell> print $foo->name;



      Did you add a newline there, like I had in my example?



      If not, your output might be being overwritten by your prompt when the

      program ends.



      --

      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>

      Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.

      See http://methodsandmessages.posterous.com/ for Smalltalk discussion























      [Non-text portions of this message have been removed]
    • merlyn@stonehenge.com
      ... Wendell yes, in-fact I took your code below and just added my name with no success. Wendell #!/usr/bin/perl Wendell use strict; Wendell use warnings;
      Message 2 of 9 , Oct 14, 2010
      • 0 Attachment
        >>>>> "Wendell" == Wendell Hatcher <wlh1074@...> writes:

        Wendell> yes, in-fact I took your code below and just added my name with no success.
        Wendell> #!/usr/bin/perl
        Wendell> use strict;
        Wendell> use warnings;

        Wendell> BEGIN {
        Wendell> package Foo;
        Wendell> use Moose;
        Wendell> has name => (is => 'rw');
        Wendell> }

        Wendell> my $object = Foo->new(name => 'Dell');

        Wendell> print $object->name, "\n";

        This runs just fine for me, prints "Dell" followed by newline. *Just*
        tested it.

        --
        Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
        <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
        Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
        See http://methodsandmessages.posterous.com/ for Smalltalk discussion
      • Wendell Hatcher
        hmm, not sure why it isnt printing out for me. I am using the code below and calling it from my windows laptop from the command line. #!/usr/bin/perl use
        Message 3 of 9 , Oct 14, 2010
        • 0 Attachment
          hmm, not sure why it isnt printing out for me. I am using the code below and calling it from my windows laptop from the command line.


          #!/usr/bin/perl
          use strict;
          use 5.12.1;
          use warnings;

          BEGIN {
          package Foo;
          use Moose;
          has name => (is => 'rw');
          }

          my $object = Foo->new(name => 'Dell');

          print $object->name, "\n";


          --- On Thu, 10/14/10, merlyn@... <merlyn@...> wrote:

          From: merlyn@... <merlyn@...>
          Subject: Re: [PBML] Moose what am I doing wrong here?
          To: "Wendell Hatcher" <wlh1074@...>
          Cc: perl-beginner@yahoogroups.com
          Date: Thursday, October 14, 2010, 12:25 PM







           









          >>>>> "Wendell" == Wendell Hatcher <wlh1074@...> writes:



          Wendell> yes, in-fact I took your code below and just added my name with no success.

          Wendell> #!/usr/bin/perl

          Wendell> use strict;

          Wendell> use warnings;



          Wendell> BEGIN {

          Wendell> package Foo;

          Wendell> use Moose;

          Wendell> has name => (is => 'rw');

          Wendell> }



          Wendell> my $object = Foo->new(name => 'Dell');



          Wendell> print $object->name, "\n";



          This runs just fine for me, prints "Dell" followed by newline. *Just*

          tested it.



          --

          Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

          <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>

          Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.

          See http://methodsandmessages.posterous.com/ for Smalltalk discussion























          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.