> Hi, > Hi
> I'm currently trying to find a good way to modify a string. A > program returns me > a MAC address under the form 0a0a0a0a0a0a, and I would like to > tranform it to > obtain : 0a:0a:0a:0a:0a:0a > Try this: $ perl -e '$str = "0a0a0a0a0a"; $str2 =join(":",$str=~ /(..)/g); print "$str2\n";' prints: 0a:0a:0a:0a:0a Regards, Edward WIJAYA SINGAPORE ------------ Institute For Infocomm Research - Disclaimer ------------- This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you. -------------------------------------------------------- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>