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 DeltronicsIn reply to Re: regex basics
by CountZero
in thread regex basics
by jott19
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |