yankeeblue has asked for the wisdom of the Perl Monks concerning the following question:
## This is the line containing the build num from the file $buildnumfi +le2. ## [assembly: AssemblyFileVersion("1.0.0.408")] ### Opens the buildnum file for input. tie @array2, 'Tie::File', $buildnumfile2 or die "Cannot open build number file: $!"; $num_files = @array2; for ($p=0; $p<$num_files; $p++) { $file = $array2[$p]; if ($file =~ /(AssemblyFileVersion)\(("([^"]*)")\)\]/) { $relnumber2 = $3; #1.0.0.1 @nums2 = split /\./, $relnumber2; $lastbldnumber2 = $nums2[3]; $newbldnumber2 = $lastbldnumber2 + 1; } } ### Now replace the old build number with the new build number. for (@array2) { s/(AssemblyFileVersion)(\("$nums2[0]\.$nums2[1]\.$nums2[2]\.$lastbld +number2"\))/AssemblyFileVersion\("$nums2[0]\.$nums2[1]\.$nums2[2]\.$n +ewbldnumber2"\)/g; } $newrelnumber2 = join ".", $nums2[0], $nums2[1], $nums2[2], $newbldnum +ber2;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: increment # but keep # of digits same
by ikegami (Patriarch) on Apr 26, 2005 at 14:33 UTC | |
|
Re: increment # but keep # of digits same
by suaveant (Parson) on Apr 26, 2005 at 14:39 UTC | |
|
Re: increment # but keep # of digits same
by duff (Parson) on Apr 26, 2005 at 14:42 UTC | |
by Hero Zzyzzx (Curate) on Apr 26, 2005 at 14:51 UTC | |
|
Re: increment # but keep # of digits same
by Fletch (Bishop) on Apr 26, 2005 at 14:33 UTC | |
|
Re: increment # but keep # of digits same
by brian_d_foy (Abbot) on Apr 26, 2005 at 18:55 UTC | |
by Anonymous Monk on Apr 27, 2005 at 09:13 UTC | |
|
Re: increment # but keep # of digits same
by yankeeblue (Novice) on Apr 27, 2005 at 13:07 UTC |