marcos rebelo wrote:
Hi all
Hello,
This time, it's much more a personal opinion than a recipe.
http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/04---misc/01-when-shall-we-use-default-variables
Sorry, I strongly disagree with your opinion. :-(
Also, it appears that you always prefix Perl's function names with an
ampersand in your comments but built-ins will not work with a prefixed
ampersand and user defined subroutines almost never need them.
Opinions are always welcome in perl-reci...@googlegroups.com
You ask here, you shall receive here also. :-)
At:
http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/02-arrays/02-arrays-slice
<QUOTE>
02 - Arrays Slice
</QUOTE>
The adjective should not be plural, it should be either:
02 - Array Slices
Or:
02 - Slice Arrays
At:
http://sites.google.com/site/oleberperlrecipes/recipes/02-io/03-autoflushing-a-handle
<QUOTE>
How to set a Handle buffer size to zero, forcing a write before
continuing the processing.
</QUOTE>
Autoflushing does not change the buffer size, it just flushes it.
At:
http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/02-arrays/03-sort-arrays
<QUOTE>
I have an array, I need if sorted and fast.
</QUOTE>
Should be:
I have an array, I need it sorted and fast.
<QUOTE>
We may also add a comparison closure, it is very useful to sort numbers
like:
my @sorted_number_array = sort { $a <=> $b } @number_array;
</QUOTE>
The "code block" in your example is not a "closure".
perldoc -q closure
http://en.wikipedia.org/wiki/Closure_(computer_science)
<QUOTE>
First we will create an array of array refs having as index 0 the file
size and as second index the filepath:
my @filesizes = map { -t $_ } @filepaths;
</QUOTE>
You are not creating "an array of array refs" and -t has nothing to do
with the file size. You probably meant:
my @filesizes = map [ -s, $_ ], @filepaths;
At:
http://sites.google.com/site/oleberperlrecipes/recipes/01-variables/02-arrays/01-getting-a-duplication-free-array-1
<QUOTE>
# faster, but the element order is aleatory
sub unique {
my %hash;
@ha...@_} = ();
return keys %hash;
}
</QUOTE>
Aleatory is a rather obscure word (I had to look it up) but it does not
accurately describe how hashes work, they are not truly random.
John
--
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction. -- Albert Einstein
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/