-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation patch for -M #16909
Comments
From book@cpan.orgHere's a tiny documentation patch for -M. I found this while and reading `perlrun` and exploring the possibilities $ perl -MO=Deparse '-M5;insert_code_here()' -pe 1 Feel free to reword it as needed. -- Destroy the little and you destroy the large. |
From book@cpan.org0001-Document-a-way-to-perform-use-Module-VERSION-LIST-on.patchFrom 832c0a61e398ca47fc96eed3573c061ff8ba880d Mon Sep 17 00:00:00 2001
From: "Philippe Bruhat (BooK)" <book@cpan.org>
Date: Wed, 27 Mar 2019 09:00:24 +0100
Subject: [PATCH] Document a way to perform `use Module VERSION LIST` on the
command-line
The `split(/,/,q{foo,bar})` seems to still happen.
This is the currently documented case:
$ perl -MO=Deparse '-MList::Util=any,all' -e1
use List::Util (split(/,/, 'any,all', 0));
'???';
-e syntax OK
And these work too (and the split on comma also happens somehow):
$ perl -MO=Deparse '-MList::Util any,all' -e1
use List::Util ('any', 'all');
'???';
-e syntax OK
$ perl -MO=Deparse '-MList::Util 1.5' -e1
use List::Util 1.5;
'???';
-e syntax OK
$ perl -MO=Deparse '-MList::Util 1.5 any,all' -e1
use List::Util 1.5 ('any', 'all');
'???';
-e syntax OK
---
pod/perlrun.pod | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pod/perlrun.pod b/pod/perlrun.pod
index 77660ef17d..4855c29d81 100644
--- a/pod/perlrun.pod
+++ b/pod/perlrun.pod
@@ -692,6 +692,11 @@ is that B<-MI<MODULE>=number> never does a version check,
unless C<I<MODULE>::import()> itself is set up to do a version check, which
could happen for example if I<MODULE> inherits from L<Exporter>.
+However, it should be noted that since the syntax C<'-MI<MODULE foo,bar>'>
+shown above will generate C<use MODULE ('foo', 'bar')>, it's possible
+to do a version check using C<'-MI<MODULE VERSION foo,bar>'>, which will
+generate C<use MODULE VERSION ('foo', 'bar')>.
+
=item B<-n>
X<-n>
--
2.20.1
|
From @jkeenanOn Wed, 27 Mar 2019 08:56:54 GMT, book wrote:
If we accept the patch, then this becomes a feature which we have to support going forward. Do we want to do that? Should we? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From book@cpan.orgOn Wed, 27 Mar 2019 05:24:28 -0700, jkeenan wrote:
My understanding of many of the command-line operators like -p, -n, -e This powers the Eskimo Greeting secret operator `}{` and makes weird https://metacpan.org/pod/perlsecret#Eskimo-greeting -- BooK |
@book, if you want to move this patch forward, could you file a pull request? |
Migrated from rt.perl.org#133961 (status was 'open')
Searchable as RT133961$
The text was updated successfully, but these errors were encountered: