YehorM has asked for the wisdom of the Perl Monks concerning the following question:

Hello everyone! I am a very new in perl, just started yesterday. My qualification is biochemistry and mol.biology, and i decided to try learn how work with BioPerl, and how write scripts. My OS is Windows 10, and i created a virtual maschine for Linux (Ubuntu). Anything were good, but when i tried run to my elementary script (simply "hallo NAME") I'd got a messege that "Can't find perl script". I changed file name many times. I had wrote script in a Nano text editor. May be someone can help with this?

Replies are listed 'Best First'.
Re: Can't find perl script
by 1nickt (Canon) on Nov 27, 2017 at 13:17 UTC

    Really, the message said "Can't find perl script"? I've never seen that message.

    What you need to do:

    • Paste the actual error message here, in <code></code> tags.
    • Post the script here, also in code tags.
    • Post the command you used to run the script, in code tags.

    There's more that could be useful debugging info, but let's start with that.

    Also please read:

    Thanks!


    The way forward always starts with a minimal test.
Re: Can't find perl script
by Discipulus (Canon) on Nov 27, 2017 at 15:23 UTC
    Hello YehorM and welcome to the monastery and to the wonderful world of Perl!

    as side note on windows you can profit of strawberryperl and develop directly on windows without the need for virtual machines.

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: Can't find perl script
by karlgoethebier (Abbot) on Nov 27, 2017 at 13:01 UTC

    Welcome! You posted not no code :-(

    Try this:

    #!/usr/bin/env perl use strict; use warnings; use feature qw(say); say q(Hello world!) __END__ karls-mac-mini:monks karl$ ./first.pl Hello world!

    See also chmod.

    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

Re: Can't find perl script
by thanos1983 (Parson) on Nov 27, 2017 at 14:01 UTC

    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!
      "...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!