Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Comparison by position and value

by ambrus (Abbot)
on Jan 02, 2005 at 11:08 UTC ( #418771=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub compatible { 
        my ($s1, $s2) = @_; 
    ...
        !(($s1 | $s2)=~y/\0//); 
    } 
    print(compatible("_8__3__19", "48_____7_") ? "true\n" : "false\n");
    
  2. or download this
    sub compatible {
        y/_/\477/c, y/_/\0/ for my @m = @_;
    ...
            for [ qw[ _8__3__19 48____7__ ] ],  # compat
                    [ qw[ _8__3__19 4_8___7__ ] ],  # compat
                    [ qw[ _8__3__19 48_____7_ ] ];  # clash
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://418771]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2020-06-02 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (17 votes). Check out past polls.

    Notices?