in reply to regex basics
Strange (or not) as it may be, "perl" is not a keyword within Perl! You are actually mixing up the Perl "one liner" style and proper scripting style.
Script:
use Modern::Perl qw /2014/; my $iniprod = 'php.ini-production'; my $ininocm = 'php.ini-nocomments'; open my $IN, '<', $iniprod or die "Could not open $iniprod for readin +g: $!"; open my $OUT, '>', $ininocm or die "Could not open $ininocm for writin +g: $!"; while (<$IN>) { print $OUT $_ unless /;\s+/ ; } close $IN or die "Error closing $iniprod: $!"; close $OUT or die "Error closing $ininocm: $!";
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial Deltronics
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex basics
by AnomalousMonk (Archbishop) on Jan 31, 2015 at 16:43 UTC | |
by CountZero (Bishop) on Feb 02, 2015 at 08:48 UTC | |
|
Re^2: regex basics
by jott19 (Initiate) on Feb 01, 2015 at 01:36 UTC | |
by poj (Abbot) on Feb 01, 2015 at 13:29 UTC | |
by jott19 (Initiate) on Feb 01, 2015 at 21:51 UTC | |
by CountZero (Bishop) on Feb 02, 2015 at 13:12 UTC | |
by jott19 (Initiate) on Feb 02, 2015 at 14:01 UTC | |
by choroba (Cardinal) on Feb 02, 2015 at 15:28 UTC | |
by AnomalousMonk (Archbishop) on Feb 02, 2015 at 19:13 UTC | |
by Anonymous Monk on Feb 04, 2015 at 07:18 UTC |