02-28-2011
Re: Intersection and union of array by hash
Thanks!
I got it now, but it seems to me if there is duplicate items in either of the arrays, it won't work, right?
Thank you again!
YT
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a little problem. To keep a configuration simple, I've exceeded my perl knowledge. :-) I've worked with multi-dimentional arrays before, but this one has me beat:
@info = (
{
'defval' => 'abc'
'stats' = (
{ 'name' => 'a', },
{ 'name' =>... (1 Reply)
Discussion started by: jsmoriss
1 Replies
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
Hi all experts,
May I know how to read a csv file and read the content in a hash in PERL?
Currently, I hard-coded and defined it in my code. I wanna know how to make up the %mymap hash thru reading the cfg.txt
====
csv file(cfg.txt):
888,444
999,333
===
#!/usr/bin/perl
my... (1 Reply)
Discussion started by: kinmak
1 Replies
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. Programming
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
10. Programming
Sorry for the “word salad” subject, but I wanted to cast a wide net for help.
I've created an IP (Internet Protocol) server which serves HTTP, SMTP, and FTP requests.
As you probably know, they all require creating a socket, listening on it, accepting connections, and then having a short... (3 Replies)
Discussion started by: John S.
3 Replies
LEARN ABOUT DEBIAN
gnome2::apphelper
Gnome2::AppHelper(3pm) User Contributed Perl Documentation Gnome2::AppHelper(3pm)
NAME
Gnome2::AppHelper
GnomeUIInfo
In Gnome2 GnomeUIInfo's are often used as a convenient way to create GUI's. In Perl, GnomeUIInfo's are always references to arrays of
items. Items can either be references to hashs or references to arrays:
Hash Reference
When using hash references, items are specified by giving key-value pairs. A typical example:
{ type => "item", label => "Quit", callback => sub { exit(0); } }
For the list of valid keys, see below.
Array References
When using array references, items are a list of the following keys, in this order:
type,
label,
hint,
moreinfo,
pixmap_type,
pixmap_info,
accelerator_key and
modifiers.
The example from above would become:
[ "item", "Item", undef, sub { exit(0); },
undef, undef, undef, undef ]
To create multi-level structures, you use the "subtree" type and the "subtree" key, as in the following example:
{
type => "subtree",
label => "Radio Items",
subtree => [
{
type => "radioitems",
moreinfo => [
{
type => "item",
label => "A"
},
{
type => "item",
label => "B"
},
{
type => "item",
label => "C"
},
{
type => "item",
label => "D"
},
{
type => "item",
label => "E"
}
]
}
]
}
METHODS
Gnome2->accelerators_sync
$menu_shell->fill_menu ($uiinfo, $accel_group, $uline_accels, $pos)
o $uiinfo (Gnome2::UIInfo)
o $accel_group (Gtk2::AccelGroup)
o $uline_accels (boolean)
o $pos (integer)
$toolbar->fill_toolbar ($uiinfo, $accel_group)
o $uiinfo (Gnome2::UIInfo)
o $accel_group (Gtk2::AccelGroup)
list = $parent->find_menu_pos ($path)
o $path (string)
Returns the GtkWidget and the position associated with the path.
$bar->install_menu_hints ($uiinfo)
o $uiinfo (Gnome2::UIInfo)
SEE ALSO
Gnome2
COPYRIGHT
Copyright (C) 2003-2004 by the gtk2-perl team.
This software is licensed under the LGPL. See Gnome2 for a full notice.
perl v5.14.2 2011-11-16 Gnome2::AppHelper(3pm)