in reply to On running perl scripts

  1. perl abc.cgi will execute abc.cgi using which ever perl is found in first in your PATH. If there's no perl in your PATH, it will not be executed. If the first line is a she-bang line, and the command listed there doesn't containt the word 'perl', perl will feed abc.cgi to that command.
    ./abc.cgi will run abc.cgi. If the file is a binary, it will be run as a binary. If it starts with a she-bang line, the kernel will feed abc.cgi to whatever program is listed on the she-bang line. Else, it will be executed by the same shell you're running in.
    So, without knowing more details, we don't know whether there's a difference, and if there's a difference, what the difference is.
  2. Yes. A couple of ways:
    1. Using perl program.
    2. By putting #!/usr/local/bin/perl as the first line, and having a /usr/local/bin/perl.
    3. By putting
      #!/bin/sh eval 'exec perl -wS $0 ${1+"$@"}' if $running_under_some_shell;
      as the first lines of your shell.
    4. By doing a fork and exec, and execing perl.