ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] Q: perl
@ 2000-12-19 21:40 Aleksey Novodvorsky
  2000-12-19 23:35 ` Mikhail Zabaluev
  0 siblings, 1 reply; 3+ messages in thread
From: Aleksey Novodvorsky @ 2000-12-19 21:40 UTC (permalink / raw)
  To: devel

Господа, я уже почти привык к perl'у, но все же будет лучше, если эту 
функицю перепишет кто-нибудь из знатоков.
sub version_compare {
   my ($a, $b) = @_;
   local $_;

   while ($a || $b) {
       my ($sb, $sa) =  map { $1 if $a =~ /^\W*\d/ ? s/^\W*0*(\d+)// : 
s/^\W*(\D+)// } ($b, $a);
       $_ = length($sa) cmp length($sb) || $sa cmp $sb and return $_;
   }
}

Дело в том, что она неверно (точнее -- не так, как хотелось бы) 
сравнивает названия полей release в том случае, если там есть ipl.
Пжста!

Rgrds, AEN

_______________________________________________
Devel mailing list
Devel@linux.iplabs.ru
http://www.logic.ru/mailman/listinfo/devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-12-20  4:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-19 21:40 [devel] Q: perl Aleksey Novodvorsky
2000-12-19 23:35 ` Mikhail Zabaluev
2000-12-20  4:54   ` Aleksey Novodvorsky

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git