Fri Aug 19 21:57:23 2022
EVENTS
 FREE
SOFTWARE
INSTITUTE

POLITICS
JOBS
MEMBERS'
CORNER

MAILING
LIST

NYLXS Mailing Lists and Archives
NYLXS Members have a lot to say and share but we don't keep many secrets. Join the Hangout Mailing List and say your peice.

DATE 2011-12-01

HANGOUT

2022-08-19 | 2022-07-19 | 2022-06-19 | 2022-05-19 | 2022-04-19 | 2022-03-19 | 2022-02-19 | 2022-01-19 | 2021-12-19 | 2021-11-19 | 2021-10-19 | 2021-09-19 | 2021-08-19 | 2021-07-19 | 2021-06-19 | 2021-05-19 | 2021-04-19 | 2021-03-19 | 2021-02-19 | 2021-01-19 | 2020-12-19 | 2020-11-19 | 2020-10-19 | 2020-09-19 | 2020-08-19 | 2020-07-19 | 2020-06-19 | 2020-05-19 | 2020-04-19 | 2020-03-19 | 2020-02-19 | 2020-01-19 | 2019-12-19 | 2019-11-19 | 2019-10-19 | 2019-09-19 | 2019-08-19 | 2019-07-19 | 2019-06-19 | 2019-05-19 | 2019-04-19 | 2019-03-19 | 2019-02-19 | 2019-01-19 | 2018-12-19 | 2018-11-19 | 2018-10-19 | 2018-09-19 | 2018-08-19 | 2018-07-19 | 2018-06-19 | 2018-05-19 | 2018-04-19 | 2018-03-19 | 2018-02-19 | 2018-01-19 | 2017-12-19 | 2017-11-19 | 2017-10-19 | 2017-09-19 | 2017-08-19 | 2017-07-19 | 2017-06-19 | 2017-05-19 | 2017-04-19 | 2017-03-19 | 2017-02-19 | 2017-01-19 | 2016-12-19 | 2016-11-19 | 2016-10-19 | 2016-09-19 | 2016-08-19 | 2016-07-19 | 2016-06-19 | 2016-05-19 | 2016-04-19 | 2016-03-19 | 2016-02-19 | 2016-01-19 | 2015-12-19 | 2015-11-19 | 2015-10-19 | 2015-09-19 | 2015-08-19 | 2015-07-19 | 2015-06-19 | 2015-05-19 | 2015-04-19 | 2015-03-19 | 2015-02-19 | 2015-01-19 | 2014-12-19 | 2014-11-19 | 2014-10-19 | 2014-09-19 | 2014-08-19 | 2014-07-19 | 2014-06-19 | 2014-05-19 | 2014-04-19 | 2014-03-19 | 2014-02-19 | 2014-01-19 | 2013-12-19 | 2013-11-19 | 2013-10-19 | 2013-09-19 | 2013-08-19 | 2013-07-19 | 2013-06-19 | 2013-05-19 | 2013-04-19 | 2013-03-19 | 2013-02-19 | 2013-01-19 | 2012-12-19 | 2012-11-19 | 2012-10-19 | 2012-09-19 | 2012-08-19 | 2012-07-19 | 2012-06-19 | 2012-05-19 | 2012-04-19 | 2012-03-19 | 2012-02-19 | 2012-01-19 | 2011-12-19 | 2011-11-19 | 2011-10-19 | 2011-09-19 | 2011-08-19 | 2011-07-19 | 2011-06-19 | 2011-05-19 | 2011-04-19 | 2011-03-19 | 2011-02-19 | 2011-01-19 | 2010-12-19 | 2010-11-19 | 2010-10-19 | 2010-09-19 | 2010-08-19 | 2010-07-19 | 2010-06-19 | 2010-05-19 | 2010-04-19 | 2010-03-19 | 2010-02-19 | 2010-01-19 | 2009-12-19 | 2009-11-19 | 2009-10-19 | 2009-09-19 | 2009-08-19 | 2009-07-19 | 2009-06-19 | 2009-05-19 | 2009-04-19 | 2009-03-19 | 2009-02-19 | 2009-01-19 | 2008-12-19 | 2008-11-19 | 2008-10-19 | 2008-09-19 | 2008-08-19 | 2008-07-19 | 2008-06-19 | 2008-05-19 | 2008-04-19 | 2008-03-19 | 2008-02-19 | 2008-01-19 | 2007-12-19 | 2007-11-19 | 2007-10-19 | 2007-09-19 | 2007-08-19 | 2007-07-19 | 2007-06-19 | 2007-05-19 | 2007-04-19 | 2007-03-19 | 2007-02-19 | 2007-01-19 | 2006-12-19 | 2006-11-19 | 2006-10-19 | 2006-09-19 | 2006-08-19 | 2006-07-19 | 2006-06-19 | 2006-05-19 | 2006-04-19 | 2006-03-19 | 2006-02-19 | 2006-01-19 | 2005-12-19 | 2005-11-19 | 2005-10-19 | 2005-09-19 | 2005-08-19 | 2005-07-19 | 2005-06-19 | 2005-05-19 | 2005-04-19 | 2005-03-19 | 2005-02-19 | 2005-01-19 | 2004-12-19 | 2004-11-19 | 2004-10-19 | 2004-09-19 | 2004-08-19 | 2004-07-19 | 2004-06-19 | 2004-05-19 | 2004-04-19 | 2004-03-19 | 2004-02-19 | 2004-01-19 | 2003-12-19 | 2003-11-19 | 2003-10-19 | 2003-09-19 | 2003-08-19 | 2003-07-19 | 2003-06-19 | 2003-05-19 | 2003-04-19 | 2003-03-19 | 2003-02-19 | 2003-01-19 | 2002-12-19 | 2002-11-19 | 2002-10-19 | 2002-09-19 | 2002-08-19 | 2002-07-19 | 2002-06-19 | 2002-05-19 | 2002-04-19 | 2002-03-19 | 2002-02-19 | 2002-01-19 | 2001-12-19 | 2001-11-19 | 2001-10-19 | 2001-09-19 | 2001-08-19 | 2001-07-19 | 2001-06-19 | 2001-05-19 | 2001-04-19 | 2001-03-19 | 2001-02-19 | 2001-01-19 | 2000-12-19 | 2000-11-19 | 2000-10-19 | 2000-09-19 | 2000-08-19 | 2000-07-19 | 2000-06-19 | 2000-05-19 | 2000-04-19 | 2000-03-19 | 2000-02-19 | 2000-01-19 | 1999-12-19

Key: Value:

Key: Value:

MESSAGE
DATE 2011-12-14
FROM Ruben Safir
SUBJECT Re: [NYLXS - HANGOUT] A simple perl script
From owner-hangout-outgoing-at-mrbrklyn.com Wed Dec 14 22:45:09 2011
Return-Path:
X-Original-To: archive-at-mrbrklyn.com
Delivered-To: archive-at-mrbrklyn.com
Received: by www2.mrbrklyn.com (Postfix)
id 2298EC9C3F; Wed, 14 Dec 2011 22:45:09 -0500 (EST)
Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com
Received: by www2.mrbrklyn.com (Postfix, from userid 28)
id 11A33FF99F; Wed, 14 Dec 2011 22:45:08 -0500 (EST)
Delivered-To: hangout-at-mrbrklyn.com
Received: from mail-qy0-f172.google.com (mail-qy0-f172.google.com [209.85.216.172])
by www2.mrbrklyn.com (Postfix) with ESMTP id 1EECEC9C3F
for ; Wed, 14 Dec 2011 22:45:07 -0500 (EST)
Received: by qcsf15 with SMTP id f15so1159017qcs.17
for ; Wed, 14 Dec 2011 19:46:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=message-id:date:from:user-agent:mime-version:to:cc:subject
:references:in-reply-to:content-type:content-transfer-encoding;
bh=Af6nGW/VEczFnXPfFCbTHwlt25e1r1xs9OLsG7Y8Myg=;
b=gWMFqkbftPyjPik5rPETvtNbtGujTF+3WO3BDWkDMK9PqgSK7eithNACMAapKadKnu
RqVigsFm/9b/bG1MBvFVmdz3A61ACKI7GqI3aHPozjox2CSOzUJX25TgUA0gOTgLXj4G
w4pkJ4JZ8E6IgPSRhC8gc/HdQn1QI5Gio5NVQ=
Received: by 10.224.199.134 with SMTP id es6mr2793518qab.2.1323920807536;
Wed, 14 Dec 2011 19:46:47 -0800 (PST)
Received: from [10.0.0.24] (www2.mrbrklyn.com. [96.57.23.82])
by mx.google.com with ESMTPS id ed2sm10089860qab.15.2011.12.14.19.46.46
(version=SSLv3 cipher=OTHER);
Wed, 14 Dec 2011 19:46:46 -0800 (PST)
Message-ID: <4EE96DA4.2050105-at-gmail.com>
Date: Wed, 14 Dec 2011 22:46:44 -0500
From: Ruben Safir
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111101 SUSE/3.1.16 Thunderbird/3.1.16
MIME-Version: 1.0
To: hangout-at-mrbrklyn.com
CC: Elfen Magix
Subject: Re: [NYLXS - HANGOUT] A simple perl script
References: <20111214070833.GA11058-at-panix.com> <1323908859.93530.YahooMailNeo-at-web38006.mail.mud.yahoo.com>
In-Reply-To: <1323908859.93530.YahooMailNeo-at-web38006.mail.mud.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Sender: owner-hangout-at-mrbrklyn.com
Precedence: bulk
Reply-To: hangout-at-mrbrklyn.com

On 12/14/2011 07:27 PM, Elfen Magix wrote:
> I need a simple thing that goes through a file to find "Chapter [and a number]". Then it must increment that number by 1 and resave the file without altering nothing else.
>
> I know I've seen this, and even wrote one years ago myself, but I cant for the life of me remember how!
>
> Thanks.
>
How can I copy a file?
(contributed by brian d foy)

Use the "File::Copy" module. It comes with Perl and can do a
true copy
across file systems, and it does its magic in a portable fashion.

use File::Copy;

copy( $original, $new_copy ) or die "Copy failed: $!";

If you can't use "File::Copy", you'll have to do the work yourself:
open the original file, open the destination file, then print to the
destination file as you read the original. You also have to
remember to
copy the permissions, owner, and group to the new file.


perlfaq5


How do I traverse a directory tree?
(contributed by brian d foy)

The "File::Find" module, which comes with Perl, does all of the hard
work to traverse a directory structure. It comes with Perl. You
simply
call the "find" subroutine with a callback subroutine and the
directories you want to traverse:

use File::Find;

find( \&wanted, -at-directories );

sub wanted {
# full path in $File::Find::name
# just filename in $_
... do whatever you want to do ...
}

The "File::Find::Closures", which you can download from CPAN,
provides
many ready-to-use subroutines that you can use with "File::Find".

The "File::Finder", which you can download from CPAN, can help you
create the callback subroutine using something closer to the
syntax of
the "find" command-line utility:

use File::Find;
use File::Finder;

my $deep_dirs =
File::Finder->depth->type('d')->ls->exec('rmdir','{}');

find( $deep_dirs->as_options, -at-places );

The "File::Find::Rule" module, which you can download from CPAN,
has a
similar interface, but does the traversal for you too:

use File::Find::Rule;

my -at-files = File::Find::Rule->file()
->name(
'*.pm' )
->in(
-at-INC );


  1. 2011-12-01 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Ron Call me
  2. 2011-12-01 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Charter
  3. 2011-12-01 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Ten Reasons - Nothing has changed
  4. 2011-12-03 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] [conspire] Lessons from CarrierIQ
  5. 2011-12-03 einker <eminker-at-gmail.com> Re: [NYLXS - HANGOUT] [conspire] Lessons from CarrierIQ
  6. 2011-12-03 einker <eminker-at-gmail.com> Re: [NYLXS - HANGOUT] [conspire] Lessons from CarrierIQ
  7. 2011-12-05 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Lessons from CarrierIQ (was: Mashable - The Social Media Guide)
  8. 2011-12-05 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Call me also please
  9. 2011-12-05 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] [nylug-talk] Tuesday 6 December 2011 NYLUG: General Meeting
  10. 2011-12-05 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] NYLUG tomorrow
  11. 2011-12-06 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Party like a Pirate!!
  12. 2011-12-07 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Shout Out!!
  13. 2011-12-07 Michael L Richardson <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Shout Out!!
  14. 2011-12-07 Michael L Richardson <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Shout Out!!
  15. 2011-12-07 Ruben Safir <ceo.brooklyn-at-gmail.com> Re: [NYLXS - HANGOUT] Shout Out!!
  16. 2011-12-07 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Pearl Harbor
  17. 2011-12-07 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Pearl Harbor
  18. 2011-12-07 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Pearl Harbor
  19. 2011-12-07 Robert Menes <viewtiful.icchan-at-gmail.com> Re: [NYLXS - HANGOUT] Pearl Harbor
  20. 2011-12-07 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Pearl Harbor
  21. 2011-12-07 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Pearl Harbor
  22. 2011-12-07 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Pearl Harbor
  23. 2011-12-07 Robert Menes <viewtiful.icchan-at-gmail.com> Re: [NYLXS - HANGOUT] Pearl Harbor
  24. 2011-12-08 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] New Linux Tends
  25. 2011-12-08 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Eh
  26. 2011-12-09 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Linux Pinup girls
  27. 2011-12-09 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Security Updates for older suse dstros
  28. 2011-12-09 Ruben Safir <ceo.brooklyn-at-gmail.com> Subject: [NYLXS - HANGOUT] 3d Printing
  29. 2011-12-09 einker <eminker-at-gmail.com> Re: [NYLXS - HANGOUT] Eh
  30. 2011-12-09 einker <eminker-at-gmail.com> Re: [NYLXS - HANGOUT] Eh
  31. 2011-12-09 Ruben Safir <ceo.brooklyn-at-gmail.com> Re: [NYLXS - HANGOUT] Eh
  32. 2011-12-09 Ruben Safir <ceo.brooklyn-at-gmail.com> Re: [NYLXS - HANGOUT] Eh
  33. 2011-12-09 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] GNU in Medicine
  34. 2011-12-14 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Linux Job Market
  35. 2011-12-14 Redpill <redpill-at-rcn.com> Re: [NYLXS - HANGOUT] Linux Job Market
  36. 2011-12-14 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Linux Job Market
  37. 2011-12-14 Elfen Magix <elfen_magix-at-yahoo.com> Subject: [NYLXS - HANGOUT] A simple perl script
  38. 2011-12-14 Ruben Safir <ceo.brooklyn-at-gmail.com> Re: [NYLXS - HANGOUT] A simple perl script
  39. 2011-12-14 Ruben Safir <ceo.brooklyn-at-gmail.com> Re: [NYLXS - HANGOUT] A simple perl script
  40. 2011-12-14 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] A simple perl script
  41. 2011-12-14 Kevin Mark <kevin.mark-at-verizon.net> Re: [NYLXS - HANGOUT] A simple perl script
  42. 2011-12-15 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] A simple perl script
  43. 2011-12-15 Kevin Mark <kevin.mark-at-verizon.net> Re: [NYLXS - HANGOUT] A simple perl script
  44. 2011-12-15 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] [nylug-talk] collaboration platform for the charter
  45. 2011-12-15 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] A simple perl script
  46. 2011-12-15 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Ip Wars
  47. 2011-12-15 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] IP Wars II
  48. 2011-12-15 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] IP Wars III
  49. 2011-12-15 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Yvette Clark Phone Number
  50. 2011-12-15 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Fight Censorship
  51. 2011-12-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Get Rid of the Pigs Now
  52. 2011-12-16 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Get Rid of the Pigs Now
  53. 2011-12-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Stop it ALREADY!!
  54. 2011-12-16 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Get Rid of the Pigs Now
  55. 2011-12-16 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Get Rid of the Pigs Now
  56. 2011-12-16 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] What a Pig sounds like when it talks
  57. 2011-12-17 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Fwd: Re: [nylug-talk] What a Pig sounds like when it talks
  58. 2011-12-17 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Fwd: SOPA still scheduled for vote
  59. 2011-12-17 Elfen Magix <elfen_magix-at-yahoo.com> Re: [NYLXS - HANGOUT] Fwd: Re: [nylug-talk] What a Pig sounds like when it talks
  60. 2011-12-17 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] SOPA - The JOB DESTROYER
  61. 2011-12-19 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Reckless Congress
  62. 2011-12-19 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Death of Marriage
  63. 2011-12-22 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Jan 17th NYLUG meeting
  64. 2011-12-22 einker <eminker-at-gmail.com> Re: [NYLXS - HANGOUT] Jan 17th NYLUG meeting
  65. 2011-12-23 Ron Guerin <ron-at-vnetworx.net> Subject: [NYLXS - HANGOUT] Left-Right Alliance against SOPA
  66. 2011-12-24 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Tough Day at the Office
  67. 2011-12-25 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Left-Right Alliance against SOPA
  68. 2011-12-25 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Left-Right Alliance against SOPA
  69. 2011-12-26 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Maybe it was SOPA
  70. 2011-12-26 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Maybe it was SOPA
  71. 2011-12-26 Ruben Safir <ceo.brooklyn-at-gmail.com> Re: [NYLXS - HANGOUT] Maybe it was SOPA
  72. 2011-12-27 Ruben Safir <mrbrklyn-at-panix.com> Subject: [NYLXS - HANGOUT] Tech Jobs in Brooklyn
  73. 2011-12-29 einker <eminker-at-gmail.com> Subject: [NYLXS - HANGOUT] Linux Hardware Vendor
  74. 2011-12-29 Ruben Safir <mrbrklyn-at-panix.com> Re: [NYLXS - HANGOUT] Linux Hardware Vendor
  75. 2011-12-31 Michael L Richardson <mlr52-at-michaellrichardson.com> Subject: [NYLXS - HANGOUT] Is this worth a try?
  76. 2011-12-31 Ronny <ronny.coder-at-gmail.com> Re: [NYLXS - HANGOUT] Is this worth a try?
  77. 2011-12-31 Michael L Richardson <mlr52-at-michaellrichardson.com> Re: [NYLXS - HANGOUT] Is this worth a try?

NYLXS are Do'ers and the first step of Doing is Joining! Join NYLXS and make a difference in your community today!