10-10-2012
Usually hash is just a random storage partial key, so it feels like we need the outer code and app to understand the problem. Is this like a top 10 scoring problem?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a script with dynamic hash of hashes , and I want to print the entire hash (with all other hashes).
Itried to do it recursively by checking if the current key is a hash and if yes call the current function again with refference to the sub hash.
Most of the printing seems to be OK but in... (1 Reply)
Discussion started by: Alalush
1 Replies
2. Shell Programming and Scripting
hi there, I have some database output that looks like this
SELECT nic_name,nic_duplex,nic_speed,nic_ip FROM network_table WHERE hostname = "server1"
result is this (ive delimited with a pipe for ease of reading)
bge0|full|1000|10.32.100.1
bge1|full|1000|11.12.101.7 ... (1 Reply)
Discussion started by: hcclnoodles
1 Replies
3. Shell Programming and Scripting
Hi there
I have a hash of hashes made up of the following data
bge0|100|half|10.36.100.21
bge1|1000|full|10.36.100.22
bge2|1000|full|10.36.100.23
which when i turn into a hash, would look like this inside the system
bge0 ->
nic_speed -> 100
nic_duplex -> half
... (6 Replies)
Discussion started by: hcclnoodles
6 Replies
4. Shell Programming and Scripting
Hi, sorry, two hash related questions in one day .. but this has got me a bit stuck.
I have a mysql database table that kind of looks like this, the table is called "view1" and a snippet of that table (SELECT'ing just rows with serial number 0629AN1200) is below
serial nic_name ... (2 Replies)
Discussion started by: hcclnoodles
2 Replies
5. 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
6. Shell Programming and Scripting
hi all,
i have a small problem regarding sorting the keys in a hash.
my %hash;
for($i=0;$i<19;$i++)
{
$hash{$i}=$i;
}
foreach $c (sort keys %hash)
{
print "\n $hash{$c}";
} (1 Reply)
Discussion started by: niteesh_!7
1 Replies
7. Shell Programming and Scripting
Hi there, I am trying to dereference my hash of hashes but post dereferencing, it seems to lose its structure I am using Data::dumper to help me anaylise.
This is the code im using to build the HoH, (data comes from a file). I have also performed a Dumper on the data structure before and after... (1 Reply)
Discussion started by: rethink
1 Replies
8. 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
9. 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
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 DEBIAN
digest::multihash
Digest::MultiHash(3pm) User Contributed Perl Documentation Digest::MultiHash(3pm)
NAME
Digest::MultiHash - XOR based, variable width multiplexing of hashes (a generalized Digest::SV1).
SYNOPSIS
use Digest::MultiHash;
my $d = Digest::Multihash->new(
width => 16, # bytes
hashs => ["SHA-512", "Whirlpool"], # see below for arbitrary arguments
);
$d->add($data);
print $d->hexdigest;
DESCRIPTION
This class inherits from Digest::base, and provides generalized digest multiplexing.
It will multiplex all calls to "add" to all of it's sub digest objects. Likewise, when the final digest is extracted the digests will be
extracted and then XOR'd over eachother according to "width".
"width" will default to the width of the first hash if unspecified.
"hashes" defaults to "SHA-1" for compatibility reasons.
This module is useful for generating keys from passphrases, by supplying the desired width and simply making sure there is enough data from
the combined hashes.
METHODS
See Digest for the complete API. This module inherits from Digest::base.
new This methods accepts a hash reference or an even sized list of parameters named according to the methods.
add
digest
Compute the hash by calling "digest" on all of the subhashes, splitting the result up into "width" sized chunk, and then XORing these
together.
If the result is not aligned on "width" the result will not be truncated. The shorter string will still be XOR'd with the hash, even if
this only affects part of the result.
If there are not at least "width" bytes of data in the output of the combined hashes an error is thrown.
clone
Clones the hash.
hashes
Get the array of hashes to use. Array values in this will be dereferenced before the call to "new" in Digest to allow passing of
arbitrary arguments. Blessed objects (of any class) will be used verbatim.
The list of hashes cannot be changed after construction.
width
Get/set the byte-width to use.
SEE ALSO
Digest, Digest::SV1, Digest::SHA1
perl v5.14.2 2009-10-19 Digest::MultiHash(3pm)