Are there different types of PERL?

They have: 62 posts

Joined: May 2000

Because I see some PERL, it contains a lot of => and weird stuff like that. Is that some weird mod or something?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

=> is for hashes (multi-dimensional lists), a part of Perl.

What I love most about Perl is that it works for basic stuff, flat text files, database integration and is also OPTIONALLY OOP! Smiling

I love Perl.

I wish I had time to learn it properly instead of hacking away at it.

*sigh*

Suzanne

They have: 62 posts

Joined: May 2000

Uh, I know what hashes are, I've just never used those in my hashes. What's their purpose? Anything?

They have: 193 posts

Joined: Feb 2000

There is a reason to use =>: it is visually easier to read. All => is is a comma, plus it should allow the key to be unqouted.

Example, which is easier to read?

%this = (one => "1",
         two => "2");
'

or

%this = ("one", "1",
         "two", "2");
'

Richard
richjb::424

[email protected]

Everyone here has a website. It's just that not all are worth posting (Mine! Smiling).

They have: 568 posts

Joined: Nov 1999

=> for hashes, -> for OOP. And we all love OOP, even if I it was probably the hardest thing to learn about Perl. Laughing out loud

They have: 193 posts

Joined: Feb 2000

I probably already know what it is, but just not as what it is referred to here: what is OOP? Shocked

Richard
richjb::426

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Object Oriented Programming

One of Perl's most amazing bits (to me) is that it is OPTIONALLY OOP! So if you don't need the power of OOP (like for quick little scripts, you don't have to use the resource heavy methods. But if you NEED the power of OOP, you have it there, available.

It's also what makes the fantastic modules work so well, so you can write those quick little scripts and not rewrite the same wheel endlessly.

Whee!

Smiling Suzanne

They have: 193 posts

Joined: Feb 2000

Oh, ok, thanks.

Richard
richjb::429

They have: 62 posts

Joined: May 2000

For example, I stole this from one of Myriad's posts. Is this OOP PERL?

if(!param('inputbox1') || !param('inputbox2'))
{ url="http://yourscriptnamehere.pl";
print "Location: $url\nURI: $url\n\n";
exit();
}

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.