« blib/lib/blx/xsdsql/xsd_parser/node/attribute.pm
↑ Summary
blib/lib/blx/xsdsql/connection/sql/connection.pm »
| 1 | package blx::xsdsql::ut::ut; | ||
| 2 | use strict; # use strict is for PBP | ||
| 3 | use Filter::Include; | ||
| 4 | include blx::xsdsql::include; | ||
| 5 | #line 6 | ||
| 6 | use base qw(Exporter); | ||
| 7 | |||
| 8 | our %EXPORT_TAGS = ( 'all' => [ qw( nvl ev ) ] ); | ||
| 9 | |||
| 10 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | ||
| 11 | |||
| 12 | our @EXPORT = qw( ); | ||
| 13 | |||
| 14 | |||
| 15 | sub nvl { | ||
| 16 | return '' if scalar(@_) == 0; | ||
| 17 | return defined $_[0] ? $_[0] : '' if scalar(@_) == 1; | ||
| 18 | return defined $_[0] ? $_[0] : $_[1] if scalar(@_) == 2; | ||
| 19 | return defined $_[0] ? $_[1] : $_[2] if scalar(@_) == 3; | ||
| 20 | my $a=[nvl(@_[0..2]),@_[3..scalar(@_) -1]]; | ||
| 21 | return wantarray ? @$a : $a; | ||
| 22 | } | ||
| 23 | |||
| 24 | sub ev { | ||
| 25 | local $@; | ||
| 26 | my $r=eval join(' ',@_); ## no critic | ||
| 27 | croak $@ if $@; | ||
| 28 | return $r; | ||
| 29 | } | ||
| 30 | |||
| 31 | 1; | ||
| 32 | |||
| 33 | __END__ |