Hi,
When using sort on an associative array:
foreach $key (sort(keys(%opalfabet))){
$value = $opalfabet{$key};
$result .= $value;
}
How does it handle double values?
It seems to me that it removes them, is that true? If so, is there a way to get... (2 Replies)
plz help me..........i have a ksh script that sorts data in ascending order.
the 1st half is correct,but for the line no 31 its showing problem
1 #!/bin/ksh
2
3
4
5 echo "Enter the array length"
6 read num
7
8
9 echo "enter the... (4 Replies)
Generalized arrays take any type of variable(s) as subscripts, but the subscript(s) are treated as one long string expression.
The use of for(a in x) on a generalized array will return all of the valid subscripts in some order, not necessarily the one you wished.
How can I make it so that i... (2 Replies)
Hi All,
I have an array in perl as @match = (201001,201002,201001,201002);
I am trying to sort this array as
@match = sort(@match);
print "@match";
I dont see the output sorted any answers
I also tried another way, but still the results are not sorted
foreach my $match (sort { $a... (2 Replies)
Hi,
I would like to do the following sorting, but the output is not what i expected. Why 222 and 2222 are not at the last two elements of array?
awk 'BEGIN{a="22";a="2222";a="33";a="44";a="222";a="11";a="22";a="33";asort(a); for (i=1;i<=8;i++) print a}'
11
22
22
222
2222
33
33
44... (1 Reply)
Hi,
i have a txtfile with the format <Nr>tab<word>tab<other stuff>new line and i want to sort the <word>-colum with a perl script.
My textfile:
<Nr>tab<word>tab<other stuff>new line
6807 die ART.Acc.Sg.Fem
6426 der ART.Gen.Sg.Fem
2 die ART.Nom.Sg.Fem
87 auf APPR.--
486 nicht PTKNEG.--... (1 Reply)
Hi all,
I have a script which produces a nice table but I want to sort it on column 3.
This is the output line in the script:
# Output
{ FS = ":";
format = "%11s %6s %-16s\n";
prinft "\n"
printf ( format, "Size","Count","Who" ) }
for (i in... (21 Replies)
I need help to sort the output of an awk array
Example datadata="1 blue
2 green
3 blue
4 yellow
5 blue
6 red
7 yellow
8 red
9 yellow
10 yellow
11 green
12 orange
13 black"
My awk line to get output in one lineecho "$data" | awk ' {arr++; next} END { for (i in arr) { if(arr>1 )... (2 Replies)
Hello,
I have a file which has the following structure
word space Frequency
The file is around 30,000 headwords each along with its frequency. The words have different lengths. What I need is a PERL or AWK script which can sort the file on length of the headword and once the file is sorted on... (12 Replies)
Discussion started by: gimley
12 Replies
LEARN ABOUT DEBIAN
business::onlinepayment::https
OnlinePayment::HTTPS(3pm) User Contributed Perl Documentation OnlinePayment::HTTPS(3pm)NAME
Business::OnlinePayment::HTTPS - Base class for HTTPS payment APIs
SYNOPSIS
package Business::OnlinePayment::MyProcessor;
use base qw(Business::OnlinePayment::HTTPS);
sub submit {
my $self = shift;
#...
# pass a list (order is preserved, if your gateway needs that)
( $page, $response, %reply_headers )
= $self->https_get( field => 'value', ... );
# or a hashref
my %hash = ( field => 'value', ... );
( $page, $response_code, %reply_headers )
= $self->https_get( \%hash );
#...
}
DESCRIPTION
This is a base class for HTTPS based gateways, providing useful code for implementors of HTTPS payment APIs.
It depends on Net::HTTPS::Any, which in turn depends on Net::SSLeay _or_ ( Crypt::SSLeay and LWP::UserAgent ).
METHODS
https_get [ \%options ] HASHREF | FIELD => VALUE, ...
Accepts parameters as either a hashref or a list of fields and values. In the latter case, ordering is preserved (see Tie::IxHash to
do so when passing a hashref).
Returns a list consisting of the page content as a string, the HTTP response code and message (i.e. "200 OK" or "404 Not Found"), and a
list of key/value pairs representing the HTTP response headers.
The options hashref supports setting headers:
{
headers => { 'X-Header1' => 'value', ... },
}
https_post [ \%options ] SCALAR | HASHREF | FIELD => VALUE, ...
Accepts form fields and values as either a hashref or a list. In the latter case, ordering is preserved (see Tie::IxHash to do so when
passing a hashref).
Also accepts instead a simple scalar containing the raw content.
Returns a list consisting of the page content as a string, the HTTP response code and message (i.e. "200 OK" or "404 Not Found"), and a
list of key/value pairs representing the HTTP response headers.
The options hashref supports setting headers and Content-Type:
{
headers => { 'X-Header1' => 'value', ... },
Content-Type => 'text/namevalue',
}
SEE ALSO
Business::OnlinePayment, Net::HTTPS::Any
perl v5.12.4 2010-05-25 OnlinePayment::HTTPS(3pm)