[26260] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8444 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 22 14:05:18 2005

Date: Thu, 22 Sep 2005 11:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 22 Sep 2005     Volume: 10 Number: 8444

Today's topics:
    Re: @_ aliasing xhoster@gmail.com
    Re: https with LWP::UserAgent <newsAT@screenlightDOT.com>
    Re: https with LWP::UserAgent <richard@zync.co.uk>
    Re: https with LWP::UserAgent <richard@zync.co.uk>
    Re: https with LWP::UserAgent <sherm@dot-app.org>
    Re: https with LWP::UserAgent <sherm@dot-app.org>
    Re: https with LWP::UserAgent <babacio@free.fr>
    Re: Package to calculate time diff <lv@aol.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 22 Sep 2005 16:26:39 GMT
From: xhoster@gmail.com
Subject: Re: @_ aliasing
Message-Id: <20050922122639.635$OC@newsreader.com>

Matija Papec <mpapec@nohome.com> wrote:
> Is there a perl version which prints 5 in case when,
> perl -le 'sub f {my $a = shift; $a=5} f(my $b=1); print $b'
>
> I was almost sure that shift() should not break the aliasing.

It is the assignment, not the shift, which is breaking the aliasing.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: Thu, 22 Sep 2005 16:20:31 GMT
From: one man army <newsAT@screenlightDOT.com>
Subject: Re: https with LWP::UserAgent
Message-Id: <newsAT-879376.09223022092005@newsclstr02.news.prodigy.com>

I found Crypy::SSLeay on CPAN. I brought it down, and in the readme it 
says that you must have OpenSSL installed before compiling/building.

I searched for openSSL (case-insensitive) anywhere on my system, but 
found nothing.

 How to install OpenSSL on MacOS 10.3?  thanks

> Aha!  I am using Perl 5.8.1 on the FreeBSD derivative, Mac OS X/Darwin.
> How do I install the SSL Library? I have a folder called /Library/Perl, 
> then :
> 5.8.1
>    File
>    lwptut.pod
>    lwpcook.pod
>    Regexp
>    Net
>    LWP.pm
>    LWP
>    WWW
>    URI.pm
>    URI
>    Bundle
>    HTTP
>    HTML
>    darwin-thread-multi-2level
> HTML-LinkExtractor-0.13
> HTML-Tagset-3.04
> HTML-Parser-3.45
> URIC-2.02
> libwww-perl-5.69
> Regexp-Common-2.120
> libnet-1.19
> URI-1.35
> 
> 
> In article <pan.2005.09.22.13.46.58.100503@zync.co.uk>,
>  Richard Gration <richard@zync.co.uk> wrote:
> 
> > On Wed, 21 Sep 2005 17:47:09 +0000, one man army wrote:
> > 
> > > Hi All-
> > > 
> > >   I am an infrequent user of Perl, but have succeeded in a few endeavors.
> > > I have a script that reads data from a series of web pages. But now I 
> > > want to modify it to handle an HTTPS page.
> > > 
> > >   I looked briefly in UserAgent.pm
> > 
> > That way lies pain and death. Well, pain anyway. You haven't specified
> > your OS, so I'll say how it is for mine, Linux.
> > 
> > Using LWP with the https protocol is as simple as
> > 
> > my $ua = LWP::UserAgent->new;
> > my $req = HTTP::Request->new(GET => 'https://secure.tld');
> > my $res = $ua->request($req);
> > 
> > The key on *nix is to have some SSL libraries installed to do the hard
> > work. LWP itself doesn't have any SSL code.
> > 
> > If LWP finds a 3rd party SSL library, such as openssl, when it is
> > installed then it will be capable of fetching from https URLs. If not,
> > then you will see an error like 'unknown protocol' or similar.
> > 
> > This could well be different on winders et al.
> > 
> > HTH
> > Rich


------------------------------

Date: Thu, 22 Sep 2005 17:12:52 +0100
From: Richard Gration <richard@zync.co.uk>
Subject: Re: https with LWP::UserAgent
Message-Id: <pan.2005.09.22.16.12.51.795166@zync.co.uk>

On Thu, 22 Sep 2005 14:48:32 +0000, one man army wrote:
> 
> In article <pan.2005.09.22.13.46.58.100503@zync.co.uk>,
>  Richard Gration <richard@zync.co.uk> wrote:
> 
>> On Wed, 21 Sep 2005 17:47:09 +0000, one man army wrote:
>> 
>> > Hi All-
>> > 
>> >   I am an infrequent user of Perl, but have succeeded in a few endeavors.
>> > I have a script that reads data from a series of web pages. But now I 
>> > want to modify it to handle an HTTPS page.
>> > 
>> >   I looked briefly in UserAgent.pm
>> 
>> That way lies pain and death. Well, pain anyway. You haven't specified
>> your OS, so I'll say how it is for mine, Linux.
>> 
>> Using LWP with the https protocol is as simple as
>> 
>> my $ua = LWP::UserAgent->new;
>> my $req = HTTP::Request->new(GET => 'https://secure.tld');
>> my $res = $ua->request($req);
>> 
>> The key on *nix is to have some SSL libraries installed to do the hard
>> work. LWP itself doesn't have any SSL code.
>> 
>> If LWP finds a 3rd party SSL library, such as openssl, when it is
>> installed then it will be capable of fetching from https URLs. If not,
>> then you will see an error like 'unknown protocol' or similar.
>> 
>> This could well be different on winders et al.
>> 
>> HTH
>> Rich

> Aha!  I am using Perl 5.8.1 on the FreeBSD derivative, Mac OS X/Darwin.
> How do I install the SSL Library? I have a folder called /Library/Perl, 
> then :
> 5.8.1
>    File
>    lwptut.pod
>    lwpcook.pod
>    Regexp
>    Net
>    LWP.pm
>    LWP
>    WWW
>    URI.pm
>    URI
>    Bundle
>    HTTP
>    HTML
>    darwin-thread-multi-2level
> HTML-LinkExtractor-0.13
> HTML-Tagset-3.04
> HTML-Parser-3.45
> URIC-2.02
> libwww-perl-5.69
> Regexp-Common-2.120
> libnet-1.19
> URI-1.35

[ Please don't top post ]

SSL isn't part of perl. It's a thing in and of itself. I know next to
nothing about Macs so I can't tell you specifically how to do what you
need to but I would:

1. Find out if you have SSL libraries. On my system I have
/usr/lib/libssl.*

2. If not, then install openssl or equivalent.

3. Once you have ssl on your machine, the most likely point of failure is
that libwww-perl doesn't know it's there. Once you are certain you have an
ssl implementation, reinstall libwww-perl. Make sure that it notices ssl
during configuration / installation. You might have to give some options
when configuring to specify the location of your ssl.

If none of this helps, then I'm afraid I'm at a bit of a loss.

Rich


------------------------------

Date: Thu, 22 Sep 2005 17:31:12 +0100
From: Richard Gration <richard@zync.co.uk>
Subject: Re: https with LWP::UserAgent
Message-Id: <pan.2005.09.22.16.31.11.708923@zync.co.uk>

On Thu, 22 Sep 2005 16:20:31 +0000, one man army wrote:

>  How to install OpenSSL on MacOS 10.3?  thanks

This thread has now lost even a tenuous connection to perl, I'm afraid ;-)

You should try asking in a MacOS newsgroup.

Cheers
Rich


------------------------------

Date: Thu, 22 Sep 2005 13:15:41 -0400
From: Sherm Pendley <sherm@dot-app.org>
Subject: Re: https with LWP::UserAgent
Message-Id: <m2ek7hxbuq.fsf@Sherm-Pendleys-Computer.local>

one man army <newsAT@screenlightDOT.com> writes:

> I searched for openSSL (case-insensitive) anywhere on my system, but 
> found nothing.
>
>  How to install OpenSSL on MacOS 10.3?

You don't need to - it's included with the OS. Honestly, couldn't you have at
least *tried* to install the module before assuming it would fail?

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: Thu, 22 Sep 2005 13:19:06 -0400
From: Sherm Pendley <sherm@dot-app.org>
Subject: Re: https with LWP::UserAgent
Message-Id: <m2aci5xbp1.fsf@Sherm-Pendleys-Computer.local>

one man army <newsAT@screenlightDOT.com> writes:

> Aha!  I am using Perl 5.8.1 on the FreeBSD derivative, Mac OS X/Darwin.
> How do I install the SSL Library?

Same way you install it on any other *nix, by following the instructions found
in "perldoc perlmodinstall".

I'm not being snide - the instructions there are far better and more detailed
than any usnet posting could be. Be sure to follow the Unix instructions - the
Mac instructions are for MacPerl running on MacOS 9 and earlier.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: Thu, 22 Sep 2005 19:29:23 +0200
From: Babacio <babacio@free.fr>
Subject: Re: https with LWP::UserAgent
Message-Id: <m2zmq5au4s.fsf@baba.ba>

one man army <newsAT@screenlightDOT.com> writes:

> I found Crypy::SSLeay on CPAN. I brought it down, and in the readme it 
> says that you must have OpenSSL installed before compiling/building.
>
> I searched for openSSL (case-insensitive) anywhere on my system, but 
> found nothing.
>
>  How to install OpenSSL on MacOS 10.3?  thanks

Have a look on darwinports. There is a port 'openssl' which sure gives
you all what you need. There is even a package named p5-net-ssleay
which installs Net::SSLeay, which may be of interest.

-- 
Bé erre hue ixe eu elle, Bruxelles.


------------------------------

Date: Thu, 22 Sep 2005 12:45:15 -0500
From: l v <lv@aol.com>
Subject: Re: Package to calculate time diff
Message-Id: <1127411284_923@spool6-east.superfeed.net>

* Tong * wrote:
> Hi, 
> 
> I'm wondering which package can do time diff calculation. I.e., something
> that can do time_diff 0:40:33 0:28:50 and gives me 00:11:43.
> 
> I've tried Date::Simple, Date::Calc, Class::Date and DateTime, but none
> of them can. Maybe I'm too blunt, so I'm not going to show my stupid
> trials here. 
> 
> Thanks for your help.
> 

I don't know how the Ruby solution will help you out, but Date::Calc is 
my preferred *Perl* module.  However, when comparing times with 
Date::Calc you need to pass it the date (year, month, day) as well.  For 
this example I used Date::Calc's Today function for that.  If you 
determine the correct date, then Date::Calc will correctly calculate the 
time diff when spanning different days.

use Date::Calc qw(Today Delta_YMDHMS);

my $end   = q/0:40:33/;
my $start = q/0:28:50/;

my ($D_y,$D_m,$D_d, $Dh,$Dm,$Ds) =
       Delta_YMDHMS(Today(), (split /:/, $start) ,
                    Today(), (split /:/, $end) );

printf "Start: %s  End: %s  Diff: %02d:%02d:%02d",
		$start, $end, $Dh, $Dm, $Ds;

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8444
***************************************


home help back first fref pref prev next nref lref last post