bluethundr has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; $^I = ".bak"; my %do_these; foreach (@ARGV) { $do_these{$_} = 1; } while (<>) { if (/^## Copyright/) { delete $do_these{$ARGV}; } } @ARGV = sort keys %do_these; while (<>) { if (/^#!/) { $_ .= "## Copyright (C) 2008 by C'est mois\n"; } print; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Prorgam obliterates contents of files
by merlyn (Sage) on Dec 28, 2008 at 17:21 UTC | |
by spx2 (Deacon) on Dec 29, 2008 at 09:34 UTC | |
by Corion (Patriarch) on Dec 29, 2008 at 09:51 UTC | |
by ikegami (Patriarch) on Dec 29, 2008 at 10:27 UTC | |
by xhunter (Sexton) on Dec 29, 2008 at 16:33 UTC |