Re: sort by extension

2004-07-29 Thread Randy W. Sims
perl.org wrote: On Thu, 29 Jul 2004 12:08:20 -0400 (EDT), Jeff 'japhy' Pinyan wrote That's why he broke it down. Is the map() really the problem, or is it the regex, the ?: operator, and the two array references? All of the above ;), but now that I think about it the map looks easiest, then > ?:

A simple client/server problem

2004-07-29 Thread Dan Timis
Hi everyone, I am very new to Perl. I need two perl scripts, one would run on a client, the other would run on a server. The perl script on the client machine runs an application. The application creates a file called "request.xml" The perl script reads the file, and sends it to the server.

Re: Warnings with Spreadsheet::WriteExcel

2004-07-29 Thread Randy W. Sims
On 7/29/2004 4:27 PM, NandKishore.Sagi wrote: ... a number of messages to a public mailing list with a receipt notification request. Please, don't do that. Features such as receipt notification, message priorities, auto responders are not appropriate for mailing lists. Thank you, Randy. -- To u

subclassing HTML::Parser

2004-07-29 Thread Andrew Gaffney
I've created a module that uses HTML::Parser to parse some HTML and create a tree structure. Someone had suggested to use HTML::TreeBuilder, but my HTML contains HTML::Mason code embedded, and HTML::TreeBuilder doesn't handle that well at all. HTML::TreeBuilder also adds , , and tags when ther

RE: Warnings with Spreadsheet::WriteExcel

2004-07-29 Thread NandKishore.Sagi
Never mind guys. I figured it out. The row and col value were not set and as a result I got a screenful :D Thanks for any time you spent on this issue. Nand Kishore -Original Message- From: NandKishore.Sagi [mailto:[EMAIL PROTECTED] Sent: Thursday, July 29, 2004 3:33 PM To: [EMAI

RE: Warnings with Spreadsheet::WriteExcel

2004-07-29 Thread NandKishore.Sagi
I guess the script was not recieved by you guys. Here is the script I have written. #! /opt/3d/bin/perl -w use strict ; use warnings ; use Spreadsheet::WriteExcel; my $workbook ; my $worksheet ; my $format ; my $row ; my $col ; my $host ; $workbook = Spreadsheet::WriteExcel->new("dclist.xls

Warnings with Spreadsheet::WriteExcel

2004-07-29 Thread NandKishore.Sagi
Title: Message Hi All ,         I am in process of generating some statistics for different unix boxes. I would like to generate excel workbook with a single worksheet for each box. I had written a test script to create the excel sheet. I was able to create the excel sheet but

RE: sort by extension

2004-07-29 Thread Charles K. Clarkson
perl.org <[EMAIL PROTECTED]> wrote: : Thanks for the detailed response. I know the interspersed : comments won't make some members of the list happy, but : they're just opinions. : : James Edward Gray II wrote: : : Not a "fan" of map() and grep() or just don't understand them? : : Both, didn't

RE: sort by extension

2004-07-29 Thread Galbreath, Mark A
But trinaries are so much more elegant than if/else statements. Mark -Original Message- From: James Edward Gray II [mailto:[EMAIL PROTECTED] Sent: Thursday, July 29, 2004 12:33 PM To: perl.org Cc: Perl Beginners Subject: Re: sort by extension On Jul 29, 2004, at 11:23 AM, perl.org wrote

Re: sort by extension

2004-07-29 Thread James Edward Gray II
On Jul 29, 2004, at 11:23 AM, perl.org wrote: On Thu, 29 Jul 2004 12:08:20 -0400 (EDT), Jeff 'japhy' Pinyan wrote That's why he broke it down. Is the map() really the problem, or is it the regex, the ?: operator, and the two array references? All of the above ;), but now that I think about it the

Re: sort by extension

2004-07-29 Thread James Edward Gray II
On Jul 29, 2004, at 10:42 AM, perl.org wrote: Thanks for the detailed response. Anytime. It's easier to read that code bottom to top, so let's start with: map { m/\.([^.]+)$/ ? [$_, $1] : [$_, ''] } @input; Unfortunately I really don't find this easy to read. That's unfortunate, because I actually

Re: sort by extension

2004-07-29 Thread perl.org
On Thu, 29 Jul 2004 12:08:20 -0400 (EDT), Jeff 'japhy' Pinyan wrote > > That's why he broke it down. Is the map() really the problem, or is > it the regex, the ?: operator, and the two array references? All of the above ;), but now that I think about it the map looks easiest, then ?: (which I a

RE: File not being written to and no errors?

2004-07-29 Thread arichmond(contr-ird)
On Jul 29, [EMAIL PROTECTED] said: >>You are opening a file for appending and reading. But you forgot (or >>didn't know) that you start out at the *end* of the file. I didn't thanks for the tip >open (DONE,"+>>$done") or die "Cannot open file: $!"; > >flock (DONE, 1); >>You should real

Re: sort by extension

2004-07-29 Thread Jeff 'japhy' Pinyan
On Jul 29, perl.org said: >> It's >> easier to read that code bottom to top, so let's start with: >> >> map { m/\.([^.]+)$/ ? [$_, $1] : [$_, ''] } @input; > >Unfortunately I really don't find this easy to read. That's why he broke it down. Is the map() really the problem, or is it the regex, th

RE: use lib - not known at compile time

2004-07-29 Thread Thompson, Glenn
Thanks. Didn't know about PERL5LIB but when it looked it up in the Cookbook its the perfect & easy solution. I just put export PERL5LIB=$RGSE/lib into my .bashrc file and now there is no longer a need to use: perl -I${RGSE}/lib myprogram.pl to run the program. I can just do:

Re: sort by extension

2004-07-29 Thread perl.org
Thanks for the detailed response. I know the interspersed comments won't make some members of the list happy, but they're just opinions. On Wed, 28 Jul 2004 13:46:07 -0500, James Edward Gray II wrote > > Not a "fan" of map() and grep() or just don't understand them? Both, didn't understand them

Re: Modifying @INC

2004-07-29 Thread Joshua Colson
On Wed, 2004-07-28 at 22:14, PerlDiscuss - Perl Newsgroups and mailing lists wrote: > I want to add some paths to the @INC array to resolve certain package > names at runtime. > > One of the methods is: "push(@INC,$path) or unshift($path,@INC)" and then > say "require package_name;". > the problem

RE: use lib - not known at compile time

2004-07-29 Thread Bakken, Luke
> I'm trying to add my own module "DEGS::ldegs" to a Perl program. > However, this module will part of a distribution called "RGSE", > which could be installed on a different path on different peoples PCs. > However, it will always be in the directory "$ENV{RGSE}/lib". > > The problem is when I ru

RE: use lib - not known at compile time

2004-07-29 Thread Bob Showalter
Thompson, Glenn wrote: > I'm trying to add my own module "DEGS::ldegs" to a Perl program. > However, this module will part of a distribution called "RGSE", > which could be installed on a different path on different peoples PCs. > However, it will always be in the directory "$ENV{RGSE}/lib". > > T

RE: use lib - not known at compile time

2004-07-29 Thread Moon, John
You may wish to look at "BEGIN" ... Hope that gives you some ideas... Thanks, jwm -Original Message- From: Thompson, Glenn [mailto:[EMAIL PROTECTED] Sent: Thursday, July 29, 2004 10:54 AM To: [EMAIL PROTECTED] Subject: use lib - not known at compile time I'm trying to add my own modu

use lib - not known at compile time

2004-07-29 Thread Thompson, Glenn
I'm trying to add my own module "DEGS::ldegs" to a Perl program. However, this module will part of a distribution called "RGSE", which could be installed on a different path on different peoples PCs. However, it will always be in the directory "$ENV{RGSE}/lib". The problem is when I run the progra

Re: Endless Loop

2004-07-29 Thread James Edward Gray II
On Jul 29, 2004, at 9:23 AM, BOLCATO CHRIS (esm1cmb) wrote: This may be a dumb question, but why will this loop not end when nothing is entered in STDIN? STDIN is a stream. A blank line does not constitute the end of a stream. I believe your can signal an end to the stream in most terminals wi

RE: Endless Loop

2004-07-29 Thread Bob Showalter
BOLCATO CHRIS (esm1cmb) wrote: > This may be a dumb question, but why will this loop not end when > nothing is entered in STDIN? > > print "Enter Things:\n"; > while () { > print "I saw $_"; > } > print "The End\n"; By "nothing is entered", I assume you mea

RE: Modifying @INC

2004-07-29 Thread kamal.gupta
Prasanna kothari wrote: >try this > "use lib "; Randy W. Sims wrote: >push( @INC, $path ); >require package_name; >package_name->import(); # pulls in exported symbols Well these are real sweet ways, I agree. No BEGIN blocks required and no hassles. But is there any way to avoid this Expor

Endless Loop

2004-07-29 Thread BOLCATO CHRIS (esm1cmb)
This may be a dumb question, but why will this loop not end when nothing is entered in STDIN? print "Enter Things:\n"; while () { print "I saw $_"; } print "The End\n"; If nothing is entered the loop continues. Output: I saw red I sa

Re: deleting HTML tag...but not everyone

2004-07-29 Thread James Edward Gray II
On Jul 29, 2004, at 7:52 AM, Francesco del Vecchio wrote: Hi guys, Hello. I have a problem with a Regular expression. I have to delete from a text all HTML tags but not the DIV one (keeping all the parameters in the tag). This is a complex problem. Your solution is pretty naive and will only wor

Re: deleting HTML tag...but not everyone

2004-07-29 Thread Jenda Krynicky
From: Francesco del Vecchio <[EMAIL PROTECTED]> > I have a problem with a Regular expression. > I have to delete from a text all HTML tags but not the DIV one > (keeping all the parameters in the tag). Don't do that! You should use a HTML parser module instead of regexps. Parsing HTML is not as

Re: File not being written to and no errors?

2004-07-29 Thread Jeff 'japhy' Pinyan
On Jul 29, arichmond(contr-ird) said: >I have a file I am trying to read and write to, it's obviously opening >it ie.. No errors but not writing to it. > > Since no errors are being produced I can't figure out why? You are opening a file for appending and reading. But you forgot (or didn't know)

Re: sort files by extension

2004-07-29 Thread Jeff 'japhy' Pinyan
On Jul 28, perl.org said: >On Wed, 28 Jul 2004 14:04:26 -0400 (EDT), Jeff 'japhy' Pinyan wrote >> On Jul 28, perl.org said: >> >> I would use File::Basename so that I can be sure it works on all >> platforms. What is your take on files with multiple extensions, like >> program.pl.bak or jeff.piny

deleting HTML tag...but not everyone

2004-07-29 Thread Francesco del Vecchio
Hi guys, I have a problem with a Regular expression. I have to delete from a text all HTML tags but not the DIV one (keeping all the parameters in the tag). I've done this: ^^ #!/usr/bin/perl use strict; my $test=< =SU

RE: Modifying @INC

2004-07-29 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I want to add some paths to the @INC array to resolve certain package > names at runtime. > > One of the methods is: "push(@INC,$path) or unshift($path,@INC)" and > then say "require package_name;". > the problem with this is that we still need to use the "::" operator >

File not being written to and no errors?

2004-07-29 Thread arichmond(contr-ird)
I have a file I am trying to read and write to, it’s obviously opening it ie.. No errors but not writing to it.  Since no errors are being produced I can’t figure out why? In short I am reading the file to see if I previously sent an email concerning a “name” and if I have then don’t sen

Re: Modifying @INC

2004-07-29 Thread Randy W. Sims
[EMAIL PROTECTED] wrote: This is one way of doing it. Probably there could be some other short and sweet ways of doing it. I'm also waiting for such an answer. push( @INC, $path ); require package_name; package_name->import(); # pulls in exported symbols -Original Message- From: PerlDiscus

Re: Modifying @INC

2004-07-29 Thread Prasanna Kothari
try this "use lib "; PerlDiscuss - Perl Newsgroups and mailing lists wrote: I want to add some paths to the @INC array to resolve certain package names at runtime. One of the methods is: "push(@INC,$path) or unshift($path,@INC)" and then say "require package_name;". the problem with this is that we

RE: Modifying @INC

2004-07-29 Thread kamal.gupta
Hi shahj, Instead of "require package_name" you may say use package_name. As 'require' is not bringing in the symbols. Only 'use' does it. You should always use 'use' when you wanted to bring in the symbols inside your script from the package. More importantly the package 'package_name' should

Modifying @INC

2004-07-29 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I want to add some paths to the @INC array to resolve certain package names at runtime. One of the methods is: "push(@INC,$path) or unshift($path,@INC)" and then say "require package_name;". the problem with this is that we still need to use the "::" operator with the symbols to resolve the packag

Re: Keeping track of a variable

2004-07-29 Thread Randy W. Sims
Alok Bhatt wrote: Hi All, Can someone please tell me how do we keep track of a variable. ie Whenever a particular variable is accessed (printed, incremented etc.), a counter should increase, so that we can know how many times it has been accesssed. The mechanism is tie, see `perldoc tie` Here

Keeping track of a variable

2004-07-29 Thread Alok Bhatt
Hi All, Can someone please tell me how do we keep track of a variable. ie Whenever a particular variable is accessed (printed, incremented etc.), a counter should increase, so that we can know how many times it has been accesssed. Thanks in Advance, Regards, Alok