44package Text::PerlPP ;
55
66# Semantic versioning, packed per Perl rules. Must always be at least one
7- # digit left of the decimal, and six digits right of the decimal.
8- our $VERSION = ' 0.600_000' ;
7+ # digit left of the decimal, and six digits right of the decimal. For
8+ # prerelease versions, put an underscore before the last three digits.
9+ our $VERSION = ' 0.600001' ;
910
1011use 5.010001;
1112use strict;
@@ -815,26 +816,25 @@ sub Main {
815816 return EXIT_OK;
816817 }
817818
818- # Preamble
819-
820819 # Save
821820 push @Instances , $self ;
822821
823822 $self -> {Package } = $self -> {Opts }-> {INPUT_FILENAME };
824823 $self -> {Package } =~ s / ^.*?([a-z_][a-z_0-9.]*).pl?$/ $1 / i ;
825824 $self -> {Package } =~ s / [^a-z0-9_]/ _/ gi ;
826- # $self->{Package} is not the whole name, so can start with a number.
825+ # Not the whole name yet , so can start with a number.
827826 $self -> {Package } = " PPP_$self ->{Package}$#Instances " ;
828827
829828 # Make $self accessible from inside the package.
830829 # This has to happen first so that :macro or :immediate blocks in the
831830 # script can access it while the input is being parsed.
832831 {
833832 no strict ' refs' ;
834- ${ " $self ->{Package}::" . PPP_SELF_INSIDE }
835- = $Text::PerlPP::Instances [$#Instances ];
833+ ${ " $self ->{Package}::" . PPP_SELF_INSIDE } = $self ;
836834 }
837835
836+ # --- Preamble -----------
837+
838838 $self -> StartOB(); # Output from here on will be included in the generated script
839839
840840 # Help the user know where to look
@@ -846,7 +846,7 @@ sub Main {
846846 emit " use constant { true => !!1, false => !!0 };\n " ;
847847 emit ' our $' . PPP_SELF_INSIDE . " ;\n " ; # Lexical alias for $self
848848
849- # Definitions
849+ # --- Definitions --------
850850
851851 # Transfer parameters from the command line (-D) to the processed file,
852852 # as textual representations of expressions.
@@ -910,6 +910,8 @@ sub Main {
910910 }
911911 emit " );\n " ;
912912
913+ # --- User input ---------
914+
913915 # Initial code from the command line, if any
914916 if ($self -> {Opts }-> {EVAL }) {
915917 $self -> emit_pound_line( ' <-e>' , 1 );
@@ -921,7 +923,7 @@ sub Main {
921923
922924 my $script = $self -> EndOB(); # The generated Perl script
923925
924- # --- Run it ---
926+ # --- Run it -------------
925927 if ( $self -> {Opts }-> {DEBUG } ) {
926928 print $script ;
927929
0 commit comments