Perl without using package manager commands? • I think to get Perl Source Code, do compile and execute install. (copy to contain PATH directory) • These processes are called “builds".
to download from GitHub. • If you want to get commit logs. • If you do not want to get commit logs. git clone -b perl-1.0 —single-branch [email protected]:Perl/perl5.git wget https://github.com/Perl/perl5/archive/perl-1.0.tar.gz
also perl5 (it is executed automatically) • Basically it is almost the same as modern perl5!! • old perl (strictly around Perl3) depends manually on make
so-called GNU tools such as autoconf and automake. • autoconf commands, create Configure using setting file called configure.in. • Created Configure create Makefile using makefile.in. (It is automake to automatically generate makefile.in)
at from 1.0 • First of all, autoconf was not released in Perl 1.0 era. (Autoconf 1991 release, Perl 1987 release) • I wondered how Larry was creating the settings.
toolkit by himself. • dist is create Configure using setting files. • —> create package from codes. • —> sent the package to email. • Also, the maintenance right was handed over to other people immediately after publication.
maintained. • But, Perl 4 flavored source code that can run on Perl 5. • Some dist toolkits are not maintained as Perl 5 (eg there is code left requiring getopts.pl)
} sub auto_main'profile { &main'dataload; } # Load the calling function from DATA segment and call it. This function is # called only once per routine to be loaded. sub main'dataload { local($__packname__) = (caller(1))[3]; $__packname__ =~ s/::/'/; local($__rpackname__) = $__packname__; local($__at__) = [email protected]; $__rpackname__ =~ s/^auto_//; &perload'load_from_data($__rpackname__); local($__fun__) = "$__rpackname__"; $__fun__ =~ s/'/'load_/; eval "*$__packname__ = *$__fun__;"; # Change symbol table entry die [email protected] if [email protected]; # Should not happen [email protected] = $__at__; # Restore value [email protected] had on entrance &$__fun__; # Call newly loaded function
.SH) required to run metaconfig can be used at that time, which is convenient. • Perl5's Configure is not just using dist's metaconfig, but it is becoming more and more often direct rewriting itself.
there is no big difference between Perl 5 and other Perls. • perly.c have main function. • perl.c is a parsing phase generated by perl.y (YACC) • The names of perl.c and perly.c are replaced from Perl 5.
optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. •It combines (in the author's opinion, anyway) some of the best features of C, sed, awk, and sh, so people familiar with those languages should have little difficulty with it. — by Perl1 man page
1.0 patches regularly (100% test passing version exists) • I was implementation Perl1.0 Docker Images. • You can easy execute Perl1.0 when using Docker.
K&R C second edition (Perl1.0 is written in C before ANSI-C) • Since C at that time did not have a standard, the return type of the library function was different depending on the processing system. • These are controlled by the macro.
char **argv; register char **env; { register STR *str; register char *s; char *index(); linestr = str_new(80); str = str_make("-I/usr/lib/perl "); /* first There is no type in the main function. Receive environment in env. The keyword register hints to compiler that a given variable can be put in a register.
char **argv; register char **env; { register STR *str; register char *s; char *index(); linestr = str_new(80); str = str_make("-I/usr/lib/perl "); /* first In the first place, the declaration of arguments is so-called K & R style
char **argv) #else int main(int argc, char **argv, char **env) #endif { int exitstatus, i; #ifdef PERL_GLOBAL_STRUCT struct perl_vars *my_vars = init_global_struct(); # ifdef PERL_GLOBAL_STRUCT_PRIVATE int veto; main function is int type, written in perlmain.c
as it is • but when make depend it is destroyed in relation to the header file of mac os ./config.h:172:19: warning: '/*' within block comment [-Wcomment] #/*undef TMINSYS /**/ ^ /usr/include/AvailabilityInternal.h:38846:2: error: #else after #else #else ^ /usr/include/AvailabilityInternal.h:38203:10: error: unterminated conditional directive #if __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_13 ^ /usr/include/AvailabilityInternal.h:38116:10: error: unterminated conditional
If you try to build gcc from source code, I think you need to use llvm / clang installed with brew. brew install gcc brew install llvm #should include PATH (at /usr/libexec/bin)
• Currently int type • It is not necessary because sprintf includes header files in the first place #ifdef CHARSPRINTF char *sprintf(); #else int sprintf(); #endif
./perl.h:235:1: error: unknown type name 'UIDTYPE' UIDTYPE getuid(); ^ ./perl.h:236:1: error: unknown type name 'UIDTYPE' UIDTYPE geteuid(); ^ ./perl.h:237:1: error: unknown type name 'GIDTYPE' GIDTYPE getgid(); ^ ./perl.h:238:1: error: unknown type name 'GIDTYPE' GIDTYPE getegid();
static, etc… malloc.c:155:1: error: static declaration of 'morecore' follows non-static declaration malloc.c:126:5: note: previous implicit declaration is here morecore(bucket); ^ malloc.c:164:5: error: non-void function 'morecore' should return a value [- Wreturn-type] return; ^ malloc.c:181:5: error: non-void function 'morecore' should return a value [- Wreturn-type] return; ^
of magic! • If you do something with Gcc, it will automatically enter but not clang static morecore(register); static findbucket(union overhead*, int);
• rewrite Perl1 sourcecode C to Rust. • Implementing Inline::Perl1 as Perl5 CPAN. • Implementing scripts to run all Perl versions with one liner (PERL-ALL?)