Rex::C...:Upload(3pm)
π Rex::Commands::Upload β the manual page, but make it cute β¨
okay bestie, so this is Rex::Commands::Upload(3pm), from the User Contributed Perl Documentation collection. Yes it's a mouthful. No we're not scared of it. π«Ά
β¨ NAME β¨
Rex::Commands::Upload β literally just: upload a local file to a remote server. That's the whole job. It does one thing and it eats. π
πΈ DESCRIPTION πΈ
So here's the tea: with this module you can upload a local file via sftp to a remote host. That's it. That's the vibe. Local file β remote host. Slay. π¦
π SYNOPSIS π
look at this lil baby example, so clean:
task "upload", "remoteserver", sub {
upload "localfile", "/remote/file";
};
like?? iconic. π
π EXPORTED FUNCTIONS π
π upload($local, $remote)
Perform an upload. Simple as that, no cap. And listen β if $remote is a directory, the file will be uploaded to that directory. She's smart like that. π§ β¨
task "upload", "remoteserver", sub {
upload "localfile", "/path";
};
This function supports the following hooks, and bestie, these are the good part, so pay attention:
beforeβ this gets executed before anything is done. All original parameters are passed to it.
β οΈ heads up: the return value of this hook overwrites the original parameters of the function-call. So likeβ¦ whatever you return from here becomes the new args. main character energy, honestly. π
before_changeβ this gets executed right before the new file is written. The local file name, and the remote file name, are passed as parameters. πafter_changeβ this gets executed right after the file was written. On top of the local file name, and the remote file name, any returned results are passed as parameters. πafterβ this gets executed right before theupload()function returns. All original parameters, and any results returned, are passed to it. A lil goodbye moment. π₯Ή
and that's the whole page, you're welcome π go forth and upload responsibly, fr fr. this was perl v5.40.1, dated 2025-10-03 β writing this to you from the Rex::C...:Upload(3pm) section of the manual, mwah πβ¨
π¦ where this page comes from
- ubuntu resolute: rex 1.16.1-1 Β· Apache-2.0
- ubuntu stonking: rex 1.16.1-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms