Thread Fehlermeldungen abfangen/unterdrücken: Use of uninitialized value in concatenat
(17 answers)
Opened by Duff at 2007-05-27 19:16
[quote=Duff,27.05.2007, 17:16]
Code: (dl
)
31 my ($match) = $input =~ /\.(.+?)\./ if defined $input; niemals sowas machen. besser: my ($match) = defined $input ? $input =~ /\.(.+?)\./ : undef; eine variablendeklaration mit nachgestelltem if ist in perl unvorhersagbares verhalten (es ist ja auch nicht dokumentiert). 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: ![]() ![]() |