Sponsored Content
Full Discussion: hash,array and perl
Top Forums Shell Programming and Scripting hash,array and perl Post 302118633 by Unbeliever on Wednesday 23rd of May 2007 08:46:32 AM
Old 05-23-2007
Quote:
Originally Posted by Yogesh Sawant
the hash is being assigned. hash consists of keys and values. both keys and values would be assigned to Content.
Strictly speaking, I think what is being assigned is a reference to an array, the elements of which are the keys and values of the hash %tag (which are the string 'info' and the value of the variable $datastring)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl array question from going through hash

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

PERL, push to hash of array problem

$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

Array of hash in perl does not work

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

perl - need help with 2 arrays to hash or 2d array?

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

perl Can't coerce array into hash at

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

array of hash - perl

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

Compare values of hashes of hash for n number of hash in perl without sorting.

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

Perl Array within an hash

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

Perl : Assigning multile hash values to a single array

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

Perl hash of hashes anonymous array

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
Config::Grammar::Dynamic(3pm)				User Contributed Perl Documentation			     Config::Grammar::Dynamic(3pm)

NAME
Config::Grammar::Dynamic - A grammar-based, user-friendly config parser DESCRIPTION
Config::Grammar::Dynamic is like Config::Grammar but with some additional features useful for building configuration grammars that are dynamic, i.e. where the syntax changes according to configuration entries in the same file. The following keys can be additionally specified in the grammar when using this module: Special Section Keys _dyn A subroutine reference (function pointer) that will be called when a new section of this syntax is encountered. The subroutine will get three arguments: the syntax of the section name (string or regexp), the actual name encountered (this will be the same as the first argument for non-regexp sections) and a reference to the grammar tree of the section. This subroutine can then modify the grammar tree dynamically. _dyndoc A hash reference that lists interesting names for the section that should be documented. The keys of the hash are the names and the values in the hash are strings that can contain an explanation for the name. The _dyn() subroutine is then called for each of these names and the differences of the resulting grammar and the original one are documented. This module can currently document differences in the _vars list, listing new variables and removed ones, and differences in the _sections list, listing the new and removed sections. _recursive Array containing the list of those sub-sections that are recursive, ie. that can contain a new sub-section with the same syntax as themselves. The same effect can be accomplished with circular references in the grammar tree or a suitable _dyn section subroutine (see below}, so this facility is included just for convenience. Special Variable Keys _dyn A subroutine reference (function pointer) that will be called when the variable is assigned some value in the config file. The subroutine will get three arguments: the name of the variable, the value assigned and a reference to the grammar tree of this section. This subroutine can then modify the grammar tree dynamically. Note that no _dyn() call is made for default and inherited values of the variable. _dyndoc A hash reference that lists interesting values for the variable that should be documented. The keys of the hash are the values and the values in the hash are strings that can contain an explanation for the value. The _dyn() subroutine is then called for each of these values and the differences of the resulting grammar and the original one are documented. This module can currently document differences in the _vars list, listing new variables and removed ones, and differences in the _sections list, listing the new and removed sections. COPYRIGHT
Copyright (c) 2000-2005 by ETH Zurich. All rights reserved. Copyright (c) 2007 by David Schweikert. All rights reserved. LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHORS
David Schweikert, Tobias Oetiker, Niko Tyni perl v5.10.0 2007-09-25 Config::Grammar::Dynamic(3pm)
All times are GMT -4. The time now is 07:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy