Well, it wasn't what I was looking for, but this is the best solution I could find:
sub UserError {
my $msg = shift;
my $serialcode = shift;
my $email = shift;
open JAPANERROR, $japanerrorfile
or die "Can not open $japanerrorfile: $!";
my @JapanArray = <JAPANERROR>;
close JAPANERROR or die "Can not close $japanerrorfile: $!";
chomp @JapanArray;
my ($j_invalidcode,
$j_badcodelength,
$j_invalidemail,
$j_expiredtrial,
$j_unknownerror) =
@JapanArray;
$Response->Write("<html><body><h3>");
if ( $msg =~ /Bad code length/ )
{ $Response->Write( "$j_badcodelength ($serialcode)" ) }
elsif ( $msg =~ /Not a valid code/ )
{ $Response->Write( "$j_invalidcode ($serialcode)" ) }
elsif ( $msg =~ /Not a valid Email/ )
{ $Response->Write( "$j_invalidemail ($email)" ) }
elsif ( $msg =~ /You already used your 3 trial time/ )
{ $Response->Write( "$j_expiredtrial ($email)" ) }
else
{ $Response->Write( "$j_unknownerror" ) }
$Response->Write("</h3></body></html>");
exit(1);
}
And here's an example of the error file, not yet translated:
ERROR : Bad code length
ERROR : Not a valid code
ERROR : Not a valid Email
ERROR : You already used your 3 trial time
ERROR : Unknown Error
-Lexicon
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|