Sponsored Content
Full Discussion: one question of perl5
Top Forums UNIX for Advanced & Expert Users one question of perl5 Post 19789 by ybz3721 on Tuesday 16th of April 2002 09:48:01 PM
Old 04-16-2002
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 02:05 PM..
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sh script to traul through /usr/lib/perl5 ...

Hey, Im trying to create a script to create a dir-tree of pod converted to html. so far this is the script: #!/bin/sh cd /usr/lib/perl5 for d in ./* ; do # is it a dir? if ; then # yes! get the basename cd $d ; dir=`basename $d` for f in ./* ; do ... (1 Reply)
Discussion started by: emcb
1 Replies

2. UNIX for Dummies Questions & Answers

question

hi guys.. I'm just wondering, everytime I go to a unix dictionary to get the definition of things such as $ and >& i dont get results back.. could you give me any link that has these simple definitions or could you tell me what $ means? or >&? (1 Reply)
Discussion started by: hamoudiii
1 Replies

3. UNIX for Dummies Questions & Answers

Problems installing perl5

Hi!! I have problems installing perl5 in a Tru64 4.0F enviroment, and i need it to install OpenSSL and OpenSSH to establis a SFTP... I'm installing perl 5.8.8 but an error occurr during make test, i ran ./perl harness and the result is the problem is on op/filetest.t I didn't know what to... (0 Replies)
Discussion started by: irasela
0 Replies

4. UNIX for Dummies Questions & Answers

One question about ls(1)

Hi, When I see man page of different UNIX commands, I find something like this: ls(1), vi(1) etc. What is meant by (1) here? Can any body pls explain this. Regards, Tayyab (2 Replies)
Discussion started by: tayyabq8
2 Replies

5. AIX

df question

Hi, Can anyone please explain a little about df command. I have following question: Following example is showing % used as 4 where as total free blocks are 15.46 out of 16.00 MB blocks. df -m /test Filesystem MBblocks Free %Used Iused %Iused ... (5 Replies)
Discussion started by: itsabhi9
5 Replies

6. Solaris

Wrong ELF data format: ELFDATA2MSB at /usr/perl5/5.8.4/lib/i86pc-solaris-64int/DynaLoader.pm

We are trying to install our project on solaris 10 x86 machine. we are getting the following error. Can't load '/u01/apps/WatchMark/FlexPM//R39FOA1/sw/perl/lib/auto/DBI/DBI.so' for module DBI: ld.so.1: perl: fatal: /u01/apps/WatchMark/FlexPM//R39FOA1/sw/perl/lib/auto/DBI/DBI.so: wrong ELF data... (3 Replies)
Discussion started by: Jagandadi
3 Replies

7. Linux

Installing perl5.14 failed

Hi, While installing perl5.14 on my Linux box its failing with c compiler issue. below is the error message. Use which C compiler? ./trygcc: line 10: cc: command not found Uh-oh, the C compiler 'cc' doesn't seem to be working. ./trygcc: line 25: gcc: command not found ./checkcc:... (11 Replies)
Discussion started by: muzaffar.k
11 Replies
TALK(1) 						    BSD General Commands Manual 						   TALK(1)

NAME
talk -- talk to another user SYNOPSIS
talk person [ttyname] DESCRIPTION
Talk is a visual communication program which copies lines from your terminal to that of another user. Options available: person If you wish to talk to someone on your own machine, then person is just the person's login name. If you wish to talk to a user on another host, then person is of the form 'user@host'. ttyname If you wish to talk to a user who is logged in more than once, the ttyname argument may be used to indicate the appropriate terminal name, where ttyname is of the form 'ttyXX'. When first called, talk sends the message Message from TalkDaemon@his_machine... talk: connection requested by your_name@your_machine. talk: respond with: talk your_name@your_machine to the user you wish to talk to. At this point, the recipient of the message should reply by typing talk your_name@your_machine It doesn't matter from which machine the recipient replies, as long as his login-name is the same. Once communication is established, the two parties may type simultaneously, with their output appearing in separate windows. Typing control-L '^L' will cause the screen to be reprinted, while your erase, kill, and word kill characters will behave normally. To exit, just type your interrupt character; talk then moves the cursor to the bottom of the screen and restores the terminal to its previous state. Permission to talk may be denied or granted by use of the mesg(1) command. At the outset talking is allowed. Certain commands, in particu- lar nroff(1) and pr(1), disallow messages in order to prevent messy output. FILES
/etc/hosts to find the recipient's machine /var/run/utmp to find the recipient's tty SEE ALSO
mail(1), mesg(1), who(1), write(1) BUGS
The version of talk(1) released with 4.3BSD uses a protocol that is incompatible with the protocol used in the version released with 4.2BSD. HISTORY
The talk command appeared in 4.2BSD. 4.2 Berkeley Distribution June 6, 1993 4.2 Berkeley Distribution
All times are GMT -4. The time now is 10:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy