On 2/2/19 9:29 PM, Brad Gilbert wrote:
It is also weird that you are using CamelCase for variables,
and a mixture of CamelCase and snake-case for the subroutine name.
Hi Brad,
An explanation. I do this for "maintainability".
I have been able to "type" since high school typing
class. Upper and lower are no difference in speed
to me. (I do realize that "hunt and peckers" go nuts
with upper and lower case.)
So, Camel Case tells me instantly that a variable and
sub name came from me and are not something I copied
from somewhere else (zef), or a reserved word or a
build-in sub name. There is no "Did I write this
or ...?" when I go months later to fix/add some
something.
Since I come from Modula 2, I live and breath modules.
Awful nice to be able to know at a glance if I wrote
something or I used someone else's module.
And I absolutely ADORE the way Perl 6 does their modules.
Well, importing them needs some work. They need to
restore Perl 5's functionality where you can explicitly
state which subs you are importing from a module:
use Term::ANSIColor qw ( BOLD BLUE RED GREEN RESET );
use Term::ReadKey qw ( ReadKey ReadMode );
Again, for maintainability, so I know where the blazes
something came from.
I work around the problem with my own imposed comments:
use CurlUtils; # qw[ CurlDownloadFile CurlGetWebSite
CurlGetHeader CurlExists CurlSendMail, CurlGetRedirectUrl ];
and
#`{
Interface to curl from Perl 6
To use these, place the following at the top(ish) of your program
use lib "/home/linuxutil";
use CurlUtils; # qx[ CurlDownloadFile CurlGetWebSite
CurlGetHeader CurlExists CurlSendMail ]
}
Oh ya, and I live and die in "Top Down", so I GOT TO HAVE my subs!
Perl is a "Write Only language" if you let it be.
-T