Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use fatal; open( FH, "<test.txt" ); open( FH2, ">test.txt" ); while ( <FH> ) { s/^(\s+)//g; print FH2 $_; } close FH; close FH2;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Removing leading whitespace from a file?
by atcroft (Abbot) on Jul 09, 2002 at 04:34 UTC | |
|
Re: Removing leading whitespace from a file?
by Zaxo (Archbishop) on Jul 09, 2002 at 04:34 UTC | |
|
Re: Removing leading whitespace from a file?
by greenFox (Vicar) on Jul 09, 2002 at 05:11 UTC | |
|
Re: Removing leading whitespace from a file?
by Juerd (Abbot) on Jul 09, 2002 at 05:44 UTC | |
|
Re: Removing leading whitespace from a file?
by abstracts (Hermit) on Jul 09, 2002 at 04:40 UTC | |
|
Re: Removing leading whitespace from a file?
by Mr. Muskrat (Canon) on Jul 09, 2002 at 04:41 UTC | |
|
Re: Removing leading whitespace from a file?
by runrig (Abbot) on Jul 09, 2002 at 04:34 UTC |