On Mon, Jan 10, 2011 at 12:59 AM, moshe nahmias <[email protected]> wrote: > this gave me an idea, hard to do but i think its possible, to make a program > that changes the old version script to a new one and tell the user what they > need to make it run well. > for example: lets say one have the next (very simple) script: > > print "hello world\n"; > > our program will change it to: > > say "hello world"; > > and say to the user it needs at least version 5.10. > i know its a lot of work, but that way if you upgrade your perl system you > can make your programs rather easily workable instead of trying to find what > you need to change to make it workable. > > since i am rather new to programing i would like to know if this is complete > nonsense or just to much work or a great idea and so on.
There are technical issues with what you are suggesting but the main problem, as I can see, is much more on the fear level. People are afraid of change. So they are afraid of upgrading perl but they would be afraid to change the code, especially by some automated tool. Though in that case they might lay the blame on the tool so that might be a better choice. The way to reduce the fear from changes is to put in control mechanism. For example a central version control system for code. Even if they are "just perl scripts" as some people put it. Then constantly keeping up with changes in the outside world. Making small changes will reduce the scope of the problem. Of course if a company is still using perl 5.6.x this means that their code base is probably somewhere around 7-10 or even 15 years old. (5.6.0 was released in 3/2000 and 5.6.2 was released in 11/2003) Then testing. Making sure your modules and scripts do what they supposed to do in an automatic way. Regarding your suggestion. In the general case I don't think it is solvable. Especially having seen some code in many places. There might be a tool that could find code snippets that are deprecated and suggest replacement but it can never ensure that your new code will do exactly the same as it did earlier. Even tests cannot prove that but they can go a much longer way in the right direction that eyeballing the code. regards Gabor _______________________________________________ Perl mailing list [email protected] http://mail.perl.org.il/mailman/listinfo/perl
