Sponsored Content
Full Discussion: Increase your income
The Lounge What is on Your Mind? Increase your income Post 302323820 by Neo on Tuesday 9th of June 2009 04:23:16 AM
Old 06-09-2009
Quote:
Originally Posted by ballack
I am a retired man. Though a get a pension, I would like to keep myself busy and do something to supplement my income. I want to work from home at my own pace and schedule. Do I have any choice?
This seems like a pretext to some spam, since the poster registered just to post the above witthout any context to Unix or Linux.

I think I'll close this thread to be on the safe side Smilie
 

10 More Discussions You Might Find Interesting

1. HP-UX

increase size

Hi All, one of the mount point in Hp ux server has reached 95% its a data base file and can not be deleted. so i want to know how to increase the size of mount point i am new to unix ,please help me (1 Reply)
Discussion started by: jyoti
1 Replies

2. UNIX for Dummies Questions & Answers

File increase

Sorry im really new here this is my second post today! My question is, im trying to write a script and i want to output to a text file but i want each text file to be different so for instance log.txt, log1.txt, log2.txt ect how would i do that? (7 Replies)
Discussion started by: chapmana
7 Replies

3. Solaris

how to increase fs

hi, i installed solaris 9 on my v240 server on 36gb disk. here are the ouputs of the df -h command: # df -h Filesystem size used avail capacity Mounted on /dev/dsk/c1t0d0s0 9.6G 3.4G 6.1G 36% / /proc 0K 0K 0K 0% /proc mnttab ... (6 Replies)
Discussion started by: xuc_xich_duc
6 Replies

4. HP-UX

increase fs /var

Question I am not a hp admin but aix admin. I am wondering if to increase the fs /var we really have to umount the fs so means stop the system ... just to do an extendlv ? It is what I saw on man page of extendlv and that surprise me. On aix we can dynamically increase a fs and with version... (2 Replies)
Discussion started by: touny
2 Replies

5. AIX

I can not increase the maxdata to 2 G.B

Please can anyone help me in my problem my problem is i have AIX 5.3 and We need 1 GB of data segment size available and we found To set the data segment size to 1 GB, set the LDR_CNTRL variable to LDR_CNTRL=MAXDATA=0x40000000@DSA. But after we set it and check with command “$ dump -X64 -o... (0 Replies)
Discussion started by: mghazaly
0 Replies

6. AIX

How to increase capacity?

Hello everybody, is a very simple question how can I increase the capacity of a disk wich is on a DS4300?, I have done the procedure on the Storage Manager but the space is the same on the AIX (5.3) , what should I do to obtain the new ammount of disk space? (16 Replies)
Discussion started by: GermanSkull
16 Replies

7. Shell Programming and Scripting

Increase Performance

I have written a code using AWK & sed to compare two files. The structure of the files is like this" Format is this: <bit code> <file code> <string> Follwoed by any numbers of properties lines whic start with a "space" 10101010101111101 XX abcd a AS sasa BS kkk 1110000101010110 XX... (1 Reply)
Discussion started by: sandeep_hi
1 Replies

8. AIX

How can I increase a PV?

Hi, I have a 10GB iSCSI LUN attached to an AIX 5.3 system. I increased the LUN to 15GB, but the system is still showing 10GB as the Total Size. How can I get the OS to see the extra space? Do I have to reboot the system? (2 Replies)
Discussion started by: bbbngowc
2 Replies

9. Red Hat

Increase maxuproc value

Hi Guys, I am running RHEL6 and now my processes reach maximum limit. How do I increase the maxuproc value? Can I increase the value without rebooting the server? Thanks in advance... Please Help!!! (5 Replies)
Discussion started by: Phuti
5 Replies

10. Solaris

Increase the / partition

Hi all im new to solaris and i got the task to increase the size of the / partition. its solaris 9 update6 running in a vmware esxi. i already added space on the VM, when im trying the "growfs" command im gettings error. see attached picture: http://i.imgur.com/9ywWLNN.png thanks for... (5 Replies)
Discussion started by: guy3145
5 Replies
Moose::Manual::MethodModifiers(3pm)			User Contributed Perl Documentation		       Moose::Manual::MethodModifiers(3pm)

NAME
Moose::Manual::MethodModifiers - Moose's method modifiers VERSION
version 2.0603 WHAT IS A METHOD MODIFIER
? Moose provides a feature called "method modifiers". You can also think of these as "hooks" or "advice". It's probably easiest to understand this feature with a few examples: package Example; use Moose; sub foo { print " foo "; } before 'foo' => sub { print "about to call foo "; }; after 'foo' => sub { print "just called foo "; }; around 'foo' => sub { my $orig = shift; my $self = shift; print " I'm around foo "; $self->$orig(@_); print " I'm still around foo "; }; Now if I call "Example->new->foo" I'll get the following output: about to call foo I'm around foo foo I'm still around foo just called foo You probably could have figured that out from the names "before", "after", and "around". Also, as you can see, the before modifiers come before around modifiers, and after modifiers come last. When there are multiple modifiers of the same type, the before and around modifiers run from the last added to the first, and after modifiers run from first added to last: before 2 before 1 around 2 around 1 primary around 1 around 2 after 1 after 2 WHY USE THEM
? Method modifiers have many uses. They are often used in roles to alter the behavior of methods in the classes that consume the role. See Moose::Manual::Roles for more information about roles. Since modifiers are mostly useful in roles, some of the examples below are a bit artificial. They're intended to give you an idea of how modifiers work, but may not be the most natural usage. BEFORE, AFTER, AND AROUND Method modifiers can be used to add behavior to methods without modifying the definition of those methods. BEFORE and AFTER modifiers Method modifiers can be used to add behavior to a method that Moose generates for you, such as an attribute accessor: has 'size' => ( is => 'rw' ); before 'size' => sub { my $self = shift; if (@_) { Carp::cluck('Someone is setting size'); } }; Another use for the before modifier would be to do some sort of prechecking on a method call. For example: before 'size' => sub { my $self = shift; die 'Cannot set size while the person is growing' if @_ && $self->is_growing; }; This lets us implement logical checks that don't make sense as type constraints. In particular, they're useful for defining logical rules about an object's state changes. Similarly, an after modifier could be used for logging an action that was taken. Note that the return values of both before and after modifiers are ignored. AROUND modifiers An around modifier is more powerful than either a before or after modifier. It can modify the arguments being passed to the original method, and you can even decide to simply not call the original method at all. You can also modify the return value with an around modifier. An around modifier receives the original method as its first argument, then the object, and finally any arguments passed to the method. around 'size' => sub { my $orig = shift; my $self = shift; return $self->$orig() unless @_; my $size = shift; $size = $size / 2 if $self->likes_small_things(); return $self->$orig($size); }; Wrapping multiple methods at once "before", "after", and "around" can also modify multiple methods at once. The simplest example of this is passing them as a list: before [qw(foo bar baz)] => sub { warn "something is being called!"; }; This will add a "before" modifier to each of the "foo", "bar", and "baz" methods in the current class, just as though a separate call to "before" was made for each of them. The list can be passed either as a bare list, or as an arrayref. Note that the name of the function being modified isn't passed in in any way; this syntax is only intended for cases where the function being modified doesn't actually matter. If the function name does matter, use something like this: for my $func (qw(foo bar baz)) { before $func => sub { warn "$func was called!"; }; } Using regular expressions to select methods to wrap In addition, you can specify a regular expression to indicate the methods to wrap, like so: after qr/^command_/ => sub { warn "got a command"; }; This will match the regular expression against each method name returned by "get_method_list" in Class::MOP::Class, and add a modifier to each one that matches. The same caveats apply as above. Using regular expressions to determine methods to wrap is quite a bit more powerful than the previous alternatives, but it's also quite a bit more dangerous. Bear in mind that if your regular expression matches certain Perl and Moose reserved method names with a special meaning to Moose or Perl, such as "meta", "new", "BUILD", "DESTROY", "AUTOLOAD", etc, this could cause unintended (and hard to debug) problems and is best avoided. INNER AND AUGMENT
Augment and inner are two halves of the same feature. The augment modifier provides a sort of inverted subclassing. You provide part of the implementation in a superclass, and then document that subclasses are expected to provide the rest. The superclass calls "inner()", which then calls the "augment" modifier in the subclass: package Document; use Moose; sub as_xml { my $self = shift; my $xml = "<document> "; $xml .= inner(); $xml .= "</document> "; return $xml; } Using "inner()" in this method makes it possible for one or more subclasses to then augment this method with their own specific implementation: package Report; use Moose; extends 'Document'; augment 'as_xml' => sub { my $self = shift; my $xml = " <report> "; $xml .= inner(); $xml .= " </report> "; return $xml; }; When we call "as_xml" on a Report object, we get something like this: <document> <report> </report> </document> But we also called "inner()" in "Report", so we can continue subclassing and adding more content inside the document: package Report::IncomeAndExpenses; use Moose; extends 'Report'; augment 'as_xml' => sub { my $self = shift; my $xml = ' <income>' . $self->income . '</income>'; $xml .= " "; $xml .= ' <expenses>' . $self->expenses . '</expenses>'; $xml .= " "; $xml .= inner() || q{}; return $xml; }; Now our report has some content: <document> <report> <income>$10</income> <expenses>$8</expenses> </report> </document> What makes this combination of "augment" and "inner()" special is that it allows us to have methods which are called from parent (least specific) to child (most specific). This inverts the normal inheritance pattern. Note that in "Report::IncomeAndExpenses" we call "inner()" again. If the object is an instance of "Report::IncomeAndExpenses" then this call is a no-op, and just returns false. It's a good idea to always call "inner()" to allow for future subclassing. OVERRIDE AND SUPER
Finally, Moose provides some simple sugar for Perl's built-in method overriding scheme. If you want to override a method from a parent class, you can do this with "override": package Employee; use Moose; extends 'Person'; has 'job_title' => ( is => 'rw' ); override 'display_name' => sub { my $self = shift; return super() . q{, } . $self->title(); }; The call to "super()" is almost the same as calling "$self->SUPER::display_name". The difference is that the arguments passed to the superclass's method will always be the same as the ones passed to the method modifier, and cannot be changed. All arguments passed to "super()" are ignored, as are any changes made to @_ before "super()" is called. SEMI-COLONS Because all of these method modifiers are implemented as Perl functions, you must always end the modifier declaration with a semi-colon: after 'foo' => sub { }; CAVEATS
These method modification features do not work well with multiple inheritance, due to how method resolution is performed in Perl. Experiment with a test program to ensure your class hierarchy works as expected, or more preferably, don't use multiple inheritance (roles can help with this)! AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for details. COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-28 Moose::Manual::MethodModifiers(3pm)
All times are GMT -4. The time now is 11:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy