File: hello_idn_email.pl

package info (click to toggle)
libnet-idn-encode-perl 2.500-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,820 kB
  • sloc: perl: 416; makefile: 8
file content (18 lines) | stat: -rw-r--r-- 286 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use strict;
use utf8;

binmode STDOUT, ":utf8";

use Net::IDN::Encode;

my @email = (
  'postmaster@例.テスト',
  'info@müller.example.net',
);

foreach (@email) {
  printf "%s: toASCII=<%s>, toUnicode=<%s>\n",
	$_, email_to_ascii($_), email_to_unicode($_);
}