Re: Array Manipulations

2004-01-08 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Hello Everyone, Hello, > I am a Perl newbie trying to learn as much Perl as I can. I am trying to > combine specific array elements into one single array element so that I can > write > to an Excel cell, where all the data will fit. > > For instance I have, > > ar

OS X, cpan, libnet

2004-01-08 Thread Robert Citek
Hello all, I have perl 5.6.0 on my Mac OS X. I'd like to install libnet. However, when I try to use cpan, it wants to automagically upgrade my perl to 5.8.2. All I really want is Net::FTP. What is my best course of action: - upgrade to perl 5.8.2 and then libnet-1.17 - upgrade to some othe

Clumsy choice

2004-01-08 Thread Jan Eden
Hi, I wrote a script to update some websites based on a template system. The script starts asking the user to choose a site to update: [script preamble omitted] my ($update_path, $site_root, $site_type); my %choice_hash = ( 1 => 'janeden', 2 => 'gargnano', 3 => 'breskens', );

RE: putting $1 into a var

2004-01-08 Thread Jan Eden
Dan Muey wrote: >> Thanks to everyone who helped me with this one, I had a >> deadline to meet that is now met. >> >> It was a missing ~ and me failing to use s on the end of my pattern >> >> may be of use to other users but for some reason my Linux >> server needs s///s; to match over newlin

Re: How to get a dir creation time

2004-01-08 Thread Sergei Krivov
Hi Yannick, I hope you are still around. http://www.faqs.org/faqs/unix-faq/faq/part3/section-1.html answers your quesiton. Sergei >Subject: How to get a dir creation time >From: "Yannick Warnier" <[EMAIL PROTECTED]> >To: "perl beginners list" <[EMAIL PROTECTED]> >Date: Sun, 30 Nov 2003 18:

Re: Clumsy choice

2004-01-08 Thread John W. Krahn
Jan Eden wrote: > > Hi, Hello, > I wrote a script to update some websites based on a template system. The > script starts asking the user to choose a site to update: > > [script preamble omitted] > > my ($update_path, $site_root, $site_type); > > my %choice_hash = ( > 1 => 'janeden', >

Use of FOR statement

2004-01-08 Thread Paul Harwood
I am reading through a book on Objects and References and I don't understand this statement: $sum += $_ for split //; I thought a FOR statement needed to be in braces. How is it being used in this context? --Paul

Re: Use of FOR statement

2004-01-08 Thread Paul Johnson
Paul Harwood said: > I am reading through a book on Objects and References and I don't > understand this statement: > > $sum += $_ for split //; > > I thought a FOR statement needed to be in braces. How is it being used > in this context? It means exactly the same as: for (split //) {

Re: Use of FOR statement

2004-01-08 Thread Rob Dixon
Paul Harwood wrote: > > I am reading through a book on Objects and References and I don't > understand this statement: > > $sum += $_ for split //; > > I thought a FOR statement needed to be in braces. How is it being used > in this context? Hi Paul. In this instance 'for' is working as a statem

Parsing dhcpd.leases and squid access.log

2004-01-08 Thread Paul Kraus
Problem: Need to create a hash like data structure that contains the key as an ip address. The dhcpd leases file contains all leases handed out and the time they where assigned using UTC time. Using the epoch time stamp in the access file and the ipaddress to get the actual host name of the machine

Re: OS X, cpan, libnet

2004-01-08 Thread Daniel Staal
--As off Thursday, January 8, 2004 1:18 AM -0600, Robert Citek is alleged to have said: Hello all, I have perl 5.6.0 on my Mac OS X. I'd like to install libnet. However, when I try to use cpan, it wants to automagically upgrade my perl to 5.8.2. All I really want is Net::FTP. What is my best

Re: killing processes after x seconds

2004-01-08 Thread Ramprasad A Padmanabhan
Dan Anderson wrote: Is it possible to (easily) tell perl to kill itself and all children if the script doesn't execute in x seconds? to kill a script in itself you could use alarm($seconds) If you really are serious about killed all forked children properly write a function that will kill a

Re: Use of FOR statement

2004-01-08 Thread Dan Anderson
On Wed, 2004-01-07 at 20:39, Paul Harwood wrote: > I am reading through a book on Objects and References and I don't > understand this statement: > > $sum += $_ for split //; FWIW, for is synonymous with foreach. -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-ma

Re: coping txt files over a peer to peer.

2004-01-08 Thread William.Ampeh
I have implemented something similar using named pipes instead of sockets. For send/receive type dialog, you may be better of trying EXPECT. It is very easy to learn, and so cool to use. __ William Ampeh (x3939) Federal Reserve Board -- To unsubscribe, e-mail: [EMAIL PROT

Re: Parsing dhcpd.leases and squid access.log

2004-01-08 Thread Rob Dixon
Paul Kraus wrote: > > Problem: Need to create a hash like data structure that contains the key as > an ip address. The dhcpd leases file contains all leases handed out and the > time they where assigned using UTC time. Using the epoch time stamp in the > access file and the ipaddress to get the act

RE: One line variable declaration with multiple conditions

2004-01-08 Thread Dan Muey
> Dan Muey wrote: > > > Howdy list. > > I'm trying to one lineify this: > > > > my $guts = $firstchoice || ''; > > if(!$guts && $use_second_choice_if_first_is_empty) { > > $guts = $secondchoice; > > } > > > > Basically > > my $guts = $firstchoice || $secondchoic || ''; > > Would be perfect

RE: One line variable declaration with multiple conditions

2004-01-08 Thread Dan Muey
> Dan Muey wrote: > > > BTW - I'm not really using these variable names, only using > them here > > ot help clarify my goal. > > Why not? They looked very good to me, at least in the > context of the question at hand. One of the best aspects of In context yes, but the really really long w

printf sprintf

2004-01-08 Thread Paul Kraus
What is the difference. The only I see is that printf can take a filehandle? But what use would that be. Paul Kraus --- PEL Supply Company Network Administrator --- 800 321-1264 Toll Free 216 267-5775 Voice 216 267-6176 Fax www.pelsupply.com -

RE: printf sprintf

2004-01-08 Thread Dan Muey
> What is the difference. The only I see is that printf can One difference is printf prints it's output and sprintf returns it';s value. printf ... my $formatted_goodies = sprintf ... > take a filehandle? But what use would that be. > To format the contents of it. For instance, you might hav

Re: printf sprintf

2004-01-08 Thread Wiggins d Anconia
> > What is the difference. The only I see is that printf can take a filehandle? > But what use would that be. > The filehandle tells printf where to print the result, aka which filehandle, by default STDOUT. Which doesn't have a purpose with sprintf since it returns its value... http://dan

RE: printf sprintf

2004-01-08 Thread Wiggins d Anconia
> > What is the difference. The only I see is that printf can > > One difference is printf prints it's output and sprintf returns it';s value. > > printf ... > my $formatted_goodies = sprintf ... > > > take a filehandle? But what use would that be. > > > > To format the contents of it. For

RE: printf sprintf

2004-01-08 Thread Dan Muey
> > > What is the difference. The only I see is that printf can > > > > One difference is printf prints it's output and sprintf > returns it';s > value. > > > > printf ... > > my $formatted_goodies = sprintf ... > > > > > take a filehandle? But what use would that be. > > > > > > > To format

Re: printf sprintf

2004-01-08 Thread Rob Dixon
Wiggins D Anconia wrote: > > Notice the difference in the docs: > > printf FILEHANDLE FORMAT, LIST > printf FORMAT, LIST > > In the first there is NO comma following the filehandle, this means it > is interpreted in a different manner than the rest of the argument list, > or probably to be more pre

Re: coping txt files over a peer to peer.

2004-01-08 Thread William.Ampeh
Hello Dzhuo, Your server code will not be able to handle multiple clients. You need to undefine $file after closing the client connection. That is: close(FILE) if($file); close($client); $file = undef;#<-- you omitted this line } __END__ __ Wi

Re: printf sprintf

2004-01-08 Thread Rob Dixon
Wiggins D Anconia wrote: > > Notice the difference in the docs: > > printf FILEHANDLE FORMAT, LIST > printf FORMAT, LIST > > In the first there is NO comma following the filehandle, this means it > is interpreted in a different manner than the rest of the argument list, > or probably to be more pre

Re: printf sprintf

2004-01-08 Thread Wiggins d Anconia
> Wiggins D Anconia wrote: > > > > Notice the difference in the docs: > > > > printf FILEHANDLE FORMAT, LIST > > printf FORMAT, LIST > > > > In the first there is NO comma following the filehandle, this means it > > is interpreted in a different manner than the rest of the argument list, > > or p

Re: PERL debuggers

2004-01-08 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (William Ampeh) writes: > >Sorry I forgot to include this in my earlier question: > >Beside perldebug, and the usual (use strict and perl -c). You apppear to have a broad definition of "debugger" that extends beyond the customary trace/inspect too

Re: coping txt files over a peer to peer.

2004-01-08 Thread david
William Ampeh wrote: > Your server code will not be able to handle multiple clients. You need to > undefine $file after closing the client connection. That is: > > > close(FILE) if($file); > close($client); > $file = undef;#<-- you omitted this line > } good catch.

Re: One line variable declaration with multiple conditions

2004-01-08 Thread drieux
On Jan 8, 2004, at 7:45 AM, Dan Muey wrote: [..] Except I need to do this to about ten variabels all in a row. Which gives me 10 lines with Bob's way and 40 with my very first example. Boo for that! :) [..] Have you thought about a simplification process? One of the tricks I do is say my ($var1,$

Re: Use of FOR statement

2004-01-08 Thread Randal L. Schwartz
> "Dan" == Dan Anderson <[EMAIL PROTECTED]> writes: Dan> On Wed, 2004-01-07 at 20:39, Paul Harwood wrote: >> I am reading through a book on Objects and References and I don't >> understand this statement: >> >> $sum += $_ for split //; Dan> FWIW, for is synonymous with foreach. Syntactical

RE: One line variable declaration with multiple conditions

2004-01-08 Thread Dan Muey
> On Jan 8, 2004, at 7:45 AM, Dan Muey wrote: > [..] > > > > Except I need to do this to about ten variabels all in a row. Which > > gives me 10 lines with Bob's way and 40 with my very first example. > > Boo for that! :) > > > [..] > > Have you thought about a simplification process? > One of t

RE: Use of FOR statement

2004-01-08 Thread Paul Kraus
Wow just tested that for (@array) do something. I didn't think that would work. So there is no difference as far as the compiler is concerned with for and foreach? Why bother having both then? Paul Kraus --- PEL Supply Company Network Administrator > -Original Messag

Re: One line variable declaration with multiple conditions

2004-01-08 Thread drieux
On Jan 8, 2004, at 10:38 AM, Dan Muey wrote: [..] The vars to be assigned ($var1, $var2,etc...) come from a database query so they are handled already earlier. So how they are declared are irrelevant to the issue. (Yes they must be initialized for a warnings safe environment and they are, just assu

Re: Use of FOR statement

2004-01-08 Thread Randal L. Schwartz
> "Paul" == Paul Kraus <[EMAIL PROTECTED]> writes: Paul> Wow just tested that for (@array) do something. Paul> I didn't think that would work. Paul> So there is no difference as far as the compiler is concerned Paul> with for and foreach? Why bother having both then? So you can avoid typing

RE: One line variable declaration with multiple conditions

2004-01-08 Thread Dan Muey
> > I think I better see the context at this point. > note, as I presume you did The issue is resolved, but for the die hards here goes... I'm wanted to figure out my method of attack before I did the whole thing but here is an example that will illustrate the basic idea hopefully: #!/usr/bin/p

Re: coping txt files over a peer to peer.

2004-01-08 Thread William.Ampeh
Hello David, How would you convert your code to allow a bidirectional communication between the clients and the server without the use of files or named pipes? That is: Client send a request to server, waits for server to respond, Server processes client's request, and send response back to

Getopt::Long::Configure('auto_help')

2004-01-08 Thread Paul Kraus
How do I take advantage of this? I turn it on but I do not know how to get it to display a help message. If I pass in -h --help it just ends. I am assuming I need some kind of pod file but I am unknowledgeable on how to write a pod file. Also how do I tell it what pod file to open? Form perldoc Ge

RE: Drawing an Arc at an angle.

2004-01-08 Thread Dan Muey
> On Thu, 08 Jan 2004 09:44:31 -0500, [EMAIL PROTECTED] (Zentara) > wrote: > > >On Wed, 7 Jan 2004 10:53:20 -0600, [EMAIL PROTECTED] (Dan Muey) > >wrote: > > > >>Thanks! Even more to add to my look into list! > > > >Yeah upon futher thought, you probably could use the Tk::Canvas and > >actually p

Re: Use of FOR statement

2004-01-08 Thread Rob Dixon
Paul Kraus wrote: > > Wow just tested that for (@array) do something. > I didn't think that would work. > > So there is no difference as far as the compiler is concerned with for and > foreach? Why bother having both then? The practical reason is likely to be historical, but Larry would tell you a

Re: coping txt files over a peer to peer.

2004-01-08 Thread david
William Ampeh wrote: > Hello David, > > > How would you convert your code to allow a bidirectional communication > between the clients and the server without the use of files or named > pipes? > > That is: > Client send a request to server, waits for server to respond, > Server processes clien

Re: Getopt::Long::Configure('auto_help')

2004-01-08 Thread Wiggins d Anconia
> > How do I take advantage of this? I turn it on but I do not know how to get > it to display a help message. If I pass in -h --help it just ends. I am > assuming I need some kind of pod file but I am unknowledgeable on how to > write a pod file. Also how do I tell it what pod file to open? >

Re: printf sprintf

2004-01-08 Thread R. Joseph Newton
Paul Kraus wrote: > What is the difference. The only I see is that printf can take a filehandle? > But what use would that be. All the use one could imagine. The printf function can print pretty much anywhere. I believe that it preceded sprintf historically, but I wouldn't swear to it. Many C

Re: How to parse Microsoft Outlook Inbox

2004-01-08 Thread Wiggins d'Anconia
PerlDiscuss - Perl Newsgroups and mailing lists wrote: Hi, I am trying to write a script that will parse Microsoft outlook Inbox to a .txt file. Please let me know if there a way to do that. Thanks in advance for your help. I know very little about this specific subject, but Mail::Box has so

Re: How to parse Microsoft Outlook Inbox

2004-01-08 Thread Tassilo von Parseval
On Thu, Jan 08, 2004 at 10:37:02PM -0500 Wiggins d'Anconia wrote: > PerlDiscuss - Perl Newsgroups and mailing lists wrote: > >Hi, > >I am trying to write a script that will parse Microsoft outlook Inbox > >to a .txt file. Please let me know if there a way to do that. Thanks in > >advance for