| 1 | use POSIX qw(locale_h); |
| 2 | |
| 3 | sub foo { "Subroutine foo called with args: @_"; } |
| 4 | |
| 5 | sub foo_undef { $x; } |
| 6 | |
| 7 | sub foo_die { die "expiring..."; } |
| 8 | |
| 9 | sub readvar { Exim::expand_string("\$$_[0]"); } |
| 10 | |
| 11 | sub return_scalar { 42; } |
| 12 | |
| 13 | sub return_list { (10,20,30); } |
| 14 | |
| 15 | sub return_variable_vector { @x = (4,5,6); @x; } |
| 16 | |
| 17 | sub return_hash { %x = ("a", 4, "b", 5); %x; } |
| 18 | |
| 19 | sub debug_write { Exim::debug_write("$_[0]"); "Wrote debug"; } |
| 20 | |
| 21 | sub log_write { Exim::log_write("$_[0]"); "Wrote log"; } |
| 22 | |
| 23 | sub change_locale { setlocale(LC_TIME, "fr_FR"); "Changed locale"; } |
| 24 | |
| 25 | sub foo_warn { warn "this is a warning"; "Wrote warning"; } |
| 26 | |
| 27 | sub no_warn { $SIG{__WARN__} = sub { }; "Discarded warnings"; } |