Sponsored Content
The Lounge What is on Your Mind? Mad World Remix of Moby Video (Are You Lost In The World Like Me) Post 303026076 by MadeInGermany on Monday 19th of November 2018 02:55:47 PM
Old 11-19-2018
Nice Smilie
It's really a mad world.
I think the Internet has become a kind of religion for (too) many.
In Germany people go on the street shouting "luegenpresse", and the US even has got a president who says "fake news".
 

7 More Discussions You Might Find Interesting

1. Solaris

hello world

just wanted to give salutations to all in here. i hope to contribute as much as i take. happy "unix-ing" :b: (0 Replies)
Discussion started by: JeepResQ
0 Replies

2. What is on Your Mind?

What The World Needs Now...

What does the world need now.... ??? Feel free to suggest new items to the poll .... we might add them :) (25 Replies)
Discussion started by: Neo
25 Replies

3. UNIX for Dummies Questions & Answers

What in the world does $$ mean?

If I type "echo $$" in to the command line it outputs some random number but it outputs the same one every time. What is this? (7 Replies)
Discussion started by: weexpectedthis
7 Replies

4. Programming

Almost -> Hello World!

Hello! I know I must take the efforts of learning C..! I need to recompile a binary with the following at the beginning: test if a file exists, remove it and exit. All in "C". As simple as this in sh: file=/tmp/filename if ; then rm -f $file exit 0 fi Thanks! (8 Replies)
Discussion started by: teresaejunior
8 Replies

5. Programming

Exact meaning of the "world" in "hello world"

Hello! I have a question to native English-speaking people. In the popular program's "hello world" greeting, what meaning the "world" has: "all", "everybody", "people", "friends" or "whole world", "planet", "Earth", "Universe"? In other words, to whom this greeting is addressed: to the... (14 Replies)
Discussion started by: Eugene Muzychen
14 Replies

6. What is on Your Mind?

Hello World!

Just wanna say "Hello World!" :) (6 Replies)
Discussion started by: ment0smintz
6 Replies

7. What is on Your Mind?

UNIX.com Hello World HUD YT Video

UNIX.com Hello World HUD YT Video https://youtu.be/cs3dbPnzDV4 Check it out! Subscribe, Like, Share, Comment . Cyber Dystopia (Ep. 2) - The Myth of the Singularity Coming Soon! (3 Replies)
Discussion started by: Neo
3 Replies
Class::Adapter::Clear(3pm)				User Contributed Perl Documentation				Class::Adapter::Clear(3pm)

NAME
Class::Adapter::Clear - A handy base Adapter class that makes no changes SYNOPSIS
Hello World with CGI.pm the normal way # Load and create the CGI use CGI; $q = new CGI; # Create the page print $q->header, # HTTP Header $q->start_html('hello world'), # Start the page $q->h1('hello world'), # Hello World! $q->end_html; # End the page Hello World with CGI.pm the Adapter'ed way # Load and create the CGI use CGI; $q = new CGI; # Convert to an Adapter use Class::Adapter::Clear; $q = new Class::Adapter::Clear( $q ); # Create the page print $q->header, # HTTP Header $q->start_html('hello world'), # Start the page $q->h1('hello world'), # Hello World! $q->end_html; # End the page Creating a CGI Adapter class using Class::Adapter::Clear package My::CGI; use base 'Class::Adapter::Clear'; # Optional - Create the thing we are decorating auto-magically sub new { my $class = shift; # Create the object we are decorating my $query = CGI->new(@_); # Wrap it in the Adapter $class->SUPER::new($query); } # Decorate the h1 method to change what is created sub h1 { my $self = shift; my $str = shift; # Do something before the real method call if ( defined $str and $str eq 'hello world' ) { $str = 'Hello World!'; } $self->_OBJECT_->($str, @_); } DESCRIPTION
"Class::Adapter::Clear" provides the base class for creating one common type of Class::Adapter classes. For more power, move up to Class::Adapter::Builder. On it's own "Class::Adapter::Clear" passes all methods through to the same method in the parent object with the same parameters, responds to "->isa" like the parent object, and responds to "->can" like the parent object. It looks like a "Duck", and it quacks like a "Duck". On this base, you simple implement whatever method you want to do something special to. # Different method, same parameters sub method1 { my $self = shift; $self->_OBJECT_->method2(@_); # Call a different method } # Same method, different parameters sub method1 { my $self = shift; $self->_OBJECT_->method1( lc($_[0]) ); # Lowercase the param } # Same method, same parameters, tweak the result sub method1 { my $self = shift; my $rv = $self->_OBJECT_->method1(@_); $rv =~ s/ /<br> /g; # Add line-break HTML tags at each newline return $rv; } As you can see, the advantage of this full-scale Adapter approach, compared to inheritance, or function wrapping (see Class::Hook), is that you have complete and utter freedom to do anything you might need to do, without stressing the Perl inheritance model or doing anything unusual or tricky with "CODE" references. You may never need this much power. But when you need it, you really need it. As an aside, Class::Adapter::Clear is implemented with the following Class::Adapter::Builder formula. use Class::Adapter::Builder ISA => '_OBJECT_', AUTOLOAD => 1; METHODS
new $object As does the base Class::Adapter class, the default "new" constructor takes a single object as argument and creates a new object which holds the passed object. Returns a new "Class::Adapter::Clear" object, or "undef" if you do not pass in an object. SUPPORT
Bugs should be reported via the CPAN bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Class-Adapter> For other issues, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
Class::Adapter, Class::Adapter::Builder COPYRIGHT
Copyright 2005 - 2010 Adam Kennedy. 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.1 2010-04-11 Class::Adapter::Clear(3pm)
All times are GMT -4. The time now is 03:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy