There is an interface.pl file, it contains:

use strict; use warnings; use parser; my $PROGNAME = "Spark"; my $PROGVERSION = 0.1; 

When starting, it gives an error:

 parser.pm did not return a true value at /Users/stolz/HolyLanguage/Spark/interface.pl line 3. BEGIN failed--compilation aborted at /Users/stolz/HolyLanguage/Spark/interface.pl line 3. 

parser.pm file:

 package Parser; { my $val; 1; } 

and if instead of 1 I write return 1 , it gives me an error:

 Can't return outside a subroutine at /Users/stolz/HolyLanguage/Spark/parser.pm line 4. 

How can this problem be solved?

    2 answers 2

    just take out 1; for all braces. So nada. In the book with a camel everything is written.

    • I rendered it, but in the end now he swears, saying Can't locate parser.pm in @INC - Nicholas Goncharov
    • fixed this problem by BEGIN { unshift @INC, '/users/stolz/spark'; } BEGIN { unshift @INC, '/users/stolz/spark'; } , can I somehow do without this record? - Nicholas Goncharov
    • use lib '/users/stolz/spark'; cleverly adds directory to @INC - hobo-mts

    In fact, you don't need braces. You can simply remove them.