From owner-freebsd-questions@FreeBSD.ORG Thu Apr 7 17:24:19 2011 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 30512106566C for ; Thu, 7 Apr 2011 17:24:19 +0000 (UTC) (envelope-from prvs=0071221578=johnl@iecc.com) Received: from gal.iecc.com (gal.iecc.com [64.57.183.53]) by mx1.freebsd.org (Postfix) with ESMTP id F04A38FC1E for ; Thu, 7 Apr 2011 17:24:18 +0000 (UTC) Received: (qmail 32914 invoked from network); 7 Apr 2011 16:57:37 -0000 Received: from mail1.iecc.com (64.57.183.56) by mail1.iecc.com with QMQP; 7 Apr 2011 16:57:37 -0000 Date: 7 Apr 2011 16:57:15 -0000 Message-ID: <20110407165715.90743.qmail@joyce.lan> From: "John Levine" To: freebsd-questions@freebsd.org In-Reply-To: Organization: X-Headerized: yes Mime-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit Cc: Subject: Re: Merging CIDR lists 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: Thu, 07 Apr 2011 17:24:19 -0000 In article you write: >Does anyone have a convenient way to merge a list of CIDR netblocks? Using Net::CIDR or Net::CIDR::Lite, both of which are in the ports, this script will do it: ----- snip ----- use Net::CIDR; print join(' ',Net::CIDR::cidradd(@ARGV)) . "\n"; ----- snip -----