From owner-freebsd-questions@FreeBSD.ORG Fri Apr 16 13:59:06 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 36B6C16A4CE for ; Fri, 16 Apr 2004 13:59:06 -0700 (PDT) Received: from sv19.dfserver19.com (sv19.dfserver19.com [207.44.192.91]) by mx1.FreeBSD.org (Postfix) with ESMTP id E82FB43D55 for ; Fri, 16 Apr 2004 13:59:03 -0700 (PDT) (envelope-from shaun@insipidity.co.uk) Received: from host217-42-19-218.range217-42.btcentralplus.com ([217.42.19.218] helo=[192.168.1.40]) by sv19.dfserver19.com with asmtp (Exim 4.24) id 1BEaQS-0006F8-4t; Fri, 16 Apr 2004 21:58:42 +0100 From: Shaun Friedle To: Barbish3@adelphia.net In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-15 Message-Id: <1082149145.280.9.camel@Shaun> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 16 Apr 2004 21:59:05 +0100 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sv19.dfserver19.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - insipidity.co.uk cc: freebsd-questions@FreeBSD.ORG Subject: Re: perl script help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 20:59:06 -0000 On Fri, 2004-04-16 at 17:05, JJB wrote: > I know nothing about writing perl scripts. >=20 > Can somebody show me how to add the : in the output=20 > of the date command in the simple following script? Try this: #!/usr/bin/perl $timezone=3D`date +\%z`; #Gets the offset in $timezone $timezone =3D~ s/(\+[0-9][0-9])/$1:/; #Replaces =B1NN with =B1NN: print $timezone; #Prints $timezone --=20 Shaun Friedle shaun@insipidity.co.uk