From the course: Perl 5 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

An example module

An example module - Perl Tutorial

From the course: Perl 5 Essential Training

Start my 1-month free trial

An example module

- [Voiceover] In this lesson, I'll take you through a more functional version of our simple class. Let's get started, here's a working copy of hello.pl from Chapter 14 of the exercise files. And I'm just going to come down here and I'm going to say use better, BW, colon, colon, better. And I'll create an object, and I'll go ahead and get a value from it, and I'll display that value. And when I run this, I did that wrong, dollar O number, like that, and when I run this we get our value. So if we come over here to our better class, again it's package BW better, because it's in the BW folder, and we have the version, and we have our constructor. Our constructor is a little bit refined, and here's how this works, when the constructor is called the name of the class is passed to it. I'm putting this in this inv variable, which to me stands for invocation. And so I know the name of the class, and I take that name of the class and I assign it to a variable called class, and it can either be…

Contents