Skip to content

Make Net::OpenSSH::More loadable - #56

Open
salva wants to merge 2 commits into
masterfrom
fix/more-loadable-module
Open

Make Net::OpenSSH::More loadable#56
salva wants to merge 2 commits into
masterfrom
fix/more-loadable-module

Conversation

@salva

@salva salva commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

Make lib/Net/OpenSSH/More.pm a valid standalone module instead of an installed source fragment.

Changes

  • Declare package Net::OpenSSH.
  • Enable strict and warnings.
  • Load Net::OpenSSH so internal helpers/constants are available.
  • Declare the shared package global $debug used by the extension.
  • Return true from the module.
  • Add More.pm to MANIFEST.

Fixes #37.

Testing

  • perl -Ilib -c lib/Net/OpenSSH/More.pm
  • perl -Ilib -MNet::OpenSSH::More -e 'print Net::OpenSSH->can(q(scp_cat)) ? qq(ok\\n) : qq(missing\\n)'
  • perl -Ilib -c lib/Net/OpenSSH.pm

Copilot AI review requested due to automatic review settings June 4, 2026 11:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make lib/Net/OpenSSH/More.pm loadable as a standalone Perl module (instead of behaving like an include fragment) so that it can be checked/loaded independently and packaged correctly (per Issue #37).

Changes:

  • Adds a module header to More.pm (package declaration, strict/warnings, load Net::OpenSSH, declare $debug, and return true).
  • Adds lib/Net/OpenSSH/More.pm to MANIFEST so it is included in the packaged distribution.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
MANIFEST Ensures More.pm is shipped as part of the distribution.
lib/Net/OpenSSH/More.pm Attempts to make More.pm independently loadable by adding a proper module preamble and 1;.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/Net/OpenSSH/More.pm
Comment on lines +1 to +9
package Net::OpenSSH;

use strict;
use warnings;

use Net::OpenSSH ();

our $debug;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this locally and the import concern does not reproduce. Both of these succeed on this branch:\n\nperl -Ilib -MNet::OpenSSH::More -e 'print Net::OpenSSH->can(q(scp_cat)) ? qq(ok\n) : qq(missing\n)'\n\nperl -Ilib -e 'use Net::OpenSSH::More; print Net::OpenSSH->can(q(scp_cat)) ? qq(ok\n) : qq(missing\n)'\n\nI added t/more.t anyway to make that load behavior explicit and keep it covered.

Comment thread lib/Net/OpenSSH/More.pm
Comment on lines +1 to +6
package Net::OpenSSH;

use strict;
use warnings;

use Net::OpenSSH ();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit 3c58f1a by adding t/more.t, which runs use Net::OpenSSH::More and verifies Net::OpenSSH->can('scp_cat').

@salva salva mentioned this pull request Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Net::OpenSSH::More is not a loadable standalone module

2 participants