I have a script that uses a subclass that I wrote about a module from CPAN for presentation. Ideally, I would like to have two in one file, since there is not much code in the subclass module. It makes no sense to expand either a subclassed module to include script code, or turn a script into a module. How to include module code in a script?
There are no problems with having multiple packages in one file.
package Foo; sub new { print "Foo::new\n"; } package main; new Foo;
, , "", core.pm, - . , script, script put require core; . use require, , .
core.pm
require core;
use
require
Source: https://habr.com/ru/post/1789083/More articles:LazyInitializationException in RESTORE_VIEW (incorrect PersistentSet instance creation) - hibernateThe problem with fillRoundRect would seem to be wrong - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1789080/how-much-information-does-the-deferred-library-allow-a-packaged-function-access-to&usg=ALkJrhj83OhezrlQ2m0LLo6Edmjr-AbmIwjQuery / Google Maps: choosing a radius-controlled location? - mapJQuery Mobile does not update button styles - javascriptDifferences between DLNA 1.5 and 2.0 - dlnaIs it safe to accept uniform geo-ip resolution for the same first 16-bit IP addresses? - ip-addressВозврат двух счетчиков (*) приводит к одному выбору - sqlFast line counter - c #Maven Release Plugin: SNAPSHOT Release - javaAll Articles