On Mon, Jul 04, 2005 at 08:34:26PM + Vineet Pande wrote:
> Hello!
> In the following code:
>
> **
> #!/usr/bin/perl
> use warnings;
> use strict;
> my @unsorted = (1, 2, 11, 24, 3, 36, 40, 4);
> my @number = sort { $a <=> $b } @unsorted;
> print
Vineet Pande [VP], on Monday, July 04, 2005 at 20:34 (+) wrote:
VP> what I don't understand is how the block functions here: we did not define
VP> $a and $b? Also I donot understand this kind of block usage.
when you don't know something, try ask perl:
perldoc -q sort
if you find (or know)
Hello!
In the following code:
**
#!/usr/bin/perl
use warnings;
use strict;
my @unsorted = (1, 2, 11, 24, 3, 36, 40, 4);
my @number = sort { $a <=> $b } @unsorted;
print "Numeric sort: @number\n";
**
re