05-23-2007
Quote:
Originally Posted by new2ss
I am not sure of what the code does. would appreciate if anyone can correct me.
I will be inclined to say that if you have some basic knowledge Perl, you will understand the syntax used on those 3 lines. But they alone do not make much sense in my opinion. It's actually what the code does that is more important.
So are you working on a program using HTTP::Request? If so, please take a look at the POD for the module. It will tell you what methods are provided, and the arguments you need to use. Then, you simply provide the arguments as needed.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
suppose my @{$data1{$callid}}; cotains
one two three
three five six
one two three
of random patterns but each item is separated by white space or tab,
Below code extract and get rid of the whitespace perfectly so that it shows now like this
onetwothree
threefivesix... (2 Replies)
Discussion started by: hankooknara
2 Replies
2. Shell Programming and Scripting
$key = "a";
$value = "hello";
%myhash = {} ;
push @{ myHash{$key} }, $hello;
print $myHash{$key}."\n";
this script prints
"hello" but has following error message.
Reference found where even-sized list expected at ./test line 5.
can any one help me to fix this problem?? (3 Replies)
Discussion started by: bonosungho
3 Replies
3. Shell Programming and Scripting
Hi ,
I have an input.txt file that i read
node: id= c1, class=nb, cx=100, cy=100, r=10
node: id=c2, class=b, cx=150, cy=130, r=10
node: id=c3, class=nb, cx=50, cy=80, r=10
node: id=c4, class=nb, cx=120, cy=200, r=10
i split over , and = to create a global array and then passed it to a... (6 Replies)
Discussion started by: rsanjay
6 Replies
4. Shell Programming and Scripting
I have 2 arrays:
@array1 outputs the following:
1
1
1
2
@array2 outputs the following
A
B
C
D (2 Replies)
Discussion started by: streetfighter2
2 Replies
5. Shell Programming and Scripting
Hi guys
I have this part of a perl script that returns and odd error
if ($args{software}) {
print " @DISTFILE_GROUPS $output->{distfile_groups}->{ get_rdist_groups}\n";
and the error is
Can't coerce array into hash at
i've never seed this error before, any ideas
thanks... (0 Replies)
Discussion started by: ab52
0 Replies
6. Shell Programming and Scripting
How do I get the unique hashes from an array of hashes?
@ar1 = ( {a=>1,b=>2}, {c=>3,d=>4},{a=>1,b=>2});I need :
@ar2 = ( {a=>1,b=>2}, {c=>3,d=>4});Thanks. (2 Replies)
Discussion started by: shellwell
2 Replies
7. Shell Programming and Scripting
Hi,
I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all .
my %result (
$abc => {
'data_count' => '10',
'ID' => 'ABC122',
}
$def => {
'data_count' => '20',
'ID' => 'defASe',
... (1 Reply)
Discussion started by: asak
1 Replies
8. Programming
Hi All
I have been using a curl code to output an hash that looks like this
$VAR1 = {
'data'... (5 Replies)
Discussion started by: ab52
5 Replies
9. Shell Programming and Scripting
I know that
@food = %fruit;
Works. But how do I assign %fruit and %veggies to @food ? (2 Replies)
Discussion started by: popeye
2 Replies
10. Shell Programming and Scripting
Hello experts. I'm having problems with a snippet of code.
I was hoping to get help/advice to correct.
A file that this script parses has changed to the point where
I can no longer use a scalar, it looks as though I need to
create an array for a hash of hashes below.
The first output of... (1 Reply)
Discussion started by: timj123
1 Replies
LEARN ABOUT REDHAT
http::request
HTTP::Request(3) User Contributed Perl Documentation HTTP::Request(3)
NAME
HTTP::Request - Class encapsulating HTTP Requests
SYNOPSIS
require HTTP::Request;
$request = HTTP::Request->new(GET => 'http://www.oslo.net/');
DESCRIPTION
"HTTP::Request" is a class encapsulating HTTP style requests, consisting of a request line, some headers, and some (potentially empty) con-
tent. Note that the LWP library also uses this HTTP style requests for non-HTTP protocols.
Instances of this class are usually passed to the "request()" method of an "LWP::UserAgent" object:
$ua = LWP::UserAgent->new;
$request = HTTP::Request->new(GET => 'http://www.oslo.net/');
$response = $ua->request($request);
"HTTP::Request" is a subclass of "HTTP::Message" and therefore inherits its methods. The inherited methods most often used are header(),
push_header(), remove_header(), and content(). See HTTP::Message for details.
The following additional methods are available:
$r = HTTP::Request->new($method, $uri)
$r = HTTP::Request->new($method, $uri, $header)
$r = HTTP::Request->new($method, $uri, $header, $content)
Constructs a new "HTTP::Request" object describing a request on the object $uri using method $method. The $uri argument can be either
a string, or a reference to a "URI" object. The optional $header argument should be a reference to an "HTTP::Headers" object. The
optional $content argument should be a string.
$r->method([$val])
$r->uri([$val])
These methods provide public access to the attributes containing respectively the method of the request and the URI object of the
request.
If an argument is given the attribute is given that as its new value. If no argument is given the value is not touched. In either case
the previous value is returned.
The method() method argument should be a string.
The uri() method accept both a reference to a URI object and a string as its argument. If a string is given, then it should be
parseable as an absolute URI.
$r->as_string()
Method returning a textual representation of the request. Mainly useful for debugging purposes. It takes no arguments.
SEE ALSO
HTTP::Headers, HTTP::Message, HTTP::Request::Common
COPYRIGHT
Copyright 1995-2001 Gisle Aas.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
libwww-perl-5.65 2001-11-15 HTTP::Request(3)