Well, if it's a file containing a perl script, on a solaris
box, then the first line of the file should read:
#!/usr/bin/perl
or whatever the path is to the perl interpreter (binary
executable) file that you have installed.
If the installation went well enough for the perl interpreter
to run, then the following shell command ought to work,
printing the config/environment info for your installation:
perl -V
and so should the next command line, printing "hello, world" on
your screen, assuming that your newly installed perl can be found in
the PATH variable of your current environment setup.:
perl -e 'print "hello world\n"'
(note the use of both single and double quotes)
What seems odd is that you have to install perl yourself on
a solaris box -- I would have thought that perl would be there
already. Anyway, if you've done your own perl install for
whatever reason, you have to know the path to your "perl"
executable, and you have to make sure you cite that path
on the shebang line of every script you write. | [reply] [d/l] [select] |
Thank you, your help is appreciated. The command line perl statement works well (as did the perl -v). When putting the /usr/local/bin/perl in the first line, I get an internal error as if it does not know where it is. Is there a way to check where it thinks perl exists.
| [reply] |
Folks here might be able to help if you:
- Post the code you're trying to run
- Post the error message or other odd result you're getting
The information you've provided so far is too vague.
By the way, what do you get in response to either of
these two commands:
type perl
which perl
Those should print the path where your shell finds the
perl executable, given your current PATH setting. That is
what should be on the shebang line of any perl script you
write. (Note: this could report the path to a version of
perl that you did not install yourself. You do know the
path to the version you installed, right? Did you actually
place your installation in /usr/local/bin?)
| [reply] [d/l] |
If you print without "\n", the msg is not neccessary to show up on screen at the time you expected. It will show up when one of those happened:
- The output buffer is full
- a later print statement contains \n
- the program finished
If you don't want to wait:
- end your msg with "\n"
- at the beginning of your code: $| ++
| [reply] |
1, I have installed perl (myself) and loaded a number of libraries (lwp, cgi, dbd - got lots of errors with that install). Errors with that install? Did you fix them or just ignore them?
2, has the header #!/bin/sh if that helps The shabang on the script should point to your perl bin whereever you installed it to, usually it is in /usr/bin/perl or /usr/local/bin/perl but not always.
-Waswas | [reply] |