Yes, we can help you, but you have to take the first few steps so that we have something to work with.
I don't know of a script that is already written, which specifically changes all instances of 2013 to 2014 in a website, but after reading perlintro, perlretut, perlopentut, and File::Find, you could probably write it yourself. Once you've gotten a start on it, let us know what part you're having trouble with, post some relevant code, and we'll do what we can to help you past the tricky parts. Try to write it as a solution general enough that you'll be able to reuse it next year too.
| [reply] |
G'day Ben,
While it would appear that "2013" may well be a year, take note of the discussion (in this thread) regarding the possibility that it could be part of a telephone number.
Then realise that it could, in fact, be part of a street address, a post code, a product ID, a reference number, or anything else that could contain four digits.
It may not even be something that appears on any webpage on your website, e.g. '<h2 id="sales-for-2013" ...', '<a href="#sales-for-2013" ...', '<input type="hidden" ...2013... />', etc.
So, you probably don't want to search for "all instances of 2013", but rather more specific strings, e.g. 'Copyright © 2012-2013'.
Continuing the copyright example, you probably don't want to change the 2013 to 2014.
Instead, consider changing it to something that evaluates to the current year.
Without knowing anything about your website, I can't tell you what that "something" might be: perhaps a function call or a variable; you may need to make the change on every page or, if you're using some sort of template, a single change in one place might suffice.
Of course, because you haven't told us, I actually have no idea what 2013 refers to (although, a year does seem like a reasonable guess).
You'll need to determine all the places that 2013 might occur; which are the ones that need changing and which do not; then write your script accordingly.
Given that could be quite a large task, and assuming you don't want to have to repeat it in 11 months, you should be motivated to doing it (right) once and never having to worry about it again.
| [reply] [d/l] [select] |
| [reply] [d/l] |
| [reply] |
| [reply] [d/l] |
Hey, don't criticise my code. It matches the spec.
| [reply] |
Very interesting point. Upvoted. But, at the same time, the Anonymous Monk's proposal did fit perfectly the OP's requirement: "a perl script that will find all instances of 2013 on a website and change it to 2014".
| [reply] |