Fri Aug 12 05:56: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-12 | 2022-07-12 | 2022-06-12 | 2022-05-12 | 2022-04-12 | 2022-03-12 | 2022-02-12 | 2022-01-12 | 2021-12-12 | 2021-11-12 | 2021-10-12 | 2021-09-12 | 2021-08-12 | 2021-07-12 | 2021-06-12 | 2021-05-12 | 2021-04-12 | 2021-03-12 | 2021-02-12 | 2021-01-12 | 2020-12-12 | 2020-11-12 | 2020-10-12 | 2020-09-12 | 2020-08-12 | 2020-07-12 | 2020-06-12 | 2020-05-12 | 2020-04-12 | 2020-03-12 | 2020-02-12 | 2020-01-12 | 2019-12-12 | 2019-11-12 | 2019-10-12 | 2019-09-12 | 2019-08-12 | 2019-07-12 | 2019-06-12 | 2019-05-12 | 2019-04-12 | 2019-03-12 | 2019-02-12 | 2019-01-12 | 2018-12-12 | 2018-11-12 | 2018-10-12 | 2018-09-12 | 2018-08-12 | 2018-07-12 | 2018-06-12 | 2018-05-12 | 2018-04-12 | 2018-03-12 | 2018-02-12 | 2018-01-12 | 2017-12-12 | 2017-11-12 | 2017-10-12 | 2017-09-12 | 2017-08-12 | 2017-07-12 | 2017-06-12 | 2017-05-12 | 2017-04-12 | 2017-03-12 | 2017-02-12 | 2017-01-12 | 2016-12-12 | 2016-11-12 | 2016-10-12 | 2016-09-12 | 2016-08-12 | 2016-07-12 | 2016-06-12 | 2016-05-12 | 2016-04-12 | 2016-03-12 | 2016-02-12 | 2016-01-12 | 2015-12-12 | 2015-11-12 | 2015-10-12 | 2015-09-12 | 2015-08-12 | 2015-07-12 | 2015-06-12 | 2015-05-12 | 2015-04-12 | 2015-03-12 | 2015-02-12 | 2015-01-12 | 2014-12-12 | 2014-11-12 | 2014-10-12 | 2014-09-12 | 2014-08-12 | 2014-07-12 | 2014-06-12 | 2014-05-12 | 2014-04-12 | 2014-03-12 | 2014-02-12 | 2014-01-12 | 2013-12-12 | 2013-11-12 | 2013-10-12 | 2013-09-12 | 2013-08-12 | 2013-07-12 | 2013-06-12 | 2013-05-12 | 2013-04-12 | 2013-03-12 | 2013-02-12 | 2013-01-12 | 2012-12-12 | 2012-11-12 | 2012-10-12 | 2012-09-12 | 2012-08-12 | 2012-07-12 | 2012-06-12 | 2012-05-12 | 2012-04-12 | 2012-03-12 | 2012-02-12 | 2012-01-12 | 2011-12-12 | 2011-11-12 | 2011-10-12 | 2011-09-12 | 2011-08-12 | 2011-07-12 | 2011-06-12 | 2011-05-12 | 2011-04-12 | 2011-03-12 | 2011-02-12 | 2011-01-12 | 2010-12-12 | 2010-11-12 | 2010-10-12 | 2010-09-12 | 2010-08-12 | 2010-07-12 | 2010-06-12 | 2010-05-12 | 2010-04-12 | 2010-03-12 | 2010-02-12 | 2010-01-12 | 2009-12-12 | 2009-11-12 | 2009-10-12 | 2009-09-12 | 2009-08-12 | 2009-07-12 | 2009-06-12 | 2009-05-12 | 2009-04-12 | 2009-03-12 | 2009-02-12 | 2009-01-12 | 2008-12-12 | 2008-11-12 | 2008-10-12 | 2008-09-12 | 2008-08-12 | 2008-07-12 | 2008-06-12 | 2008-05-12 | 2008-04-12 | 2008-03-12 | 2008-02-12 | 2008-01-12 | 2007-12-12 | 2007-11-12 | 2007-10-12 | 2007-09-12 | 2007-08-12 | 2007-07-12 | 2007-06-12 | 2007-05-12 | 2007-04-12 | 2007-03-12 | 2007-02-12 | 2007-01-12 | 2006-12-12 | 2006-11-12 | 2006-10-12 | 2006-09-12 | 2006-08-12 | 2006-07-12 | 2006-06-12 | 2006-05-12 | 2006-04-12 | 2006-03-12 | 2006-02-12 | 2006-01-12 | 2005-12-12 | 2005-11-12 | 2005-10-12 | 2005-09-12 | 2005-08-12 | 2005-07-12 | 2005-06-12 | 2005-05-12 | 2005-04-12 | 2005-03-12 | 2005-02-12 | 2005-01-12 | 2004-12-12 | 2004-11-12 | 2004-10-12 | 2004-09-12 | 2004-08-12 | 2004-07-12 | 2004-06-12 | 2004-05-12 | 2004-04-12 | 2004-03-12 | 2004-02-12 | 2004-01-12 | 2003-12-12 | 2003-11-12 | 2003-10-12 | 2003-09-12 | 2003-08-12 | 2003-07-12 | 2003-06-12 | 2003-05-12 | 2003-04-12 | 2003-03-12 | 2003-02-12 | 2003-01-12 | 2002-12-12 | 2002-11-12 | 2002-10-12 | 2002-09-12 | 2002-08-12 | 2002-07-12 | 2002-06-12 | 2002-05-12 | 2002-04-12 | 2002-03-12 | 2002-02-12 | 2002-01-12 | 2001-12-12 | 2001-11-12 | 2001-10-12 | 2001-09-12 | 2001-08-12 | 2001-07-12 | 2001-06-12 | 2001-05-12 | 2001-04-12 | 2001-03-12 | 2001-02-12 | 2001-01-12 | 2000-12-12 | 2000-11-12 | 2000-10-12 | 2000-09-12 | 2000-08-12 | 2000-07-12 | 2000-06-12 | 2000-05-12 | 2000-04-12 | 2000-03-12 | 2000-02-12 | 2000-01-12 | 1999-12-12

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:48:28 2011
Return-Path:
X-Original-To: archive-at-mrbrklyn.com
Delivered-To: archive-at-mrbrklyn.com
Received: by www2.mrbrklyn.com (Postfix)
id E6712FF99F; Wed, 14 Dec 2011 22:48:27 -0500 (EST)
Delivered-To: hangout-outgoing-at-www2.mrbrklyn.com
Received: by www2.mrbrklyn.com (Postfix, from userid 28)
id D5435FFEAA; Wed, 14 Dec 2011 22:48:27 -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 7C58AFFAD8
for ; Wed, 14 Dec 2011 22:48:27 -0500 (EST)
Received: by qcsf15 with SMTP id f15so1160455qcs.17
for ; Wed, 14 Dec 2011 19:50:07 -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=zCPcGCPN2HHkkCeN9j1H7WNbSukPpKRnYVppUSEIsc8=;
b=D1bM3aDT1ayjg8wptZ4x3o3FoBOTcWVUgH8oCiDZrmHrgINRSzRlpBbINXSQ2ACANv
Q7nb6+WfJRzuXcjWL2RSHYP5Dq2vEZoAbwRSva3gfE4VreZWEwU5hs1TK0H3gcpIwpyd
b7poDAOScwY7A9LFDwG76wvO3eqoZCBdHSDEo=
Received: by 10.224.32.20 with SMTP id a20mr2523530qad.61.1323921007405;
Wed, 14 Dec 2011 19:50:07 -0800 (PST)
Received: from [10.0.0.24] (www2.mrbrklyn.com. [96.57.23.82])
by mx.google.com with ESMTPS id dk9sm10158230qab.0.2011.12.14.19.50.06
(version=SSLv3 cipher=OTHER);
Wed, 14 Dec 2011 19:50:07 -0800 (PST)
Message-ID: <4EE96E6D.1050205-at-gmail.com>
Date: Wed, 14 Dec 2011 22:50:05 -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> <4EE96DA4.2050105-at-gmail.com>
In-Reply-To: <4EE96DA4.2050105-at-gmail.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 10:46 PM, Ruben Safir wrote:
> 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 );
>
>


Also see


perldoc -f opendir


opendir DIRHANDLE,EXPR
Opens a directory named EXPR for processing by "readdir",
"telldir", "seekdir", "rewinddir", and "closedir". Returns
true if successful. DIRHANDLE may be an expression
whose value
can be used as an indirect dirhandle, usually the real
dirhandle name. If DIRHANDLE is an undefined scalar
variable
(or array or hash element), the variable is assigned a
reference to a new anonymous dirhandle. DIRHANDLEs have
their
own namespace separate from FILEHANDLEs.

See example at "readdir".

  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!