in reply to Re^3: Perl Module
in thread Perl Module
All parameter passing in and out of functions or subs in Perl is done by passing in or out a flat list. There is no standard mechanism to do what you describe, although I find the following template comes close:
Of course you would use more meaningful variable names in a real situation.sub my_subroutine { my ($required_parameter_1, $required_paramater_2, @optional_parame +ters) = @_; }
The '1/8' is the value of a hash in a scalar context. It means '1 bin out of 8 possible bins are being used'. 'Bins' are what is being used internally by a hash to store the keys and values. I have never seen any practical use for this information.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Perl Module
by tilly (Archbishop) on Dec 31, 2008 at 07:53 UTC | |
|
Re^5: Perl Module
by cdarke (Prior) on Dec 31, 2008 at 15:24 UTC | |
|
Re^5: Perl Module
by shmem (Chancellor) on Feb 19, 2010 at 15:50 UTC | |
by CountZero (Bishop) on Feb 19, 2010 at 19:34 UTC |