DEV Community

Yuki Kimoto
Yuki Kimoto

Posted on

Suggestion: cpanm is added to Perl core

I suggest cpanm is added to Perl core.

For now, cpanm is attached to all SPVM repositories for portable tests using Github Action.

And if anyone knows the way to install cpanm using IO::Socket::INET, please let me know.

The following oneliner failed.

perl -MIO::Socket::INET -e 'my $socket = IO::Socket::INET->new(PeerAddr => "cpanmin.us", PeerPort => 80, Proto=> "tcp");print $socket "GET / HTTP/1.0\r\n\r\n";print <$socket>;close($sock);' > cpanm
Enter fullscreen mode Exit fullscreen mode

I got the answer. The following oneliner works well.

perl -MIO::Socket::INET -e 'my $socket = IO::Socket::INET->new(PeerAddr => "cpanmin.us", PeerPort => 80, Proto=> "tcp");print $socket "GET / HTTP/1.0\r\nHost: cpanmin.us\r\n\r\n";;print <$socket>;close($sock);' > cpanm
Enter fullscreen mode Exit fullscreen mode

cpanm can be used from Perl 5.8.1.

Top comments (4)

Collapse
 
ap profile image
Aristotle Pagaltzis • Edited

Please let me know

print $socket "GET / HTTP/1.0\r\nHost: cpanmin.us\r\n\r\n";
Enter fullscreen mode Exit fullscreen mode
Collapse
 
yukikimoto profile image
Yuki Kimoto

Thank you very much.

It works well.

Collapse
 
ap profile image
Aristotle Pagaltzis • Edited

cpanm can be used from Perl 5.6.

Not recent versions: metacpan.org/release/MIYAGAWA/App-...

It is probably still possible to run an older version of cpanminus which works on 5.6. But the MetaCPAN API has changed over time so unfortunately you can expect that someday these old versions will stop being able to talk to it.

Collapse
 
yukikimoto profile image
Yuki Kimoto

Sorry, it is 5.8.1. I fixed it.