• Contact Editorial Team
  • Advertise on YNOT
  • Submit PR
Friday, February 6, 2026
  • Login
  • Register
YNOT
  • Home
  • Industry News
    • Porn Star & Adult Talent News
    • Adult Business News
    • Adult Novelty News
    • Adult Industry Legal News
    • Tech News for Adult Webmasters
    • Video Game News for Adults
    • EU News
  • PR Wire
  • Podcasts
  • Industry Guides
  • Newsletters
No Result
View All Result
  • Home
  • Industry News
    • Porn Star & Adult Talent News
    • Adult Business News
    • Adult Novelty News
    • Adult Industry Legal News
    • Tech News for Adult Webmasters
    • Video Game News for Adults
    • EU News
  • PR Wire
  • Podcasts
  • Industry Guides
  • Newsletters
No Result
View All Result
YNOT
No Result
View All Result
Home YNOT Features YNOT University

Perl and Object Oriented Programming

admin by admin
July 28, 2000
in YNOT University
491
SHARES
Share on FacebookShare on Twitter

“Hereby you reduce the time it takes to code, hence, making you more productive!”In a previous article I mentioned perl modules, and how modularising your code can be a good thing. We’re going to take it a step further this time and discuss Perl Objects. Perl’s definition of an object is very simple: “An Object is a reference to a thingie that belongs to another thingie”.

Says much doesn’t it? What it comes down to – an object is a variable that belongs to a specific class. An example:


package MyThingie;

sub new {
my $that=shift;
my $this=ref($that) || $that;
my $self={};
bless($self, $this);
return $self;
}

Basically, what that did is create an object. You use that one as follows:


use MyThingie;
$thing=new MyThingie;

There you go. You blessed ‘thing’ into the ‘MyThingie’ class. Now, the fun part about objects is that you can move them around at will. If I wanted 10 MyThingie objects, I could create 10 and push them into an array. You can also store variables and methods inside an object, like this:


package MyThingie;

sub new {
my $that=shift;
my $this=ref($that) || $that;
my $self={“thingie” => “something”};

bless($self, $this);
return $self;
}

sub what {
my $self=shift;
my $what=shift;

return $self->{what};
}

Using the above usage example, you would be able to do this:


$something=$thingie->what();

$something would now contain ‘something’. Objects are especially useful for writing skeleton applications, that is, provide all the functions necessary for an application to work. Since you can now easily create multiple frontends for applications using the same object.

“Hereby you reduce the time it takes to code, hence, making you more productive!”

Another fun trait about objects is that they can ‘inherit’ from other objects. Taking the above MyThingie object, we can make another object that inherits from that class by simply using this:


package AnotherThingie;
use MyThingie;

@ISA=qw(MyThingie);
sub that {
my $self=shift;

print(“That’s nice\n”);
}

This AnotherThingie class will inherit all methods from the MyThingie class (including it’s constructor ‘new’ and the ‘what’ function) and adds a new ‘that’ function:


use AnotherThingie;

$anotherthingie=new AnotherThingie;
print($anotherthingie->what);
$anotherthingie->that;

See how easy that was? This is the key to objects. You can now write very complicated applications in a short matter of time!

You can have a base class to access a database for you and give it enough functions to be able to connect, store, and retrieve data. On top of that class, you can build a new class that will do exactly what you want it to do for any given application. Hereby you reduce the time it takes to code, hence, making you more productive!

Reader Comments on this Article:

Comment by:Summary:
StephenI *Still* Don’t Get It! ™

Share196Tweet123
admin

admin

YNOT Admin wields his absolute power without mercy. When he's not busy banning spam comments to hell he enjoys petting bunnies and eating peanut butter. He recommends everyone try the YNOT Mail (ynotmail.com) email marketing platform and avoid giving their money to mainstream services that hate adult companies.

Related Posts

Adult Business News

UK Online Safety Act Cuts Pornhub Traffic 36% as Age Verification Takes Effect

December 13, 2025
Adult Business News

The Cambassador: Lindsey Banks, Flirt4Free and Brand Representation

September 5, 2018
Adult Business News

ImLive’s Mere Menezes Siqueira Manages Models, Makes the Machine Work

August 23, 2018
Corey Silverstein of Adult.law
Adult Business News

Silverstein Says: 3 Legal Issues Cam Companies, Models Must Pay Attention To

August 22, 2018
Load More

SPONSOR

INDUSTRY EVENTS

Currently Playing

YNOT Summit Model Track: Nerds Dig Sexy Gamers

YNOT Summit Model Track: Nerds Dig Sexy Gamers

01:05:46

YNOT Summit Webmaster Track: Understanding Webcam Business Models

00:51:11

YNOT Summit Model Track: Cam Law 101

01:26:24

SPONSOR

POPULAR NEWS

Wisconsin committee hears proposal to regulate minors’ use of chatbots

February 5, 2026

Will Sergey Lagodinsky’s proposal make AI ‘nudification’ illegal across the EU?

February 5, 2026

Honey Play Box Introduces Gift Wishlist System for Adult Entertainment Streamers

February 5, 2026

Sponsor

YNOT YNOT

QUICK LINKS:

  • About YNOT
  • Terms of Use
  • Privacy Policy
  • Editorial Team
  • Advertise on YNOT
  • Sitemap

FRIENDS OF YNOT:

  • Best Adult Cams
  • Live Porn
  • Adult Reviews
  • Adult Email Marketing
  • Discounted Porn
  • vr porn sites
  • European Adult Biz Magazine

FRIENDS OF YNOT:

  • Rabbits Reviews
  • XXX Job Interviews
  • Adult Site Broker
  • Femdom
  • Paid Porn Sites
  • Live Sex
  • Cam girl sites
  • AI Girlfriend

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms below to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • Home
  • Adult Business News
  • Adult Industry Legal News
  • Adult Novelty News
  • Porn Star & Adult Talent News
  • Tech News for Adult Webmasters
  • Video Game News for Adults
  • Interviews
  • Opinions
  • YNOT Industry Wire
  • Newsletters

Copyright © 2026 YNOT Group LLC.

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.