From owner-freebsd-questions@FreeBSD.ORG Tue May 12 18:05:28 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44C051065673 for ; Tue, 12 May 2009 18:05:28 +0000 (UTC) (envelope-from tfcheng@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.29]) by mx1.freebsd.org (Postfix) with ESMTP id 03C9B8FC1C for ; Tue, 12 May 2009 18:05:27 +0000 (UTC) (envelope-from tfcheng@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so73086yxb.13 for ; Tue, 12 May 2009 11:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=ZV6olB6CrC94l7/sLV0PQ0CsuAIcECTNzvUfSzEcGR0=; b=jjKvwREC7NZYBmRD8Z19r3zLGJ5tiy+dq34t0bRs/t5DSHdJlwZymKiWRk44Ez/D6I g//Vu4LLcbS6SXIPDe7/cSfFXKkGIqV/cLnNXApETcHKi/N7lCMMKXGmPZO/yInENsuv PAOJK0YmIhQZhKNdBcDtnoux28FKs7DY6gp5Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=ibRaL5EA2V1FCcBXPj63PRx3bThr0V9Rsk2u7glYG3jvFZygUAFD5KtlUVfiMrZM6L HDLi0U2AQfc2xz5GLhAisJFvuXfKhIKgGBBMiEZdah6fwBuWWvfQ08+BIlRc/qX67Hjm k66Ls3vdtOhUDiIZKbSqdy437inRvToUkYEU8= MIME-Version: 1.0 Received: by 10.90.100.11 with SMTP id x11mr3992211agb.71.1242151527401; Tue, 12 May 2009 11:05:27 -0700 (PDT) Date: Tue, 12 May 2009 14:05:27 -0400 Message-ID: From: Tsu-Fan Cheng To: FreeBSD Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: How to compare two arrays by using perl script? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2009 18:05:28 -0000 Hi ALL, This is not a fbsd-related but a programming question. But this is the only forum I join, I give it a try. I have two arrays, each has two columns (so its A1, B1 and A2, B2). As are the positions while Bs are the values. I need to get the ratio between B1 and B2 if their As are the same or close to each other within a certain distance. This sounds pretty straight forward but I am not an experienced programmer. Can anybody show me how to do it by perl? thank you!! TFC