in reply to Re^2: Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.
in thread Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.
Done some changes now $lines[0] working fine.. thanks for your help /K creating a problem.. But still issue with $line1
$lines[0] =~ s~/(4947000219)/$1+$n/~e;Working fine
}e;$lines[1] =~ 's{:20140924105028(\d+)}'{ my $tp = Time::Piece->strptime($1, DATE_FORMAT); ($tp+ONE_MINUTE*2*$n)->strftime(DATE_FORMAT);
Error message
String found where operator expected at ./prog.pl line 33, near "$lines1 =~ 's{:20140924105028(\d+)}'" (Missing operator before 's{:20140924105028(\d+)}'?) syntax error at ./prog.pl line 33, near "$lines1 =~ 's{:20140924105028(\d+)}'" Can't use global $1 in "my" at ./prog.pl line 34, near "($1" syntax error at ./prog.pl line 41, near "}" Bareword "e" not allowed while "strict subs" in use at ./prog.pl line 36.
As m very new in perl you kind help would be highly appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.
by Anonymous Monk on Jan 05, 2015 at 21:56 UTC | |
Re^4: Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.
by pvaldes (Chaplain) on Jan 08, 2015 at 13:17 UTC |