Subject: | |
From: | |
Reply To: | |
Date: | Mon, 23 Nov 2015 22:31:06 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
That's one example of anonymous references called an anonymous code reference, which is vital to understanding how Perl 5 object oriented syntax works but it goes much deeper than that. Also there is a syntax similar to the C++ example that works in Perl too, wherever you see that "my $var=modulename->new();" syntax in the documentation.
I'm still out with friends but will be home soon. I'll send out a more complete reading list (which I've used to train Jr. Perl programmer before) then. Along with some links to well documented code example I've written over the years on github and source forge which you can ask me questions about if there is any thing you don't understand.
Original Message
From: Konstantin Olchanski
Sent: Monday, November 23, 2015 19:51
To: ToddAndMargo
Cc: [log in to unmask]; [log in to unmask]
Subject: Re: Perl window question
On Mon, Nov 23, 2015 at 02:58:35PM -0800, ToddAndMargo wrote:
>
> "anonymous references"? Is that the mysterious "->" thingy?
>
> $ua = LWP::UserAgent->new;
> $ua->timeout ( MaxTime1 );
> $ua->show_progress;
>
perl-for-dummies to the rescue, read section about object-oriented programming in perl.
Quick answer, it is same as C++:
std::string *s = new std::string;
s->length();
s->c_str();
--
Konstantin Olchanski
Data Acquisition Systems: The Bytes Must Flow!
Email: olchansk-at-triumf-dot-ca
Snail mail: 4004 Wesbrook Mall, TRIUMF, Vancouver, B.C., V6T 2A3, Canada
|
|
|