RE: need helps

RE: need helps

am 08.09.2011 18:00:43 von qichao.zhu

--_000_7F5C853DC6385D4695124751945402650CB4B260017CH1MPN1016 01_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi

There are two arrays

@a =3D [[a,b,c]...[d,e]...[f]...[g,h]...]
@b =3D [[...],[...,a,..,c,...,b...],[d],[e],[g...h]...]

How can I make an arithmetic to detected that.
if (element of array @a include by the element of array @b one time){
True;
Else {
False ;
}
************************************************************ ***************=
************* Note: If the reader of this message is not the intended recip=
ient, or an employee or agent responsible for delivering this message to th=
e intended recipient, you are hereby notified that any dissemination, distr=
ibution or copying of this communication is strictly prohibited. If you hav=
e received this communication in error, please notify us immediately by rep=
lying to the message and deleting it from your computer. Thank you. *******=
************************************************************ ***************=
******

--_000_7F5C853DC6385D4695124751945402650CB4B260017CH1MPN1016 01_--

Re: need helps

am 08.09.2011 18:16:15 von Shlomi Fish

Hi,

On Thu, 8 Sep 2011 16:00:43 +0000
"Zhu, Qichao" wrote:

> Hi
>=20
> There are two arrays
>=20
> @a =3D [[a,b,c]...[d,e]...[f]...[g,h]...]
> @b =3D [[...],[...,a,..,c,...,b...],[d],[e],[g...h]...]
>=20

I don't understand this notation. Are these arrays of arrays?

> How can I make an arithmetic to detected that.
> if (element of array @a include by the element of array @b one time){

Maybe read "perldoc -q contain".

Regards,

Shlomi Fish

> True;
> Else {
> False ;
> }
> ************************************************************ *************=
*************** Note: If the reader of this message is not the intended rec=
ipient, or an employee or agent responsible for delivering this message to =
the intended recipient, you are hereby notified that any dissemination, dis=
tribution or copying of this communication is strictly prohibited. If you h=
ave received this communication in error, please notify us immediately by r=
eplying to the message and deleting it from your computer. Thank you. *****=
************************************************************ ***************=
********



--=20
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
Apple Inc. is Evil - http://www.shlomifish.org/open-source/anti/apple/

:)-<
+--
â€=94 Moses the Smiley by Shlomi Fish

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: need helps

am 09.09.2011 18:40:57 von Mike McClain

On Thu, Sep 08, 2011 at 04:00:43PM +0000, Zhu, Qichao wrote:
> There are two arrays
> @a = [[a,b,c]...[d,e]...[f]...[g,h]...]
> @b = [[...],[...,a,..,c,...,b...],[d],[e],[g...h]...]
>
> How can I make an arithmetic to detected that.
> if (element of array @a include by the element of array @b one time){
> True;
> Else {
> False ;
> }

The Perl FAQ has an article on comparing arrays by converting
to hashes. In your case you need to go one step further and
convert each sub array with more than one element to a string
first using some character that is not in the data set as a
separator so the conversion goes both ways.
So that @a_new = (qw/ a\b\c ... d\e ... f ... g\h ... /);
HTH,
Mike
--
Satisfied user of Linux since 1997.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/