RE: Round a digit in perl

2008-09-12 Thread V.Ramkumar
>>Hope this helps: >>#!/usr/bin/perl -w >>$| = 1; >>use strict; >>sub correct_range { >> my @args = @_; # nasty side effects if you map @_! >> my( $from, $to ) = map { $_ = reverse $_ } @args; >> substr( $from, 0, length $to ) = $to; >> return reverse( $from ); >>} >>while( my $line = ){ >>my

RE: Round a digit in perl

2008-09-12 Thread Thomas Bätzler
Hi, V.Ramkumar <[EMAIL PROTECTED]> asked: > My input xml file has, > 246–52 > > I have to replace, > 246–252 > > Similarly, > > 100-5 100-105 > 198-10198-210. > > If anybody have logic for the above, please suggest. Hope this helps: #!/usr/bin/perl -w $| = 1; use strict;

Re: Round a digit in perl

2008-09-12 Thread Raymond Wan
Hi Ramkumar, Ummm, as a suggestion, why don't you explain to us (in words) what you want to do and try some sample code and we can give you some feedback/corrections? Your question about whether anyone has any "logic for the above" sounds like you can't put the problem into words? That see

RE: Round a digit in perl

2008-09-12 Thread Stewart Anderson
> -Original Message- > From: V.Ramkumar [mailto:[EMAIL PROTECTED] > Sent: 12 September 2008 11:33 > To: beginners@perl.org > Subject: Round a digit in perl > > Hi List, > > My input xml file has, > 246–52 > > I have to replace, > 246–252

Round a digit in perl

2008-09-12 Thread V.Ramkumar
Hi List, My input xml file has, 246–52 I have to replace, 246–252 Similarly, 100-5 100-105 198-10 198-210. If anybody have logic for the above, please suggest. Regards, Ramkumar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http