Update: Fixed script. Placed the current script below first.
New script:#!/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});
#!/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"); }
In reply to A dualLived command-line util by Khen1950fx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |