Thread funktion kompakter schrieben
(15 answers)
Opened by mr-sansibar at 2008-01-03 22:02
kann man diese Funktion kompakter schreiben ?
vg, mr-sansibar 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 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 sub work_with_tmp_line { my ($message) = @_; if ( $message =~ /socketException/ ) { return 'NullPointerException'; } elsif ( $message =~ /ArrayIndexOutOfBoundsException/ ) { return 'ArrayIndexOutOfBoundsException'; } elsif ( $message =~ /NullPointerException/ ) { return 'NullPointerException'; } elsif ( $message =~ /LockedPinException/ ) { return 'LockedPinException'; } elsif ( $message =~ /AuthenticationException/ ) { return 'AuthenticationException'; } elsif ( $message =~ /BusinessServiceException/ ) { return 'BusinessServiceException'; } elsif ( $message =~ /IllegalStateException/ ) { return 'IllegalStateException'; } elsif ( $message =~ /NumberFormatException/ ) { return 'NumberFormatException'; } elsif ( $message =~ /Exception/ ) { return 'Exception'; } elsif ( $message =~ /NoSuchElementException/ ) { return 'NoSuchElementException'; } elsif ( $message =~ /RemoteException/ ) { return 'RemoteException'; } elsif ( $message =~ /SQLException/ ) { return 'SQLException'; } elsif ( $message =~ /IOException/ ) { return 'IOException'; } elsif ( $message =~ /FileNotFoundException/ ) { return 'FileNotFoundException'; } else { return 'No Exception'; } } |