The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Problems installing perl5 irasela UNIX for Dummies Questions & Answers 0 03-03-2006 04:06 PM
sh script to traul through /usr/lib/perl5 ... emcb Shell Programming and Scripting 1 08-06-2002 10:01 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-16-2002
Registered User
 

Join Date: Apr 2002
Posts: 2
Stumble this Post!
one question of perl5

I'm a chinese.I want to change the number $103,456 to chinese
>" ʰÍòÁãÈþǪËÁ°ÛÎéʰ½" user perl5!
> That always talk me it have errors"
>syntax error at uper line 25, near "If"
>syntax error at uper line 29, near "$chg("
>Execution of uper aborted due to compilation errors."
>it's seem that it error in syntax of 'if'
>but i don't know what's wrong!Can you help me?
Code:
>#!/usr/bin/perl
>@lab=("ʰ","°Û","Ǫ","Íò","ʰ","°Û","Ǫ","ÒÚ");
>$flag1=0;
>$flag2=0;
>$flag3=0;
>$num=23;
>$var=23000;
>$st="Áã";
>$strl="";
>$i=8;
>if($var>10000){
>                $flag3=1;
>               };
>for ($i>=0){
>      $temp=$var;
>      $var = $var%(10**$i);
>      $temp=$var - $temp;
>      $inter = $temp/(10**$i);
>      if (($i=4) && ($inter=0) && $flag3 ){
>                             $str = $str . "Íò"
>                                            };
>If ($inter != 0){
>   If(Not $flag1){
>         $flag1=1;
>      If($flag2){
>         $strl.=$st;
>         $flag2=0;
>            }
>         $strl = $strl . $chg($inter) . $lab(i);
>                   };
>ElseIf ($flag1)
>      {
>    If (Not $flag2) { $flag2 = 1};
>      }
>$i=$i-1;
>}
>$strl = $strl . "Ôª";
>
>sub chg{
>my($numb)=@_;
>if ($numb=1){ return "Ò¼"};
>if ($numb=2){ return "·¡"};
>if ($numb=3){ return "Èþ"};
>if ($numb=4){ return "ËÁ"};
>if ($numb=5){ return "Îé"};
>if ($numb=6){ return "½"};
>if ($numb=7){ return "Æâ"};
>if ($numb=8){ return "°Ç"};
>if ($numb=8){ return "°Ç"};
>if ($numb=9){ return "¾Á"};
>if ($numb=0){ return ""};
>}
added code tags for readability --oombera

Last edited by oombera; 02-20-2004 at 10:05 AM.
Forum Sponsor
  #2 (permalink)  
Old 04-17-2002
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 909
Stumble this Post!
perl is case sensitive. Change your "If" statements to "if" instead. (lowercase the first letter). Same for "else" and "elseif".
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:28 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0