$in=12345678.90;
$out=&big_money($in);

sub big_money {
        $number = sprintf " %.2f", shift @_;
      1 while $number =~ s/^(-?\d+) (\d\d\d) /$1, $2/; $number=~
s/^(-?)/$1\$/; $number;
}


-----Original Message-----
From: Ronen Kfir [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 02, 2003 11:52 AM
To: [EMAIL PROTECTED]
Subject: looking at a string


Hi,
This code is taken from "learning Perl\ Schwartz & Phoenix.
 
sub big_money {
           $number = sprintf " %.2f", shift @_;
          1 while $number =~ s/^(-?\d+) (\d\d\d) /$1, $2/; $number=~
s/^(-?)/$1\$; $number; }
 
In the book they write the no. 12345678.90 as the no. of example. What I
miss is how I include this no. in the script. How do I make script look
at this no.?
 
Thanx!
 
 R o n e n   K f i r
System Administrator
 CIT div. Tel Aviv University
Israel
Tel: 972-3-6407416
Fax: 972-3-6405158
cellular: 972-55-405910
E-mail: [EMAIL PROTECTED]
 
 


**** DISCLAIMER ****

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to