07-14-2009
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
This is driving me mad, where am I going wrong?
The relevant segment of code:
sub getndsybcons {
my @servers=@{$_};
my @sybservers=@{$_};
my %results;
foreach my $server(@servers) {
my $biggestsyb;
my $biggestsybval=0;
... (9 Replies)
Discussion started by: Smiling Dragon
9 Replies
2. 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
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
#use perl 5.8.5;
my %h1=(a=>'b', c=>'d');
my %h2=(a1=>'b1', c1=>'d1');
my $R1=\%h1;
my $R2=\%h2;
my %h= {$R1, $R2};
my $href=\%h; # hash of hashes
foreach my $key (keys %$href){
print "Z::$$href{$key}\n"
}
When I am trying to print elements of hash of hashes,
it prints HASH... (1 Reply)
Discussion started by: shristi
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,
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
9. Cybersecurity
I have found this excellent site: NSRL Downloads
(sorry if it was already mentioned)
there are Solaris and Linux files there too.
its all in a text file, over 11Gb large. (0 Replies)
Discussion started by: orange47
0 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
dbix::simple::comparison
DBIx::Simple::Comparison(3pm) User Contributed Perl Documentation DBIx::Simple::Comparison(3pm)
NAME
DBIx::Simple::Comparison - DBIx::Simple in DBI jargon
DESCRIPTION
This is just a simple and inaccurate overview of what DBI things the DBIx::Simple things represent, or the other way around.
This document can be useful to find the foo equivalent of bar.
"?" means that DBI doesn't have an equivalent or that I couldn't find one.
"=" means that DBIx::Simple provides a direct wrapper to the DBI function.
"~" means that DBIx::Simple's method does more or less the same, but usually in a more high level way: context sensitive, combining things,
automatically taking care of something.
Note that DBIx::Simple is a wrapper around DBI. It is not "better" than DBI. In fact, DBIx::Simple cannot work without DBI.
Using DBI directly is always faster than using DBIx::Simple's equivalents. (For the computer, that is. For you, DBIx::Simple is supposed to
be faster.)
Classes, common names
use DBI ~ use DBIx::Simple
$DBI::errstr = DBIx::Simple->error
DBI::db ~ DBIx::Simple
$dbh ~ $db
$dbh->errstr = $db->error
connect ~ connect
connect ~ new
DBI::st ~ DBIx::Simple::Result
<undef> ~ DBIx::Simple::Dummy
$sth ~ $result
Queries
DBI
my $sth = $dbh->prepare_cached($query);
$sth->execute(@values);
~ DBIx::Simple
my $result = $db->query($query, $values);
Results
DBI DBIx::Simple
bind_columns ~ bind
fetchrow_arrayref/fetch = fetch
fetchrow_array ~ list
*1 ~ flat
[@{fetchrow_arrayref}] = array
fetchall_arrayref ~ arrays
fetchrow_hashref() *2*3 = hash
fetchall_arrayref({}) *4 ~ hashes
fetchall_hashref *2 = map_hashes
? ? map_arrays
fetchall_hashref(1) *2 = map
$sth->{NAME_lc/NAME} = $result->columns
*1 There's no fetch variant, but you can do "{ @{ $dbh->selectcol_arrayref('SELECT ...', { Slice => [] }) } }".
*2 To receive the keys (column names) lowercased, use "$db->{FetchHashKeyName} = 'NAME_lc'". DBIx::Simple lower cases them by default.
*3 Or supply an argument, 'NAME_lc'.
*4 No, arrayref isn't a typo. When supplied an empty hash reference, DBI's fetchall_arrayref actually returns hashrefs. This DBI method
does not support lower casing of keys, DBIx::Simple does.
Direct access
DBI DBIx::Simple
$dbh = $db->dbh
$sth->{$foo} = $result->attr($foo)
func = func
begin_work = begin_work
commit = commit
rollback = rollback
last_insert_id = last_insert_id
rows = rows
disconnect ~ disconnect
finish ~ finish
DBIx::Simple specific (?)
keep_statements
lc_columns
iquery (via SQL::Interp)
select, insert, update, delete (via SQL::Abstract)
abstract (via SQL::Abstract)
flat
hashes
map_arrays
map
LICENSE
There is no license. This software was released into the public domain. Do with it what you want, but on your own risk. The author
disclaims any responsibility.
AUTHOR
Juerd Waalboer <juerd@cpan.org> <http://juerd.nl/>
SEE ALSO
DBI, DBIx::Simple
perl v5.10.0 2007-07-14 DBIx::Simple::Comparison(3pm)