Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

If Perl Existed in the 1960's...

by thezip (Vicar)
on Mar 10, 2007 at 17:40 UTC ( #604142=poem: print w/replies, xml ) Need Help??

#! perl use strict; package Person; sub new { my ($class, $name) = @_; my $self = {}; if ($who eq 'you') { $self = { name => $name, confirm => 'Yeah!', amplitude => 3, } }; bless $self, $class; } sub confirm { my $self = shift; $self->{confirm} || ""; } sub amplitude { my $self = shift; $self->{amplitude} || ""; } sub loves { my ($source, $target) = @_; if ($target->{name} eq 'you') { join(" ", ($target->confirm()) x $target->amplitude()) . "\n"; } } package main; my $she = Person->new(); my $who = Person->new('you'); my @depth = qw/None Somewhat Lots OohBaby/; print $she->loves($who) for @depth; print $who->confirm(), "\n\n";

Replies are listed 'Best First'.
Re: If Perl Existed in the 1960's...
by jonadab (Parson) on Mar 11, 2007 at 11:18 UTC

    I fear that if perl as it is known today had been around in the sixties, it would have fallen into such severe disrepute that nobody would be using it today. Back then, every byte of memory that you could save counted. perl uses a *lot* more memory that the languages available in the sixties. It does so for good reasons, and the trade-off is well worth it now in this decadent era of cheap DDR SDRAM and many-gigabyte hard drives, but it would have been a different thing in the sixties. Look at the reputation Lisp got, and it didn't have anything like as much memory overhead as perl. Even as late as the mid eighties it was still considered reasonable to store eight boolean variables in a single byte, in order to conserve RAM. It meant an extra couple of clock cycles (also at a premium back then) to examine or change any of them, but it saved seven whole bytes of RAM, so people did it. Indeed, Infocom's ubiquitous zmachine (almost certainly the most portable and widely-implemented virtual machine in the history of computing) has this feature (variables that are actually stored in a single bit) hardwired into its object data structure.

    -- 
    We're working on a six-year set of freely redistributable Vacation Bible School materials.
If Perl Existed in the 1960's...
by Zaxo (Archbishop) on Mar 11, 2007 at 06:16 UTC

    . . . it would sound like ALGOL ;-)

    After Compline,
    Zaxo

      . . . it would sound like ALGOL ;-)

      ...or we would have at least Perl 8 by now.

      Which makes me think I may propose a poll on the subject, also because when I saw the root node of this thread in the daily best list, I thought it actually were one. Oh, well, I did it!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: poem [id://604142]
Approved by Joost
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2022-07-06 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?