I am jumping my Web pages from 2007 to 2022(now).
Hi Everyone, especially Web-Casting Programmers !!
Naturally I encountered various problems. When I moved from an old computer platform Compaq-Evo with Fedora Core 7 (2007 Red Hat LINUX) to a newer Ubuntu and Rocky 9.1 (2022) as Web-Casting, Web codes encounters various errors and weird displays on the screen. I have to fix all the problems one by one. O.K. let me start one question. Will you help me if you have similar experience. In my case this is a big jump from 2007 -> to 2022.
Here is my first question . HELP me !
When I tested PERL script at Rocky 9.1, I needed to have the command "perl" in front of excitable script filename.
[ At Fedora-Core 7 ] $ script.pl [ENTER] -> it runs. Of course, the file script.pl has an executable file permission.
[ At Rocky 9.1 ] $ script.pl [ENTER] -> It didn't run. But,
[ At Rocky 9.1 ] $ perl script.pl [ENTER] -> It runs.
Should I have to call the interpreter "perl" explicitly like the second line always ???
This is all the way my first posting at this blog, so I hope this posting will work to communicating with someone. Thank you !!
First, brew your own Perl. System Perl is for the system. Get on board with cpanm.
#!/usr//bin/env perl in the header solves a lot of problems if perlbrew is set up right.
When you say that "It didn't run", what exactly do you mean? Did you get an error message? Did it fail silently?
This web site isn't a help forum. You'll probably get more help if you post your problem on Reddit or Stack Overflow.
Maybe it's not Perl related.
You can run executables without path only if they are located in one of the $PATH folders. And usually the current folder is not in $PATH.
Try with ./script.pl
I am so sorry, I was too busy for various chores. Thank you Dave, thank you Dave Cross and, thank you Vicenzo Buttazzo.
It was simply my careless mistake. While I am at Fedora Core 7, I always run my PERL script at my [bin] direcotry as below,
/home/mkido/bin
And this directory is in Environmental PATH like below,
PATH=/usr/local/bin:/home/mkido/bin so on.
-----------------------
Then I am at Rocky 9.1, I was running my perl script at my home directory as below
/home/mkido
And this directory isn't in Environmental PATH.
Then I moved my PERL script to
/home/mkido/bin
then, the script runs just like as in Fedora Core 7. This directory PATH is in Environmental PATH
PATH=/usr/local/bin:/home/mkido/bin
CONCLUSION : I was running a PERL script in a wrong PATH, which doesn't exist in RPCKY 9.1 environmental PATH. When I moved my PERL script in a proper PATH, it is executed just like in Fecora Core 7 as well as in Rocky 9.1, by typing the filename alone.
Thank you, thank you, thank you everyone, responding to my boring post.
What I reminded about was to run a command [env]. That led to the solution.
$ env [ENTER]
Then I carefully read what is the current environmental PATH setting. Then my script was moved to the proper PATH. It runs.