Sponsored Content
Full Discussion: One liners, quick rant...
The Lounge What is on Your Mind? One liners, quick rant... Post 302977497 by elixir_sinari on Tuesday 19th of July 2016 07:11:21 AM
Old 07-19-2016
When I started out on unix.com, I was awestruck by the ultra-compressed one-liners from the clever guys (Scrutinizer, you were my hero!!!). Over time, I learned from you guys and started doling out some good (I believe Smilie) one-liners myself.

I viewed one-liners as a way to test my knowledge and bring in some supposedly esoteric features of the tool into the solution. But, now I realize that the people who will actually use that solution will hardly appreciate (or be able to) the "art". Also, the "compression" will only confuse myself some time in the future! So, it's better to make a trade-off somewhere...
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Where can I rant?

First of all, apologies to the admins for not reading the rules totally and missing the bit about ranting off about other OSs. But that raises a question. Where do you go to have a good rant, to vent your disgust at various corporations and thier hideous behaviour? :confused: (2 Replies)
Discussion started by: u6ik
2 Replies

2. Shell Programming and Scripting

awk - one liners

Guys, I have a requirement like this. A file has >5K records always. Separated by "|", it has 30 fields for each line. In some lines, I am getting an odd field. say, the 15th field is supposed to be 2 characters but comes in as >2. In this case, for resolving this I need to copy the value of... (6 Replies)
Discussion started by: PikK45
6 Replies

3. What is on Your Mind?

Those simple one liners

I wanted to say LOL and punch my face when I saw post#11 (where Don_Cragun even reduced the string manipulation with a simple regex) in the thread https://www.unix.com/shell-programming-scripting/220553-add-0-start-filename-2.html I mean, when things can be done with just a one liner, sometimes I... (6 Replies)
Discussion started by: ahamed101
6 Replies

4. What is on Your Mind?

A rant...

Hi guys... (Apologies for any typos etc...) This is basically a rant. I have been doing kids level projects and writing code to suit since around 1982, for the uProfessor, for the Sinclair Spectrum and later for the QL, IBM-XT in MS-DOS and after that for a 386DX40 up to Windows 95, until I... (3 Replies)
Discussion started by: wisecracker
3 Replies
Module::Package(3pm)					User Contributed Perl Documentation				      Module::Package(3pm)

NAME
Module::Package - Postmodern Perl Module Packaging SYNOPSIS
In your "Makefile.PL": use inc::Module::Package; or one of these invocations: # These two are functionally the same as above: use inc::Module::Package ':basic'; use inc::Module::Package 'Plugin:basic'; # With Module::Package::Catalyst plugin options use inc::Module::Package 'Catalyst'; # With Module::Package::Catalyst::common inline plugin class use inc::Module::Package 'Catalyst:common'; # Pass options to the Module::Package::Ingy::modern constructor use inc::Module::Package 'Ingy:modern', option1 => 'value1', option2 => 'value2'; DESCRIPTION
This module is a dropin replacement for Module::Install. It does everything Module::Install does, but just a bit better. Actually this module is simply a wrapper around Module::Install. It attempts to drastically reduce what goes in a Makefile.PL, while at the same time, fixing many of the problems that people have had with Module::Install (and other module frameworks) over the years. PROPAGANDA
Module::Install took Makefile.PL authoring from a black art to a small set of powerful and reusable instructions. It allowed packaging gurus to take their fancy tricks and make them into one liners for the rest of us. As the number of plugins has grown over the years, using Module::Install has itself become a bit of a black art. It's become hard to know all the latest tricks, put them in the correct order, and make sure you always use the correct sets for your various Perl modules. Added to this is the fact that there are a few problems in Module::Install design and general usage that are hard to fix and deploy with certainty that it will work in all cases. This is where Module::Package steps in. Module::Package is the next logical step in Makefile.PL authoring. It allows gurus to create well tested sets of Module::Install directives, and lets the rest of us use Makefile.PLs that are one line long. For example: use inc::Module::Package 'Catalyst:widget'; could be the one line Makefile.PL for a Catalyst widget (whatever that is) module distribution. Assuming someone creates a module called Module::Package::Catalyst, with an inline class called Module::Package::Catalyst::widget that inherited from Module::Package::Plugin. Module::Package is pragmatic. Even though you can do everything in one line, you are still able to make any Module::Install calls as usual. Also you can pass parameters to the Module::Package plugin. use inc::Module::Package 'Catalyst:widget', deps_list => 0, some_cataylst_thing => '...'; # All Module::Install plugins still work! requires 'Some::Module' => 3.14; This allows Module::Package::Catalyst to be configurable, even on the properties like "deps_list" that are inherited from Module::Package::Plugin. The point here is that with Module::Package, module packaging just got a whole lot more powerful and simple. A rare combination! FEATURES
Module::Package has many advantages over vanilla Module::Install. Smaller Makefile.PL Files In the majority of cases you can reduce your Makefile.PL to a single command. The core Module::Package invokes the Module::Install plugins that it thinks you want. You can also name the Module::Package plugin that does exactly the plugins you want. Reduces Module::Install Bloat Somewhere Module::Install development went awry, and allowed modules that only have useful code for an author, to be bundled into a distribution. Over time, this has created a lot of wasted space on CPAN mirrors. Module::Package fixes this. Collaborator Plugin Discovery An increasing problem with Module::Install is that when people check out your module source from a repository, they don't know which Module::Install plugin modules you have used. That's because the Makefile.PL only requires the function names, not the module names that they come from. Many people have realized this problem, and worked around it in various suboptimal ways. Module::Package manages this problem for you. Feature Grouping and Reuse Module::Install has lots of plugins. Although it is possible with plain Module::Install, nobody seems to make plugins that group other plugins. This also might introduce subtle problems of using groups with other groups. Module::Package has object oriented plugins whose main purpose is to create these groups. They inherit base functionality, subclass it to their design goals and can define options for the user to tweak how they will operate. USAGE
The basic anatomy of a Makefile.PL call to Module::Package is: use inc::Module::Package 'PluginName:flavor <version>', $option1 => $value1; The "inc::Module::Package" part uses the Module::Install "inc" bootstrapping trick. "PluginName:flavor" (note the single ':') resolves to the inline class "Module::Package::PluginName::flavor", within the module "Module::Package::PluginName". Module::Package::PluginName::flavor must be a subclass of Module::Package::Plugin. An optional version can be used after the plugin name. Optional key/value pairs can follow the Plugin specification. They are used to pass information to the plugin. See Plugin docs for more details. If ":flavor" is omitted, the class Module::Package::PluginName is used. The idea is that you can create a single module with many different plugin styles. If "PluginName" is omitted, then ":flavor" is used against Module::Package::Plugin. These are a set of common plugin classes that you can use. If "PluginName:flavor" is omitted altogether, it is the same as saying 'Plugin:basic'. Note that you need to specify the ':basic' plugin if you want to also pass it options. STATUS
This is still an early release. We are still shaking out the bugs. You might want to hold off for a bit longer before using Module::Package for important modules. SEE ALSO
o Module::Package::Plugin o Module::Install::Package o Module::Package::Tutorial AUTHOR
Ingy doet Net <ingy@cpan.org> COPYRIGHT AND LICENSE
Copyright (c) 2011. Ingy doet Net. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2011-10-06 Module::Package(3pm)
All times are GMT -4. The time now is 09:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy