EchoAngel has asked for the wisdom of the Perl Monks concerning the following question:
foreach $element (@list_of_Num_Extraction) { if ($element =~ m/^([0-9]+),([0-9]+)$/) { my $first_num = $1; my $second_num = $2; my $current_num = ($first_num - 1)*$NumOfColumns + $second_ +num; $Unique_Num_List{$current_num} = "($first_num,$second_num)"; } elsif ($element =~ m/^([0-9]+),([0-9]+):([0-9]+),([0-9]+)$/) { my $num1x = $1; my $num1y = $2; my $num2x = $3; my $num2y = $4; my $counter1 = 0; my $counter2 = 0; foreach $counter1 ($num1x .. $num2x) { foreach $counter2 ($num1y .. $num2y) { my $current_num = ($counter1 - 1)*$NumOfColumns + $count +er2; $Unique_Num_List{$current_num} = "($counter1,$counter2)"; #print "$counter1 - $counter2 \n"; }} } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extraction of List of Coordinates
by kvale (Monsignor) on Oct 05, 2004 at 22:45 UTC | |
|
Re: Extraction of List of Coordinates
by ikegami (Patriarch) on Oct 05, 2004 at 23:28 UTC | |
by Roy Johnson (Monsignor) on Oct 06, 2004 at 02:39 UTC | |
by sgifford (Prior) on Oct 06, 2004 at 05:28 UTC | |
by Roy Johnson (Monsignor) on Oct 06, 2004 at 15:31 UTC | |
|
Re: Extraction of List of Coordinates
by tmoertel (Chaplain) on Oct 06, 2004 at 00:37 UTC | |
|
Re: Extraction of List of Coordinates
by Roy Johnson (Monsignor) on Oct 06, 2004 at 02:43 UTC | |
|
Re: Extraction of List of Coordinates
by TedPride (Priest) on Oct 06, 2004 at 01:59 UTC |