I put dualLivedList.pl together as a prelude to a module, something like corelist, but for dualLived modules. From the commandline, just enter dualLivedList.pl <module name>, and it will tell you if it is dualLived. If it's not, it returns undef.

Update: Fixed script. Placed the current script below first.

#!/usr/bin/perl use strict; use warnings; use Data::Dumper::Concise; my $dualLived = shift @ARGV; my $d = "$dualLived is dualLived"; my %mods = ( "autodie" => $d, "base" => $d, "bigint" => $d, "constant" => $d, "encoding" => $d, "if" => $d, "lib" => $d, "parent" => $d, "threads" => $d, "threads::shared" => $d, "version" => $d, "Test::Harness" => $d, "Archive::Extract" => $d, "Archive::Tar" => $d, "Attribute::Handlers" => $d, "AutoLoader" => $d, "B::Debug" => $d, "B::Lint" => $d, "CGI" => $d, "CPAN" => $d, "CPANPLUS" => $d, "CPANPLUS::Dist::Build" => $d, "Class::ISA" => $d, "Compress::Raw::Bzip2" => $d, "Compress::Raw::Zlib" => $d, "Compress::Zlib" => $d, "Cwd" => $d, "DB_File" => $d, "Data::Dumper" => $d, "Devel::InnerPackage" => $d, "Devel::PPPort" => $d, "Digest" => $d, "Digest::MD5" => $d, "Digest::SHA" => $d, "Exporter" => $d, "ExtUtils::CBuilder" => $d, "ExtUtils::Command" => $d, "ExtUtils::MakeMaker" => $d, "ExtUtils::Constant::Base" => $d, "ExtUtils::Install" => $d, "ExtUtils::Manifest" => $d, "ExtUtils::ParseXS" => $d, "File::Fetch" => $d, "File::Path" => $d, "File::Temp" => $d, "Text::Balanced" => $d, "Filter::Simple" => $d, "Filter::Util::Call" => $d, "Getopt::Long" => $d, "I18N::LangTags" => $d, "IO" => $d, "IO::Compress::Base" => $d, "IO::Zlib" => $d, "IPC::Cmd" => $d, "IPC::Msg" => $d, "List::Util" => $d, "Locale::Constants" => $d, "Locale::Maketext" => $d, "Locale::Maketext::Simple" => $d, "Log::Message" => $d, "MIME::Base64" => $d, "Math::BigInt" => $d, "Math::BigInt::FastCalc" => $d, "Math::BigRat" => $d, "Math::Complex" => $d, "Memoize" => $d, "Module::Build" => $d, "Module::CoreList" => $d, "Module::Load" => $d, "Module::Load::Conditional" => $d, "Module::Loaded" => $d, "Module::Pluggable" => $d, "NEXT" => $d, "Net::Cmd" => $d, "Package::Constants" => $d, "Params::Check" => $d, "Parse::CPAN::Meta" => $d, "PerlIO::via::QuotedPrint" => $d, "Pod::Checker" => $d, "Pod::Escapes" => $d, "Pod::LaTeX" => $d, "Pod::Man" => $d, "Pod::Perldoc" => $d, "Pod::Plainer" => $d, "Pod::Simple" => $d, "Pod::Usage" => $d, "Safe" => $d, "SelfLoader" => $d, "Shell" => $d, "Storable" => $d, "Switch" => $d, "Sys::Syslog" => $d, "Term::ANSIColor" => $d, "Term::Cap" => $d, "Term::UI" => $d, "Test" => $d, "Test::Simple" => $d, "Text::Balanced" => $d, "Text::ParseWords" => $d, "Text::Soundex" => $d, "Text::Tabs" => $d, "Thread::Queue" => $d, "Thread::Semaphore" => $d, "Tie::File" => $d, "Tie::RefHash" => $d, "Time::HiRes" => $d, "Time::Local" => $d, "Time::Piece" => $d, "Unicode::Collate" => $d, "Unicode::Normalize" => $d, "Win32" => $d, "Win32API::File" => $d, "XSLoader" => $d ); print Dumper($mods{$dualLived});
New script:
#!/usr/bin/perl use strict; no warnings; use Data::Dumper::Concise; my $d = shift @ARGV; my @mods = ( "autodie", "base", "bigint", "constant", "encoding", "if", "lib", "parent", "threads", "threads::shared", "version", "Test::Harness", "Archive::Extract", "Archive::Tar", "Attribute::Handlers", "AutoLoader", "B::Debug", "B::Lint", "CGI", "CPAN", "CPANPLUS", "CPANPLUS::Dist::Build", "Class::ISA", "Compress::Raw::Bzip2", "Compress::Raw::Zlib", "Compress::Zlib", "Cwd", "DB_File", "Data::Dumper", "Devel::InnerPackage", "Devel::PPPort", "Digest", "Digest::MD5", "Digest::SHA", "Exporter", "ExtUtils::CBuilder", "ExtUtils::Command" , "ExtUtils::MakeMaker", "ExtUtils::Constant::Base", "ExtUtils::Install", "ExtUtils::Manifest", "ExtUtils::ParseXS", "File::Fetch", "File::Path", "File::Temp", "Text::Balanced", "Filter::Simple", "Filter::Util::Call", "Getopt::Long", "I18N::LangTags", "IO", "IO::Compress::Base", "IO::Zlib", "IPC::Cmd", "IPC::Msg", "List::Util", "Locale::Constants", "Locale::Maketext", "Locale::Maketext::Simple", "Log::Message", "MIME::Base64", "Math::BigInt", "Math::BigInt::FastCalc", "Math::BigRat", "Math::Complex", "Memoize", "Module::Build", "Module::CoreList", "Module::Load", "Module::Load::Conditional", "Module::Loaded", "Module::Pluggable", "NEXT", "Net::Cmd", "Package::Constants", "Params::Check", "Parse::CPAN::Meta", "PerlIO::via::QuotedPrint", "Pod::Checker", "Pod::Escapes", "Pod::LaTeX", "Pod::Man", "Pod::Perldoc", "Pod::Plainer", "Pod::Simple", "Pod::Usage", "Safe", "SelfLoader", "Shell", "Storable", "Switch", "Sys::Syslog", "Term::ANSIColor", "Term::Cap", "Term::UI", "Test", "Test::Simple", "Text::Balanced", "Text::ParseWords", "Text::Soundex", "Text::Tabs", "Thread::Queue", "Thread::Semaphore", "Tie::File", "Tie::RefHash", "Time::HiRes", "Time::Local", "Time::Piece", "Unicode::Collate", "Unicode::Normalize", "Win32", "Win32API::File", "XSLoader"); my @matches = grep $_ eq $d, @mods; if (@matches) { warn Dumper("@matches is dualLived"); } else { warn Dumper("It's not dualLived"); }

Replies are listed 'Best First'.
Re: A dualLived command-line util
by shmem (Chancellor) on Apr 10, 2010 at 23:16 UTC
    my %mods = ( "autodie" => $d, "base" => $d, "bigint" => $d, ...

    After typing the third instance of "foo" => $d, I'd go "wait. What the hell am I doing?"

      Thanks, I needed that:-).
Re: A dualLived command-line util
by toolic (Bishop) on Apr 10, 2010 at 12:41 UTC
    Khen1950fx,

    Please provide a concise definition of a "dualLived module". When I googled the term, this seems like the most relevant link. Are there other useful links? Since you did not provide any background on why I would use your code, you must be assuming this is common knowledge.

    Please describe how this differs from Module::CoreList. I know that corelist is strongly dependent on the version of Perl.

      The link that you gave is my general reference, and it's the link that I usually give out. As for a definition, for me at least, a dualLived module is part of the core but can be downloaded and installed without the need to reinstall perl.

      As for corelist, I wanted a script that, like corelist, would enable me to enter a module name and get back an answer about whether it was dualLived or not dualLived.

Re: A dualLived command-line util
by jdporter (Paladin) on Apr 12, 2010 at 16:34 UTC

    This seems rather extravagant. Why not just put the list of names in a plain text file and grep it?

Re: A dualLived command-line util
by ikegami (Patriarch) on Apr 13, 2010 at 01:35 UTC
    A module that is currently dual-lived — note the spelling — might not always have been (e.g. autodie) and might not always be (e.g. Switch). You should take the hint from corelist and make it searchable by Perl version. In fact, why you don't you add this functionality to corelist itself?
Re: A dualLived command-line util (5.12.0)
by ww (Archbishop) on Apr 13, 2010 at 01:31 UTC

    And just to remind us "how quickly things change:"

    From Internal Changes in 5.12.0

    "
    • The internal structure of the dual-life modules traditionally found in the lib/ and ext/ directories in the perl source has changed significantly. Where possible, dual-lifed modules have been extracted from lib/ and ext/.

      Dual-lifed modules maintained by Perl's developers as part of the Perl core now live in dist/. Dual-lifed modules maintained primarily on CPAN now live in cpan/. When reporting a bug in a module located under cpan/, please send your bug report directly to the module's bug tracker or author, rather than Perl's bug tracker.
    "