From: "Dr.Ruud" <[EMAIL PROTECTED]>
> "Jenda Krynicky" schreef:
> > Dr.Ruud:
> > Try
> >
> > print( (1.2.3 eq '1.2.3') ? 'yes' : 'no');
>
> $ perl -wle 'print sprintf("%vd", 1.2.3) eq "1.2.3" ? "y" : "n"'
> y
So you proved that you can convert a version string into an ordinary
one. Now the other conversion please.
Let's go back to the original question. Having a string like this:
$version = 'Version: 1.47.785';
increment the last number. I seriously doubt you can do anything even
remotely as simple as
$version =~ s/^(Version:\s*(?:\d+\.)*)(\d+)/$1 . ($2+1)/e;
Make sure it works for
$version = 'Version:1.47.789';
as well. Without string eval() if I may ask.
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/