having spaces instead of underscores:
#!/usr/bin/perl -wl use strict; sub is_compatible { local $_ = $_[0] ^ $_[1]; return not (/[\001-\017]/ or /([\020-\031]).*?\1/s); } print is_compatible (' 8 3 19', '48 7 ') ? 'yes' : 'no'; print is_compatible (' 8 3 19', '4 8 7 ') ? 'yes' : 'no'; print is_compatible (' 8 3 19', '48 7 ') ? 'yes' : 'no'; __END__ # output yes no no
In reply to Re: Comparison by position and value
by ccn
in thread Comparison by position and value
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |