Re: Date calculation

2004-04-21 Thread Jan Eden
- Original Message - From: WC -Sx- Jones Sent: 21.04.2004, 14:23 Uhr >Jan Eden wrote: > >> if (season($start_date) && season($end_date) { >> $season_days = Delta_Days($start_date, $end_date) >> } elsif season($start_date) { > > >try not to make it *more* complicated :) > >You posted y

Re: Password Changer and rexec help

2004-04-21 Thread Smoot Carl-Mitchell
On Thu, 22 Apr 2004 00:37:37 -0400 WC -Sx- Jones <[EMAIL PROTECTED]> wrote: > > Expect isn't a language, it is a program written in Tcl. > > > Hmmm, too tempting, but I will pass up this opportunity =) You may want to look at the Perl Expect module. It has similar functionality as expect, but i

Re: Password Changer and rexec help

2004-04-21 Thread WC -Sx- Jones
Expect isn't a language, it is a program written in Tcl. Hmmm, too tempting, but I will pass up this opportunity =) -- _Sx_ http://youve-reached-the.endoftheinternet.org/ _ http://jaxpm.insecurity.org/ http://cis4dl.insecurity.org/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Re: simple eval $e; issue

2004-04-21 Thread JupiterHost.Net
I believe I have it! If I prepend package $caller_namespace; to the eval'ed code It works!! perldoc -f package and perldoc perlmod -> 'packages says "The scope of the package declaration is from the declaration itself through the end of the enclosing block, file, or eval" Works like a charm! T

Re: simple eval $e; issue

2004-04-21 Thread JupiterHost.Net
Wiggins d'Anconia wrote: JupiterHost.Net wrote: WC -Sx- Jones wrote: JupiterHost.Net wrote: Will work whether I do the require or use way require doesn't let you specify what to EXPORT though which is one of the goals of this funtion... use does import the module's name *and* does the

Re: Password Changer and rexec help

2004-04-21 Thread John W. Krahn
Wc -Sx- Jones wrote: > > Wiggins d'Anconia wrote: > > >> wrap-up some ssh commands inside Perl. > > > > Yikes, if you are going to go that route then consider Net::SSH::Perl, > > has worked well for me in the past, once you get through the dependency > > installation. > > Why yikes? There is an

Re: Password Changer and rexec help

2004-04-21 Thread Wiggins d'Anconia
WC -Sx- Jones wrote: Wiggins d'Anconia wrote: wrap-up some ssh commands inside Perl. Yikes, if you are going to go that route then consider Net::SSH::Perl, has worked well for me in the past, once you get through the dependency installation. Why yikes? There is another language called expec

Re: Directory Listing

2004-04-21 Thread gohaku
On Apr 21, 2004, at 6:09 AM, Ryan Thomas wrote: I am relatively new at PERL and am learning it for a school project. What I would like to do is write a perl script that can run a complete directory listing including sub-directories and save the result to a text file. Not sure where to start.

Re: Password Changer and rexec help

2004-04-21 Thread WC -Sx- Jones
Wiggins d'Anconia wrote: wrap-up some ssh commands inside Perl. Yikes, if you are going to go that route then consider Net::SSH::Perl, has worked well for me in the past, once you get through the dependency installation. Why yikes? There is another language called expect http://expect.nist

Re: Date calculation

2004-04-21 Thread Chris Charley
- Original Message - From: "Chris Charley" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 6:48 PM Subject: Re: Date calculation > > - Original Message - > From: "Jan Eden" <[EMAIL PROTECTED]> > Newsgroups: perl.beginners

Re: simple eval $e; issue

2004-04-21 Thread Wiggins d'Anconia
JupiterHost.Net wrote: WC -Sx- Jones wrote: JupiterHost.Net wrote: Will work whether I do the require or use way require doesn't let you specify what to EXPORT though which is one of the goals of this funtion... use does import the module's name *and* does the EXPORT symbols also *if* i

Re: Password Changer and rexec help

2004-04-21 Thread Wiggins d'Anconia
WC -Sx- Jones wrote: NandKishore.Sagi wrote: Also I am looking for a perl module which can help me to logon onto different boxes and execute a given script .Something more like rexec. wrap-up some ssh commands inside Perl. Yikes, if you are going to go that route then consider Net::SSH:

Re: Date calculation

2004-04-21 Thread Chris Charley
- Original Message - From: "Jan Eden" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: "Perl Lists" <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 1:29 PM Subject: Date calculation Hi, I need to find the number of days between two dates. The Perl Cookbook provides this solution:

RE: removing duplicate array values

2004-04-21 Thread Jeff 'japhy' Pinyan
On Apr 21, Bob Showalter said: >Jeff 'japhy' Pinyan wrote: >> On Apr 21, Bob Showalter said: >> > There's a Tie::Array::Unique module on CPAN which gives you a lot >> > more flexibility in handling this kind of thing. >> >> I agree (says the author of the module). It maintains the uniqueness >> t

RE: Reading rss formated sources.

2004-04-21 Thread Bob Showalter
Thomas Williams wrote: > I am trying to build a cgi script that parses RSS files. > > RSS is the name given to a simple and well-established XML format > used to syndicate headlines. XML::RSS on CPAN helps with this. It comes with an example you can use as a basis for your script. http://search.

Re: Reading rss formated sources.

2004-04-21 Thread James Edward Gray II
On Apr 21, 2004, at 3:50 PM, Thomas Williams wrote: I am trying to build a cgi script that parses RSS files. RSS is the name given to a simple and well-established XML format used to syndicate headlines. There is no question for us to answer in the above message. James -- To unsubscribe, e-mai

RE: Regular expression question: non-greedy matches

2004-04-21 Thread Boris Shor
Joseph, Thanks for writing and the advice. Here's another crack at the question. > -Original Message- > From: R. Joseph Newton [mailto:[EMAIL PROTECTED] > Sent: Monday, April 05, 2004 5:39 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; 'Stuart > V. Jordan' > Subje

Reading rss formated sources.

2004-04-21 Thread Thomas Williams
I am trying to build a cgi script that parses RSS files. RSS is the name given to a simple and well-established XML format used to syndicate headlines. Tom Williams _ Add photos to your e-mail with MSN Premium. Get 2 months FREE*

RE: removing duplicate array values

2004-04-21 Thread Bob Showalter
Jeff 'japhy' Pinyan wrote: > On Apr 21, Bob Showalter said: > > There's a Tie::Array::Unique module on CPAN which gives you a lot > > more flexibility in handling this kind of thing. > > I agree (says the author of the module). It maintains the uniqueness > throughout the life of the array, so yo

Re: coding standards question and RFC

2004-04-21 Thread WC -Sx- Jones
drieux wrote: So in classical Trinitarianism it is: Phase I: Master Yourself Stay independent. Phase II: Collect Underlings Kill all the robots. Phase III: Global Domination!!! Enjoy peace. :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Date calculation

2004-04-21 Thread WC -Sx- Jones
Jan Eden wrote: if (season($start_date) && season($end_date) { $season_days = Delta_Days($start_date, $end_date) } elsif season($start_date) { try not to make it *more* complicated :) You posted your own answer in the first post. Consider: ((season($start_date) && (season($end_date)) ?

RE: multiplexed TCP server with client socket handles stored in h ash

2004-04-21 Thread Peterson, Darren - Contractor.Westar
Thanks very much! -Original Message- From: WC -Sx- Jones [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 21, 2004 10:29 AM To: Peterson, Darren - Contractor.Westar Cc: '[EMAIL PROTECTED]' Subject: Re: multiplexed TCP server with client socket handles stored in hash Peterson, Darren - Co

Re: coding standards question and RFC

2004-04-21 Thread drieux
On Apr 21, 2004, at 4:16 AM, Michael C. Davis wrote: [..] Thanks for the insights, drieux. While I wish I were in a position to establish corporate policy, I'm not, and my objective is merely to satisfy myself that I have a reasoned, workable approach. Your feedback helps a lot. Coming up with a '

Re: simple eval $e; issue

2004-04-21 Thread JupiterHost.Net
WC -Sx- Jones wrote: JupiterHost.Net wrote: Will work whether I do the require or use way require doesn't let you specify what to EXPORT though which is one of the goals of this funtion... use does import the module's name *and* does the EXPORT symbols also *if* its called inside packag

Re: Date calculation

2004-04-21 Thread Jan Eden
- Original Message - From: WC -Sx- Jones Sent: 21.04.2004, 13:32 Uhr >Jan Eden wrote: >> if $mmdd > 0915 and $mmdd < 0630) ... >> >> in my calculation to allow for any combination of $80 and $55 days. > >(($mmdd > 0915) && ($mmdd < 0630)) ? $55 : $80; Thanks, I imagined a test like this

Re: Date calculation

2004-04-21 Thread WC -Sx- Jones
Jan Eden wrote: if $mmdd > 0915 and $mmdd < 0630) ... in my calculation to allow for any combination of $80 and $55 days. (($mmdd > 0915) && ($mmdd < 0630)) ? $55 : $80; -- _Sx_ http://youve-reached-the.endoftheinternet.org/ _ http://jaxpm.insecurity.org/ http://cis4dl.insecurity.or

Date calculation

2004-04-21 Thread Jan Eden
Hi, I need to find the number of days between two dates. The Perl Cookbook provides this solution: use Date::Calc qw(Delta_Days); @bree = (1981, 6, 16); # 16 Jun 1981 @nat = (1973, 1, 18); # 18 Jan 1973 $difference = Delta_Days(@nat, @bree); But there's a hook: I need to calculate a

Re: simple eval $e; issue

2004-04-21 Thread WC -Sx- Jones
JupiterHost.Net wrote: Will work whether I do the require or use way require doesn't let you specify what to EXPORT though which is one of the goals of this funtion... use does import the module's name *and* does the EXPORT symbols also *if* its called inside package Foo; Do you *have* to

Re: simple eval $e; issue

2004-04-21 Thread JupiterHost.Net
WC -Sx- Jones wrote: Any ideas? :) Didn't your mother teach it's not nice to play with your code? But I like it :) perldoc -f require is very much similar what you are doing already... I can get require() to do the same thing as use, import the module only not the exported stuff.. perl -m

Re: Password Changer and rexec help

2004-04-21 Thread WC -Sx- Jones
NandKishore.Sagi wrote: Also I am looking for a perl module which can help me to logon onto different boxes and execute a given script .Something more like rexec. wrap-up some ssh commands inside Perl. -- _Sx_ http://youve-reached-the.endoftheinternet.org/ _ http://jaxpm.insecur

RE: removing duplicate array values

2004-04-21 Thread Jeff 'japhy' Pinyan
On Apr 21, Bob Showalter said: >Peterson, Darren - Contractor.Westar wrote: >> I'd like to remove duplicate values from an array to leave it with >> only unique values. For instance, if an array contains >> (1,2,3,1,4,2,5) as values, I'd like to clean out the extra 1 and 2 to >> leave the values

Password Changer and rexec help

2004-04-21 Thread NandKishore.Sagi
Hi All, I am looking for some module which would help me in changing the password on multiple boxes.I have the same login ID and would liketo change the password for all of them using a Perl script. Also I am looking for a perl module which can help me to logon onto different bo

Re: Tool to convert extended ASCII to characters?

2004-04-21 Thread WC -Sx- Jones
KEVIN ZEMBOWER wrote: Can anyone tell me exactly what's going on here? Right now, my program is just using a bunch of substitution commands to substitute the extended ASCII character, but I don't want to write out every special character using this system. Is there a perl tool or module which would

Re: Tool to convert extended ASCII to characters?

2004-04-21 Thread WC -Sx- Jones
KEVIN ZEMBOWER wrote: I'm trying to analyze web log entries like this one: 2004-03-28 09:32:52 81.192.2.222 - W3SVC1 DB db.jhuccp.org GET /dbtw-wpd/exec/dbtwpcgi.exe XC=%2Fd Think of all %xx as HEX - example %7E which Hexidecimal for the tilde ~ /~sx/index.html ( %2F is the / ) See http://www.a

Re: Feeding an array

2004-04-21 Thread Jan Eden
Hi Ben, - Original Message - From: Ben Miller Sent: 21.04.2004, 9:16 Uhr >Hi Jan, > >Thanks for your help. That's what I need. I had tried something >similar earlier using () to surround the variable rather than []. My >next question is: when I try to print a specific member of the array

Tool to convert extended ASCII to characters?

2004-04-21 Thread KEVIN ZEMBOWER
I'm trying to analyze web log entries like this one: 2004-03-28 09:32:52 81.192.2.222 - W3SVC1 DB db.jhuccp.org GET /dbtw-wpd/exec/dbtwpcgi.exe XC=%2Fdbtw-wpd%2Fexec%2Fdbtwpcgi.exe&BU=http%3A%2F%2Fdb..jhuccp.org%2Fcds%2Findex.htm&QB0=AND&QF0=TITRE+%7C+AUTEUR+%7C+EDITION+%7C+COLLATION+%7C+NOTES+%7

Re: Feeding an array

2004-04-21 Thread WC -Sx- Jones
Ben Miller wrote: Thanks for the advice. I'm using a couple CPAN modules to do this: LWP::Simple; HTML::TokeParser; If there are any others you think would be helpful, please let me know. http://search.cpan.org/~sburke/HTML-Tree-3.18/lib/HTML/Tree.pm -- _Sx_ http://youve-reached-the.endoftheinte

Re: multiplexed TCP server with client socket handles stored in hash

2004-04-21 Thread WC -Sx- Jones
Peterson, Darren - Contractor.Westar wrote: I need to write a multiplexed TCP server to handle multiple client connections simultaneously. It doesn't help that I'm new to perl and even newer to TCP. If this helps, I'm basing my code on an example on pp. 352-358 of Network Programming with Perl,

Re: Feeding an array

2004-04-21 Thread Ben Miller
On 4/21/04 9:29 AM, WC -Sx- Jones wrote: > Ben Miller wrote: >> Hi Jan, >> >> Thanks for your help. That's what I need. I had tried something similar >> earlier using () to surround the variable rather than []. My next question >> is: when I try to print a specific member of the array I get an er

Re: multiplexed TCP server with client socket handles stored in hash

2004-04-21 Thread Peter Scott
In article <[EMAIL PROTECTED]>, "Peterson, Darren - Contractor.Westar" writes: >I need to write a multiplexed TCP server to handle multiple client >connections simultaneously. It doesn't help that I'm new to perl and even >newer to TCP. If this helps, I'm basing my code on an example on pp. >352

RE: removing duplicate array values

2004-04-21 Thread Thomas Bätzler
Peterson, Darren - Contractor.Westar asked: > I'd like to remove duplicate values from an array [...] This is a FAQ. Run "perldoc -q duplicate" for the answer. HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: multiplexed TCP server with client socket handles stored in h ash

2004-04-21 Thread James Edward Gray II
On Apr 21, 2004, at 9:28 AM, Peterson, Darren - Contractor.Westar wrote: That definitely returned something! I'll look into that more and gauge format. I had a chance to look it up this time. This is easier. Just call peerhost() on the socket object: my $ip_addr = $socket->peerhost(); James

Re: Feeding an array

2004-04-21 Thread WC -Sx- Jones
Ben Miller wrote: Hi Jan, Thanks for your help. That's what I need. I had tried something similar earlier using () to surround the variable rather than []. My next question is: when I try to print a specific member of the array I get an error message if I use 'print $result[0];' for example. In fa

Re: multiplexed TCP server with client socket handles stored in hash

2004-04-21 Thread James Edward Gray II
On Apr 21, 2004, at 9:03 AM, Peterson, Darren - Contractor.Westar wrote: I've never posted a code segment to a mailing list. I hope I'm doing this right. If not, please pardon me... I need to write a multiplexed TCP server to handle multiple client connections simultaneously. It doesn't hel

Re: simple eval $e; issue

2004-04-21 Thread WC -Sx- Jones
Any ideas? :) Didn't your mother teach it's not nice to play with your code? perldoc -f require is very much similar what you are doing already... -- _Sx_ http://youve-reached-the.endoftheinternet.org/ _ http://jaxpm.insecurity.org/ http://cis4dl.insecurity.org/ -- To unsubscrib

Re: Feeding an array

2004-04-21 Thread Ben Miller
Hi Jan, Thanks for your help. That's what I need. I had tried something similar earlier using () to surround the variable rather than []. My next question is: when I try to print a specific member of the array I get an error message if I use 'print $result[0];' for example. In fact, any thing I tr

Re: Problem with Code

2004-04-21 Thread WC -Sx- Jones
Something for your amusement: #! /usr/local/bin/perl -w eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}' if 0; #$running_under_some_shell use strict; use warnings; use File::Find (); use vars qw/*name *dir *prune @targets/; *name = *File::Find::name; *dir= *File::Find::dir; *prun

RE: removing duplicate array values

2004-04-21 Thread Bob Showalter
Peterson, Darren - Contractor.Westar wrote: > I'd like to remove duplicate values from an array to leave it with > only unique values. For instance, if an array contains > (1,2,3,1,4,2,5) as values, I'd like to clean out the extra 1 and 2 to > leave the values as (1,2,3,4,5). Does perl have an ar

multiplexed TCP server with client socket handles stored in hash

2004-04-21 Thread Peterson, Darren - Contractor.Westar
I've never posted a code segment to a mailing list. I hope I'm doing this right. If not, please pardon me... I need to write a multiplexed TCP server to handle multiple client connections simultaneously. It doesn't help that I'm new to perl and even newer to TCP. If this helps, I'm basing m

Re: #include like in C

2004-04-21 Thread WC -Sx- Jones
[EMAIL PROTECTED] wrote: I need to include a header/boilerplate file in several Perl scripts. At this point, I'm using it as a module, but it's a big kludge. Essentially, I want the functionality that you have in C, where you can just #include the file, and it's evaluated in the scope of the file

RE: removing duplicate array values

2004-04-21 Thread Shaw, Matthew
Hi Darren, -Original Message- > I'd like to remove duplicate values from an array to leave it with only > unique values. For instance, if an array contains (1,2,3,1,4,2,5) as > values, I'd like to clean out the extra 1 and 2 to leave the values as > (1,2,3,4,5). Does perl have an array c

Re: removing duplicate array values

2004-04-21 Thread James Edward Gray II
On Apr 21, 2004, at 8:24 AM, Peterson, Darren - Contractor.Westar wrote: I'd like to remove duplicate values from an array to leave it with only unique values. For instance, if an array contains (1,2,3,1,4,2,5) as values, I'd like to clean out the extra 1 and 2 to leave the values as (1,2,3,4,5).

Re: removing duplicate array values

2004-04-21 Thread Paul D. Kraus
On Wednesday 21 April 2004 09:24 am, you wrote: > I'd like to remove duplicate values from an array to leave it with only > unique values. For instance, if an array contains (1,2,3,1,4,2,5) as > values, I'd like to clean out the extra 1 and 2 to leave the values as > (1,2,3,4,5). Does perl have a

RE: Problem with Code

2004-04-21 Thread Charles K. Clarkson
Ryan Thomas <[EMAIL PROTECTED]> wrote: : : I have a script below that lists a directory tree : structure (thanks for the base code Jan!)and have : modified it, unsuccessfully, to add the file size. : : What have i done wrong ?? : : The output I am looking for is: : : c:\anydir\foo.txt 1,102 :

removing duplicate array values

2004-04-21 Thread Peterson, Darren - Contractor.Westar
I'd like to remove duplicate values from an array to leave it with only unique values. For instance, if an array contains (1,2,3,1,4,2,5) as values, I'd like to clean out the extra 1 and 2 to leave the values as (1,2,3,4,5). Does perl have an array command to do that, or must the process be purel

Re: Feeding an array

2004-04-21 Thread Jan Eden
Hi Ben, - Original Message - From: Ben Miller Sent: 21.04.2004, 7:49 Uhr >Hello, > >This is my first post and I'm working on my first real Perl program. >I'm trying to feed an array using information scraped off another >web page. I've got the scraping working no problem, but each of the

Feeding an array

2004-04-21 Thread Ben Miller
Hello, This is my first post and I'm working on my first real Perl program. I'm trying to feed an array using information scraped off another web page. I've got the scraping working no problem, but each of the words I pull from the other page are treated as part of a single variable. For example:

Re: Problem with Code

2004-04-21 Thread Jan Eden
I do not see the error. But from your listing, I see you're on Windows. Could you try the following code (without any modifications): --- #!/usr/bin/perl -w use strict; use File::Find; use Cwd; my $dir = cwd; print "Listing of $dir\n\n"; find ( \&printer, $dir ); sub printer {

Re: Problem with Code

2004-04-21 Thread Ryan Thomas
I don't get any errors when running the script, it just doesn't print any file size values. A copy of the output is below: c:\proggy c:\proggy/counter.bak c:\proggy/counter.exe c:\proggy/counter.pl c:\proggy/error.txt c:\proggy/filelist.pl c:\proggy/filelisting.txt c:\proggy/linecount.pl c:\progg

Re: Problem with Code

2004-04-21 Thread Jan Eden
Hi Jane, - Original Message - From: Ryan Thomas Sent: 21.04.2004, 12:18 Uhr >Hello All > >I have a script below that lists a directory tree structure (thanks for the base >code Jan!)and have modified it, unsuccessfully, to add the file size. > >What have i done wrong ?? > >The output I a

Re: coding standards question and RFC

2004-04-21 Thread Michael C. Davis
At 06:23 PM 4/19/04 -0700, drieux wrote: >The problem then becomes, and I can not tell from >your email - if you are in the position to be setting >'corporate policy' - Which is the Real Issue here. Thanks for the insights, drieux. While I wish I were in a position to establish corporate policy,

Problem with Code

2004-04-21 Thread Ryan Thomas
Hello All I have a script below that lists a directory tree structure (thanks for the base code Jan!)and have modified it, unsuccessfully, to add the file size. What have i done wrong ?? The output I am looking for is: c:\anydir\foo.txt 1,102 code: # Reads a directory tree and parses the res

Re: #include like in C

2004-04-21 Thread Michael C. Davis
At 11:59 AM 4/20/04 -0700, [EMAIL PROTECTED] wrote: >I need to include a header/boilerplate file in several Perl scripts. >At this point, I'm using it as a module, but it's a big kludge. Essentially, > I want the functionality that you have in C, where you can just #include >the file, and it's eval

Re: Directory Listing

2004-04-21 Thread Jan Eden
Hi Jane, - Original Message - From: Ryan Thomas Sent: 21.04.2004, 11:09 Uhr >I am relatively new at PERL and am learning it for a school project. What I >would like to do is write a perl script that can run a complete directory >listing including sub-directories and save the result to a

Re: Directory Listing

2004-04-21 Thread David Dorward
On 21 Apr 2004, at 11:09, Ryan Thomas wrote: I am relatively new at PERL and am learning it for a school project. What I would like to do is write a perl script that can run a complete directory listing including sub-directories and save the result to a text file. Not sure where to start. Take

Directory Listing

2004-04-21 Thread Ryan Thomas
I am relatively new at PERL and am learning it for a school project. What I would like to do is write a perl script that can run a complete directory listing including sub-directories and save the result to a text file. Not sure where to start. Help!! thanks Jane

#include like in C

2004-04-21 Thread swoon
I need to include a header/boilerplate file in several Perl scripts. At this point, I'm using it as a module, but it's a big kludge. Essentially, I want the functionality that you have in C, where you can just #include the file, and it's evaluated in the scope of the file doing the #include'ing.