in reply to Can't find perl script

Hello YehorM,

Welcome to the Monastery. I would like to add a minor suggestion that might be your case that you are having.

As fellow Monk karlgoethebier you have a script named test.pl sample of code:

#!/usr/bin/perl use strict; use warnings; use feature 'say'; say "Hello World";

I assume that you are executing the script like this: perl test.pl in the same directory as you script.

I am not sure if you know what I mean, so here is an example to find in linuxOS, if you are running the script in the correct path/directory. Sample of code:

$ ls -la | grep test.pl -rw-r--r-- 1 user user 118 Nov 27 14:47 test.pl -rw-r--r-- 1 user user 475 Nov 22 12:37 test.pl~

I can only imagine that you are getting an error code like:

$ perl thanos.pl Can't open perl script "thanos.pl": No such file or directory

This error occurs because in the directory that I am currently there is no script named thanos.pl so Perl can not execute anything.

P.S. Why you installed UbuntuOS on a virtual machine, is it only to be able to run Perl scripts? If this is the case you can execute Perl scripts in WindowsOS also, see here Perl Download for more information. Also read this article dedicated to BioPerl on how to install it. I think this is where you should be focusing.

Hope this helps, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Replies are listed 'Best First'.
Re^2: Can't find perl script
by karlgoethebier (Abbot) on Nov 27, 2017 at 17:13 UTC
    "...imagine..."

    He, he! But it depends:

    karls-mac-mini:monks karl $ mv first.pl _first.pl karls-mac-mini:monks karl $ ./first.pl -bash: ./first.pl: No such file or directory karls-mac-mini:monks karl $ perl first.pl Can't open perl script "first.pl": No such file or directory

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      Hello karlgoethebier,

      Hmmm nice, I never tried to make my Perl script executable so I never had to deal with this problem. Thanks for the tip :)

      BR / Thanos

      Seeking for Perl wisdom...on the process of learning...not there...yet!
        "I never tried to make my Perl script executable..."

        He! Nobody is perfect ;-) But if you are too lazy - like me - feel free to use my modest little helpers from Re^5: result is not listening to if.

        Minor update: Fixed wrong link. Thanks soonix.

        Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help