On Fri, 08 Jun 2007 19:52:59 -0000
ash <[EMAIL PROTECTED]> wrote:

> Hello there!
> 
> I need to remove decimal points from numbers. For eg 1.23 or 1.77
> would be just 1. Any suggestion is appreciated. Thank you.

This program removes the decimal point from your numbers
============================
#!/usr/bin/perl -w

use strict;

while (<DATA>){
chomp;
my $number = $_;
$number =~ s/\.//;

print "$number\n";
}

__DATA__
1.74
2.87
3.88

__END__
============================
Output is

174
287
388




Owen

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to