Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Question about this simple CGI

by CountZero (Bishop)
on Jul 18, 2013 at 13:54 UTC ( #1045101=note: print w/ replies, xml ) Need Help??


in reply to Question about this simple CGI

As this is a term project, you should be very careful in what you write.

So ask yourself (before the professor asks you):

  • Why do I use the -w flag in the hashbang line AND use warnings;
  • Why do I add parentheses in use DBI();

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

My blog: Imperial Deltronics


Comment on Re: Question about this simple CGI
Select or Download Code
Re^2: Question about this simple CGI
by petdance (Parson) on Sep 24, 2013 at 15:38 UTC
    I use parens in use calls to explicitly show that nothing is getting imported from the module.

    xoxo,
    Andy

Re^2: Question about this simple CGI
by Your Mother (Canon) on Sep 24, 2013 at 16:31 UTC

    It means your professor is either overly tricky or should think his/her questions through a bit more. In the case of DBI the parens do nothing except take up space and maybe mislead someone.

    ~>ack \@EXPORT DBI.pm @EXPORT = (); # we export nothing by default @EXPORT_OK = qw(%DBI %DBI_methods hash); # also populated by export_ok +_tags:

    Update: DERP, didn't see the whole thread. CountZero is asking a good question. The answer to which is... left as an exercise for the reader you.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045101]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (11)
As of 2014-09-16 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (31 votes), past polls