a problem about function returning point



hi everyone:

Today I came cross a strange problem about function returning
point.

I have a function for replace chinses character to english character.

sub replace_par{
my $str = shift;
$str =~ s/\xA3\xA8/\(/;
$str =~ s/\xA3\xA9/\)/;
return $str;
}

Then I calling this function in a subroutine. as follows:
.... ...
### first we open a text file, and read line by line:
open(F,"<aaa.txt");
while(<F>){
.... ...
#according the context we have read, we named function name.
my $progName = $conf->{'feedname'} . '_slicecheck';
#calling the named function
my ($ret,$outline) = &$progName($conf,$data,$store);

if ($ret == 2){
... ...
};
print OUTPUT "$outline\n" if ($ret==0);
}
close(F);
close(OUTPUT);

exit(0);

#the calling function name is p4sup:
#
sub p4sup_slicecheck{
my $conf = shift;
my $data = shift;
my $store = shift;

#calling function replace_par,replace the chinese character
$data->{'english_name'} = replace_par($data->{'english_name'}) if
$data->{'english_name'} =~ /\xA3\xA8/
$l = length($data->{'english_name'});
$data->{'english_name'} .= ' ' x (100 - $l) if ($l < 100);

.... ...
}

then, after calling function replace_par, system should return to
subroutine:p4sup_slicecheck. But the system return to "close(OUTPUT)"
where the line before exit(0) !

Anyone hit this situation?

Thank u in advanced.

Havel Zhang

.



Relevant Pages

  • Re: "Jumping the Shark" alternate phrases/series focus shifts
    ... the gradual shift in series' focus towards what was, until then, only ... one of a group of characters, ... Now a character who went from one type of genre show to a completely ...
    (rec.arts.tv)
  • Re: "Jumping the Shark" alternate phrases/series focus shifts
    ... On Aug 8, 2:01 am, William George Ferguson ... the gradual shift in series' focus towards what was, until then, only ... he went from being a minor character to a regular member of the ensemble. ... impossibly cute child in the cast the show will gradually shift towards ...
    (rec.arts.tv)
  • Re: overload operator<<
    ... shift is in c and c++ for some low level functions. ... >> Encoder and Encoding). ... > you're reading a multi-byte character and only get the start of it. ... reliance on static methods thing is something the programmer can become ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: quotation marks in the UK
    ... a double quote character, iirc. ... Baudot had the two 32-character sets, but all ones, possibly all 0s, and the two shift codes were common to both sets, which I think means 56 individual codes. ... blown valve _this_ time". ... I think that was LEO - Lyons Electronic Office - and it always intrigued me that a significant name in the early British history of computers was a company whose main business was tea and teashops. ...
    (uk.media.radio.archers)
  • Re: NBC No Country For Old Men
    ... If you didn't grasp in your mind the ending of NCFOM, ... then he suddenly beomes the main character is also part of the point. ... part of what I described above as the "massiver narrative shift". ... inneffective and used only as a narrator throughout. ...
    (rec.music.artists.springsteen)