in reply to Re: Please Help! This is a class assignment given to me.
in thread Please Help! This is a class assignment given to me.

Every perl program starts with the same three lines of code. And this is just to get you started:
#!/usr/bin/perl -w use strict; use warnings;

Both use warnings and -w isn't needed, see: What's wrong with -w and $^W

Personally I prefer the shebang #!/usr/bin/env perl to say "use whatever perl is in my PATH" (see env), it'll also work better with e.g. perlbrew. Pointing to a specific perl binary makes sense if distributing a script to a system where you may not have control over the PATH (e.g. CGI scripts on hosting providers).

Update: I agree with Tux's reply: In the case of the shebang, TIMTOWTDI.

Replies are listed 'Best First'.
Re^3: Please Help! This is a class assignment given to me.
by Tux (Canon) on Dec 07, 2019 at 10:08 UTC
    Pointing to a specific perl binary makes sense if distributing a script to a system where you may not have control over the PATH.

    Or if you want to make sure it uses a specific (non system) perl install that has modules installed that are not available in general distributions or have libraries linked that are specific to the script or …

    Personally I always use #!/pro/bin/perl, which is where I have my production perl installed. If I do not need anything specific, and system-perl will do (which is seldom the case), I make /pro/bin/perl a symlink to the required perl. TIMTOWTDI


    Enjoy, Have FUN! H.Merijn