Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Possible issue with Moose ScalarRef

by greengaroo (Hermit)
on Jan 10, 2013 at 17:54 UTC ( #1012711=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        $self->debug_level( 4 );
    
    ...
        print "After change:\n";
        print "Original: ", \$self->debug_level, " Value: ", $self->debug_
    +level, "\n";
        print "Reference: ", $obj->debug_level, " Value: ", ${$obj->debug_
    +level}, "\n";
    
  2. or download this
    Original: SCALAR(0xd463da0) Value: 4
    Reference: SCALAR(0xd468640) Value: 4
    After change:
    Original: SCALAR(0xd463da0) Value: 0
    Reference: SCALAR(0xd468640) Value: 4
    
  3. or download this
      has 'debug_level' => (
        traits => [qw(Getopt)],
    ...
        cmd_aliases => 'd',
        documentation => 'Debug mode: 0-4; Default: 0;'
      );
    
  4. or download this
      has 'debug_level' => (
        is => 'rw',
        isa => 'ScalarRef[Int]',
      );
    
  5. or download this
        my $obj = Something->new( {
          # Before:
    ...
          # Now:
          'debug_level' => \$self->{'debug_level'},
        } );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1012711]
Approved by keszler
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-03-30 10:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (636 votes), past polls