|
<HTML>
|
|
<HEAD>
|
|
<TITLE>A Simple PerlScript Case Convertor</TITLE>
|
|
<SCRIPT language="PerlScript">
|
|
|
|
sub Sample::toUpper_onClick() {
|
|
$input = $Sample->TheString->{'Value'};
|
|
$input =~ tr/[a-z]/[A-Z]/;
|
|
$Sample->Converted->{'Value'} = $input;
|
|
}
|
|
|
|
sub Sample::toLower_onClick() {
|
|
$input = $Sample->TheString->{'Value'};
|
|
$input =~ tr/[A-Z]/[a-z]/;
|
|
$Sample->Converted->{'Value'} = $input;
|
|
}
|
|
|
|
sub Sample::obfuscate_onClick() {
|
|
$input = $Sample->TheString->{'Value'};
|
|
$output = join("", reverse split(/(\S+)/,$input));
|
|
$Sample->Converted->{'Value'} = $output;
|
|
}
|
|
|
|
</SCRIPT>
|
|
</HEAD>
|
|
<BODY>
|
|
<center>
|
|
<h2>PerlScript in Action</h2>
|
|
<hr>
|
|
<form action="" name="Sample">
|
|
<input type="text" size="70" name="TheString">
|
|
<p>
|
|
<input type="button" name = "toUpper" value="Upper Case Conversion"\
|
|
>
|
|
<input type="button" name = "toLower" value="Lower Case Conversion"\
|
|
>
|
|
<input type="button" name = "obfuscate" value="Obfuscation">
|
|
<p>
|
|
<input type="text" size="80" name="Converted">
|
|
</form>
|
|
</center>
|
|
</BODY>
|
|
</HTML>
|