Sponsored Content
The Lounge What is on Your Mind? Post Your Favorite Joke! Laugh a Little! Post 302304696 by Franklin52 on Tuesday 7th of April 2009 05:44:36 AM
Old 04-07-2009
A game warden came upon a duck hunter who had bagged 3 ducks and decided to "enforce the laws pending".

He stopped the hunter, flashed his badge and said, "Looks like you've had a pretty good day. Mind if I inspect your kill?"
The hunter shrugged and handed the ducks to the warden.

The warden took one of the ducks, inserted his finger into the duck's butt, pulled it out, sniffed it, and said, "This here's a Washington state duck. Do you have a Washington state hunting license?"
The hunter pulled out his wallet and calmly showed the warden a Washington state hunting license.

The warden took a second duck, inserted another finger in the bird's butt, pulled it out, sniffed it, and said, "This here's an Idaho duck. Do you have an Idaho state hunting license?"
The hunter, getting annoyed, produced an Idaho state hunting license.

The warden took a third duck, conducted the same finger test, and said,
"This here's an Oregon state duck. Do you have an Oregon state hunting license?"
Once again, only this time more aggravated, the hunter produced the appropriate license.

The warden, a little disappointed at having struck out, handed the ducks back to the hunter and said, "You've got all of these licenses, just where the hell are you from?"

The hunter dropped his pants, bent over, and said "You're so smart, YOU tell ME!"
 

6 More Discussions You Might Find Interesting

1. What is on Your Mind?

Post Your Favorite UNIX/Linux Related RSS Feed Links

Hello, I am planning to revise the RSS News subforum areas, here: News, Links, Events and Announcements - The UNIX Forums ... maybe with a subforum for each OS specific news, like HP-UX, Solaris, RedHat, OSX, etc. RSS subforums.... Please post your favorite OS specific RSS (RSS2) link... (0 Replies)
Discussion started by: Neo
0 Replies

2. What is on Your Mind?

This will make you laugh.

Some of you may have seen this on other websites. But if you havnt this is great. It could actually be one of you here. Being in the IT Industry I have seen it ALMOST to this extent. The Website is Down!!! My Networks Down - FIX IT! :b: (0 Replies)
Discussion started by: Ikon
0 Replies

3. Web Development

Post Your Favorite FireFox Add-Ons Here

In an earlier poll I was a bit surprised to learn that FireFox was so popular, over 95% have voted for FireFox to date. So, let's take a little time and please list your favorite, most useful, FireFox add-ons (with links to the add-on) and add a few words on how often and how useful do you find... (17 Replies)
Discussion started by: Neo
17 Replies

4. What is on Your Mind?

Contagious Laugh

If you watch this and dont laugh, something is very wrong with you. Contagious Laugh .:b: (0 Replies)
Discussion started by: Ikon
0 Replies

5. What is on Your Mind?

Very Funny - Had to laugh

Guys, This is funny. http://i28.photobucket.com/albums/c228/jralph2005/bart.png jaysunn (2 Replies)
Discussion started by: jaysunn
2 Replies

6. UNIX for Beginners Questions & Answers

Is it a joke or a command?

Hello, I have found some commands in a forum under "top ten unix commands" topic and I'd like to ask: what does below command do: Could it really be a command or a joke? :(){ :|:& };: Thanks Boris (6 Replies)
Discussion started by: baris35
6 Replies
asa(3pm)						User Contributed Perl Documentation						  asa(3pm)

NAME
asa - Lets your class/object say it works like something else SYNOPSIS
######################################### # Your Code package My::WereDuck; use base 'My::Lycanthrope'; use asa 'Duck'; sub quack { return "Hi! errr... Quack!"; } ################################################ # Their Code sub strangle { my $duck = shift; unless ( $duck->isa('Duck') ) { die "We only strangle ducks"; } print "Farmer Joe wrings the duck's neck "; print "Said the duck, '" . $duck->quack . "' "; print "We ate well that night. "; } DESCRIPTION
Perl 5 doesn't natively support Java-style interfaces, and it doesn't support Perl 6 style roles either. You can get both of these things in half a dozen different ways via various CPAN modules, but they usually require that you buy into "their way" of implementing your code. Other have turned to "duck typing". This is, for the most part, a fairly naive check that says "can you do this method", under the "if it looks like a duck, and quacks like a duck, then it must be a duck". It assumes that if you have a "->quack" method, then they will treat you as a duck, because doing things like adding "Duck" to your @ISA array means you are also forced to take their implementation. There is, of course, a better way. For better or worse, Perl's "->isa" functionality to determine if something is or is not a particular class/object is defined as a method, not a function, and so that means that as well as adding something to you @ISA array, so that Perl's "UNIVERSAL::isa" method can work with it, you are also allowed to simply overload your own "isa" method and answer directly whether or not you are something. The simplest form of the idiom looks like this. sub isa { return 1 if $_[1] eq 'Duck'; shift->SUPER::isa(@_); } This reads "Check my type as normal, but if anyone wants to know if I'm a duck, then tell them yes". Now, there are a few people that have argued that this is "lying" about your class, but this argument is based on the idea that @ISA is somehow more "real" than using the method directly. It also assumes that what you advertise you implement needs to be in sync with the method resolution for any given function. But in the best and cleanest implementation of code, the API is orthogonal (although most often related) to the implementation. And although @ISA is about implementation and API, overloading "isa" to let you change your API is not at all bad when seen in this light. What does asa.pm do? Much as base provides convenient syntactic sugar for loading your parent class and setting @ISA, this pragma will provide convenient syntactic sugar for creating your own custom overloaded isa functions. Beyond just the idiom above, it implements various workarounds for some edge cases, so you don't have to, and allows clear seperation of concerns. You should just be able to use it, and if something ever goes wrong, then it's my fault, and I'll fix it. What doesn't asa.pm do? In Perl, highly robust introspection is really hard. Which is why most modules that provide some level of interface functionality require you to explicitly define them in multiple classes, and start to tread on your toes. This class does not do any strict enforcement of interfaces. 90% of the time, what you want to do, and the methods you need to implement, are going to be pretty obvious, so it's your fault if you don't provide them. But at least this way, you can implement them however you like, and "asa" will just take care of the details of safely telling everyone else you are a duck :) What if a Duck method clashes with a My::Package method? Unlike Perl 6, which implements a concept called "multi-methods", Perl 5 does not have a native approach to solving the problem of "API collision". Originally from the Java/C++ world, the problem of overcoming language API limitations can be done through the use of one of several "design patterns". For you, the victim of API collision, you might be interested in the "Adapter" pattern. For more information on implementing the Adapter pattern in Perl, see Class::Adapter, which provides a veritable toolkit for creating an implementation of the Adapter pattern which can solve your problem. SUPPORT
Bugs should be always be reported via the CPAN bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=asa> For other issues, or commercial enhancement or support, contact the author. AUTHORS
Adam Kennedy <cpan@ali.as< SEE ALSO
base, <http://ali.as/> COPYRIGHT
Copyright (c) 2006 Adam Kennedy. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.10.0 2006-05-10 asa(3pm)
All times are GMT -4. The time now is 06:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy