Thread funktion kompakter schrieben
(15 answers)
Opened by mr-sansibar at 2008-01-03 22:02
Noch was kürzer ;-)
Code (perl): (dl
)
1 2 3 sub work_with_tmp_line { return (shift() =~ /(\w+Exception)/)?$1:'No Exception'; } oder: Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 sub work_with_tmp_line { my $typ=join('|',qw(socket ArrayIndexOutOfBounds NullPointer LockedPin Authentication BusinessService IllegalState NumberFormat NoSuchElement Remote SQL IO FileNotFound)); return (shift() =~ /((?:$typ)?Exception)/)?$1:'No Exception'; } |