Possible duplicate:Why you need to put 1; at the end of the Perl 5 module?
From this page Perl :: Critic :: Policy :: Subroutines :: RequireFinalReturn , this is sample code
package Password; # every time the user guesses the password wrong, its value # is rotated by one character my $password; sub set_password { $password = shift; } sub check_password { my $guess = shift; if ($guess eq $password) { unlock_secrets(); } else { $password = (substr $password, 1).(substr $password, 0, 1); } } 1;
1;
I tried the code with and without it, the result looks the same.
, Perl "", . true, , , die. , , , , .
die
1; - , , .
, , .
perldoc -f require:
true , 1; , return true . 1;, .
1; , use script, :
Password.pm did not return a true value BEGIN failed--compilation aborted
Source: https://habr.com/ru/post/1765505/More articles:Differences between Flash and AIR - flashjQuery UI Accordion (hiding everyone by default) - javascript в app.config Не удалось найти информацию о схеме для элемента 'userSettings' - c#Java: creating random numbers with a logarithmic distribution - javaAsynchronous communication between two applications - c #Why is my javascript not working - javascriptRequires: C # math programming library - mathAutoconf for Visual C ++ - visual-c ++How to transfer model changes in pylons / sqlalchemy? - pythonWhat errors does this Perl code have? - arraysAll Articles