Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

steph_bow's scratchpad

by steph_bow (Pilgrim)
on Aug 16, 2007 at 08:36 UTC ( #632954=scratchpad: print w/replies, xml ) Need Help??

Thanks alot dogz007

You are very nice

your explanations are very clear, and you explained to me in every details

Just a few words to turn your attention on the following point : -- is not magical, contrary to ++

So, instead of decrementing @two, I have incremented twice @one

So I had to make some little modifications to your proposition, which is already very good

#! /usr/bin/perl use strict; while (my $line = <DATA>) { chomp $line; my @line = split ";", $line; next if $line[0] eq $line[1]; next unless length $line[0] == length $line[1]; my @one = breakup($line[0]); my @two = breakup($line[1]); my $one_incremented; my @One_Incremented = @one; foreach $one_incremented(@One_Incremented){ ++$one_incremented; } next unless scalar(@one) == scalar(@two); print STDOUT "one vaut : @one and two vaut : @two\n"; my @match = map { $one[$_] eq ++$two[$_] || ++$One_Incremented[$_] + eq $two[$_] ? 1 : 0 } (0..$#one); print STDOUT "match vaut @match\n"; print $line, "\n" if 1 == grep {$_} @match; } sub breakup { my @out; while ($_[0]) { $_[0] =~ s/^([a-zA-z]|[0-9]+)//; push @out, $1; } return @out; }

interesting topics: 674374 How would I sort a two-dimensional array by multiple columns? (with excel)

679296 : Date sorting

#128077 : Module installation

Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2022-09-25 11:34 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (116 votes). Check out past polls.