bluethundr has asked for the wisdom of the Perl Monks concerning the following question:
But what this code does is thankfully backup the original file, but"clobber" the contents of the file it's supposed to be editing. The output is completely blank, and I don't understand why.#!/usr/bin/perl use strict; use warnings; $^I = ".old"; while (<>) { if (/^#!/) { $_ .= " ## Copyright (C) 2008 Yours Truly\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: clobbering output
by kyle (Abbot) on Feb 24, 2008 at 20:33 UTC | |
by bluethundr (Pilgrim) on Feb 25, 2008 at 06:35 UTC | |
by CountZero (Bishop) on Feb 25, 2008 at 09:41 UTC | |
by kyle (Abbot) on Feb 25, 2008 at 15:00 UTC | |
|
Re: clobbering output
by CountZero (Bishop) on Feb 24, 2008 at 21:03 UTC | |
by QM (Parson) on Feb 24, 2008 at 22:43 UTC | |
|
Re: clobbering output
by ikegami (Patriarch) on Feb 24, 2008 at 23:59 UTC | |
by Anonymous Monk on Feb 25, 2008 at 06:47 UTC | |
|
Re: clobbering output
by olus (Curate) on Feb 24, 2008 at 21:06 UTC | |
by ysth (Canon) on Feb 24, 2008 at 21:50 UTC | |
|
Re: clobbering output
by chrism01 (Friar) on Feb 25, 2008 at 07:20 UTC | |
|
Re: clobbering output
by apl (Monsignor) on Feb 25, 2008 at 10:58 UTC |