On Fri, Jun 13, 2003 at 10:03:40PM +0100, Rob Dixon wrote:

> > basically i wanto get result 13 in $str.
> >
> > how to do this?
> 
> It depends on what '13' looks like in general in the strings
> you're processing. If it's always the first non-space thing
> after the start of the line then
> 
>   $str =~ /(\w+)/;
>   print $1, "\n";
> 
> prints '13'.

In this case, if you want to do some maths with the 13, then there is no
need to do anything special to $str:

  print $str + 3;

And to just get 13 in $str:

  $str += 0;

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to