summaryrefslogtreecommitdiff
path: root/new-demo
blob: 57e5e8bc00d81fe6a095a506c99ab572446349d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env perl

# Class for the object
package RPG::Wizard;
use strict;
use warnings;
use utf8;
use 5.010;
use Carp;
our $VERSION = 0.1;

sub new {
    my ($class) = @_;
    return bless {}, $class;
}

sub zap {
    my ($self) = @_;
    say 'Zap!' or croak;
    return;
}
1;

# Demonstration of PACKAGE::new()
package Sanctum::New::Demo;    ## no critic (ProhibitMultiplePackages)
use strict;
use warnings;
use utf8;
use 5.010;
use Data::Printer;             ## no critic (ProhibitDebuggingModules)
our $VERSION = 0.1;            ## no critic (ProhibitReusedNames)

# Make a wizard object
my $wizard = RPG::Wizard->new();

# Print the object
p $wizard;

# Zap!
$wizard->zap();