Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 chilling in the Monastery: (16)
As of 2014-08-22 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (163 votes), past polls