Gunnar Hjalmarsson wrote:
Richard Lee wrote:
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
code of Gunnar's
my $numbers_wanted = 2;
my ( @datawanted, @numbers );
LOOP: foreach ( @datas ) {
my @test = split;
foreach my $num ( @numbers ) {
next LOO
Richard Lee wrote:
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
code of Gunnar's
my $numbers_wanted = 2;
my ( @datawanted, @numbers );
LOOP: foreach ( @datas ) {
my @test = split;
foreach my $num ( @numbers ) {
next LOOP if grep( $num->{$_}, @tes
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
" It should include '1 2 3' because '1 2 3', '1 2 4', '1 2 7', '1 2 8',
'1 2 9' = '1 2'(the common number from the list) + anynumber. "
as any of them contains 1 and 2 and I don't understand why '1 2 3' was
picked.
My interpretation: Because it's th
Richard Lee wrote:
" It should include '1 2 3' because '1 2 3', '1 2 4', '1 2 7', '1 2 8',
'1 2 9' = '1 2'(the common number from the list) + anynumber. "
as any of them contains 1 and 2 and I don't understand why '1 2 3' was
picked.
My interpretation: Because it's the first element of those wi
[EMAIL PROTECTED] wrote:
> From: "Richard Lee" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc:
> Sent: Sunday, May 04, 2008 3:17 AM
> Subject: Re: how to simplify this script
>
>> I don't have the solution yet but shouldn't the answer be
On Sat, May 3, 2008 at 7:03 PM, <[EMAIL PROTECTED]> wrote:
> Hi Gunnar and Members
>
> I am very thrilled with your solutions. Is 'LOOP' as in >> LOOP:
> foreach ( @datas ) { <<=
> a function or a command etc. I could not find this function in
> http://perldoc.perl.org/index-function
On Sat, May 3, 2008 at 6:44 PM, <[EMAIL PROTECTED]> wrote:
snip
> The output should include '1 2 3'.
> Therefore I want the output to be
>
> 1 2 3
> 1 6 7
> 4 5 10
>
> It should include '1 2 3' because '1 2 3', '1 2 4', '1 2 7', '1 2 8', '1
> 2 9' = '1 2'(the common number from the list) +
[EMAIL PROTECTED] wrote:
Hi Gunnar and Members
I am very thrilled with your solutions. Is 'LOOP' as in >> LOOP:
foreach ( @datas ) { <<=
a function or a command etc.
No, it's just the name I chose to give the outer foreach loop to be able
to refer to it from within the inner for
e -
From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]>
To:
Sent: Sunday, May 04, 2008 4:22 AM
Subject: Re: how to simplify this script
As usual, hashes can be useful to simplify things. In the code suggestion
below I made use of the 'array of hashes' @numbers.
my $nu
From: "Richard Lee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc:
Sent: Sunday, May 04, 2008 3:17 AM
Subject: Re: how to simplify this script
I don't have the solution yet but shouldn't the answer be
1 6 7
and
4 5 10 only ?
it's printing out 1 2 3 as
[EMAIL PROTECTED] wrote:
In the script below, I have an array @datas with its elements
consisting of numbers like this :-
Out of the above list, I wish to generate a seperate array so that
among their elements, there should not be any 2 numbers that can
match and so the output should be :-
[EMAIL PROTECTED] wrote:
> Hi,
> In the script below, I have an array @datas with its elements consisting of
> numbers like this :-
>
> my @datas = (
> '1 2 3', '1 2 4', '1 2 7', '1 2 8', '1 2 9', '1 6 7',
> '1 7 12', '2 6 7', '4 5 10', '4 5 15'
> );
>
> Out of the above list, I wish to
[EMAIL PROTECTED] wrote:
> Hi,
> In the script below, I have an array @datas with its elements consisting of
> numbers like this :-
>
> my @datas = (
> '1 2 3', '1 2 4', '1 2 7', '1 2 8', '1 2 9', '1 6 7',
> '1 7 12', '2 6 7', '4 5 10', '4 5 15'
> );
>
> Out of the above list, I wish to
Hi,
In the script below, I have an array @datas with its elements consisting of
numbers like this :-
my @datas = (
'1 2 3', '1 2 4', '1 2 7', '1 2 8', '1 2 9', '1 6 7',
'1 7 12', '2 6 7', '4 5 10', '4 5 15'
);
Out of the above list, I wish to generate a seperate array so that among the
14 matches
Mail list logo