The code:
sub mkrelease_dot_h{
$devlabel = shift (@_);
$file = shift (@_);
my ($major,$minor,$patch,$build) = ExtractRelease($devlabel);
my ($month,$day,$year) = GetCurrentDate();
chomp($year);
open(RELFILE,"$file") || die ("error opening file \"$file\"");
$string = "\"$major.$minor.$patch.$build\"";
while (<RELFILE>) {
chomp($_);
$_=~ s/(#define SW_VERSION_MAJOR)(.*)/$1\t$major/;
$_=~ s/(#define SW_VERSION_MINOR)(.*)/$1\t$minor/;
$_=~ s/(#define SW_VERSION_PATCH)(.*)/$1\t$patch/;
$_=~ s/(#define SW_VERSION_BUILD)(.*)/$1\t$build/;
$_=~ s/(#define SW_VERSION_STR)(.*)/$1\t$string/;
$_=~ s/(#define SW_RELEASE_MONTH)(.*)/$1\t$month/;
$_=~ s/(#define SW_RELEASE_DAY)(.*)/$1\t\t$day/;
$_=~ s/(#define SW_RELEASE_YEAR)(.*)/$1\t\t$year/;
}
close (RELFILE);
return $file;
}
The question:
Why this code does not change the content of file $file ?
Thanks,
Shy Aviram