Sponsored Content
Full Discussion: Perl Array within an hash
Top Forums Programming Perl Array within an hash Post 302800245 by ab52 on Monday 29th of April 2013 08:59:04 AM
Old 04-29-2013
thanks that worked, list a treat, just two questions, if i wanted other fileds as well could i do this,

Code:

for my $host (@{$perl_data->{data}}){
   print "$host->{hostname}\n";
   print "$host->{oui}";
}

and also i am getting lots of these errors,

Code:
Use of uninitialized value in concatenation (.) or string at ./tester line 20


e,g it will give me some hostname and then that line, or blank lines

Thanks
A

Last edited by Corona688; 04-29-2013 at 01:20 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

hash,array and perl

Hi,i have a code fragment below. %tag = (); #line 1 $tag{'info'} = $datastring; #line 2 $resp = $ua->request( #$ua is a user agent POST 'http://10.2.3.0' , Content_Type => application/x-www-form-urlencoded Content => #line 3 I am not sure of what the code... (3 Replies)
Discussion started by: new2ss
3 Replies

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

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
wnnaccess(1M)						  System Administration Commands					     wnnaccess(1M)

NAME
wnnaccess - Access control over Wnn6 Kana-Kanji conversion server/dictionary lookup server SYNOPSIS
/usr/sbin/wnnaccess [-D jserver_name] [-ds wnnds_name] [-L LANG_name] [ -| + [hostname | username] ] DESCRIPTION
wnnaccess adds or deletes hosts and users, obtains the current access control information, enables or disables access control for access permission retained by the Wnn6 Kana-Kanji conversion server/dictionary lookup server. OPTIONS
The following options are available. -D jserver_name Specifies the Wnn6 Kana-Kanji conversion server (jserver) to work on. If this option is omitted, wnnaccess refers to the serverdefs file and determines the Kana-Kanji conversion server to work on. The Kana-Kanji conversion server must be specified in the following format. hostname Kana-Kanji conversion server that uses the well-known port number(22273) on host hostname hostname:no Kana-Kanji conversion server that uses port number of " the well-known port number plus no" on host host- name hostname/port_noKana-Kanji conversion server that uses port_no as port number on host hostname -ds wnnds_name Specifies the Wnn6 dictionary lookup server (wnnds) to work on. The dictionary lookup server must be specified in the following format. hostname Dictionary lookup server that uses the well-known port number(26208) on host hostname hostname:no Dictionary lookup server that uses port number of "the well-known port number plus no" on host hostname hostname/port_noDictionary lookup server that uses port_no as port number on host hostname -L LANG_name Specifies the language. The language is used to refer to the serverdefs file and determine the server to connect. Specify ja for the Solaris releases (Japanese version). If no options are specified, wnnaccess writes the current access control information. The first line shows the current status of access control enabled or disabled. The second and following lines show hosts and users that are given access rights as in any of the following formats: host-name All users can access from this host. host-name: No users can access from this host. host-name:user-name,user-name,..Only users shown in the list can access from this host. @user-name This user can access from any host. Specifying - option only enables access control. Specifying + option only disables access control. If access control is disabled, no restriction is imposed on connection to the server. If + option and hostname| username are specified, the host or user will be added to the access control. If - option and hostname| username are specified, the host or user will be deleted from the access control. The format of hostname| username is the same as in displaying the current access control information. If neither - nor + option is specified, the behavior will be the same as in specifying + option. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWjwnsu | +-----------------------------+-----------------------------+ SEE ALSO
jserver(1M), wnnds(1M), wnnhosts(4), wnn_serverdefs(4) SunOS 5.10 10 Jan 2003 wnnaccess(1M)
All times are GMT -4. The time now is 07:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy