Thread Fehlerbehandlung
(13 answers)
Opened by Schland-Meister at 2012-06-25 14:17
mit welcher version?
Code (perl): (dl
)
1 2 3 4 5 6 use strict; use warnings; use diagnostics; my $m = bless{}, "main"; eval{ $m->foo }; if ($@) { say "perl $]: $@" } ich bekomme: Code: (dl
)
1 perl 5.010001: Can't locate object method "foo" via package "main" at -e line 6. Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wie frage ich & perlintro brian's Leitfaden für jedes Perl-Problem |