> -----Original Message----- > From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 29, 2001 7:25 AM > To: [EMAIL PROTECTED] > Subject: Re:2 last number with a regex > > > How can I check the last 2 number of an IP adress and > increment it by 10. > for exemple: > $IP="192.40.54.41" > > Th elast 2 number is 41 i increment it by 10. > > $IP1="192.40.54.51"
$IP1 =~ s/(\d+)$/$1 + 10/e; The /e option treats the replacement part as a perl expression. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]