I can garantuee you that nobody here thought that the string was "major.minor.build.revision". Not because I can mind read but because your script is really not that complicated and none of the answers to your post seems to assume a fixed string.
You might not be aware that in perl the following is true:
@a=("one","two");
dosumption(@a);
# is the same as
@a a=("one","two",undef);
dosumption(@a);
# is the same as
dosumption("one","two");
And because of that the solutions offered to you are really equivalent to your script (with the exception of what happens to "" and "0" both of which result to false without being undef) but mich simpler and less error prone
|