File: FoodWithComment.pm

package info (click to toggle)
prt 0.22-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 404 kB
  • sloc: perl: 1,185; makefile: 3
file content (23 lines) | stat: -rw-r--r-- 295 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package FoodWithComment;
use strict;
use warnings;

# create a new food
# You can use when you want to create a new instance
sub new {
    my ($class, $name) = @_;

    bless {
        name => $name,
    }, $class;
}

# another comment

sub name {
    my ($self) = @_;

    $self->{name};
}

1;