in reply to Search, modify, replace?
Thank you all for your speedy replies, I really appreciate it.
ikegami, that looks like exactly what I was looking for, thank you. I'm not sure why I never realized I could directly call timelocal() inside s///. I also did not properly understand the $1, $2, etc. special variables, but that example illustrates their use perfectly.
Well, except that you're using "&" on your function call. Why are you telling Perl to ignore prototypes?The "&" was my attempt to call a subroutine inside the s///. My thought process was to have the subroutine do the work of appropriately arranging the date elements (day, month, year, etc), calling timelocal(), and returning the epoch timestamp. I have a knack for over-complicating my own code. =) I'm also still learning with regexes in general - I don't yet remember all of the characters that have special meanings inside a regex (as it sounds like "&" does: to ignore prototypes?).
I will give this a shot. Thanks again everyone.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search, modify, replace?
by AnomalousMonk (Archbishop) on Jun 10, 2009 at 18:25 UTC |