ExtUtils::PL2Bat(3pm)

πŸ“¦
version 5.42.3 Β· 4 versions
, in alpine 3.24

Okay bestie, welcome to the ExtUtils::PL2Bat(3pm) page from the Perl Programmers Reference Guide β€” aka the manual for ExtUtils::PL2Bat πŸ’–

✨ NAME ✨

ExtUtils::PL2Bat β€” batch file creation to run perl scripts on Windows πŸͺŸβœ¨

πŸŽ€ VERSION πŸŽ€

version 0.005 β€” noted, bestie πŸ’…

🌸 OVERVIEW 🌸

So here’s the vibe: this module converts a perl script into a batch file that can be executed on Windows/DOS-like operating systems. The whole point is to let you use a Perl script like regular programs and batch files β€” where you just enter the name of the script [probably minus the extension] plus any command-line arguments, and the script is found in your PATH and run. Periodt. πŸ¦‹

πŸ”₯ FUNCTIONS πŸ”₯

πŸ’œ pl2bat(%opts) πŸ’œ

This function takes a perl script and writes a batch file that contains the script. Sometimes this is just necessary, okay? 😌

  • in β€” the name of the script that is to be batchified. This argument is mandatory, no cap. 🚨
  • out β€” the name of the output batch file. If it’s not given, it will be generated using in and stripsuffix. πŸŽ€
  • ntargs β€” arguments to invoke perl with in the generated batch file when run from Windows NT. Defaults to -x -S %0 %* ✨
  • otherargs β€” arguments to invoke perl with in the generated batch file except when run from Windows NT (ie. when run from DOS, Windows 3.1, or Windows 95). Defaults to -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 πŸ’«
  • stripsuffix β€” strip a suffix string from the file name before appending a .bat suffix. The suffix is not case-sensitive. It can be a regex or a string, and a trailing $ is always assumed. Defaults to qr/\.plx?/ 🌈
  • usewarnings β€” with the usewarnings option, the exact string -w is added after the value of $Config{startperl}. If a line matching /^#!.*perl/ already exists in the script, then it is not changed and the -w option is ignored. 🫢
  • update β€” if the script appears to have already been processed by pl2bat, then the script is skipped and not processed unless update was specified. If update is specified, the existing preamble is replaced. πŸ‘‘

🌟 ACKNOWLEDGEMENTS 🌟

Real talk: this code was taken from Module::Build and then modified; which had taken it from perl’s pl2bat script. This module is an attempt at unifying all three implementations. Iconic, honestly. πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

Leon Timmermans <leont@cpan.org> πŸ’Œ

This software is copyright (c) 2015 by Leon Timmermans. πŸŽ€

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. ✨


Later, bestie β€” this page is from perl v5.42.3, dated 2026-11-03 πŸ’…πŸ«Ά

πŸ“¦ where this page comes from