Net::O...at::SSH(3pm)

πŸ“¦
version 0.09 Β· 2 versions
  • 0.09 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.09 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Net::OpenSSH::Compat::SSH β€” bestie edition ✨

okay so this is Net::OpenSSH::Compat::SSH, and it lives in the User Contributed Perl Documentation section of the manual (you know, the (3pm) crew πŸ’…). if you're a Net::SSH girlie who wants Net::OpenSSH energy under the hood, this is literally your page. 🫢


🌸 NAME 🌸

Net::OpenSSH::Compat::SSH β€” a Net::OpenSSH adapter that gives you Net::SSH API compatibility. it's giving "glow up, but make it drop-in." ✨


πŸŽ€ SYNOPSIS πŸŽ€

  use Net::OpenSSH::ConnectionCache; # for speed bost
  use Net::OpenSSH::Compat qw(Net::SSH);

  use Net::SSH qw(ssh ssh_cmd sshopen3);

  my $out = ssh_cmd('username@host', $command);

  sshopen2('user@hostname', $reader, $writer, $command);

  sshopen3('user@hostname', $writer, $reader, $error, $command);

look at that. three whole helpers, no cap. ssh_cmd grabs you the output, sshopen2 hands you a reader and a writer, and sshopen3 pulls up with a reader, a writer and an error handle. main character trio fr fr. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea: this module implements the Net::SSH API on top of Net::OpenSSH. it's a compatibility layer, aka a little wardrobe change so your old code still slays. πŸ’œ

once you load it like this:

  use Net::OpenSSH::Compat 'Net::SSH';

or, if you're feeling command-line chaotic:

  $ perl -MNet::OpenSSH::Compat=Net::SSH script.pl

then boom β€” it will supplant the Net::SSH module as if it was installed on the machine, and use Net::OpenSSH under the hood to handle all your SSH operations. sneaky? no. iconic? yes. πŸ™ˆβœ¨

most programs using Net::SSH should continue to work without any change. like, zero edits, zero tears, just vibes. πŸ˜­πŸ’–

and you can run it together with Net::OpenSSH::ConnectionCache β€” usually for a big speed boost. it's the little collab that eats. πŸ”₯ (hot tip: that's the same thing the synopsis is on about up there πŸ‘€)

ngl, if you're swapping Net::SSH out for this, definitely pair it with Net::OpenSSH::ConnectionCache. the manpage says big speed boost and honestly? believe it. 🧚

and that's the whole page, bestie β€” short, sweet, and it ate. πŸ’…

sign-off time: this beauty is documented as perl v5.34.0, dated 2022-06-30, and yes, it's still filed under Net::O...at::SSH(3pm) because the header column only has so much room and the terminal said "abbreviate or perish." πŸ’€βœ¨ go write some SSH, you gorgeous nerd. πŸ“πŸŒˆβ­

πŸ“¦ where this page comes from