Re: hash comparison ideas

2007-07-04 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi Hello, I have a script which contains 2 hashes of file names as the keys and md5 sums as the values. I am looking for ideas on fast and efficient ways to compare the 2 hashes in the manner of the pseudo code below Can you fill us in on the big picture? Perhaps

RE: formatting a string

2007-07-04 Thread Joseph L. Casale
Yup, lol... Wish I understood this! What is the line that does the search called? What do I look up to read up on this? Thanks! jlc From: Prabu Ayyappan [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 03, 2007 10:55 PM To: Joseph L. Casale; beginners@perl.org Subject: Re: formatting a string A

foreach broken in my script

2007-07-04 Thread Joseph L. Casale
I have a list: @list = ('Exchange','Filter','DNS','Domain'); This is a list of arrays I also have of course to leverage this I am trying to . the @ symbol on it during use. foreach $vm (@list) { my_sub(@ . $vm); print @ . $vm\n; } The print likes this, but the

Re: foreach broken in my script

2007-07-04 Thread Jeff Pang
May you need eval?Like, use strict; use warnings; my @list = ('Exchange','Filter','DNS','Domain'); my @Exchange = (1,2); my @Filter = (3,4); my @DNS = (5,6); my @Domain = (7,8); foreach my $vm (@list) { print eval '@'.$vm,\n; } __END__ good luck. 2007/7/4, Joseph L. Casale [EMAIL

RE: formatting a string

2007-07-04 Thread Prabu Ayyappan
Read Perl reqular expression and search replace. $perldoc perlretut http://search.cpan.org/~nwclark/perl-5.8.8/pod/perlretut.pod Joseph L. Casale [EMAIL PROTECTED] wrote: v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:*

RE: foreach broken in my script

2007-07-04 Thread Thomas Bätzler
Joseph L. Casale [EMAIL PROTECTED] wrote: I have a list: @list = ('Exchange','Filter','DNS','Domain'); This is a list of arrays I also have of course to leverage this I am trying to . the @ symbol on it during use. foreach $vm (@list) { my_sub(@ . $vm);

Re: formatting a string

2007-07-04 Thread Mumia W.
On 07/03/2007 08:32 PM, Joseph L. Casale wrote: I have an array with the following data in it: /vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/AN-DC (Win2003 Ent x64).vmx /vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/AN-DC (Win2003 Ent x64)/Disc 1.vmdk

Re: foreach broken in my script

2007-07-04 Thread Paul Lalli
On Jul 4, 2:29 am, [EMAIL PROTECTED] (Joseph L. Casale) wrote: I have a list: @list = ('Exchange','Filter','DNS','Domain'); This is a list of arrays I also have of course to leverage this I am trying to . the @ symbol on it during use. foreach $vm (@list) { my_sub(@ .

Re: foreach broken in my script

2007-07-04 Thread Rob Dixon
Joseph L. Casale wrote: I have a list: @list = ('Exchange','Filter','DNS','Domain'); This is a list of arrays I also have of course to leverage this I am trying to . the @ symbol on it during use. foreach $vm (@list) { my_sub(@ . $vm); print @ . $vm\n; } The

query about code

2007-07-04 Thread Amichai Teumim
Can someone explain to me what this script really does? I mean I see that it lists dir within dir. But what is the code doing? For example all the blue highlighted stuff, what is it doing? #!/usr/bin/perl $startdir = /lib; $level = 0; list_dirs($startdir,$level); sub list_dirs(){ my $dir =

Re: hash comparison ideas

2007-07-04 Thread Jenda Krynicky
From: [EMAIL PROTECTED] [EMAIL PROTECTED] Hi I have a script which contains 2 hashes of file names as the keys and md5 sums as the values. I am looking for ideas on fast and efficient ways to compare the 2 hashes in the manner of the pseudo code below -- %base_hash %new_hash for keys

Re: Problem with runaway format

2007-07-04 Thread Mathew Snyder
Tom Phoenix wrote: On 7/2/07, Mathew [EMAIL PROTECTED] wrote: foreach my $date (@searchDate) { while (my $ticket = $tix-Next) { Seeing this worries me. I don't know enough about what's going on to tell whether it's wrong or not, but it looks wrong. When the outer loop goes on to

Re: query about code

2007-07-04 Thread Jenda Krynicky
From: Amichai Teumim [EMAIL PROTECTED] Can someone explain to me what this script really does? I mean I see that it lists dir within dir. But what is the code doing? For example all the blue highlighted stuff, what is it doing? There is no highlighting in a plain text email!

Re: query about code

2007-07-04 Thread Martin Barth
Hi, it was hard to see the blue stuff.. :) On Wed, 4 Jul 2007 16:14:47 +0300 Amichai Teumim [EMAIL PROTECTED] wrote: #!/usr/bin/perl $startdir = /lib; $level = 0; list_dirs($startdir,$level); calls list_dir with $startdir and $level. sub list_dirs(){ my $dir = shift (@_);

Re: Problem with runaway format

2007-07-04 Thread Mathew Snyder
Tom Phoenix wrote: On 7/2/07, Mathew [EMAIL PROTECTED] wrote: foreach my $date (@searchDate) { while (my $ticket = $tix-Next) { Seeing this worries me. I don't know enough about what's going on to tell whether it's wrong or not, but it looks wrong. When the outer loop goes on to

Re: Problem with runaway format

2007-07-04 Thread Tom Phoenix
On 7/4/07, Mathew Snyder [EMAIL PROTECTED] wrote: foreach my $user (keys %tickets) { foreach my $env (keys %{ $tickets{$user} }) { foreach my $tikID (keys %{ $tickets{$user}{$env} }) { foreach my $subject (keys %{

Re: hash comparison ideas

2007-07-04 Thread [EMAIL PROTECTED]
On Jul 4, 2:05 am, [EMAIL PROTECTED] (John W. Krahn) wrote: I have a script which contains 2 hashes of file names as the keys and md5 sums as the values. I am looking for ideas on fast and efficient ways to compare the 2 hashes in the manner of the pseudo code below Can you fill us in on

Re: Need Help Installing Win32:SerialPort

2007-07-04 Thread Chas Owens
On 7/3/07, CM Analyst [EMAIL PROTECTED] wrote: snip ppm install c:\temp\Win32-API-0.41\API.pm Searching for 'c:\temp\Win32-API-0.41\API.pm' returned no results. Try a broader search first. snip Firstly, ppm installs ppd (Perl Package Description) files not pm (Perl Module) files and secondly

Check if file is being modified by another process

2007-07-04 Thread kyle . halberstam
Hi, I have an application that creates and writes to an output file I need to process. I need to process the file when it is completely written to. I do not initially know how big the file will be in the end. Further, the application does NOT put a write lock on the file while it is writing it.

help with syntax using an if statement

2007-07-04 Thread Daluk
Hi ppl, I have a some code that reads in a file, and then i have some if statements. The if statement i want to change is if (($DeviceType eq Switch) || ($DeviceType eq Router) || ($DeviceType eq Hub) || ($DeviceType eq Access point)) what i would like to do is check each device type with

Re: Check if file is being modified by another process

2007-07-04 Thread Chas Owens
On 7/4/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: snip What's the most efficient way of checking this? - one way is perhaps inifinite loop checking mmtime until it is stable for a certain amount of time?? I am not sure. snip Yep, that is about it. I usually use size rather than mtime

Re: Check if file is being modified by another process

2007-07-04 Thread Tom Phoenix
On 7/4/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have an application that creates and writes to an output file I need to process. I need to process the file when it is completely written to. I do not initially know how big the file will be in the end. Further, the application does NOT

Re: help with syntax using an if statement

2007-07-04 Thread Paul Lalli
On Jul 4, 3:46 am, [EMAIL PROTECTED] (Daluk) wrote: I have a some code that reads in a file, and then i have some if statements. The if statement i want to change is if (($DeviceType eq Switch) || ($DeviceType eq Router) || ($DeviceType eq Hub) || ($DeviceType eq Access point)) what i

Re: Check if file is being modified by another process

2007-07-04 Thread Chas Owens
On 7/4/07, Chas Owens [EMAIL PROTECTED] wrote: On 7/4/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: snip What's the most efficient way of checking this? - one way is perhaps inifinite loop checking mmtime until it is stable for a certain amount of time?? I am not sure. snip Yep, that is

File::Spec-splitpath

2007-07-04 Thread Joseph L. Casale
Hi, I am trying to use the following: ($volume,$directories,$file) = File::Spechttp://perldoc.perl.org/File/Spec.html-splitpath( $path ); I am leveraging this fine, but would like to shove the last directory from the path in $directories into a new var. Is there a function from this module

Re: File::Spec-splitpath

2007-07-04 Thread Tom Phoenix
On 7/4/07, Joseph L. Casale [EMAIL PROTECTED] wrote: ($volume,$directories,$file) = File::Spechttp://perldoc.perl.org/File/Spec.html-splitpath( $path ); I am leveraging this fine, but would like to shove the last directory from the path in $directories into a new var. Is there a function

Re: Need Help Installing Win32:SerialPort

2007-07-04 Thread [EMAIL PROTECTED]
ppm install c:\temp\Win32-API-0.41\API.pm Searching for 'c:\temp\Win32-API-0.41\API.pm' returned no results. Try a broader search first. Can anyone please advise on what I need to do next? Thanks in advance. Amad. the package should contain a file with a ppd extension. cd to the

Howto decode an arp entry to hex

2007-07-04 Thread Bernard
Hi, When I try to get the arp table from any type of device (oid 1.3.6.1.2.1.4.22.1.3) with the snmp_util module, it returns the 6 character, instead of the hex byte value. How can I convert a 6 byte word into the hex equivalent like 00:0a:8b:bd:62:8a. Any help greatly appreciated

RE: File::Spec-splitpath

2007-07-04 Thread Joseph L. Casale
Just found that. I suppose I could use it, then get the size of the array and use the last indices? Is there a cleaner way to do it? Thanks! jlc -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tom Phoenix Sent: Wednesday, July 04, 2007 1:38 PM To: Joseph

Re: File::Spec-splitpath

2007-07-04 Thread Tom Phoenix
On 7/4/07, Joseph L. Casale [EMAIL PROTECTED] wrote: Just found that. I suppose I could use it, then get the size of the array and use the last indices? Is there a cleaner way to do it? pop? --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: Howto decode an arp entry to hex

2007-07-04 Thread Tom Phoenix
On 7/4/07, Bernard [EMAIL PROTECTED] wrote: When I try to get the arp table from any type of device (oid 1.3.6.1.2.1.4.22.1.3) with the snmp_util module, it returns the 6 character, instead of the hex byte value. How can I convert a 6 byte word into the hex equivalent like 00:0a:8b:bd:62:8a.

Re: Howto decode an arp entry to hex

2007-07-04 Thread Bernard
Tom, Many thanks, works great. Bernard Tom Phoenix wrote: On 7/4/07, Bernard [EMAIL PROTECTED] wrote: When I try to get the arp table from any type of device (oid 1.3.6.1.2.1.4.22.1.3) with the snmp_util module, it returns the 6 character, instead of the hex byte value. How can I convert

Re: File::Spec-splitpath

2007-07-04 Thread Chas Owens
On 7/4/07, Joseph L. Casale [EMAIL PROTECTED] wrote: Just found that. I suppose I could use it, then get the size of the array and use the last indices? Is there a cleaner way to do it? Thanks! jlc snip You can use negative indices to count from the end of the array: my @a = (1, 2, 3, 4, 5,

Re: Howto decode an arp entry to hex

2007-07-04 Thread John W. Krahn
Bernard wrote: Hi, Hello, When I try to get the arp table from any type of device (oid 1.3.6.1.2.1.4.22.1.3) with the snmp_util module, it returns the 6 character, instead of the hex byte value. How can I convert a 6 byte word into the hex equivalent like 00:0a:8b:bd:62:8a. $ perl

RE: File::Spec-splitpath

2007-07-04 Thread Joseph L. Casale
Dang, you perl guys thought of everything! Thanks! jlc From: Chas Owens [EMAIL PROTECTED] Sent: Wednesday, July 04, 2007 3:21 PM To: Joseph L. Casale Cc: Tom Phoenix; beginners@perl.org Subject: Re: File::Spec-splitpath On 7/4/07, Joseph L. Casale [EMAIL

Re: ccomplex problem...

2007-07-04 Thread Tom Phoenix
On 7/4/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all, ok.i will go straight to the problem but d bear with me a it's a complex problem . first the thing that is to be done.. i have this file which is in a tab delimited format.This is a huge file with 3000 experiments and

help needed!!

2007-07-04 Thread [EMAIL PROTECTED]
oops sorry for the last mail...i pressed the enter button inadvertently. neways here is the problem... File1:example.txt ProbeNames Exp1Exp2Exp3Exp4Exp5 244901_at 24.346.437.419.559.6 244902_at 36.692.449.542.4

Re: help with syntax using an if statement

2007-07-04 Thread Ken Foskey
On Wed, 2007-07-04 at 19:00 +0200, Martin Barth wrote: Hi if (($DeviceType eq Switch) || ($DeviceType eq Router) || ($DeviceType eq Hub) || ($DeviceType eq Access point)) what i would like to do is check each device type with where the first letter is uppercase or lowercase

Re: help needed!!

2007-07-04 Thread Tom Phoenix
On 7/4/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: File1:example.txt ProbeNames Exp1Exp2Exp3Exp4Exp5 244901_at 24.346.437.419.559.6 244902_at 36.692.449.542.4 29.6 244903_at 46.4

Re: foreach broken in my script

2007-07-04 Thread Randal L. Schwartz
Jeff == Jeff Pang [EMAIL PROTECTED] writes: Jeff May you need eval?Like, No. Wrong direction for a solution. Don't suggest things like this. Plenty of proper answers elsewhere in the thread, so I won't repeat them. DO NOT USE STRING EVAL. EVER. Until you understand why I said that. :) --

syntax error of some sort?

2007-07-04 Thread Joseph L. Casale
I have the following code (it's a snippet so it may seem silly, but altogether it would make sense as I am forcing one array into it for a test): #!/usr/bin/perl -w @DNS = (/vmfs/volumes/467f06a5-7d59c067-35cb-0007e9153886/Web DNS (Win2003 Std x32)/Web DNS (Win2003 Std

Re: syntax error of some sort?

2007-07-04 Thread Chas Owens
On 7/4/07, Joseph L. Casale [EMAIL PROTECTED] wrote: snip if ($state == 'on') { 'vmware-cmd $_[0] stop soft'; my $tools = `/usr/bin/vmware-cmd \$_[0]\ gettoolslastactive -q`;

Re: syntax error of some sort?

2007-07-04 Thread Chas Owens
On 7/4/07, Chas Owens [EMAIL PROTECTED] wrote: snip snip The second I am sure is the darn () in the file names I am feeding into the function. Can someone shed some light :) I need to call the first indices of many arrays that get passed into this function, so I was thinking $_[0] was what I

RE: syntax error of some sort?

2007-07-04 Thread Joseph L. Casale
Thanks for the help. The while loop move makes sense! I knew this looked silly, but with the rest of the code, I am looping in many arrays. In this section I am only working with the first indice (the .vmx one). Is it actually incorrect to run: stop_it(@DNS); aside from maybe looking strange?

RE: syntax error of some sort?

2007-07-04 Thread Joseph L. Casale
Heh, I am running out of hair:P I get two errors to start, one is the warning that is better write: my ($vm) = $_[0]; instead of my ($vm) = @_[0]; And the other is about the use of the global @_ (huh) with my? I have this now: #!/usr/bin/perl -w @Exchange =

RE: syntax error of some sort?

2007-07-04 Thread Joseph L. Casale
Heh, Clearly I need to sleep! This doesn't even work either? #!/usr/bin/perl -w @list = (Exchange,Filter,DNS,Domain) sub stop_it { $vm = $_[0]; print $vm\n; } stop_it(@list) What is wrong here? jlc -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: syntax error of some sort?

2007-07-04 Thread Chas Owens
On 7/4/07, Joseph L. Casale [EMAIL PROTECTED] wrote: Heh, Clearly I need to sleep! This doesn't even work either? #!/usr/bin/perl -w @list = (Exchange,Filter,DNS,Domain) snip You are missing your quotes. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: syntax error of some sort?

2007-07-04 Thread Chas Owens
On 7/4/07, Joseph L. Casale [EMAIL PROTECTED] wrote: Heh, I am running out of hair:P I get two errors to start, one is the warning that is better write: my ($vm) = $_[0]; instead of my ($vm) = @_[0]; The proper way to say this is my ($vm) = @_; And looking at your data I would suggest my

RE: syntax error of some sort?

2007-07-04 Thread Prabu Ayyappan
@list = (Exchange,Filter,DNS,Domain); sub stop_it { $vm = $_[0]; print $vm\n; } stop_it(@list) A semi-colon is missing in the list assignment. if you want to get the first value of the list then you have to use $_[0] Second Value means $_[1] and so on...