in reply to Search, modify, replace?
You want to make changes, so you want the substitution operator (s///). And you want the replacement to be the result of a Perl expression, so you need to use the "e" modifier.
use Time::Local qw( timelocal ); s/(\d{4})-(\d{2})-(\d{2})/ timelocal(0,0,0, $3,$2-1,$1) /ge;
but I continue to get syntax errors (I assume because you can't call subroutines inside a regex).
Maybe there's something wrong with the bits you omitted (like an unescaped "/"?) since the bits you did post are fine. Next time, please post the actual code and error messages.
Well, except that you're using "&" on your function call. Why are you telling Perl to ignore prototypes?
|
|---|