Still Not sure if I agree with myself.

2003-09-08 Thread drieux
Currently I am in the midst of an argument with myself about tactics and strategies for doing CGI coding. The side effect of which lead me to wonder about some prejudices I seem to have about when, where and how to cut over to using/creating a Perl Module for code re-use. Some of this comes from

Security?

2003-09-08 Thread Alejandro Chavarria - CyPage
Hey, I am writing a perl CGI script on a remote server that is supposed to do the following: 1. Have the user sign in with a username and password. 2. Allow the user to add News Stories in which that input is taken and then written to a text file (Which is as of this moment, set to chmod 777).

Re: passing an argument to a subroutine

2003-09-08 Thread R. Joseph Newton
B. Fongo wrote: Hello An argument passed to a subroutine returns wrong value. Code example: @x = (1..5); $x = @x; showValue ($x); # or showValue (\$x); sub showValue { my $forwarded = @_; print $forwarded; # print ${$forwarded}; } In both cases, the script prints out 1.

Re: Desperately needs help with nested looping

2003-09-08 Thread R. Joseph Newton
B. Fongo wrote: I'm quit confused with what I have below. I have 2 database tables; Games and groups. Name Group # John ,GroupA Miler, GroupA Peter, GroupB Mathew, GroupB Mark, GroupB Luke, GroupA I'm trying to select the members based on their groups and

RE: passing an argument to a subroutine

2003-09-08 Thread Mike Harrison
Hi all, I'm a bit late for a reply, but thought it would be appropriate to ask Babs exactly what was required from the perl program. Did you want to print the number of elements in the array, or print each element in the array? As Andrew Brosnan explained, setting a scalar equal to an array

.exe is mandatory :-(

2003-09-08 Thread Shishir Saxena
I just installed perl and I don't know what settings I fiddled with, but now on Windows Command Prompt I am unable to execute perl scripts with somthing like, perl test.pl rather I have to do perl.exe test.pl same for any application ... everything has to be suffixed with a .EXE ... Please

Re: Extracting equal entities from two different sized arrays?

2003-09-08 Thread Kevin Pfeiffer
In article [EMAIL PROTECTED], John W. Krahn wrote: Kevin Pfeiffer wrote: In article [EMAIL PROTECTED], John W. Krahn wrote: my $string1 = 'C:\Program files\directory1\directory2\directory3'; my $string2 = 'C:\Program files\directory1\dir2\dir3'; ( my $nulls = $string1 ^ $string2 )

Re: How to replace variable spaces with a tab - Please Help

2003-09-08 Thread antigone
SNIP, SNIP What I want to do is replace any repeating spaces (two or more) with a tab. I know the examples below do not work but am just giving it as pseudocode of replacing repeating spaces (between 2 and 50) with a tab: s/sp[2..50]/\t/gi; or maybe hex value (hex 20 is the space

Re: Does anyone gets duplicated copies of a message all the time?!

2003-09-08 Thread Scott R. Godin
Ramprasad A Padmanabhan wrote: Nelson Wong wrote: Hi all, I always get three identical copies of a message all the time, therefore, I just wonder if anyone has the same situation as mine! Thanks! BTW, it is a great ML!!! Happy knowledge sharing! No, But reading the full headers of

Re: Deleting a line that contains certain text

2003-09-08 Thread Scott R. Godin
David Wall wrote: --On Saturday, September 06, 2003 7:45 PM -0400 perlwannabe [EMAIL PROTECTED] wrote: OK, I have a new problem. I need to delete an entire line that contains certain text. I have done an extensive search and had no luck finding an adequate answer. Yes, I also saw

Matching quoted text question...

2003-09-08 Thread Rodney Wise
I'm trying to place HTML Tags around the contents of Quoted material. I'm using the following PERL code: $TextBlockToConvert =~ s/(.+?)/FONT Color=BLUE\1\/Font/g; Below, is an example of problem text this code chokes on. Example Text:msgStop(, Invalid date) 1. The 1st set of

Re: Matching quoted text question...

2003-09-08 Thread John W. Krahn
Rodney Wise wrote: I'm trying to place HTML Tags around the contents of Quoted material. I'm using the following PERL code: $TextBlockToConvert =~ s/(.+?)/FONT Color=BLUE\1\/Font/g; Below, is an example of problem text this code chokes on. Example Text:msgStop(, Invalid

Re: Enumerating list of IP Addresses from a given range

2003-09-08 Thread Kevin Pfeiffer
In article [EMAIL PROTECTED], John W. Krahn wrote: Kevin Pfeiffer wrote: In article [EMAIL PROTECTED], John W. Krahn wrote: You need to convert the IP address to a 32 bit integer and back again. [...] (But this includes numbers such as 12.13.1.255 and 12.13.2.0 which are not in the

Re: .exe is mandatory :-(

2003-09-08 Thread Jenda Krynicky
From: Shishir Saxena [EMAIL PROTECTED] I just installed perl and I don't know what settings I fiddled with, but now on Windows Command Prompt I am unable to execute perl scripts with somthing like, perl test.pl rather I have to do perl.exe test.pl same for any application ... everything

RE: grep with ftp

2003-09-08 Thread Dan Muey
Bob Showalter wrote: Johnson, Shaunn wrote: Howdy: I'm looking for information that will let me open an ftp connection and grep / search for files and then FTP them back to me. What do you mean grep/search for files? If you want to search for particular file *names*,

Re: Matching quoted text question...

2003-09-08 Thread Rob Dixon
John W. Krahn wrote: Rodney Wise wrote: I'm trying to place HTML Tags around the contents of Quoted material. I'm using the following PERL code: $TextBlockToConvert =~ s/(.+?)/FONT Color=BLUE\1\/Font/g; Below, is an example of problem text this code chokes on.

RE: Matching quoted text question...

2003-09-08 Thread Akens, Anthony
Hello all... I'm wanting to write a script that scans a file, ignoring all lines until it reaches a certain section, then processes all lines in that section that are not comments, until it reaches the end of that section. The section would be designated like this: ## Beging Processing ## ##

Matching a section of test

2003-09-08 Thread Akens, Anthony
Sorry for the first post, didn't mean this as a reply. Hello all... I'm wanting to write a script that scans a file, ignoring all lines until it reaches a certain section, then processes all lines in that section that are not comments, until it reaches the end of that section. The section

Re: Find the name of all the function on the system

2003-09-08 Thread Jenda Krynicky
From: [EMAIL PROTECTED] I need to do some kind of generic log trow my code, this will be used just in debug mode. I has sinking something like. sub prepareLog{ foreach my $functionName (xpto()) { next if not toLog($functionName); *$functionName = sub { print start:

RE: Matching a section of test

2003-09-08 Thread Bob Showalter
Akens, Anthony wrote: Sorry for the first post, didn't mean this as a reply. Hello all... I'm wanting to write a script that scans a file, ignoring all lines until it reaches a certain section, then processes all lines in that section that are not comments, until it reaches the end

RE: Matching a section of test

2003-09-08 Thread NYIMI Jose (BMB)
+1 to Bob; José. -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 5:29 PM To: 'Akens, Anthony'; [EMAIL PROTECTED] Subject: RE: Matching a section of test Akens, Anthony wrote: Sorry for the first post, didn't mean this as a reply.

Re: Do not understand Hashes !

2003-09-08 Thread R. Joseph Newton
Matt Matijevich wrote: foreach (@master_file) { chomp($_); @temp = split(',', $_); nope. Should be: @temp = split(/,\s*/, $_); split uses regex patterns to split on. The join function does use strings. $master{$temp[0]} = $temp[1]; } foreach

Re: Enumerating list of IP Addresses from a given range

2003-09-08 Thread John W. Krahn
Kevin Pfeiffer wrote: In article [EMAIL PROTECTED], John W. Krahn wrote: Kevin Pfeiffer wrote: In article [EMAIL PROTECTED], John W. Krahn wrote: You need to convert the IP address to a 32 bit integer and back again. [...] (But this includes numbers such as 12.13.1.255 and

Re: Does anyone gets duplicated copies of a message all the time?!

2003-09-08 Thread R. Joseph Newton
Ramprasad A Padmanabhan wrote: Nelson Wong wrote: Hi all, I always get three identical copies of a message all the time, therefore, I just wonder if anyone has the same situation as mine! Thanks! BTW, it is a great ML!!! Happy knowledge sharing! Nelson No,

Re: Matching quoted text question...

2003-09-08 Thread John W. Krahn
Rob Dixon wrote: John W. Krahn wrote: $TextBlockToConvert =~ s/([^]*)/length $1 ? 'FONT Color=BLUE\1\/Font' : ''/eg; Almost right! But the deprecated \1 in the replacement string won't work with the /e modifier: it needs to be $1. Although I'm sure you knew that. Yes, but I didn't

Re: Getting rid of white space...

2003-09-08 Thread R. Joseph Newton
Akens, Anthony wrote: The files are all pipe-delimited, so I don't have a problem separating the fields, I just am not sure how to make it remove all extra whitespace. It needs to keep all Space in the fields thedescription of the file should still be readable

Errant MAIERL-DAEMON messages from mail9.mxpath.net

2003-09-08 Thread R. Joseph Newton
HI Casey, Can you get [EMAIL PROTECTED] off this list? His ISP's MAILER_DAEMON is spamming the list with error messages. My policy is to forward a correction for each to [EMAIL PROTECTED] until they stop. Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

eval parameters one liner

2003-09-08 Thread Stephen Gilbert
I know I saw something like this in the past I just can't find it. Anyone got any ideas? perl -e 'print eval { @ARGV }, \n' 5 + 5 it should be able to take any perl arithmetic operator. so: perl -e 'print eval { @ARGV }, \n' 840928302840982 / 74098374 or perl -e 'print eval { @ARGV }, \n'

Re: eval parameters one liner

2003-09-08 Thread John W. Krahn
Stephen Gilbert wrote: I know I saw something like this in the past I just can't find it. Anyone got any ideas? perl -e 'print eval { @ARGV }, \n' 5 + 5 it should be able to take any perl arithmetic operator. so: perl -e 'print eval { @ARGV }, \n' 840928302840982 / 74098374 or

Re: Test if browser's allows cookies/has them turned onetc..

2003-09-08 Thread R. Joseph Newton
Dan Muey wrote: -Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 12:33 PM To: [EMAIL PROTECTED] Subject: Re: Test if browser's allows cookies/has them turned onetc.. Dan == Dan Muey [EMAIL PROTECTED] writes: Dan

Hashes

2003-09-08 Thread Larry Sandwick
I want to thank everybody who helped me with my Hash problems. You guys/gals are GREAT. Again Thanks !!! Larry Sandwick Sarreid, Ltd. Network/System Administrator phone: (252) 291-1414 x223 fax : (252) 237-1592

RE: Matching a section of test

2003-09-08 Thread Akens, Anthony
Thanks Bob, I'm going to file this away in my nifty perl code file. -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 10:29 AM To: Akens, Anthony; [EMAIL PROTECTED] Subject: RE: Matching a section of test Akens, Anthony wrote: Sorry for

RE: Matching a section of test

2003-09-08 Thread Bob Showalter
Akens, Anthony wrote: Thanks Bob, I'm going to file this away in my nifty perl code file. I'm guessing this (range operator) behavior was part of sed's influence on Perl. Perhaps one of the Perl historians can confirm? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: eval parameters one liner

2003-09-08 Thread Paul Johnson
On Mon, Sep 08, 2003 at 03:50:25PM -0400, Stephen Gilbert wrote: I know I saw something like this in the past I just can't find it. Anyone got any ideas? perl -e 'print eval { @ARGV }, \n' 5 + 5 it should be able to take any perl arithmetic operator. so: perl -e 'print eval { @ARGV },

RE: Test if browser's allows cookies/has them turned onetc..

2003-09-08 Thread Dan Muey
Dan Muey wrote: -Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 12:33 PM To: [EMAIL PROTECTED] Subject: Re: Test if browser's allows cookies/has them turned onetc.. Dan == Dan Muey [EMAIL PROTECTED]

Re: retrieve command data from DOS using telnet

2003-09-08 Thread R. Joseph Newton
Nitin Aggarwal wrote: Hi , I am writing this code to telnet into windows machine. The code works fine on the unix machine and runs the command 'ps -ef'. On W2K I am trying to telnet into the machine and to recognize the prompt 'C:\' . but it keeps on giving the error 'time-out. I have

RE: Test if browser's allows cookies/has them turned onetc..

2003-09-08 Thread K Old
On Mon, 2003-09-08 at 16:11, Dan Muey wrote: Dan Muey wrote: -Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 12:33 PM To: [EMAIL PROTECTED] Subject: Re: Test if browser's allows cookies/has them turned

RE: Test if browser's allows cookies/has them turned onetc..

2003-09-08 Thread Dan Muey
-Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 12:33 PM To: [EMAIL PROTECTED] Subject: Re: Test if browser's allows cookies/has them turned onetc.. Dan == Dan Muey [EMAIL PROTECTED]

Re: retrieve command data from DOS using telnet

2003-09-08 Thread John W. Krahn
R. Joseph Newton wrote: Does your Windows machine have a telnet server?!? I envy you, I guess. When I try reaching my laptop from my desktop via command line, I get: Greetings! E:\d_drive\perlStufftelnet 192.168.0.97 Connecting To 192.168.0.97...Could not open a connection to host:

Re: trouble with Mail::DeliveryStatus::BounceParser

2003-09-08 Thread R. Joseph Newton
David T-G wrote: Hi, all -- I'm having some trouble using this wonderful-looking module to tackle catching bounced mail and doing something with it. I've followed the man page to a tee but get errors. Figuring that y'all can find the man page or don't need it, here is my basic script

labeled blocks

2003-09-08 Thread Thomas Browner
Could some one show me an example of a labeled block (goto)? Thanks Thomas

Re: FW: A big trouble

2003-09-08 Thread R. Joseph Newton
Antonio Jose wrote: Hello I have 3 weeks learning Perl and I am trying to solve a trouble I need to write my thesis Learn Perl first, then try to apply it to complex mathematical issues. I have to read a file where I don't know the content of the first rows (only strings) and I

Re: labeled blocks

2003-09-08 Thread John W. Krahn
Thomas Browner wrote: Could some one show me an example of a labeled block (goto)? perlsyn.pod has many examples of labeled blocks perldoc perlsyn John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: FW: A big trouble

2003-09-08 Thread James Edward Gray II
On Monday, September 8, 2003, at 05:15 PM, R. Joseph Newton wrote: Your script had almost 100 lines of incomprehesible scripting garbage before the first subroutine definition. Egad, is that called for? I personally consider it offensive and outside the realm of constructive criticism. James

RE: retrieve command data from DOS using telnet

2003-09-08 Thread Robert J Taylor
Yes, his machine could very well have Telnet Server installed -- see below -Original Message- From: R. Joseph Newton [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 1:37 PM To: Nitin Aggarwal Cc: [EMAIL PROTECTED] Subject: Re: retrieve command data from DOS using telnet

checking for no input

2003-09-08 Thread Kevin Pfeiffer
I'm looking at HTML::TokeParser. It expects a scalar with a filename or a reference to a scalar containing the data to parse. This works fine: my $html; if (@ARGV) { # get filename for TokeParser $html = shift; } else { my @html = ; $html = \(join '', @html);

Re: .exe is mandatory :-(

2003-09-08 Thread R. Joseph Newton
Shishir Saxena wrote: I just installed perl and I don't know what settings I fiddled with, I trust that YOU did not fiddle with any settings. Fiddling with nsettings is agood recipe for making a Perl installation fail--especially if you do not know which ones you changed. If you are working

using subroutine from another file

2003-09-08 Thread Ling F. Zhang
Let's say thatI wroute some code long time ago: code1.pl. In the file there is this subroutine1(); now I am writting another code code2.pl, and would like to use that subroutine1()...how do I do it without copy and pasting it to my code2.pl? __ Do you Yahoo!?

RE: .exe is mandatory :-(

2003-09-08 Thread Paul Kraus
This brings up an interesting oddity that I have on my windows install. I can execute a script by just calling it Myscript.pl This works however if I need to pass arguments on the command line then it fails. I have to call it like this perl myscript.pl arg1 arg2 Anyone ideas on to why?

Re: eval parameters one liner

2003-09-08 Thread R. Joseph Newton
John W. Krahn wrote: Stephen Gilbert wrote: I know I saw something like this in the past I just can't find it. Anyone got any ideas? perl -e 'print eval { @ARGV }, \n' 5 + 5 it should be able to take any perl arithmetic operator. so: perl -e 'print eval { @ARGV }, \n'

Re: authenticate module

2003-09-08 Thread R. Joseph Newton
Raghupathy wrote: Hi, I like to use WWW::Mechanize to scrape a website. However the website has a authentication page. Is there a perl module I can use to perform the authentication ? Thanks, Raghu Do you have the authors permission to scrape? It is possible that they want to make

Re: chmod -- chomp not chmod!!

2003-09-08 Thread R. Joseph Newton
Christiane Nerz wrote: Oh-oh - there was a mistake - I tried chomp, not chmod.. How do I use chomp correctly? I have an array of strings, want to cut off the last \n in each line and use the rest of the line. (concatenate it to another string) Jane Return to the original thread [which you

RE: authenticate module

2003-09-08 Thread Hanson, Rob
No extra module is needed. WWW::Mechanize is a subclass of LWP::UserAgent, which supports it. my $ua = new WWW::Mechanize(); $ua-credentials('www.myhostname.com:80', 'RealmName', 'user', 'pass'); $ua-get('http://www.myhostname.com'); print $ua-content; The params are host/port, realm,

Re: chmod

2003-09-08 Thread R. Joseph Newton
Christiane Nerz wrote: Hi all! I like to read several rows out of two different table-files and put them successively in a new file by: @ergebnis_alles[$#ergebnis_alles+1] = @whole_data1[$l] . $whole_data2[$m]; Anything works fine, except that I can't delete the ending newline in the

Re: eval parameters one liner

2003-09-08 Thread John W. Krahn
R. Joseph Newton wrote: John W. Krahn wrote: Try it like this: perl -le 'print eval @ARGV' Good on 'nix/'nux, I guess. On Windows, It takes a little different quoting: You mean like: perl -le print eval [EMAIL PROTECTED] Greetings! E:\d_drive\perlStuffperl -le print eval

Re: checking for no input

2003-09-08 Thread R. Joseph Newton
Kevin Pfeiffer wrote: I'm looking at HTML::TokeParser. It expects a scalar with a filename or a reference to a scalar containing the data to parse. This works fine: my $html; if (@ARGV) { # get filename for TokeParser $html = shift; } else { my @html = ;

Re: checking for no input

2003-09-08 Thread John W. Krahn
R. Joseph Newton wrote: Kevin Pfeiffer wrote: I'm looking at HTML::TokeParser. It expects a scalar with a filename or a reference to a scalar containing the data to parse. This works fine: my $html; if (@ARGV) { # get filename for TokeParser

Re: Access

2003-09-08 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: Hello, From an Oracle utlfile data under unix, I generate an Excel-Worksheet with the module Spreadsheet::WriteExcel. How can I do the same, but for Access ? Thank you. Olivier Access is a SQL-compliant database. Therefore you should use DBI. Joseph -- To

Re: Hide password in MS DOS

2003-09-08 Thread R. Joseph Newton
Ned Cunningham wrote: Funny you just caught me working on something similar, and I have modified this code for my purposes. This should lead you in the right direction! Snip #!/usr/bin/perl use Win32::Console; $StdIn = new Win32::Console(STD_INPUT_HANDLE); my $Password = ;

perl error

2003-09-08 Thread Sachin Mathur
Hi , Please let me know if anyone has a clue about this one. error on running a perl script ld.so.1: perl: fatal: relocation error: file

Re: Desperately needs help with nested looping

2003-09-08 Thread R. Joseph Newton
B. Fongo wrote: I'm quit confused with what I have below. I have 2 database tables; Games and groups. Name Group # John ,GroupA Miler, GroupA Peter, GroupB Mathew, GroupB Mark, GroupB Luke, GroupA I'm trying to select the members based on their groups and

Re: passing an argument to a subroutine

2003-09-08 Thread R. Joseph Newton
B. Fongo wrote: Hello An argument passed to a subroutine returns wrong value. Code example: @x = (1..5); $x = @x; showValue ($x); # or showValue (\$x); sub showValue { my $forwarded = @_; print $forwarded; # print ${$forwarded}; } In both cases, the script prints out 1.

Re: Use of uninitialized value in concatenation (.) or string at...

2003-09-08 Thread Bernard Kenik
use what the message states; you are using an uninitialize string. example my $string;# $string is declared but not initialized! so any operation you do on that string (except an assignment) with produce the error message. - Original Message - From: Devon Young [EMAIL PROTECTED]

Re: Use of uninitialized value in concatenation (.) or stringat...

2003-09-08 Thread Lee Goddard
At 20:13 06/09/2003, Devon Young wrote: What does this mean?? I'm thoroughly puzzled and I've been scouring the net for an answer. I've been assuming it means I'm not putting strings together correctly, but I can't figure out how to fix it. Here's the errors I'm getting, followed by the peice