10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to make a perl script using the "open" command to open and read a file, storing the information in said file into a hash structure.
This is what is inside my file-
Celena Standard F 01/24/94 Cancer
Jeniffer Orlowski F 06/24/86 None
Brent Koehler M 12/05/97 HIV
Mao Schleich... (4 Replies)
Discussion started by: Eric1
4 Replies
2. Shell Programming and Scripting
Experts - Any advice on how to get a hash value in a foreach loop?
Values print correctly on standalone print statements, but I can't access value
in foreach loop.
See sample code below and thanks in advance.
foreach my $z (sort keys %hash) {
for $y (@{$hash{$z}}) {
print "$z... (6 Replies)
Discussion started by: timj123
6 Replies
3. Programming
My issue is that the perl script (as I have done it so far) created empty branches when I try to check some branches on existence.
I am using multydimentional hashes: found it as the best way for information that I need to handle. Saing multidimentional I means hash of hashes ... So, I have
... (2 Replies)
Discussion started by: alex_5161
2 Replies
4. 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
5. Shell Programming and Scripting
Hi,
In Perl, is it possible to use a range of numbers with '..' as a key in a hash?
Something in like:
%hash = (
'768..1536' => '1G',
'1537..2560' => '2G'
);
That is, the range operation is evaluated, and all members of the range are... (3 Replies)
Discussion started by: dsw
3 Replies
6. 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
7. Shell Programming and Scripting
Hello,
I have a hash in hsh. I need to assign it to another hash globalHsh. I think the below statement does not work
$globalHsh{$id} = %hsh;
What is the right way to assign it?
Thanks (3 Replies)
Discussion started by: rsanjay
3 Replies
8. Shell Programming and Scripting
Hi,
Now i work in a code that
1-get data stored in the database in the form of hash table with a key
field which is the " Name"
2-in the same time i open a txt file and loop through it word by word
3- which i have a problem in is that :
I need to loop word by word and check if it is a... (0 Replies)
Discussion started by: eng_shimaa
0 Replies
9. Shell Programming and Scripting
hello again, i've checked many sites for examples and am amazed that i can't find a simple example of an if statement to test for an alphanumber value ie:
if($key == "a" )
to run this pgm: perl del3.pl delin
delin data is:
a=1
b=2
c=3
thanks for any pointers
ps: java programmer... (7 Replies)
Discussion started by: bobk544
7 Replies
10. Shell Programming and Scripting
i've reworked some code from an earlier post, and it isn't working as expected
i've simplified it to try and find the problem. i spent hours trying to figure out what is wrong, eventually thinking there was a bug in perl or a problem with my computer. but, i've tried it on 3 machines with the... (5 Replies)
Discussion started by: quantumechanix
5 Replies