Re: PERL VS MOD_PERL

2007-07-04 Thread Chas Owens
On 7/5/07, Dinesh kumar <[EMAIL PROTECTED]> wrote: Hi all, can any one tell me what is the difference between perl and mod_perl in detail ?? Four letters (mod_). Seriously, mod_perl is a Perl interpreter built into Apache to enable some efficiency hacks. -- To unsubscribe, e-mail:

Re: PERL VS MOD_PERL

2007-07-04 Thread Jeff Pang
There are some difference details between them.If you really want to know it,you may first need to see what's mod_perl and how it works.Take a look at: mod_perl official documents: http://perl.apache.org/docs/index.html Why mod_perl by Stas Bekman: http://www.perl.com/pub/a/2002/02/26/whatismodp

PERL VS MOD_PERL

2007-07-04 Thread Dinesh kumar
Hi all, can any one tell me what is the difference between perl and mod_perl in detail ?? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

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..

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..

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 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 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 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 = ("/vmfs/volumes/467f06a5-7d59c067-35

RE: syntax error of some sort?

2007-07-04 Thread Joseph L. Casale
OK Chase, I saw the missing quotes:) I sniped out the later work using the other elements of the array as to much was broken! I do want to pass in an array and work with all of it. So if I wanted to work with only the first indices to start, is this correct: sub stop_it { my ($vm) = @_[0];

Re: syntax error of some sort?

2007-07-04 Thread Chas Owens
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: snip Is it actually incorrect to run: stop_it(@DNS); aside from maybe looking strange? snip It doesn't look strange, but your code only works with the first element of @DNS so it is pointless. If you want to say stop_it(@DNS) and actually

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 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 w

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`; chomp

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 x32).vmx","/vmfs/vol

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

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: 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 uppercas

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: 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 havi

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

ccomplex problem...

2007-07-04 Thread [EMAIL PROTECTED]
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 having 23000 probes with each experiment having one signal valu

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 -le'

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 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: 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: 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: 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

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 Bernar

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

Re: File::Spec->splitpath

2007-07-04 Thread Tom Phoenix
On 7/4/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: ($volume,$directories,$file) = File::Spec->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

File::Spec->splitpath

2007-07-04 Thread Joseph L. Casale
Hi, I am trying to use the following: ($volume,$directories,$file) = File::Spec->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: 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

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"))

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 p

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 (mt

Re: help with syntax using an if statement

2007-07-04 Thread Martin Barth
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 this should help: if( $DeviceType =~ m/^([Ss]witch|[Rr

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. be

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 w

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

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 %{ >> $tickets{$user}{$

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

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! > #!/usr/

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

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

Re: hash comparison ideas

2007-07-04 Thread Jenda Krynicky
From: "Jeff Pang" <[EMAIL PROTECTED]> > A hash is an array actually in perl. > So you may use Array::Diff module on CPAN: > http://search.cpan.org/~typester/Array-Diff-0.04/lib/Array/Diff.pm Beg tour pardon? Are we talking about the silly name "associative array" sometimes used form hashes? Or ar

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 >

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: 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";

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: 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 /vmfs/volum

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"); >