in reply to Calling perl subroutine through CGI script

Three solutions:
  1. Put your sub-routine in your CGI-handling script.
  2. Load your script with do '/view/sawans1_Ndb_0037_work/vobs/pp/pptai/api/NightlyDB/api_test.pl'; and then call your sub-routine as usual.
  3. Put your subroutine in a proper module and use the module.

    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