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
PRECONV(1)						      General Commands Manual							PRECONV(1)

NAME
preconv - convert encoding of input files to something GNU troff understands SYNOPSIS
preconv [-dr] [-e encoding] [files ...] preconv -h | --help preconv -v | --version It is possible to have whitespace between the -e command line option and its parameter. DESCRIPTION
preconv reads files and converts its encoding(s) to a form GNU troff(1) can process, sending the data to standard output. Currently, this means ASCII characters and `[uXXXX]' entities, where `XXXX' is a hexadecimal number with four to six digits, representing a Unicode input code. Normally, preconv should be invoked with the -k and -K options of groff. OPTIONS
-d Emit debugging messages to standard error (mainly the used encoding). -Dencoding Specify default encoding if everything fails (see below). -eencoding Specify input encoding explicitly, overriding all other methods. This corresponds to groff's -Kencoding option. Without this switch, preconv uses the algorithm described below to select the input encoding. --help -h Print help message. -r Do not add .lf requests. --version -v Print version number. USAGE
preconv tries to find the input encoding with the following algorithm. 1. If the input encoding has been explicitly specified with option -e, use it. 2. Otherwise, check whether the input starts with a Byte Order Mark (BOM, see below). If found, use it. 3. Finally, check whether there is a known coding tag (see below) in either the first or second input line. If found, use it. 4. If everything fails, use a default encoding as given with option -D, by the current locale, or `latin1' if the locale is set to `C', `POSIX', or empty (in that order). Note that the groff program supports a GROFF_ENCODING environment variable which is eventually expanded to option -k. Byte Order Mark The Unicode Standard defines character U+FEFF as the Byte Order Mark (BOM). On the other hand, value U+FFFE is guaranteed not be a Unicode character at all. This allows to detect the byte order within the data stream (either big-endian or lower-endian), and the MIME encodings `UTF-16' and `UTF-32' mandate that the data stream starts with U+FEFF. Similarly, the data stream encoded as `UTF-8' might start with a BOM (to ease the conversion from and to UTF-16 and UTF-32). In all cases, the byte order mark is not part of the data but part of the encoding protocol; in other words, preconv's output doesn't contain it. Note that U+FEFF not at the start of the input data actually is emitted; it has then the meaning of a `zero width no-break space' character - something not needed normally in groff. Coding Tags Editors which support more than a single character encoding need tags within the input files to mark the file's encoding. While it is pos- sible to guess the right input encoding with the help of heuristic algorithms for data which represents a greater amount of a natural lan- guage, it is still just a guess. Additionally, all algorithms fail easily for input which is either too short or doesn't represent a natu- ral language. For these reasons, preconv supports the coding tag convention (with some restrictions) as used by GNU Emacs and XEmacs (and probably other programs too). Coding tags in GNU Emacs and XEmacs are stored in so-called File Variables. preconv recognizes the following syntax form which must be put into a troff comment in the first or second line. -*- tag1: value1; tag2: value2; ... -*- The only relevant tag for preconv is `coding' which can take the values listed below. Here an example line which tells Emacs to edit a file in troff mode, and to use latin2 as its encoding. ." -*- mode: troff; coding: latin-2 -*- The following list gives all MIME coding tags (either lowercase or uppercase) supported by preconv; this list is hard-coded in the source. big5, cp1047, euc-jp, euc-kr, gb2312, iso-8859-1, iso-8859-2, iso-8859-5, iso-8859-7, iso-8859-9, iso-8859-13, iso-8859-15, koi8-r, us-ascii, utf-8, utf-16, utf-16be, utf-16le In addition, the following hard-coded list of other tags is recognized which eventually map to values from the list above. ascii, chinese-big5, chinese-euc, chinese-iso-8bit, cn-big5, cn-gb, cn-gb-2312, cp878, csascii, csisolatin1, cyrillic-iso-8bit, cyrillic-koi8, euc-china, euc-cn, euc-japan, euc-japan-1990, euc-korea, greek-iso-8bit, iso-10646/utf8, iso-10646/utf-8, iso-latin-1, iso-latin-2, iso-latin-5, iso-latin-7, iso-latin-9, japanese-euc, japanese-iso-8bit, jis8, koi8, korean-euc, korean-iso-8bit, latin-0, latin1, latin-1, latin-2, latin-5, latin-7, latin-9, mule-utf-8, mule-utf-16, mule-utf-16be, mule-utf-16-be, mule-utf-16be-with-signature, mule-utf-16le, mule-utf-16-le, mule-utf-16le-with-signature, utf8, utf-16-be, utf-16-be-with-signature, utf-16be-with-signature, utf-16-le, utf-16-le-with-signature, utf-16le-with-signature Those tags are taken from GNU Emacs and XEmacs, together with some aliases. Trailing `-dos', `-unix', and `-mac' suffixes of coding tags (which give the end-of-line convention used in the file) are stripped off before the comparison with the above tags happens. Iconv Issues preconv by itself only supports three encodings: latin-1, cp1047, and UTF-8; all other encodings are passed to the iconv library functions. At compile time it is searched and checked for a valid iconv implementation; a call to `preconv --version' shows whether iconv is used. BUGS
preconv doesn't support local variable lists yet. This is a different syntax form to specify local variables at the end of a file. SEE ALSO
groff(1) the GNU Emacs and XEmacs info pages Groff Version 1.22.2 7 February 2013 PRECONV(1)
All times are GMT -4. The time now is 01:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy