Hi Sayed, I could not get your exact requirement. Here is one way to get the output shown by you.
$string = 'cs_backup_restore_cmvobsvr1mum'; ($first, $second) = $string =~ /(.+)(_[^_]+)/s; print "First: $first\nSecond: $second"; output: First: cs_backup_restore Second: _cmvobsvr1mum Regards, Prasad ""Sayed, Irfan (Irfan)"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] .. -----Original Message----- From: Xavier Noria [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 19, 2006 1:33 PM To: Perl Beginners Subject: Re: split function On Jul 19, 2006, at 9:57, Sayed, Irfan ((Irfan)) wrote: > I need to split following string > > cs_backup_restore_cmvobsvr1mum > > the output which i am looking for is > > cs_backup_restore and _cmvobsvr1mum Which is the criteria, everything up to the last underscore? -- fxn hi, I think criteria shud be _ but I need output in following manner cs_backup_restore and _cmvobsvr1mum regards irfan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response> -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>