in reply to Re^2: Generate the perl sequence 1, 11, 111, ....
in thread Generate the perl sequence 1, 11, 111, ....
is mentioned in perlsub. Look in the section on prototypes where it describes the "&" prototype character, particularly the sentence "An & requires an anonymous subroutine, which, if passed as the first argument, does not require the sub keyword or a subsequent comma" and also the examples "try", "catch", and "mygrep".mysubroutine {block} @list;
it returns an array of coderefs (references to subroutines) which is not at all what is needed here.map (sub { "1" x $_ }, (1..10));
printsperl -wle 'print prototype("CORE::map")'
Use of uninitialized value in print at -e line 1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Generate the perl sequence 1, 11, 111, ....
by blazar (Canon) on Oct 11, 2008 at 10:10 UTC |