Beckett Richard-qswi266 wrote:

> Guys,
> 
> I must have brain fade, 'cause I can't work out how to do this...
> 
> I get a geometry string with "my $geom = $mw -> geometry;" which gives $geom = 
> "104x28+619+498".
> 
> I want $geom to be just the "+619+498" part of above.
> 
> It seems silly to do it like this, beacuse the if will always be true.
> 
> my $geom = $mw -> geometry;
> if ($geom =~ /.*(\+\d+\+\d+)$/) {$geom = $1};
> 
> There must be a simple $geom = ... statement, but I can't see it.
> 
> Am I going mad, or is the if the only way to do this?

Try one of these :

$geom =~ s/^.*(\+\d+\+\d+)$/$1/;

$geom =~ /.*(\+\d+\+\d+)$/; $geom = $1;


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to