in reply to RegEx to find the index of the character '@' in an Email address

Or is there any other method using substr?

Sure. You can use index to find the index of the first occurrence of @, and the use substr to extract everything before it.

Perl 6 - links to (nearly) everything that is Perl 6.
  • Comment on Re: RegEx to find the index of the character '@' in an Email address
  • Download Code