In a message dated 2/28/2004 3:28:55 AM Eastern Standard Time,
[EMAIL PROTECTED] writes:
> - Stop using prototypes. You'll find it easier to write perl
> programs without them.
Prototypes are useful and sometimes necessary, as in the supplied problem.
What would be called
my_subroutine($scalar1, $scalar2, [EMAIL PROTECTED], [EMAIL PROTECTED]);
, is now called
my_subroutine $scalar1, $scalar2, @array1, @array2;
This may be perfect for the problem at hand. Also, for constent values,
prototypes ARE 100% neccisary (That's why if you do h2ph on #define PI 3.14 the
returned subroutine has a null prototype). Also, for code reference, prototypes
are a good, easy way to handle it (As with glob prototypes and File Handles).
Prototypes exist for a reason. Should you use them in every case? No, but
they have reasons to exist, and you should use them when you think it's one of
those reasons. The real problem with prototypes is they may be overused, and
they may be misused/misunderstood (sub my_subroutine ($scalar, @array, @array) {)
-Will
-----------------------------------
Handy Yet Cryptic Code.
Just to Look Cool to Look at and try to decipher without running it.
Windows
perl -e "printf qq.%3i\x20\x3d\x20\x27%c\x27\x09.,$_,$_ for 0x20..0x7e"
Unix
perl -e 'printf qq.%3i\x20\x3d\x20\x27%c\x27%7c.,$_,$_,0x20 for 0x20..0x7e'
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>