PRT(1p)
π prt β the manual page, but make it cute (PRT(1p), bestie)
okay so you found the PRT(1p) page, that's the User Contributed Perl Documentation section, and we're about to make it make sense. this is prt, the command line frontend of App::PRT, and honestly? she's iconic. let's go π«Ά
β¨ NAME β¨
prt β the command line frontend of App::PRT. that's it, that's the name, short and slay.
πΈ SYNOPSIS πΈ
bestie, the vibe is literally just this:
$ prt <command> <args>
$ prt <command> <args> <files>
you give her a <command>, you give her <args>, and optionally you hand over some <files> too. done. periodt. π
π¦ DESCRIPTION π¦
so, prt is the command line frontend of App::PRT. that's the whole description, no notes, no lore, just a little doorway into the library. iykyk. β¨
π SUBCOMMANDS π
this is the main character section, ngl. here's every single subcommand she has:
replace_tokenβ swaps a token out. wanna replace"foo"token with"bar"? like this:
prt replace_token foo bar
and if you're picky (valid) and you want to replace "foo" token with "bar" but only when the target statements also have the "bazz" token, you add the filter:
prt replace_token foo bar --in-statement bazz
obsessed with the precision honestly. π
rename_classβ renaming a class, but make it one line. this renames the"Foo"class to the"Bar"class:
prt rename_class Foo Bar
rename_namespaceβ bigger energy thanrename_class: this one renames"Foo"and"Foo::*"classes over to"Bar"and"Bar::*"classes. so the whole namespace comes with you:
prt rename_namespace Foo Bar
delete_methodβ be so fr, sometimes a method has to go. this deletes the"eat"method from the"Food"class:
prt delete_method Food eat
(rip eat, you served cunt. π)
move_class_methodβ this one relocates things. it moves themethodmethod in theClassclass to become theanother_methodmethod in theAnotherClassclass. and heads up:"Class"'s including packages get copied over to"AnotherClass"too, so nothing gets left behind:
prt move_class_method 'Class#method' 'AnotherClass#another_method'
note those single quotes, bestie, keep them exactly like that.
introduce_variablesβ this one prints the variables in the source code. and the slay part? this command accepts input fromSTDIN. so all of these work:
prt introduce_variables a.pl
cat a.pl | prt introduce_variables
pbpaste | prt introduce_variables
pipe it, paste it, file it, whatever. she eats. π₯
list_filesβ lists the files that"App::PRT"would process. super useful, like, for example if you want to search the contents of the Perl sources in a project:
grep "some_regex" `prt list_files`
and the -0 argument makes outputs get separated by "\0" instead of the default "\n". which is giving safe-for-weird-filenames energy. for example:
prt list_files -0 | xargs -0 grep "some_regex"
π§ TARGET FILES π§
you can specify the target files you want to refactor. for example:
prt replace_token foo bar lib/**/*.pm t/*.t # Refactor Perl modules in lib/ and test files in t/
NOTE:"App::PRT"does not glob (expand wildcards). so in that command up there, the shell has to expand the"**/*.pm"and"*.t"for you. don't expectApp::PRTto do it, she will not. π
without target files, "App::PRT" detects source files in your project automatically. she looks for a "cpanfile" to detect the project's root directory. and when she's executed in a git repository, all files in the repository are used. like:
prt replace_token foo bar # Refactor the project in current working directory
so if you just want the whole current working directory project refactored, no file list needed, she's got you. π
π LICENSE π
Copyright (C) 2014-2019 hitode909 and contributors.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. open source royalty, as she should be. π
π AUTHOR π
hitode909 <hitode909@gmail.com>
and that's the whole page, bestie!! β¨ this was PRT(1p) from perl v5.36.0, dated 2023-10-03, brought to you by User Contributed Perl Documentation. now go refactor something cute. mwah. π
ππ¦
π¦ where this page comes from
- debian trixie: prt 0.22-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: prt 0.22-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: prt 0.22-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms