10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
I want to sort values of a hash in ascending order.
my %records;
for my $value (sort values %records){print $value,"\n";}
When I use the above code I get values in this order: 1,10,11,2,3,4,5,6,7,8,9. But, I need values in my output in this order: 1,2,3,4,5,6,7,8,9,10,11.
Can Someone... (1 Reply)
Discussion started by: koneru_18
1 Replies
3. Shell Programming and Scripting
Hi Folks
I am very much a newbie at perl but picking it up and I'm hoping you can help.
I have a file input that details all the /etc/group files in our enterprise in the following format: "<host>:<group>:<gid>:<users>"
I want to parse this data display it as the following:... (9 Replies)
Discussion started by: g_string
9 Replies
4. Programming
I am trying to store this information (info and number) in hash. number is the key and info is value in a hash.i shown my code below.
#!/usr/bin/perl
use warnings;
use strict;
use XML::LibXML::Reader;
my $file;open $file, 'formal.xml');
my $reader =... (0 Replies)
Discussion started by: veerubiji
0 Replies
5. Shell Programming and Scripting
Hi,
I have a datahash with 'n' number of values in perl script. I am writing a xml file from the datahash. I am getting output with sorting(Field sorting). My question is that i don't want any default sorting.whatever i am inserting into datahash it should give same xml file.
Any help?
... (0 Replies)
Discussion started by: solo123
0 Replies
6. Shell Programming and Scripting
Hi,
In Perl, is it possible to use a range of numbers with '..' as a key in a hash?
Something in like:
%hash = (
'768..1536' => '1G',
'1537..2560' => '2G'
);
That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Discussion started by: dsw
3 Replies
7. Shell Programming and Scripting
Hi,
Is there any quick way to use pull out keys that match a specific regex pattern?
eg
%hash ;
$hash(123,456) = xxx;
$hash(123,457) = xxx;
$hash(123,458) = xxx;
$hash(223,459) = xxx;
I need a fast way to get all the keys that start with 123..
Meaning I should get
... (5 Replies)
Discussion started by: Leion
5 Replies
8. Shell Programming and Scripting
Can Someone explain me why even using Tie::IxHash I can not get the output data in the same order that it was inserted? See code below.
#!/usr/bin/perl
use warnings;
use Tie::IxHash;
use strict;
tie (my %programs, "Tie::IxHash");
while (my $line = <DATA>) {
chomp $line;
my(... (1 Reply)
Discussion started by: jgfcoimbra
1 Replies
9. Shell Programming and Scripting
Data I want to sort :-
1 10 jj Y
2 100 vv B
19 5 jj A
1 11 hq D
3 8 op X
44 78 ds GG
1 8 hq D
and want to sort based on the first 2 columns - which hold numeric values.
Am using :
cat filename | sort -nk 1,2
But the result is :-
1 10 jj Y
1 11 hq D (1 Reply)
Discussion started by: sinpeak
1 Replies
10. Shell Programming and Scripting
hello
I have loop , in this loop im picking names , this names I want to be keys in %hash
but I don't know how to set in every loop entertain different key in the %hash (1 Reply)
Discussion started by: umen
1 Replies