Net::S...Compat(3pm)
β¨ NAME β¨
Net::SFTP::Foreign::Compat β bestie, it's an Adapter for Net::SFTP compatibility π (and yeah, it lives in the 3pm part of the manual, aka User Contributed Perl Documentation, so you're in the right place π«Ά)
πΈ SYNOPSIS πΈ
okay so here's the whole vibe, literally just copy-paste energy:
use Net::SFTP::Foreign::Compat;
my $sftp = Net::SFTP::Foreign::Compat->new($host);
$sftp->get("foo", "bar");
$sftp->put("bar", "baz");
use Net::SFTP::Foreign::Compat ':supplant';
my $sftp = Net::SFTP->new($host);
see how the second one just... says Net::SFTP? that's the :supplant tag doing its thing, we'll get there π¦
π DESCRIPTION π
So this package is a wrapper around Net::SFTP::Foreign that hands you an API that's (mostly) compatible with the API of Net::SFTP. that's it, that's the whole job. it's giving translator, it's giving bridge, it's giving "I got you bestie, you don't have to rewrite your code" π
The methods on this package are identical to the ones in Net::SFTP β with one teeny tiny exception: you gotta use Net::SFTP::Foreign::Attributes::Compat objects instead of Net::SFTP::Attributes. that's the one swap, no cap. π₯
And now the iconic part: if you use the :supplant tag, this module also installs wrappers on the Net::SFTP and Net::SFTP::Attributes packages. which means? zero other parts of your program need to be modified in order to move from Net::SFTP to Net::SFTP::Foreign. no editing, no find-and-replace, no tears. main character migration energy π
π Setting defaults π
So there's this hash β %Net::SFTP::Foreign::DEFAULTS β and you can use it to set default values for Net::SFTP::Foreign methods that get called under the hood but are otherwise not accessible through the Net::SFTP API. sneaky? a little. useful? absolutely π
Here's the entries it currently supports:
new => \@optsβ extra options passed to the Net::SFTP::Foreign constructor. β¨get => \@optsβ extra options passed to theNet::SFTP::Foreign::getmethod.put => \@optsβ extra options passed to theNet::SFTP::Foreign::putmethod.ls => \@optsβ extra options passed to theNet::SFTP::Foreign::lsmethod.
like, that's the whole list. four entries. short and slay π
π COPYRIGHT π
Copyright (c) 2006-2008, 2011 Salvador FandiΓ±o
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay so real talk: that's the legal bit and you should not skip it, even though it's the least fun paragraph on the page. respect the author, respect the license, periodt π
and that's a wrap, bestie!! π this page came to you from perl v5.32.0, dated 2021-01-23, and it's the Net::S...Compat(3pm) page you just read all the way through β proud of you fr fr πβ¨π¦
π¦ where this page comes from
- debian bookworm: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-sftp-foreign-perl 1.93+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms