RE: query about hash

2005-07-15 Thread arjun.mallik
Hi , Yes dumper helped up to some extent. My HASH is some thing like below, --- extract is HASH(0x4039ca60) $VAR1 = { 'Cluster' => '26' }; But I want it to be like below. How to add two keys and two values to hash. -- extract is HASH(0

Re: Append to hash

2005-07-15 Thread Chris Charley
Jakob Kofoed wrote: I have a file with some navigation (x and y's) and needed to fill in point between exiting points. My in put file: 60 6174210 600017 6174213 600028 6174206 600035 6174216 600045 6174209 For calculation I need to use line 1 and 2 for calculating one point and then

Re: sorting list of array

2005-07-15 Thread Wiggins d'Anconia
MNibble wrote: > Beast wrote: > >> Jeff 'japhy' Pinyan wrote: >> Is there any builtin function in perl to sort the above array based on uid, username or fulname? >>> >>> >>> >>> >>> There is a built-in function to sort a list, yes. But the mechanism >>> by which to sort the list is

Catalyst movies!

2005-07-15 Thread Jose Nyimi
Hi, Maybe you are interested as well ;) Rgds, José. -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Sebastian Riedel Envoyé : vendredi 15 juillet 2005 17:42 À : [EMAIL PROTECTED] Cc : mason-Users; templates@template-toolkit.org; cgiapp@lists.erlbaum.ne

How to pass back information to shell

2005-07-15 Thread Siegfried Heintze
I'm using cygwin's bash on WinXP. I want to write a while loop in bash that will loop until my perl program returns 0. However, the following does not print "64" as expected. Why not? How can I keep calling my perl program until there is nothing left to do (as indicated by a zero)? Incidentally

Re: sorting list of array

2005-07-15 Thread MNibble
Beast wrote: Jeff 'japhy' Pinyan wrote: Is there any builtin function in perl to sort the above array based on uid, username or fulname? There is a built-in function to sort a list, yes. But the mechanism by which to sort the list is, in this case, up to you to provide. This works:

Re: Append to hash

2005-07-15 Thread MNibble
Jakob Kofoed wrote: Hi, I would like to load a file to a hash so I will be able to call a specific number in that hash: use strict; use warnings; my %hash = (); open IN, "< $ARGV[0]" || die "could not open $ARGV[0]\n"; my $cnt = "0"; while () { chomp; %hash = ( $cnt => $_ );

Re: query about hash

2005-07-15 Thread Jeff 'japhy' Pinyan
On Jul 15, [EMAIL PROTECTED] said: foreach $cluster ( @{$schedules->{$DAY->[friday]}->{STRUCT}} ) from $cluster i have to extract cluster number and version. How can i do that ?? Output is like below. - extract is HASH(0x4033d910) << From this 2 values are to be retrived . upl

Re: update perl, calling sub

2005-07-15 Thread Greg Maruszeczka
Ing. Branislav Gerzo wrote: > Hi all, > > recently I've updated perl on FreeBSD machine to latest, but my > modules go away, they are not in @INC. I have 2 questions: > 1. is there possibility update perl, without modules going away? > 2. I have some perl CGIs on server, now I have 500 internal se

How to transform the XML string to a table

2005-07-15 Thread Anish Kumar K
Hi All I have a varaible in perl which is having $output_variable=" Search Multiple Courses Third Page Third Page>Sub Page 2 ";I want to process this variable such that I can display this as a table(preferably with th

need to send an XML to templatetool kit

2005-07-15 Thread Anish Kumar K
Hi Can anyone tell how I can send the XML file to a HTML file with perl template toolkit so that in HTML I want to display the datas of XML in a table.. or tell some suitable solution Thanks Anish

query about hash

2005-07-15 Thread arjun.mallik
Hi , I have a script which reads from flat file and stores data in a variable in the form of hash. code - foreach $cluster ( @{$schedules->{$DAY->[friday]}->{STRUCT}} ) - from $cluster i have to extract cluster number and version. How can i do that ?? flat file looks l

Re: creating a hash

2005-07-15 Thread Xavier Noria
On Jul 15, 2005, at 14:50, Octavian Rasnita wrote: I use to put this hash in a file and get the content using my $hashref = do $file; And I want to be able to get the dupplicate keys in order to delete them manually, without needing to search for each manually and compare it with every ot

Re: creating a hash

2005-07-15 Thread Octavian Rasnita
Hi, I use to put this hash in a file and get the content using my $hashref = do $file; And I want to be able to get the dupplicate keys in order to delete them manually, without needing to search for each manually and compare it with every other key from the hash, because if there are only a fe

Re: creating a hash

2005-07-15 Thread Xavier Noria
On Jul 15, 2005, at 13:38, Octavian Rasnita wrote: I know that if there are more keys with the same name, the last is used, but I would like to clean the hash. Given $h = { foo => 0, bar => 1, foo => 2 }; what do you mean by "cleaning" $h ? -- fxn -- To unsubscribe, e-mail: [EMAIL

creating a hash

2005-07-15 Thread Octavian Rasnita
Hi, I use to create hash references for using them as config files like: { first_item => '...', second_item => '...', third_item => '...', #... }; Sometimes the hash gets bigger and I can add a new item in the hash that already exists. I know that if there are more keys with the same name, the l

Re: Append to hash

2005-07-15 Thread Jakob Kofoed
I have a file with some navigation (x and y's) and needed to fill in point between exiting points. My in put file: 60 6174210 600017 6174213 600028 6174206 600035 6174216 600045 6174209 For calculation I need to use line 1 and 2 for calculating one point and then line 2 and 3 and so

Re: Append to hash

2005-07-15 Thread John W. Krahn
Jakob Kofoed wrote: Hi, Hello, I would like to load a file to a hash so I will be able to call a specific number in that hash: use strict; use warnings; my %hash = (); open IN, "< $ARGV[0]" || die "could not open $ARGV[0]\n"; That will never die() because of the high precedence of the ||

Re: Append to hash

2005-07-15 Thread Jakob Kofoed
Hi, Thanks both for the code hint and the note. Cheers. snip.. > > To append to %hash you just make an assignment this way: > > $hash{$cnt} = $_; > > and move the initialization above the while: > > %hash = (); > > As a side note, you know regular hashes accept only string

RE: question related to readdir function

2005-07-15 Thread Moon, John
Subject: question related to readdir function Dear all. I wrote a piece of code to read and open all files from a directory to do something with it. But I found that the variable assigned to @file_array split the file names into pieces. For example ". . test.rpt" file will be separated into thr

reading a big file

2005-07-15 Thread Octavian Rasnita
Hi, I need to create a program which reads a file from the LAN, and that file is continuously updated (kind of log). The file increases continuously, and it can become very big. On every read, I need to read just the lines for the current day (which is specified in each line) and jump over the li

Re: call other program

2005-07-15 Thread MNibble
well i simply can't ... but if you really want't to get your shellpromt back use a fork for that process you would like to read from. something like: die unless defined ($spawn=fork()); unless ($spawn) { open FH,"whoami |"; while() { print if /mnibble/;

RE: question related to readdir function

2005-07-15 Thread Ankur Gupta
Li, Aiguo (NIH/NCI) wrote: > Dear all. > > I wrote a piece of code to read and open all files from a directory > to do something with it. > But I found that the variable assigned to @file_array split the file > names into pieces. For example ". . test.rpt" file will be

Re: Append to hash

2005-07-15 Thread Xavier Noria
On Jul 15, 2005, at 11:05, Jakob Kofoed wrote: Hi, I would like to load a file to a hash so I will be able to call a specific number in that hash: use strict; use warnings; my %hash = (); open IN, "< $ARGV[0]" || die "could not open $ARGV[0]\n"; my $cnt = "0"; while () { chomp;

question related to readdir function

2005-07-15 Thread Li, Aiguo (NIH/NCI)
Dear all. I wrote a piece of code to read and open all files from a directory to do something with it. But I found that the variable assigned to @file_array split the file names into pieces. For example ". . test.rpt" file will be separated into three elements in an array, which are "." "." "tes

Append to hash

2005-07-15 Thread Jakob Kofoed
Hi, I would like to load a file to a hash so I will be able to call a specific number in that hash: use strict; use warnings; my %hash = (); open IN, "< $ARGV[0]" || die "could not open $ARGV[0]\n"; my $cnt = "0"; while () { chomp; %hash = ( $cnt => $_ ); $cnt++; } print

update perl, calling sub

2005-07-15 Thread Ing. Branislav Gerzo
Hi all, recently I've updated perl on FreeBSD machine to latest, but my modules go away, they are not in @INC. I have 2 questions: 1. is there possibility update perl, without modules going away? 2. I have some perl CGIs on server, now I have 500 internal server error because some modules are m