[30502] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1745 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 24 16:09:48 2008

Date: Thu, 24 Jul 2008 13:09:08 -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, 24 Jul 2008     Volume: 11 Number: 1745

Today's topics:
    Re: C linked lists in Perl sln@netherlands.com
    Re: comma puzzle <nick@maproom.co.uk>
    Re: comma puzzle <jurgenex@hotmail.com>
    Re: comma puzzle <szrRE@szromanMO.comVE>
    Re: Date format <Telemachus@ld.net.au>
    Re: EPIC and "my" variables rupert@web-ideas.com.au
    Re: FAQ 4.2 Why is int() broken? <hjp-usenet2@hjp.at>
    Re: FAQ 4.2 Why is int() broken? <szrRE@szromanMO.comVE>
    Re: number of maximum decimal places supported with Per <RedGrittyBrick@SpamWeary.foo>
    Re: number of maximum decimal places supported with Per sln@netherlands.com
    Re: Perl - approach to query https website for code & p (Zak B. Elep)
    Re: Perl - approach to query https website for code & p <deepalicanada@gmail.com>
    Re: Perl - approach to query https website for code & p <deepalicanada@gmail.com>
    Re: Perl - approach to query https website for code & p <glex_no-spam@qwest-spam-no.invalid>
        Profiling? <alex.buell@munted.org.uk>
    Re: Profiling? <alex.buell@munted.org.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 24 Jul 2008 18:02:12 GMT
From: sln@netherlands.com
Subject: Re: C linked lists in Perl
Message-Id: <d5gh84987245uf8ma31m9r7spo4cp02mln@4ax.com>

On Wed, 16 Jul 2008 13:11:24 -0700 (PDT), cartercc <cartercc@gmail.com> wrote:

>I guess like almost everybody, I like to discuss (argue) the merits of
>different technologies. In my world, the big two are Java and
>ColdFusion. Recently, we had someone with a background in embedded
>systems who has been advocating C. The conversation goes something
>like this:
>
>him - Does Perl have linked lists?
>me - No.
>him - Therefore, C is better than Perl because it has linked lists.
>me - But Perl has other data structures that are easier to use than
>linked lists.
>him - So what? Perl still doesn't have linked lists.
>
>I've never studied linked lists and certainly never coded one (in C or
>anything else) but it aroused my curiosity. So after searching on
>c.l.p.m. and online, I decided to see if I couldn't do a linked list
>in Perl. My first  thought is to do something like this:
>
>%linked_list{$key} = { prev => $linked_list{$prev_key}{prev},
>                                   value => $value,
>                                   next => $linked_list{$next_key}
>{next}  };
>
>I know that most people will think I'm an absolute moron for thinking
>about this (and they likely would be right), but CAN you do a linked
>list in Perl (never mind that you would never want to), and if so, how
>would you go about it?
>
>My motive is to say to my C friend, "Nya, nya, nya."
>
>Thanks, CC.

I'm kinda of against Linked lists in Perl, I don't see the need for it.
Haven't read the voluminous responces here yet but, if you really see a
need for it, I would suggest that you do it right.

I've dealt with some low level list code in my life. It boils down to
a few (about 7 or 8) tedious low level function's you will need to set up,
if you are serious.

I won't write them for you (although I could) but will steer you in the
right direction. 

In addittion to what is below, which you will have to make into functions,
you will have to make functions for adding tail/head, removing, insertion,
and deletion (this is important).

I will leave these as an excersice. You should try to keep it "C" style
as much as possible, as below.

Note also that linked lists are extremely primitive. Navigation, knowing
where you are at all times is critical. By and large, doing this in Perl
incurs an insane overhead!

Good luck,
sln

## node.pl

use strict;
use warnings;

sub new_node
{
	my $node = {
		# Node Header
		prev => undef,
		next => undef,
		# Node Data
		data => {val => undef}
	};
	return $node;
}

# Create the list with a single node
my $ListHead = new_node();
my $ListTail = $ListHead;
my $curnode  = $ListHead;
$curnode->{data}->{val} = 0;

# Add some nodes to the list
for (my $i=1; $i<20; $i++)
{
	$curnode->{next} = new_node();
	$curnode->{next}->{prev} = $curnode;
	$curnode->{next}->{data}->{val} = $i;
	$curnode = $curnode->{next};
	$ListTail = $curnode;
}

# Traverse the list from the Head
print "Traverse list from Head -\n";
$curnode = $ListHead;
while (defined $curnode)
{
	if (defined $curnode->{data}->{val})
	{
		print "data is: val = $curnode->{data}->{val}\n";
	}
	$curnode = $curnode->{next};
}

# Traverse the list from the Tail
print "Traverse list from Tail -\n";
$curnode = $ListTail;
while (defined $curnode)
{
	if (defined $curnode->{data}->{val})
	{
		print "data is: val = $curnode->{data}->{val}\n";
	}
	$curnode = $curnode->{prev};
}

__END__

output:

Traverse list from Head -
data is: val = 0
data is: val = 1
data is: val = 2
data is: val = 3
data is: val = 4
data is: val = 5
data is: val = 6
data is: val = 7
data is: val = 8
data is: val = 9
data is: val = 10
data is: val = 11
data is: val = 12
data is: val = 13
data is: val = 14
data is: val = 15
data is: val = 16
data is: val = 17
data is: val = 18
data is: val = 19
Traverse list from Tail -
data is: val = 19
data is: val = 18
data is: val = 17
data is: val = 16
data is: val = 15
data is: val = 14
data is: val = 13
data is: val = 12
data is: val = 11
data is: val = 10
data is: val = 9
data is: val = 8
data is: val = 7
data is: val = 6
data is: val = 5
data is: val = 4
data is: val = 3
data is: val = 2
data is: val = 1
data is: val = 0




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

Date: Thu, 24 Jul 2008 09:55:45 +0100
From: Nick Wedd <nick@maproom.co.uk>
Subject: Re: comma puzzle
Message-Id: <yNoovMDROEiIFA9d@maproom.demon.co.uk>

In message <g6818s02pt@news4.newsguy.com>, szr <szrRE@szromanMO.comVE> 
writes

>The real point of my post was to followup your conclusion that when you
>ran the OP's code, you got 000, while he got 111, and I just wanted to
>show how the OP might have arrived there.

OP here: you are right.

My code was
   my $i;
   for ( $i=0 , $i<10 , $i++ ) { print $i; }
but I originally gave it, incorrectly, as
   for ( my $i=0 , $i<10 , $i++ ) { print $i; }
not realising, at the time, that it made a difference.

Thanks to you all, I have learned things from this thread.

>>   s/would of/would have/
>>
>> I've suspected this for some time.
>
>Suspected what? That typos are made? It's just lazy typing on my part,
>which is quite common for anyone having spent enough time in the USA - I
>would largely blame TV and Hollywood and even Radio, given that many of
>these bad grammatical habits tend to come from sources such as these.

I don't think that the USA or TV should be blamed.  Film and radio, 
possibly.  At school in England, before TVs were commonplace, "would of" 
was frequently corrected by our English teachers.

Nick
-- 
Nick Wedd    nick@maproom.co.uk


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

Date: Thu, 24 Jul 2008 14:52:46 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: comma puzzle
Message-Id: <2q4h84pbmeel9vr54ojmkpjgujbsldk5sf@4ax.com>

"szr" <szrRE@szromanMO.comVE> wrote:
[about sloppy English]
>Suspected what? That typos are made? It's just lazy typing on my part, 
>which is quite common for anyone having spent enough time in the USA -

Unfortunately (or depending on your view maybe fortunately) that doesn't
apply to the vast majority of inhabitants of the third planet of the
solar system. To a non-native speaker those slips in spelling are
confusing, in particular when they are repetitive. As long as they are
random they can be attributed to typos and people will do a best guess
as to what may have been meant. But I did find myself sometimes
searching for translations in dictioniaries on- and offline only to
realize much later that that person simply invented their own spelling
for some common expression.

I think it's also a change in culture. While in the past people tried to
appear as educated as possible (and correct use of language is a large
part of that) nowadays sub-culture is popular and people pride
themselves in being uneducated.

>So IMHO, there's little point in making a point of it unless it 
>completely changes the meaning of what was being said, which clearly 
>wasn't the case here.

Maybe. But what you wrote didn't make sense as written. IMNSHO it is
simply inconsiderate and rude to deliberately use "cute" or "in" or
"cool" spellings.

jue


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

Date: Thu, 24 Jul 2008 09:06:50 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: comma puzzle
Message-Id: <g6a9aq02akv@news4.newsguy.com>

Jürgen Exner wrote:
> "szr" <szrRE@szromanMO.comVE> wrote:
> [about sloppy English]
>> Suspected what? That typos are made? It's just lazy typing on my
>> part, which is quite common for anyone having spent enough time in
>> the USA -
>
> Unfortunately (or depending on your view maybe fortunately) that
> doesn't apply to the vast majority of inhabitants of the third planet
> of the solar system. To a non-native speaker those slips in spelling
> are confusing, in particular when they are repetitive. As long as
> they are random they can be attributed to typos and people will do a
> best guess as to what may have been meant. But I did find myself
> sometimes searching for translations in dictioniaries on- and offline
> only to realize much later that that person simply invented their own
> spelling for some common expression.
>
> I think it's also a change in culture. While in the past people tried
> to appear as educated as possible (and correct use of language is a
> large part of that) nowadays sub-culture is popular and people pride
> themselves in being uneducated.

I admit I am not perfect, but I do try to proof read my posts before 
hitting Send, but I think it is a little bit much to expect everyone to 
be absolutely perfect each time. Everyone makes errors sometimes. 
Granted, it's a little embarrassing to make the same mistake multiple 
times in a row, but when something gets subconsciously embedded into 
your mind (such a long weekend which involved several juvenile films), 
that can happen, even when that person wouldn't normally make that 
mistake - in my case "would|could|should of" is not a way I typically 
write that sort of sequence.

>> So IMHO, there's little point in making a point of it unless it
>> completely changes the meaning of what was being said, which clearly
>> wasn't the case here.
>
> Maybe. But what you wrote didn't make sense as written. IMNSHO it is
> simply inconsiderate and rude to deliberately use "cute" or "in" or
> "cool" spellings.

I wasn't in any way attempting to be rude. Lets be real here; it was a 
typo. Even non-native English speakers would have little trouble knowing 
what was meant, especially since many non-native speakers, at least in 
this part of the USA, tend to pick up bad habits like this from the get 
go, but I do admit it may have some dependence on the locale, but 
various media outlets also do little help those wanting to learn proper 
grammar.

-- 
szr 




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

Date: Thu, 24 Jul 2008 08:05:11 -0500
From: Telemachus <Telemachus@ld.net.au>
Subject: Re: Date format
Message-Id: <x-idnYlx5c2a4xXVnZ2dnUVZ_r3inZ2d@earthlink.com>

On 2008-07-23, cc96ai <calvin.chan.cch@gmail.com> wrote:
> I want to change the date format in perl script
>
> input: "2005-11-01"
> output:November 1, 2005
>
> thanks

Please don't post an identical question simultaneously to this group and
the Perl Beginners list.

Thanks.


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

Date: Thu, 24 Jul 2008 07:26:33 -0700 (PDT)
From: rupert@web-ideas.com.au
Subject: Re: EPIC and "my" variables
Message-Id: <827fe53d-a5fb-4265-8484-cf68d2308cbe@u6g2000prc.googlegroups.com>

I would also like to know the answer to this. I've Ubuntu 8.04, Perl,
Cpan,Eclipse, EPIC, Padwalker, and everything runs except for variable
values...


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

Date: Thu, 24 Jul 2008 15:02:23 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: FAQ 4.2 Why is int() broken?
Message-Id: <slrng8gvav.69m.hjp-usenet2@hrunkner.hjp.at>

On 2008-07-22 19:09, szr <szrRE@szromanMO.comVE> wrote:
> PerlFAQ Server wrote:
>>    For example, this
>>
>>            print int(0.6/0.2-2), "\n";
>>
>>    will in most computers print 0, not 1, because even such simple
>>    numbers as 0.6 and 0.2 cannot be presented exactly by
>>    floating-point numbers.
>
> Curious:
>
>    $ perl5.10.0 -e 'print int(0.6/0.2-2), qq{\n};'
>    1
>
>    $ perl5.8.8 -e 'print int(0.6/0.2-2), qq{\n};'
>    1
>
>
> But older Perl's I still have around for testing purposes, which have no 
> 64 bit float or int support all zero:
>
>    $ perl5.8.2 -e 'print int(0.6/0.2-2), qq{\n};'
>    0
>
>    $ perl5.8.0 -e 'print int(0.6/0.2-2), qq{\n};'
>    0
>
>    $ perl5.6.1 -e 'print int(0.6/0.2-2), qq{\n};'
>    0
>
>
> I take it this is because I compiled perl5.8.8 and perl5.10.0 with 64bit 
> float (and int) support?

No, floats in perl are normally "double", i.e., 64 bit. But maybe you've
built perl long "long double" (80, 96, or 128 bit, depending on
platform) support?

% perl -V:nvtype -V:nvsize
nvtype='double';
nvsize='8';

% perl -e 'print int(0.6/0.2-2), qq{\n};' 
0


>> What you think in the above as 'three' is really more like
>>    2.9999999999999995559.
>
>    $ perl5.10.0 -e 'print 3.0, qq{\n};'
>    3
>
> Or am I missing something?
>
>    $ perl5.10.0 -e 'print sprintf(qq{%.50f}, 3.0), qq{\n};'
>    3.00000000000000000000000000000000000000000000000000
>
> I would of expected some rounding errors,

For printing 3? I wouldn't. 3 is exactly representable in binary
(1 * 2^1 + 1 * 2^0). There is no rounding error. But neither 0.6 nor 0.2
are exactly representable (0.6 is 3/5, and you cannot represent 1/5 in
a finite number of binary digits, just like you cannot represent 1/3 in
a finite number of decimal digits), so when you write 0.6/0.2 in your
source code, perl will really compute round_bin(0.6) / round_bin(0.2) 
where round_bin stands for "round to nearest representable number". For
64 bit floats,
round_bin(0.6) = 0.59999999999999997779553950749686919152736663818359375
round_bin(0.2) = 0.200000000000000011102230246251565404236316680908203125
and since 0.6 has been rounded down and 0.2 has been rounded up, the
result of the division must be slightly smaller than 3.
But note that for a different number of binary digits, it is possible
that 0.6 is rounded up, and 0.2 is rounded down, and then the result
would be slightly larger than 3 and then int(0.6/0.2-2) is of course 1.


> Again I am a bit tired from a long trip so it's entirely conceivable 
> that I'm missing something obvious here.

Only about 95 bazillion previous discussions of this topic in this group
;-).

	hp


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

Date: Thu, 24 Jul 2008 09:19:39 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: FAQ 4.2 Why is int() broken?
Message-Id: <g6aa2s02b4f@news4.newsguy.com>

Peter J. Holzer wrote:
> On 2008-07-22 19:09, szr <szrRE@szromanMO.comVE> wrote:
>> PerlFAQ Server wrote:
>>>    For example, this
>>>
>>>            print int(0.6/0.2-2), "\n";
>>>
>>>    will in most computers print 0, not 1, because even such simple
>>>    numbers as 0.6 and 0.2 cannot be presented exactly by
>>>    floating-point numbers.
>>
>> Curious:
>>
>>    $ perl5.10.0 -e 'print int(0.6/0.2-2), qq{\n};'
>>    1
>>
>>    $ perl5.8.8 -e 'print int(0.6/0.2-2), qq{\n};'
>>    1
>>
>>
>> But older Perl's I still have around for testing purposes, which
>> have no 64 bit float or int support all zero:
>>
>>    $ perl5.8.2 -e 'print int(0.6/0.2-2), qq{\n};'
>>    0
>>
>>    $ perl5.8.0 -e 'print int(0.6/0.2-2), qq{\n};'
>>    0
>>
>>    $ perl5.6.1 -e 'print int(0.6/0.2-2), qq{\n};'
>>    0
>>
>>
>> I take it this is because I compiled perl5.8.8 and perl5.10.0 with
>> 64bit float (and int) support?
>
> No, floats in perl are normally "double", i.e., 64 bit. But maybe
> you've built perl long "long double" (80, 96, or 128 bit, depending on
> platform) support?
>
> % perl -V:nvtype -V:nvsize
> nvtype='double';
> nvsize='8';

You are right. Built with 64 bit int, but 96 bit float, the size of a 
long double in c:

   $ perl5.10.0 -V:nvtype -V:nvsize
   nvtype='long double';
   nvsize='12';

   $ perl5.8.8 -V:nvtype -V:nvsize
   nvtype='long double';
   nvsize='12';

> % perl -e 'print int(0.6/0.2-2), qq{\n};'
> 0

Seems you need the extra precision that building Perl with "long double" 
support (or Math::BigFloat) affords in order to get the expected 
(mathematical) result.


>>> What you think in the above as 'three' is really more like
>>>    2.9999999999999995559.
>>
>>    $ perl5.10.0 -e 'print 3.0, qq{\n};'
>>    3
>>
>> Or am I missing something?
>>
>>    $ perl5.10.0 -e 'print sprintf(qq{%.50f}, 3.0), qq{\n};'
>>    3.00000000000000000000000000000000000000000000000000
>>
>> I would of expected some rounding errors,
>
> For printing 3? I wouldn't. 3 is exactly representable in binary
> (1 * 2^1 + 1 * 2^0). There is no rounding error. But neither 0.6 nor
> 0.2 are exactly representable (0.6 is 3/5, and you cannot represent
> 1/5 in a finite number of binary digits, just like you cannot 
> represent
> 1/3 in a finite number of decimal digits), so when you write 0.6/0.2 
> in
> your source code, perl will really compute round_bin(0.6) /
> round_bin(0.2) where round_bin stands for "round to nearest
> representable number". For 64 bit floats,
> round_bin(0.6) =
> 0.59999999999999997779553950749686919152736663818359375
> round_bin(0.2) =
> 0.200000000000000011102230246251565404236316680908203125 and since
> 0.6 has been rounded down and 0.2 has been rounded up, the result of
> the division must be slightly smaller than 3.

Alas, I see the light on this now. Thank you.

> But note that for a different number of binary digits, it is possible
> that 0.6 is rounded up, and 0.2 is rounded down, and then the result
> would be slightly larger than 3 and then int(0.6/0.2-2) is of course
> 1.

Yes, I hate those sort of edge cases.

>> Again I am a bit tired from a long trip so it's entirely conceivable
>> that I'm missing something obvious here.
>
> Only about 95 bazillion previous discussions of this topic in this
> group ;-).

Good point, once again :-)

-- 
szr 




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

Date: Thu, 24 Jul 2008 20:26:50 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: number of maximum decimal places supported with Perl
Message-Id: <7t-dnYiWYcnhShXVnZ2dnUVZ8hydnZ2d@bt.com>

Jack wrote:
> On Jul 22, 4:29 pm, Leon Timmermans <faw...@gmail.com> wrote:
>> On Tue, 22 Jul 2008 16:17:15 -0700, Jack wrote:
>>> Hi there, does anyone know what data type has the most digits of
>>> precision perl, and what the upper bound (maximum) number of decimal
>>> places is for that data type ?
>>> Thank you,
>>> Jack
>> I don't think there is a clearly defined maximum, but if you need to rely
>> on it Math::BigFloat supports arbitrary precision floating point math.
>>
>> Leon Timmermans
> 
> Great, and thank you, do you happen to know is the maximum number of
> digits supported on the left hand (positive) side of the decimal ?
> 

About 308?


-- 
RGB


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

Date: Thu, 24 Jul 2008 19:35:12 GMT
From: sln@netherlands.com
Subject: Re: number of maximum decimal places supported with Perl
Message-Id: <k8mh84d1c2ick23ecebag430iv4h308rus@4ax.com>

On Thu, 24 Jul 2008 20:26:50 +0100, RedGrittyBrick <RedGrittyBrick@SpamWeary.foo> wrote:

>Jack wrote:
>> On Jul 22, 4:29 pm, Leon Timmermans <faw...@gmail.com> wrote:
>>> On Tue, 22 Jul 2008 16:17:15 -0700, Jack wrote:
>>>> Hi there, does anyone know what data type has the most digits of
>>>> precision perl, and what the upper bound (maximum) number of decimal
>>>> places is for that data type ?
>>>> Thank you,
>>>> Jack
>>> I don't think there is a clearly defined maximum, but if you need to rely
>>> on it Math::BigFloat supports arbitrary precision floating point math.
>>>
>>> Leon Timmermans
>> 
>> Great, and thank you, do you happen to know is the maximum number of
>> digits supported on the left hand (positive) side of the decimal ?
>> 
>
>About 308?

308 digit mantissa. Really? 

sln


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

Date: Fri, 25 Jul 2008 00:28:08 +0800
From: zakame@zakame.net (Zak B. Elep)
Subject: Re: Perl - approach to query https website for code & parsing xml  response
Message-Id: <m2ej5j9rhj.fsf@zakame.net>

deep <deepalicanada@gmail.com> writes:

> I tried that but got same results. I used following:
>
> my $ua = new LWP::UserAgent;
> my $res = $ua->post ($url);
> print $res->as_string;
> print "\nResult - $res->content";
> print "\n Error - $res->status_line";

Here's my attempt against a live site (sourceforge), it works:

alteran:~ zakame$ perl -de 0 -MLWP::UserAgent

Loading DB routines from perl5db.pl version 1.28
Editor support available.

,----[ perl -de 0 -MLWP::UserAgent ]
| Enter h or `h h' for help, or `man perldebug' for more help.
| 
| main::(-e:1):   0
|   DB<1> $ua = LWP::UserAgent->new()
| 
|   DB<2> $url = 'https://sourceforge.net/forum/forum.php'
| 
|   DB<3> $res = $ua->post( $url, forum_id => '849067' )
| 
|   DB<4> x $res->as_string()
| 0  "HTTP/1.1 200 OK\cJConnection: close..."
| 
|   DB<5> x $res->status_line()
| 0  '200 OK'
`----

-- 
  I like the idea of 256 bits, though: 32 for the (Unicode) character leaves
  room for 224 Bucky bits, which ought to be enough for anyone.
				-- Roland Hutchinson, in alt.folklore.computers


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

Date: Thu, 24 Jul 2008 08:56:48 -0700 (PDT)
From: deep <deepalicanada@gmail.com>
Subject: Re: Perl - approach to query https website for code & parsing xml  response
Message-Id: <3a8e1d26-428d-4446-9e33-562a6ecf661d@c65g2000hsa.googlegroups.com>

I tried that but got same results. I used following:

my $ua = new LWP::UserAgent;
my $res = $ua->post ($url);
print $res->as_string;
print "\nResult - $res->content";
print "\n Error - $res->status_line";


I got following output.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>200 OK</title>
</head><body>
<h1>OK</h1>
<p>Your browser sent a request that this server could not
understand.<br />
</p>
</body></html>

Result - HTTP::Response=HASH(0x1e93824)->content
 Error - HTTP::Response=HASH(0x1e93824)->status_line


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

Date: Thu, 24 Jul 2008 10:56:23 -0700 (PDT)
From: deep <deepalicanada@gmail.com>
Subject: Re: Perl - approach to query https website for code & parsing xml  response
Message-Id: <7ae28e47-2204-4ab0-a567-745d05f17ed6@v39g2000pro.googlegroups.com>

On Jul 24, 1:20=A0pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
 You tried what?
>> Tried post method as get method was not working as per Zak's comment.

What's the URL?
>> Had to exclude as it's a financial website.

Of course, that's not how you'd actually see the value of those
methods,which is why you're getting this wonderful output.
>> Got your point. In the begining, I indicated that I'm new to  web progra=
mming. That's why i'm posting on this forum.

I have no idea what this has to do with 'parsing xml response', which
is in your subject.
>> Again, check the initial post. I have that in subject because if the cod=
e works properly, then the site will generate a XML response. Not sure how =
to read a XML response. And hence parsing xml response in the subject.

Do you have Crypt::SSLeay installed?
>> Yes

You're sure you want to do a POST? =A0You're not 'post'ing anything.
>> If I knew what I want then I wouldn't have posted.


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

Date: Thu, 24 Jul 2008 12:20:47 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Perl - approach to query https website for code & parsing xml response
Message-Id: <4888b9f0$0$89398$815e3792@news.qwest.net>

deep wrote:
> I tried that but got same results. I used following:
You tried what?

> 
> my $ua = new LWP::UserAgent;
> my $res = $ua->post ($url);

What's the URL?

> print $res->as_string;
> print "\nResult - $res->content";
> print "\n Error - $res->status_line";

Of course, that's not how you'd actually see the value of those methods,
which is why you're getting this wonderful output.

> Result - HTTP::Response=HASH(0x1e93824)->content
>  Error - HTTP::Response=HASH(0x1e93824)->status_line

 > print "Result - ", $res->content, "\n";
 > print "Error - ",  $res->status_line, "\n";

I have no idea what this has to do with 'parsing xml response', which
is in your subject.

Do you have Crypt::SSLeay installed?

You're sure you want to do a POST?  You're not 'post'ing anything.



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

Date: Thu, 24 Jul 2008 11:44:18 +0100
From: Alex Buell <alex.buell@munted.org.uk>
Subject: Profiling?
Message-Id: <20080724114418.589fda9e.alex.buell@munted.org.uk>

Is there a way to profile a Perl program? for example, see where it
spends most of its time doing things? Thanks!

Regards,
Alex


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

Date: Thu, 24 Jul 2008 11:53:55 +0100
From: Alex Buell <alex.buell@munted.org.uk>
To: Alex Buell <alex.buell@munted.org.uk>
Subject: Re: Profiling?
Message-Id: <20080724115355.608aac6f.alex.buell@munted.org.uk>

On Thu, 24 Jul 2008 11:44:18 +0100
Alex Buell <alex.buell@munted.org.uk> wrote:

> Is there a way to profile a Perl program? for example, see where it
> spends most of its time doing things? Thanks!

Never mind, I've just discovered -DProf and dprofpp! 

Thanks anyway,
Alex


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

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 V11 Issue 1745
***************************************


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