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 the upload() 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