@@ -894,7 +894,6 @@ perl_destruct(pTHXx)
894894 }
895895
896896 /* switches */
897- PL_preprocess = FALSE;
898897 PL_minus_n = FALSE;
899898 PL_minus_p = FALSE;
900899 PL_minus_l = FALSE;
@@ -1804,12 +1803,6 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
18041803 else
18051804 Perl_croak (aTHX_ "No directory specified for -I" );
18061805 break ;
1807- case 'P' :
1808- forbid_setid ('P' , -1 );
1809- PL_preprocess = TRUE;
1810- s ++ ;
1811- deprecate ("-P" );
1812- goto reswitch ;
18131806 case 'S' :
18141807 forbid_setid ('S' , -1 );
18151808 dosearch = TRUE;
@@ -2225,7 +2218,6 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
22252218#endif
22262219 CopLINE_set (PL_curcop , 0 );
22272220 PL_curstash = PL_defstash ;
2228- PL_preprocess = FALSE;
22292221 if (PL_e_script ) {
22302222 SvREFCNT_dec (PL_e_script );
22312223 PL_e_script = NULL ;
@@ -2862,7 +2854,6 @@ S_usage(pTHX_ const char *name) /* XXX move this out into a module ? */
28622854"-[mM][-]module execute \"use/no module...\" before executing program" ,
28632855"-n assume \"while (<>) { ... }\" loop around program" ,
28642856"-p assume loop like -n but print line also, like sed" ,
2865- "-P run program through C preprocessor before compilation" ,
28662857"-s enable rudimentary parsing for switches after programfile" ,
28672858"-S look for programfile using PATH environment variable" ,
28682859"-t enable tainting warnings" ,
@@ -2902,7 +2893,7 @@ Perl_get_debug_opts(pTHX_ const char **s, bool givehelp)
29022893 " t Trace execution" ,
29032894 " o Method and overloading resolution" ,
29042895 " c String/numeric conversions" ,
2905- " P Print profiling info, preprocessor command for -P, source file input state" ,
2896+ " P Print profiling info, source file input state" ,
29062897 " m Memory allocation" ,
29072898 " f Format processing" ,
29082899 " r Regular expression parsing and execution" ,
@@ -3371,10 +3362,6 @@ Internet, point your browser at http://www.perl.org/, the Perl Home Page.\n\n");
33713362 case 'S' : /* OS/2 needs -S on "extproc" line. */
33723363 break ;
33733364#endif
3374- case 'P' :
3375- if (PL_preprocess )
3376- return s + 1 ;
3377- /* FALL THROUGH */
33783365 default :
33793366 Perl_croak (aTHX_ "Can't emulate -%.1s on #! line" ,s );
33803367 }
@@ -3584,72 +3571,6 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, SV *sv,
35843571 Perl_croak (aTHX_ "suidperl needs (suid) fd script\n" );
35853572 }
35863573#else /* IAMSUID */
3587- else if (PL_preprocess ) {
3588- const char * const cpp_cfg = CPPSTDIN ;
3589- SV * const cpp = newSVpvs ("" );
3590- SV * const cmd = newSV (0 );
3591-
3592- if (cpp_cfg [0 ] == 0 ) /* PERL_MICRO? */
3593- Perl_croak (aTHX_ "Can't run with cpp -P with CPPSTDIN undefined" );
3594- if (strEQ (cpp_cfg , "cppstdin" ))
3595- Perl_sv_catpvf (aTHX_ cpp , "%s/" , BIN_EXP );
3596- sv_catpv (cpp , cpp_cfg );
3597-
3598- # ifndef VMS
3599- sv_catpvs (sv , "-I" );
3600- sv_catpv (sv ,PRIVLIB_EXP );
3601- # endif
3602-
3603- DEBUG_P (PerlIO_printf (Perl_debug_log ,
3604- "PL_preprocess: scriptname=\"%s\", cpp=\"%s\", sv=\"%s\", CPPMINUS=\"%s\"\n" ,
3605- scriptname , SvPVX_const (cpp ), SvPVX_const (sv ),
3606- CPPMINUS ));
3607-
3608- # if defined(MSDOS ) || defined(WIN32 ) || defined(VMS )
3609- quote = "\"" ;
3610- # else
3611- quote = "'" ;
3612- # endif
3613-
3614- # ifdef VMS
3615- cpp_discard_flag = "" ;
3616- # else
3617- cpp_discard_flag = "-C" ;
3618- # endif
3619-
3620- # ifdef OS2
3621- perl = os2_execname (aTHX );
3622- # else
3623- perl = PL_origargv [0 ];
3624- # endif
3625-
3626-
3627- /* This strips off Perl comments which might interfere with
3628- the C pre-processor, including #!. #line directives are
3629- deliberately stripped to avoid confusion with Perl's version
3630- of #line. FWP played some golf with it so it will fit
3631- into VMS's 255 character buffer.
3632- */
3633- if ( PL_doextract )
3634- code = "(1../^#!.*perl/i)|/^\\s*#(?!\\s*((ifn?|un)def|(el|end)?if|define|include|else|error|pragma)\\b)/||!($|=1)||print" ;
3635- else
3636- code = "/^\\s*#(?!\\s*((ifn?|un)def|(el|end)?if|define|include|else|error|pragma)\\b)/||!($|=1)||print" ;
3637-
3638- Perl_sv_setpvf (aTHX_ cmd , "\
3639- %s -ne%s%s%s %s | %" SVf " %s %" SVf " %s" ,
3640- perl , quote , code , quote , scriptname , SVfARG (cpp ),
3641- cpp_discard_flag , SVfARG (sv ), CPPMINUS );
3642-
3643- PL_doextract = FALSE;
3644-
3645- DEBUG_P (PerlIO_printf (Perl_debug_log ,
3646- "PL_preprocess: cmd=\"%s\"\n" ,
3647- SvPVX_const (cmd )));
3648-
3649- * rsfpp = PerlProc_popen ((char * )SvPVX_const (cmd ), (char * )"r" );
3650- SvREFCNT_dec (cmd );
3651- SvREFCNT_dec (cpp );
3652- }
36533574 else if (!* scriptname ) {
36543575 forbid_setid (0 , * suidscript );
36553576 * rsfpp = PerlIO_stdin ();
@@ -4172,8 +4093,6 @@ FIX YOUR KERNEL, OR PUT A C WRAPPER AROUND THIS SCRIPT!\n");
41724093 Perl_croak (aTHX_ "Effective UID cannot exec script\n" ); /* they can't do this */
41734094 }
41744095# ifdef IAMSUID
4175- else if (PL_preprocess ) /* PSz 13 Nov 03 Caught elsewhere, useless(?!) here */
4176- Perl_croak (aTHX_ "-P not allowed for setuid/setgid script\n" );
41774096 else if (fdscript < 0 || suidscript != 1 )
41784097 /* PSz 13 Nov 03 Caught elsewhere, useless(?!) here */
41794098 Perl_croak (aTHX_ "(suid) fdscript needed in suidperl\n" );
0 commit comments