fml 8 tutorial
Prev | Chapter 53. Mail::Message::Encode Class | Next

# run_in_chcode()

In language dependent processes, convert the charset to machine friendly one, process something and back it to the original chaset each time. This step is widely used. So it is convenient to prepare a function to pack these steps into one function.

    run_in_chcode example:

    sub run_in_chcode
    {
       my ($self, $proc, $s, $out_code, $in_code) = @_;

       my $conv_status = convert_str_ref($s, $EUC_JP, $in_code);
       my $proc_status = &$proc($s, @_);
       convert_str_ref($s, $out_code, $EUC_JP) if $conv_status && $out_code;
       return wantarray ? ($conv_status, $proc_status): $conv_status;
    }

Prev | Home | Next
Mail::Message::Encode Class | Up | Execise: Create A New Program

fml 8.0 (fml-devel) project homepage is www.fml.org/software/fml8/.
fml 4.0 project homepage is www.fml.org/software/fml4/.
about one floppy bsd routers, see www.bsdrouter.org/.
other free softwares are found at www.fml.org/software/.

author's homepage is www.fml.org/home/fukachan/.
Also, visit nuinui's world :) at www.nuinui.net.

For questions about FML, e-mail <fml-bugs@fml.org>.