Newsgroups: fj.lang.perl,fj.living
Path: galaxy.trc.rwcp.or.jp!sparky!uunet!decwrl!intertech-nh!utashiro
From: utashiro@InterTech.COM (Kazumasa Utashiro)
Subject: Re: Credit Card Expire
Message-ID: <1992Apr6.185936.17336@InterTech.COM>
Organization: InterTech Data Systems, Inc., Cupertino, CA
References: <1992Apr3.062343.8827@InterTech.COM> <1992Apr6.111049.5441@gssm.otsuka.tsukuba.ac.jp>
Date: Mon, 6 Apr 1992 18:59:36 GMT
Lines: 20
Xref: galaxy.trc.rwcp.or.jp fj.lang.perl:46 fj.living:739
X-originally-archived-at: http://galaxy.rwcp.or.jp/text/cgi-bin/newsarticle2?ng=fj.lang.perl&nb=46&hd=a
X-reformat-date: Mon, 18 Oct 2004 15:18:22 +0900
X-reformat-comment: Tabs were expanded into 4 column tabstops by the Galaxy's archiver. See http://katsu.watanabe.name/ancientfj/galaxy-format.html for more info.

In article <1992Apr6.111049.5441@gssm.otsuka.tsukuba.ac.jp>
kim@gssm.otsuka.tsukuba.ac.jp (Kim Tong Ho) writes:
>>grep($s += $i++%2 ? $_ : ($_*=2) && /(\d)?(\d)/ && $1+$2, shift=~/\d/g);
>>print "$s\n";
>
>AMEX$B$N$h$&$K!"7e?t$,4q?t$N$b$N$@$H$&$^$/F/$+$J$$$h$&$G$9!#(B

$B$J$k$[$I!"$=$l$G!V1&$+$i?t$($F!W$H$$$&$3$H$@$C$?$N$G$9$+!#;E(B
$BMM$r>!<j$K2r<a$7$F$O$$$1$J$$$H$$$&$h$$6571$G$7$?!#$G$O!"(B

grep($s += ++$i%2 ? $_ : ($_*=2)&&/(\d)?(\d)/&&$1+$2, reverse(shift=~/\d/g));

grep($s += ($_<<=!($i^=1)) && /(.)?(.)/ && $1+$2, reverse(shift=~/\d/g));

$_=reverse(shift); s/(.)(.)/$1.$2*2/ge; $s+=$& while s/.//;

$B$"$$$K$/$H(B AMEX $B$N%+!<%I$O;}$C$F$$$J$$$N$G!"4q?t7e$N%F%9%H$O(B
$B$7$F$$$^$;$s!#(B

--utashiro
