in reply to Function calls and list creation
It would actually sort the list ($sort_func, 1,2,3) and you would end up with#! /usr/bin/perl use Data::Dumper; my $sort_func = sub { $a <=> $b }; my @to_be_sorted = (1,2,3); my @new = sort ($sort_func, @to_be_sorted); print Dumper \@new;
$VAR1 = [ 1, 2, 3, sub { "DUMMY" } ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Function calls and list creation
by chromatic (Archbishop) on May 31, 2003 at 00:28 UTC | |
by tcf22 (Priest) on May 31, 2003 at 00:37 UTC | |
by brewer (Sexton) on May 31, 2003 at 01:00 UTC | |
|
Re: Re: Function calls and list creation
by brewer (Sexton) on May 31, 2003 at 00:45 UTC |