Thread Warum kein $@ statt $! (29 answers)
Opened by rosti at 2014-09-23 13:04

Muffi
 2014-09-25 11:32
#177533 #177533
User since
2012-07-18
1465 Artikel
BenutzerIn
[default_avatar]
So?
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
my $error;

sub error {
        return $error;
}

sub new{
    my $class = shift;
        my %cfg = (
                machine => '',
                @_
        );

        unless ($cfg{machine} eq 'Diesel' or $cfg{machine} eq 'Otto') {
                $error = "Machine Diese||Otto";
                return;
        }
        
        return bless {
                        machine => $cfg{machine},
                }, $class;
}
1 + 1 = 10

View full thread Warum kein $@ statt $!