>>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 = <DATA> ){ >>my( $from, $to ) = split /\s+/, $line; >>print "In: $from -- $to\n"; >>$to = correct_range( $from, $to ); >>print "Out: $from -- $to\n\n" >>}
Thanks a lot dear Thomas. I got the expected output. Regards, Ramkumar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/