Fri Nov 22 01:54:32 2024
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

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

Key: Value:

Key: Value:

MESSAGE
DATE 2011-12-14
FROM Ruben Safir
SUBJECT Re: [NYLXS - HANGOUT] A simple perl script
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!