RE: Passing multiple hashes into a sub-routine and returning them

2002-10-29 Thread Reddy Kankanala
when you loop thru keys, is there a way to get the corresponding value? -Original Message- From: Thomas Drugeon [mailto:tdrugeon;ina.fr] Sent: Tuesday, October 29, 2002 10:39 AM To: [EMAIL PROTECTED] Subject: Re: Passing multiple hashes into a sub-routine and returning them hashes and

RE: Passing multiple hashes into a sub-routine and returning them

2002-10-29 Thread Stovall, Adrian M.
foreach $key (keys %hash) { print key: $key - value: $hash{$key}\n; } The code above loops through the keys (in no particular order) and prints each key along with its value. -Original Message- From: Reddy Kankanala [mailto:rkankanala;Interelate.com] Sent: Tuesday, October

RE: Passing multiple hashes into a sub-routine and returning them

2002-10-29 Thread Serebnik, Kiril
Basically you may use something like this (note that this is old fashioned perl style - before references were invented) %a = (ak1 = av1, ak2 = av2); %b = (bk1 = bv1, bk2 = bv2); func (*a, *b); foreach $a (keys %a) { print $a = $a{$a}\n; } foreach $b (keys %b) { print $b =

RE: Passing multiple hashes into a sub-routine and returning them

2002-10-29 Thread Reddy Kankanala
Thanks Adrian! -Original Message- From: Stovall, Adrian M. [mailto:Adrian.Stovall;durez.com] Sent: Tuesday, October 29, 2002 11:12 AM To: [EMAIL PROTECTED] Subject: RE: Passing multiple hashes into a sub-routine and returning them foreach $key (keys %hash) { print key: $key -

Parsing return value from LWP::Simple::get()

2002-10-29 Thread Tony White
As far as I can tell, the return value from LWP::Simple::get is simply a long string. In my case, I'm grabbing an HTML page that contains a list of dates that link to maintenance notices for that date specified. The input would look something like: a href =

Random numbers

2002-10-29 Thread Krishna, Hari
Title: RE: Terrible at my logic Hi friends, I want to generate some 1000 or more passwords for some NT machine. I should be able to generate an 8 digit alphanumeric random numbers from the list of characters. Say I have 3 strings... First string : 0 - 9 numbers Second string : A - Z

RE: Random numbers

2002-10-29 Thread Patrick Connolly
Title: RE: Terrible at my logic @a = (0..9,A..Z,a..z); for($I=0;$I1000;$I++) { for($x=0;$x8;$x++) { $index = rand @a; print $a[$index]; } print \n; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Krishna, Hari Sent: Tuesday,

RE: Random numbers

2002-10-29 Thread Peter Eisengrein
Title: RE: Terrible at my logic perldoc -f rand here's an example: printint rand ; -Original Message-From: Krishna, Hari [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 29, 2002 12:48To: 'FARRINGTON, RYAN'; [EMAIL PROTECTED]Subject: Random numbers Hi

RE: Random numbers

2002-10-29 Thread Patrick Connolly
Title: RE: Terrible at my logic To make it even a little more fun you could also vary the length of the password: @a = (0..9,A..Z,a..z); # password charactors @b = (6..14); # length of password for($I=0;$I1000;$I++) { for($x=0;$x$b[rand @b];$x++) { print $a[rand @a]; } print

RE: Random numbers

2002-10-29 Thread Krishna, Hari
Title: RE: Terrible at my logic OH MY GOD!!! That is soo overwhelming I don't have enough thatyou 's to say THANKYOU ALL SO VERY MUCH your humble servant, Hari.

RE: Random numbers

2002-10-29 Thread Bullock, Howard A.
Title: RE: Terrible at my logic sub GenRandomPW ($Length) { # This subroutine generate a relatively strong random password of a specified length. WriteLog($LogFile, Entered GenRandomPW) if $DEBUG; my $Length = shift; my $password; my @chars = ('A'..'H', 'K', 'M', 'N',

merging two tabseparated text files.

2002-10-29 Thread Mohanty, Debi \(MED, TCS\)
Title: RE: Terrible at my logic Hi, Please any one suggest how can I add two tabseparated text files in to one tabseparated text file. In the text file 1 and the text file2 One column is common to both the files. So Is there any way by comparing the record no (which is present in both the

RE: Random numbers

2002-10-29 Thread Thomas_M
Title: Message Personally, I like to useCrypt::GeneratePassword. You can create passwords that are longer, yet easierfor users toremember and less likely to be written on a Post-it on their monitor. -- Mark Thomas [EMAIL PROTECTED] Internet Systems Architect User Technology Associates,

pipes and blocking

2002-10-29 Thread Zempel, David
I am attempting to migrate a Perl application I developed on unix to win32 and I've run into a roadblock. This application executes perl scripts via a pipe to drive automated regression tests of hardware/software systems. My problem is that on unix I can use a named pipe to executed test

Re: pipes and blocking

2002-10-29 Thread Martin Hudec
Hello David, hmmm i am wondering if use of Threads module will not do the work for you...it works same on win and on unix.but i think it will need to recode your applicationnot sure bout it.. -- Best regards, Martinmailto:corwin;corwin.sk Tuesday, October

RE: Random numbers

2002-10-29 Thread Burak Gürsoy
you can use crypt(): #!/usr/bin/perl -w use strict; print generate_password(), \n for 1..1000; sub generate_password return(substr(crypt(,join('',(0..9,'A'..'Z','a'..'z')[rand 62,rand 62])), -8 )); } if you want to check if the same string is generated, you can write some control

RE: merging two tabseparated text files.

2002-10-29 Thread FARRINGTON, RYAN
Title: RE: Terrible at my logic your data does not match with the info... =( -Original Message-From: Mohanty, Debi (MED, TCS) [mailto:[EMAIL PROTECTED]]Sent: Tuesday, October 29, 2002 12:46 PMTo: [EMAIL PROTECTED]Subject: merging two tabseparated text files. Hi,

RE: merging two tabseparated text files.

2002-10-29 Thread Peter Eisengrein
Title: RE: Terrible at my logic easy with hashes. #untested my %hash1; my %hash2; open(FILE1, $file1) || die "Can't open $file1 : $!\n"; foreach my $line (FILE1) { chomp($line); my @line = split(/ +/,$line); my $key = $line[0]; $hash1{$key} = join(" ",@line); } close(FILE1);

RE: merging two tabseparated text files.

2002-10-29 Thread Mohanty, Debi \(MED, TCS\)
Title: RE: Terrible at my logic file 3 is a manual merge file. attached below is the file 2 and file 3. if we take a small example then . All the files are tabseparated text files. file1 col1 col2 col3 col4 1text1text2 2text4text5 3text6text7 File2 col1col6col7col8 1text11text12

RE: Parsing return value from LWP::Simple::get()

2002-10-29 Thread Tony White
Sorry -- %hshDateLinks ('10/29/2002' = http://site/date-maint-10292002;) should be: $hshDateLinks ('10/29/2002' = http://site/date-maint-10292002;) but you get the idea. Here's the code that I've used now; but I'm *sure* that there's a simpler, more elegant way to do this, right?

subrooteens/functions within strings.

2002-10-29 Thread Shain Edge
I know that perl can parse varibles and return the results if a string has Scaler varibles within them. I would like to figure out how to do the same with perl and user defined functions. Is there a way to do this within a double quoted string? example of what I would like to happen: print

RE: subrooteens/functions within strings.

2002-10-29 Thread Burak Gürsoy
you cant use functions in double quotes. When you pass a string, you must quote it, and leading ampersand is optional when you call it with parenthesis... print Hello ,caps('shain'), Nice to see you today.\n; sub caps {return uc shift}; -Original Message- From: [EMAIL PROTECTED]