You can create a perl oneliner like this:
perl -MIO -e 'some_perl_code'
Can someone explain what this -MIO
means? Couldn't find any useful information about this (On https://perldoc.perl.org/perl.html there are flags -I
and -M
, but this makes no sense for me).
Refer to perldoc perlrun for Perl command line switches:
-M module executes
use module;
before executing your program. This loads the module and calls itsimport
method, causing the module to have its default effect, typically importing subroutines or giving effect to a pragma.
-MIO
is interpreted as the -M
option where the module name is IO . This is equivalent to using:
perl -e 'use IO; some_perl_code'
It does not use the -I
option.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.