Re: question about sort

2001-07-23 Thread EriK W
Thank you Paul, Randal!!! :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: question about sort

2001-07-21 Thread Paul
--- EriK W <[EMAIL PROTECTED]> wrote: > Thanks! Paul, you are really good tutor, It is much clear for me now, Thank you. That's a high compliment. > But I think I still can't easily distinguish the list and scalar > context. That's a common problem. To oversimplify, a scalar context is a situa

Re: question about sort

2001-07-20 Thread EriK W
Thanks! Paul, you are really good tutor, It is much clear for me now, But I think I still can't easily distinguish the list and scalar context. Like here, you say it is a list context, just because we are using the "sort" or because the ()[0] ? -- To unsubscribe, e-mail: [EMAIL PROTE

Re: question about sort

2001-07-20 Thread Matija Papec
Paul <[EMAIL PROTECTED]> wrote: >here, it's not doing anything magical. Putting parens around it and >subscripting > > ($b =~ /=(\d+)/)[0] > >means treat the resulting list of matches as an array, and give me >element zero. Thus, it's getting the first matched set of digits in $b >that follow an e

Re: question about sort

2001-07-20 Thread Paul
--- EriK W <[EMAIL PROTECTED]> wrote: > Thanks , Paul, but I think I can't make it straight part of because > my broken English , so it seems make sense for me, but Better to try than sit quietly and be confused. =o) > > In > > > > ($b =~ /=(\d+)/)[0] <=> ($a =~ /=(\d+)/)[0] > > > > the <=> i

Re: question about sort

2001-07-20 Thread EriK W
Thanks , Paul, but I think I can't make it straight part of because my broken English , so it seems make sense for me, but "Paul" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > --- EriK W <[EMAIL PROTECTED]> wrote: > > Hi guys, > > > > I have a question ma

Re:[OT]question about sort

2001-07-20 Thread Paul
--- Michael Fowler <[EMAIL PROTECTED]> wrote: > On Fri, Jul 20, 2001 at 09:01:55AM -0700, Paul wrote: > > I don't know the behavior for certain on a final return of zero, > > but I don't think it does anything, which likely means that later > > things may or may not reverse their order based on c

Re: question about sort

2001-07-20 Thread Michael Fowler
On Fri, Jul 20, 2001 at 09:01:55AM -0700, Paul wrote: > I don't know the behavior for certain on a final return of zero, but I > don't think it does anything, which likely means that later things may > or may not reverse their order based on comparisons of other pairs, so > that the end result is

Re: question about sort

2001-07-20 Thread Paul
--- EriK W <[EMAIL PROTECTED]> wrote: > Hi guys, > > I have a question maybe about "sort" or regular expression, > > @new = sort {($b =~ /=(\d+)/)[0] <=> ($a =~ /=(\d+)/)[0]|| uc($a) > cmp uc($b) } @old; > > I don't really understand this /=(\d+)/ [0] thing, expecially that > "=" , what does

question about sort

2001-07-19 Thread EriK W
Hi guys, I have a question maybe about "sort" or regular expression, @new = sort {($b =~ /=(\d+)/)[0] <=> ($a =~ /=(\d+)/)[0]|| uc($a) cmp uc($b) } @old; I don't really understand this /=(\d+)/ [0] thing, expecially that "=" , what does that mean? Thanks! -- To unsubscribe, e-mail: [EMAI