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'},
        } );