Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #5637
| X-Received | by 2002:a0c:e891:: with SMTP id b17mr553674qvo.235.1583883198992; Tue, 10 Mar 2020 16:33:18 -0700 (PDT) |
|---|---|
| X-Received | by 2002:a25:1d56:: with SMTP id d83mr159351ybd.230.1583883198809; Tue, 10 Mar 2020 16:33:18 -0700 (PDT) |
| Path | csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail |
| Newsgroups | comp.programming.threads |
| Date | Tue, 10 Mar 2020 16:33:18 -0700 (PDT) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | google-groups.googlegroups.com; posting-host=24.200.162.29; posting-account=R-6XjwoAAACnHXTO3L-lyPW6wRsSmYW9 |
| NNTP-Posting-Host | 24.200.162.29 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <55fb72b2-e1af-47e1-bdfd-b7905421bd7a@googlegroups.com> (permalink) |
| Subject | More about Perl and Python.. |
| From | aminer68@gmail.com |
| Injection-Date | Tue, 10 Mar 2020 23:33:18 +0000 |
| Content-Type | text/plain; charset="UTF-8" |
| Lines | 89 |
| Xref | csiph.com comp.programming.threads:5637 |
Show key headers only | View raw
Hello,
More about Perl and Python..
I know how to program in Perl, and i think Perl is powerful and is better than Python, and you can in Perl set a property or a method of a class to be private or public by the following Perl methodoly, read my following program to notice it:
================================================
package class_A;
my $private_method = sub { #_{
#
# Declaring a private method. The method apparantly can not be called
# from outside this package.
#
my $self = shift;
$self->echo("private_method was called");
}; #_}
sub new { #_{
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
} #_}
sub public_method {
my $self = shift;
$self->echo("public_method was called, going to call private method");
# Call private method.
$self->$private_method();
}
sub echo { #_{
my $self = shift;
my $text = shift;
print "$text\n";
} #_}
1;
------
#!/usr/bin/perl
use warnings;
use strict;
use class_A;
my $ca = class_A->new();
$ca->public_method();
=============================================================
And here is also why Python is not good: Python has a global interpreter lock, but Perl threads can execute in parallel, read this:
What is the Python Global Interpreter Lock (GIL)?
https://realpython.com/python-gil/
And RPerl compiler for Perl is here..
I also use Perl, so here is an interesting new website about RPerl and Perl:
http://perlcommunity.org/#performance
Ant about Perl in 2020: Is It Still Worth Learning Now?
Read more here:
https://somedudesays.com/2020/02/perl-in-2020-is-it-still-worth-learning/
Thank you,
Amine Moulay Ramdane.
Back to comp.programming.threads | Previous | Next | Find similar | Unroll thread
More about Perl and Python.. aminer68@gmail.com - 2020-03-10 16:33 -0700
csiph-web