Re: Form parameter as filename?

2002-01-07 Thread fliptop
Rob Cottingham wrote: I'm trying to use a parameter passed from a CGI form as the basis of a filename: my $file_location = /home2/samuel-c/HTML/alex/urltest/; my $filename=param('category'); my $fileid=$file_location.'urls_'.$filename; open(ULL, $fileid) || die Can't open

fulltext search on a cd

2002-01-07 Thread Bernd Lach
Hello, I maybe have a little bit tricky question (for me at least): I want to create a fulltext search possibility in a web project that should be stored on a cd-rom. the web project consists of html files. The fulltext search should search in all that documents. as result there should be a

Parsing url from html content

2002-01-07 Thread Özgür ÖZTÜRK
With the following code i want to get the url of the first link (which come from a query at google.com). My target token is a href=http://www.hotmail.com/ and i want to get http://www.hotmail.com from there, but my program get the first letter a. I couldn't find any way to access the rest of

Re: File Upload via URL

2002-01-07 Thread Brent Michalski
If i remember correctly, this is also not allowed. It would be a big security risk to allow something like this. The same goes for the file upload box that you put on an HTML form... You cannot prefill the values in it. Brent

scheduling

2002-01-07 Thread Camilo Gonzalez
Anyone know of a module or method that will run a Perl script on a given time each day? I need to FTP a file from one site to another daily and I was hoping to automate it. if ( $Camilo_Gonzalez $Web_Developer ) { Taylor Johnson Associates; [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ;

RE: scheduling

2002-01-07 Thread Camilo Gonzalez
How can I find out about cron? -Original Message- From: fliptop [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 4:30 PM To: Camilo Gonzalez Cc: [EMAIL PROTECTED] Subject: Re: scheduling Camilo Gonzalez wrote: Anyone know of a module or method that will run a Perl script on

Re[2]: Curtis Poe Script/Lesson Questions

2002-01-07 Thread K.L. Hayes
Hello Mr. Poe All, Thank you very much for your articulate thorough answers. I'm sure you've enlightened others as well with your response. I'm a Site Designer turning Perl Hacker over the last 5-6 months I'm just concerned about being dangerous in the transition. IMO It's better that I ask

Re: 2 Q's, Google and Me - can you spell it out?

2002-01-07 Thread Curtis Poe
--- Henk van Ess [EMAIL PROTECTED] wrote: Dear all, They told me that this forum teaches Perl in a friendly atmosphere, so I hope you can help me. My name is Henk van Ess and I run www.voelspriet.nl, a Dutch site about searchengines (non-commercial). I'm busy with a form for searching

Cookies and SSI

2002-01-07 Thread Robert Howard
If a script is being called as a Server Side Include, is it still possible to set and read cookies from within the script? Problem I am running into is that the header of the main html is read before my script, so no cookies are set by using print header (-cookie = $session_cookie). R.A. Howard

Re: Form parameter as filename?

2002-01-07 Thread Rob Cottingham
Thanks for the suggestion, Fliptop. Someone finally pointed out my problem: data tainting was on, and I had to untaint the data before Perl would let me use it in something as exposed as a filename. Whew!! Cheers, --rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: SubRoutine Help

2002-01-07 Thread John W. Krahn
Michael R. Wolf wrote: # Readable. sub total { my $sum; foreach my $num (@_) { $sum += $num; } return $sum; } # Streamlined sub total { my $sum; $sum += $_ foreach (@_);# $_ implicitly set } # sum implicitly returned

RE: Adding quotes to a string variable

2002-01-07 Thread Robert Graham
You have two options: Option one: Put the string between single quotes $a = 'Test Test Test'; Option two: $a = q(Test Test Test); Regards Robert Graham -Original Message- From: Hubert Ian M. Tabug [mailto:[EMAIL PROTECTED]] Sent: 07 January 2002 12:02 To: Perl Subject: Adding quotes

Re: Adding quotes to a string variable

2002-01-07 Thread Steven Brooks
On Monday 07 January 2002 03:16 am, you wrote: You have two options: Option one: Put the string between single quotes $a = 'Test Test Test'; Option two: $a = q(Test Test Test); Regards Robert Graham Well, there are other options. Not that they are better, but they are options. Both

Re: Query

2002-01-07 Thread Jon Molin
Manish Uskaikar wrote: Can anyone tell me if i can use threads in perl; If yes then what all library files i have to include. Also tell me how i include a system library file like math.h or unistd.h in perl. How can one include C libraries in perl program i.e.. *.pl Regards Manish U.

Re: regexp to replace double with single quotes inside html tags

2002-01-07 Thread birgit kellner
--On Sonntag, 06. Jänner 2002 22:48 -0500 Michael R. Wolf [EMAIL PROTECTED] wrote: Which is why many folks use a parser rather than regular expressions for this. The parsers take care of the special cases that are very, very, very (read the history of this group) difficult to get around

Re: RegEx speed (was: Using regexp to get a substring)

2002-01-07 Thread Jos I. Boumans
if we're talking about optimization and the question was really how to CAPTURE the characters after the last / there is really NO need for a s/// and a simple m// would do which i imagine will also be quite a bit faster regards, jos - Original Message - From: Gary Hawkins [EMAIL

RE: Adding quotes to a string variable

2002-01-07 Thread John
$a = \TEST TEST TEST\; print $a; Prints: TEST TEST TEST The quotes are part of the string stored in the variable -Original Message- From: Hubert Ian M. Tabug [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 3:02 AM To: Perl Subject: Adding quotes to a string variable Hello,

Re: Adding quotes to a string variable

2002-01-07 Thread John W. Krahn
Steven Brooks wrote: On Monday 07 January 2002 03:16 am, you wrote: You have two options: Option one: Put the string between single quotes $a = 'Test Test Test'; Option two: $a = q(Test Test Test); Regards Robert Graham Well, there are other options. Not that they are

Re: regexp to replace double with single quotes inside html tags

2002-01-07 Thread John W. Krahn
Birgit Kellner wrote: --On Sonntag, 06. Jänner 2002 22:48 -0500 Michael R. Wolf [EMAIL PROTECTED] wrote: Which is why many folks use a parser rather than regular expressions for this. The parsers take care of the special cases that are very, very, very (read the history of this

your my last hope on this cgi programming question

2002-01-07 Thread Hockey List
I posted this in a perl forum and was told you all might be able to help.. I was hoping you might point me in the right direction on a pretty simple problem. I have spent days just trying to see HOW to get this done, let alone doing it. This seems so damn simply but Im running into a brick wall.

@$

2002-01-07 Thread McCollum, Frank
What does the @$ sign indicate? I have a value in @$row in the code below that I want to strip out any html tags. I tried to use s/\*\//g; but it gives me an error (Can't modify array deref in substitution). foreach $ts ($te-table_states) { print Table (, join(',', $ts-coords), ):\n;

RE: your my last hope on this cgi programming question

2002-01-07 Thread John Edwards
You should start out by investigating the CGI.pm module for Perl. Does your web host allow Perl scripts and do they have the CGI.pm module available for use? Once you've got some simple CGI scripts up and running it isn't too hard to do what you are after. You just need to use CGI.pm to display

EXCEL automation

2002-01-07 Thread Billie
Hi all, What's wrong with the following code? use Win32::OLE; $book = Win32::OLE-GetObject(Book1.xls); $book-Saveas(Book2.xls); Book1 and the script are in the same directory. When I open Book2.xls, I cannot see any worksheet. Why? Thanks Billie -- To unsubscribe, e-mail: [EMAIL

RE: @$

2002-01-07 Thread John Edwards
It means treat the value in $row as a reference to an array. If you print out $row you will get something that looks like this. ARRAY(0x369ab0) Try altering your code to this foreach $ts ($te-table_states) { print Table (, join(',', $ts-coords), ):\n; foreach $row ($ts-rows) { my

RE: your my last hope on this cgi programming question

2002-01-07 Thread Hockey List
thats pretty much the main part of the problem. Like I said, Im not afrain of the cgi. Its the fact that the server wont allow me access to the cgi bin at all.. anyone know a free server for a cgi-bin? --- John Edwards [EMAIL PROTECTED] wrote: You should start out by investigating the CGI.pm

test and question

2002-01-07 Thread Alex Harris
I just joined and have a newbie question. How can I read in the date of a file (mmdd) AND then compare that to another date in Perl? I'm running of and AIX Unix machine. Please email me direct at [EMAIL PROTECTED] _ Chat

pattern matching for ip addresses in a text file

2002-01-07 Thread Ken Yeo
Hi, What is the best pattern matching for ip addresses? I tried $var =~ /\b\d{1-3}\.\d{1-3}\.\d{1-3}\.\d{1-3}\s/ but the {1-3} didn't work, please advise, TIA! Ken Yeo -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: test and question

2002-01-07 Thread John Edwards
You mean the timestamp on the file? http://www.google.com/search?sourceid=navclientq=perl+read+file+timestamp To compare dates http://www.google.com/search?sourceid=navclientq=perl+compare+dates HTH John P.S If you ask a question on the list, you should be prepared for the answer to go back

RE: your my last hope on this cgi programming question

2002-01-07 Thread Hockey List
Oh, Ok. Thats about the best news Ive heard yet. Thanks a million! -M#39 --- John Edwards [EMAIL PROTECTED] wrote: You should start out by investigating the CGI.pm module for Perl. Does your web host allow Perl scripts and do they have the CGI.pm module available for use? Once you've

Re: Parallel::ForkManager

2002-01-07 Thread Randal L. Schwartz
James == James Lucero [EMAIL PROTECTED] writes: James Has anyone successfully used the Parallel::ForkManager James to download web pages consistently? My series of Link Checkers in my columns have had that problem as well. The most recent incarnation does a preforking with a hand-rolled RPC,

Re: your my last hope on this cgi programming question

2002-01-07 Thread Hockey List
Yeh, I saw that site last night. Check this out.. Want to see something funny? Go to that site, www.myCGIserver right? click on sign up and read the warning: Please note that this service DOES NOT SUPPORT Perl, PHP or other scripting languages! you gotta love the internet!! -M#39 --- Alfred

Re: pattern matching for ip addresses in a text file

2002-01-07 Thread Jeff 'japhy' Pinyan
On Jan 7, Ken Yeo said: What is the best pattern matching for ip addresses? I tried $var =~ /\b\d{1-3}\.\d{1-3}\.\d{1-3}\.\d{1-3}\s/ but the {1-3} didn't work, please You want {1,3}, not {1-3}. Also, should that \s be a \b? And be warned that the number 500 matches /\d{1-3}/ without being

Re: Searching for a book...

2002-01-07 Thread Richard S. Crawford
Can't go wrong with the Camel Book: _Programming Perl_, 3rd edition, from O'Reilly publishing. The _Perl Cookbook_, also available from O'Reilly, is also an excellent buy. I have both (in addition to _Learning Perl_, the Llama Book), and between them I am almost always able to get the

Re: Searching for a book...

2002-01-07 Thread Jon Molin
Stanislav Zahariev wrote: Hello, I'm searching for a perl book to buy... But I'm not sure which is the best, or which are the best. Can you refer me some so I can chose from them? I know the basic things of perl, if the book holds them they must be very detailed. I'm oriented in

Re: Searching for a book...

2002-01-07 Thread Scott
http://perl.oreilly.com/ At 06:31 PM 1/7/2002 +0200, Stanislav Zahariev wrote: Hello, I'm searching for a perl book to buy... But I'm not sure which is the best, or which are the best. Can you refer me some so I can chose from them? I know the basic things of perl, if the book

comparing dates

2002-01-07 Thread Alex Harris
if I use the following to get the date of a file: use File::stat; use Time::localtime; $date_string = ctime(stat($file)-mtime); print file $file updated at $date_string\n; I get: Mon Jan 7 10:21:21 2002 Now I want to compare another file date to this one getting the date

RE: Searching for a book...

2002-01-07 Thread John Edwards
Try to keep lines shorter? I think Stanislav's post was more than adequate for the list. Especially as it would appear that English isn't his first language. Take a look at the FAQ section 2.3, bullet point 1 and chill out. /John ;) -Original Message- From: Jon Molin [mailto:[EMAIL

Re: pattern matching for ip addresses in a text file

2002-01-07 Thread John W. Krahn
Ken Yeo wrote: Hi, Hello, What is the best pattern matching for ip addresses? I tried $var =~ /\b\d{1-3}\.\d{1-3}\.\d{1-3}\.\d{1-3}\s/ but the {1-3} didn't work, please advise, TIA! The correct syntax is to use a comma. \d{1,3} John -- use Perl; program fulfillment -- To

Re: Searching for a book...

2002-01-07 Thread Jon Molin
John Edwards wrote: Try to keep lines shorter? I think Stanislav's post was more than adequate for the list. Especially as it would appear that English isn't his first language. i wasn't complaining on the language, i just have a hard time reading 299 char long lines. Also, perhaps you saw

Re: comparing dates

2002-01-07 Thread Matt C.
Check out Date::Manip; it can do just about anything you'd need to do with dates. If speed is of great concern (I use Date::Manip and it performs fine), you may be able to find another Date::* module more specifically tuned to your needs. Definitely try Date::Manip first though, as it will work

date compare problems

2002-01-07 Thread Alex Harris
Ok so I'm REALLY REALLY a newbie and this next question is going to sound like where's the spoon so you can feed me but... Here's my code and the error I got. I know it means I'm suppose to include something but I'm not sure what. use File::stat; use Time::localtime; $date_string =

RE: date compare problems

2002-01-07 Thread McCollum, Frank
the ParseDate, and Date_Cmp are looking for subroutines that would split the dates up, it appears. So, I would expect your code to include a subroutine similar to this: sub ParseDate { ($month,$day,$year) = split /\//; } but much more detailed to handle different types of date strings. -Frank

Re: comparing dates

2002-01-07 Thread John W. Krahn
Alex Harris wrote: if I use the following to get the date of a file: use File::stat; use Time::localtime; $date_string = ctime(stat($file)-mtime); print file $file updated at $date_string\n; I get: Mon Jan 7 10:21:21 2002 Now I want to compare another file date

Re: date compare problems

2002-01-07 Thread John W. Krahn
Alex Harris wrote: Ok so I'm REALLY REALLY a newbie and this next question is going to sound like where's the spoon so you can feed me but... Here's my code and the error I got. I know it means I'm suppose to include something but I'm not sure what. You are making this _way_ too

RE: EXCEL automation

2002-01-07 Thread Ryan Guy
Maybe youre just a wuss. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Variable interpolation?

2002-01-07 Thread Mad B . Jones
06/01/02 17:20:37, Jeff 'japhy' Pinyan [EMAIL PROTECTED] a écrit: The contents of @string are raw text. You'll need to expand the variables in it manually: perldoc -q 'expand variables' That FAQ will tell you what to do. Thanks, Jeff, for taking the time to answer. My problem was, as a

Re: SubRoutine Help

2002-01-07 Thread Michael R. Wolf
[EMAIL PROTECTED] (John W. Krahn) writes: Michael R. Wolf wrote: [buggy code deleted ...] $ perl -le' @fred = qw(1 3 5 7 9); sub total { my $sum; $sum += $_ foreach (@_); } # undef from final foreach always returned print total( @fred ); ' My bad! Sorry.

who is the method cop?

2002-01-07 Thread Skip Montanaro
I'm trying to figure out Perl's object-oriented features. I'm a long-time Python programmer, so I'm well-versed in its notion of OO programming, but Perl's method definition stuff seems a bit loose. All of my Perl programming is in a Mason context, so that's where I'll pull an example. Let's

RE: EXCEL automation

2002-01-07 Thread Stout, Joel R
Not sure, but if you go to Window - Unhide you can see that the book was created successfully. Maybe a Win32 Perl Guru can help more. Joel -Original Message- From: Billie [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 7:15 AM To: [EMAIL PROTECTED] Subject: EXCEL

perl sleep

2002-01-07 Thread Scott
I have been asked to rewrite a ftp process in perl on Win32. The program will scan a directory every five minutes and if a file exists, it will ftp the file to a server. My question is, has any had an experience using the Windows Task Scheduler to do a every 5 minute process or do you think

Re: who is the method cop?

2002-01-07 Thread Peter Scott
At 12:27 PM 1/7/02 -0600, Skip Montanaro wrote: I'm trying to figure out Perl's object-oriented features. I'm a long-time Python programmer, so I'm well-versed in its notion of OO programming, but Perl's method definition stuff seems a bit loose. Yes, we like it that way :-) sub new

RE: perl sleep

2002-01-07 Thread Tisdel, Matthew
This used to be the method that MRTG used on a NT machine. The newer versions do not do this, so you will have to find older versions with docs that tell you how to do it. Actually, I remember there being an NT script, or little Perl program that added all of this for you. I got the following

Re: who is the method cop?

2002-01-07 Thread Jonathan E. Paton
I'm trying to figure out Perl's object-oriented features. I'm a long-time Python Programmer, so I'm well-versed in its notion of OO programming, but Perl's method definition stuff seems a bit loose. All of my Perl programming is in a Mason context, so that's where I'll pull an example.

RE: perl sleep

2002-01-07 Thread Stout, Joel R
Here a little daemon that runs my Perl FTP program with different job cards. It runs every 5 minutes. #!/usr/bin/perl -w use strict; use POSIX; # Start the loop for the daemon while(1) { my(@now) = localtime(); my($today) = POSIX::strftime( %m/%d/%Y, @now);

Re: Threads

2002-01-07 Thread Mark Maunder
RAHUL SHARMA wrote: Can anyone please help me if I can use threads in perl; If yes then what all library files I have to include. Thanks, Rahul. Perl supports threads, but it's not mature technology yet. You may need to compile your own version of Perl as the default install doesn't

Re: date compare problems

2002-01-07 Thread Matt C.
It looks very much like you've not installed the Date::Manip module on your system. Have you? If not try this at the command-line: perl -MCPAN -eshell then tell it: install Date::Manip And watch it roll. You may need your sys admin to run 'make install' on it, however. In fact, you may

Re: who is the method cop?

2002-01-07 Thread Peter Scott
At 01:02 PM 1/7/02 -0600, Skip Montanaro wrote: I understand the assignment to $self and $class. What I don't understand is how new and flush_buffer are associated with a specific class. For example, is there anything that keeps me from calling flush_buffer with an

Perl2Exe (or Compiled Perl) and Shipping Runnable Source

2002-01-07 Thread Morbus Iff
Hey all, To summarize, my impresssion of people's hatred of Perl2Exe or generically, compiled (hidden source) perl is: - it hides the source from the user. this goes against Perl, and you really should be using another language if you want to be such a Nazi. I totally agree with

RE: perl sleep

2002-01-07 Thread Scott
Thank you to everyone for the help. I think the timer should be easy enough to implement in perl. My concern was memory usage with the NT task scheduler and would rather have perl do the chore. At 06:52 PM 1/7/2002 +, Stout, Joel R wrote: I used to do this with NT Scheduler (if you have

Re: CGI perl html urgent

2002-01-07 Thread Prahlad Vaidyanathan
Hi, On Sun, 06 Jan 2002 Brett W. McCoy spewed into the ether: [-- snip --] You shouldn't use WordPad for writing Perl code (or any kind of code), you should get some kind of programmer's editor that can do syntax highlighting and has some kind of smarts about the syntax of the language you

Stripping records

2002-01-07 Thread Scott
Hi: I have a file that contains a header row, I want to remove the first line and start processing on the second line. Would you recommend using seek to scan for the last word in the first line? Thanks, -Scott -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

substitute all non-digits with ''. I think I saw this posted recently, but I could not find it...

2002-01-07 Thread McCollum, Frank
I want to take all non-digits and drop them out of my string. I would think it would be something like... s/!(\d+)//; but this is not the case Frank McCollum Bank Of America Securities, LLC [EMAIL PROTECTED] (704) 388-8894 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

RE: Stripping records

2002-01-07 Thread Wagner-David
If straight text, then could just read the first line and start on the second: my $MyHdrLine = FILEIN; # get first line WHILE ( FILEIN ) { } You have bypassed first line(has carriage return still with it. Now you start your processing. Wags ;)

RE: your my last hope on this cgi programming question

2002-01-07 Thread Alan C.
Hi, http://www.delphiforums.com/ I originally discovered the follows site from being a member at above site. I'm a member at above of which I can first log on there which then entitles me to freely travel/navigate follows/next site without logged on to above, membership (free)

Re: substitute all non-digits with ''. I think I saw this posted rec ently, but I could not find it...

2002-01-07 Thread Tanton Gibbs
\D means anything that is not a digit, so $str = AB123CD; $str =~ s/\D//g; will work. Also, you could use tr $str =~ tr/0-9//d; - Original Message - From: McCollum, Frank [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 07, 2002 2:52 PM Subject: substitute all non-digits

RE: substitute all non-digits with ''. I think I saw this posted recently, but I could not find it...

2002-01-07 Thread McCollum, Frank
Aha. That is very familiar. Thx. -Original Message- From: Tanton Gibbs [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 2:54 PM To: McCollum, Frank; [EMAIL PROTECTED] Subject: Re: substitute all non-digits with ''. I think I saw this posted rec ently, but I could not find it...

RE: substitute all non-digits with ''. I think I saw this posted rec ently, but I could not find it...

2002-01-07 Thread Wagner-David
Might be faster and easier to use tr: tr/0-9//c ; # take complement of what is in string1 and replace w/ string2(null in this case) Wags ;) -Original Message- From: McCollum, Frank [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 11:53 To: [EMAIL

Re: substitute all non-digits with ''. I think I saw this posted rec ently, but I could not find it...

2002-01-07 Thread John W. Krahn
Tanton Gibbs wrote: From: McCollum, Frank [EMAIL PROTECTED] I want to take all non-digits and drop them out of my string. I would think it would be something like... s/!(\d+)//; but this is not the case \D means anything that is not a digit, so $str = AB123CD; $str =~ s/\D//g;

Re: Stripping records

2002-01-07 Thread Jonathan E. Paton
Hi: I have a file that contains a header row, I want to remove the first line and start processing on the second line. Would you recommend using seek to scan for the last word in the first line? Another solution is: # Skip over line 1, adds overhead to all iterations though. while

Fw: substitute all non-digits with ''. I think I saw this posted rec ently, but I could not find it...

2002-01-07 Thread Tanton Gibbs
- Original Message - From: Tanton Gibbs [EMAIL PROTECTED] To: Tanton Gibbs [EMAIL PROTECTED] Sent: Monday, January 07, 2002 3:06 PM Subject: Re: substitute all non-digits with ''. I think I saw this posted rec ently, but I could not find it... oops :) forgot the c on my tr $str =~

Re: substitute all non-digits with ''. I think I saw this postedrec ently, but I could not find it...

2002-01-07 Thread John W. Krahn
Wagner-David wrote: Might be faster and easier to use tr: tr/0-9//c ; # take complement of what is in string1 and replace w/ string2(null in this case) This will replace the complement of 0-9 with the complement of 0-9. It doesn't change the original string at all. You

PerlEz question

2002-01-07 Thread SathishDuraisamy
This is more like a non-PERL question...but since it involves PerlEz.dll I am addressing this mailing-list :-) I need to have my servlets invoke a PERL subroutine through PerlEz.dll (using JNI) on the web server side. The PERL subroutine may take few seconds to perform its job. PerlEz

Re: who is the method cop?

2002-01-07 Thread Michael Fowler
On Mon, Jan 07, 2002 at 12:27:26PM -0600, Skip Montanaro wrote: I understand the assignment to $self and $class. What I don't understand is how new and flush_buffer are associated with a specific class. For example, is there anything that keeps me from calling flush_buffer with an instance

About DBD-ODBC Module

2002-01-07 Thread Jose Vicente
I can't install the module because I get some errors, when I read README file i find this: BUILDING: set-up these environment variables: DBI_DSN The dbi data source, e.g. 'dbi:ODBC:YOUR_DSN_HERE' DBI_USER The username to use to connect to the database DBI_PASS The

global substitution

2002-01-07 Thread Scott
Hi all: I have two files that I am reading into an array, I want to substitute a period and a dash, actually I want to remove them completely. Here is my code: while (my $record = QUOTEP){ my $policies = POLTEP; my @fields = split( /\t/, $record ); my @policies = split( /\t/, $policies );

RE: global substitution

2002-01-07 Thread McCollum, Frank
$record =~ s/[\.\-]//g; if it is a '.' or a '-' replace it with nothing. Actually, I don't even think the [] is necessary, so it could just be: $record =~ s/\.\-//g; -Original Message- From: Scott [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 4:02 PM To: [EMAIL PROTECTED]

RE: global substitution

2002-01-07 Thread Jeff 'japhy' Pinyan
On Jan 7, McCollum, Frank said: $record =~ s/[\.\-]//g; Neither of those two slashes are needed. if it is a '.' or a '-' replace it with nothing. Actually, I don't even think the [] is necessary, so it could just be: $record =~ s/\.\-//g; No, the [...] is needed. Otherwise, you're removing

Re: global substitution

2002-01-07 Thread Jose Vicente
I think: foreach $value(@fields) { $value = s/\.\-//g; } - Original Message - From: Scott [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, January 07, 2002 4:02 PM Subject: global substitution Hi all: I have two files that I am reading into an array, I want to substitute a

RE: global substitution

2002-01-07 Thread Scott
At 04:04 PM 1/7/2002 -0500, Jeff 'japhy' Pinyan wrote: No, the [...] is needed. Otherwise, you're removing all occurrences of the string .- which is not what was intended. So s/[.-]+//g, or perhaps tr/.-//d; I might have worded it wrong, I need to replace a period (.) and a dash (-), they may

RE: global substitution

2002-01-07 Thread McCollum, Frank
so, if a character is inside of square brackets [], then perl recognizes that it is part of a character class and never uses it as a quantifier or special character?? -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Monday, January 07, 2002 4:04 PM To:

RE: global substitution

2002-01-07 Thread Jeff 'japhy' Pinyan
On Jan 7, Scott said: At 04:04 PM 1/7/2002 -0500, Jeff 'japhy' Pinyan wrote: No, the [...] is needed. Otherwise, you're removing all occurrences of the string .- which is not what was intended. So s/[.-]+//g, or perhaps tr/.-//d; I might have worded it wrong, I need to replace a period (.)

RE: global substitution

2002-01-07 Thread Jeff 'japhy' Pinyan
On Jan 7, McCollum, Frank said: so, if a character is inside of square brackets [], then perl recognizes that it is part of a character class and never uses it as a quantifier or special character?? Very few characters need escaping a char class. ] does (unless it's the first character of the

rand() function

2002-01-07 Thread Robert Howard
Is there a statistically better solution for generating random numbers than Perl's built in rand() function? I noticed a couple modules on CSPAN, but are they any better? I haven't done a true test of the spread regular rand() gives, but it seems to me to give numbers closer to the top of the

CGI::FastTemplate confusion

2002-01-07 Thread webmaster
Hello all, I've just begun to use CGI::FastTemplate and I get the feeling I am misunderstanding something. I have read the perldoc repeatedly, but I guess it's just not sinking in. If anyone can lend some insight, it would be much appreciated. I have done the following: 1) Created an HTML

Re: CGI::FastTemplate confusion

2002-01-07 Thread Peter Cline
At 04:36 PM 1/7/02 -0500, you wrote: Hello all, I've just begun to use CGI::FastTemplate and I get the feeling I am misunderstanding something. I have read the perldoc repeatedly, but I guess it's just not sinking in. If anyone can lend some insight, it would be much appreciated. I have done

Re: CGI::FastTemplate confusion

2002-01-07 Thread Jeff 'japhy' Pinyan
On Jan 7, [EMAIL PROTECTED] said: 1) Created an HTML template file which contains HTML code (of course) and the names of variables that are populated in my script. For example, if the following line is in my template file: tdHello $name/td Then somewhere in my perl script, you will find: my

Re: CGI::FastTemplate confusion

2002-01-07 Thread webmaster
Hello Peter et al, This probably should be addressed to [EMAIL PROTECTED], but since I think I can help, here goes. Sorry about that; I thought about it only after hitting send. You need to use the assign method before the parse. tpl-assign($hashref) This method expects a hasref as an

RE: rand() function

2002-01-07 Thread McCollum, Frank
I did a random sampling of 10,000 random numbers in two separate groups : for (0..1) { print rand().\n } It seemed to consistently revert towards a mean of 0.50 (i.e. results(1) = 0.503; results(2) = 0.498). I also broke those into groups of 100 and seemed to get the same results. That

RE: global substitution

2002-01-07 Thread Scott
At 04:12 PM 1/7/2002 -0500, Jeff 'japhy' Pinyan wrote: So s/[.-]+//g, or perhaps tr/.-//d; I might have worded it wrong, I need to replace a period (.) and a dash (-), they may not be together ie (.-), they could be in any of the fields in the array. Some of the fields are numbers (5000.00),

RE: global substitution

2002-01-07 Thread Jeff 'japhy' Pinyan
On Jan 7, Scott said: At 04:12 PM 1/7/2002 -0500, Jeff 'japhy' Pinyan wrote: So s/[.-]+//g, or perhaps tr/.-//d; I might have worded it wrong, I need to replace a period (.) and a dash (-), they may not be together ie (.-), they could be in any of the fields in the array. Some of the fields

Re: who is the method cop?

2002-01-07 Thread Skip Montanaro
Jonathan To make this clear, in Perl OOP you use: Jonathan Packages as classes. Jonathan Subroutines as instance methods/class methods. Jonathan Package variables for class variables. Jonathan Blessed variables for object instances. Thanks, this is the correspondence I was

A tk question

2002-01-07 Thread Murzc
I have a TK issue. This code creates the initial TK box. use vars qw/$TOP/; $TOP = Tk::MainWindow-new; $TOP-title('blah blah'); $TOP-configure(-background = lc('PeachPuff1')); etc.(a lot more code) When the user clicks the button of his choice, the TK box disappears into the task

RE: global substitution

2002-01-07 Thread Scott
At 05:01 PM 1/7/2002 -0500, Jeff 'japhy' Pinyan wrote: Anyway, you want s/[.:-]+//g, or something to that effect. Be warned, though, that [.-:] is NOT what you want, since that means characters from '.' to '-', which is the following list: . / 0 1 2 3 4 5 6 7 8 9 : And that was my newbie

Re: rand() function

2002-01-07 Thread John W. Krahn
Robert Howard wrote: Is there a statistically better solution for generating random numbers than Perl's built in rand() function? I noticed a couple modules on CSPAN, but are they any better? I haven't done a true test of the spread regular rand() gives, but it seems to me to give numbers

Re: date compare problems

2002-01-07 Thread John W. Krahn
John W. Krahn wrote: #!/usr/bin/perl -w use strict; # Get the mtime from two files my $date1 = (stat $file)[9]; my $date2 = (stat 'zzp2.txt')[9]; print scalar $date1, ' ', scalar $date2, \n; Sorry, I was typing too fast. This line should be: print scalar localtime($date1), ' ',

Re: CGI perl html urgent

2002-01-07 Thread Bud Rogers
Prahlad Vaidyanathan wrote: Does emacs do syntax highlighting ? I've been using Vim for a very long time now, but last time I checked Emacs didn't do it. Xemacs does. IMO not as good as Vim, but very good nonetheless. It's been a very long time since I used Emacs, but I'm pretty sure it

how to change directory in AIX in Perl ?

2002-01-07 Thread Families Laws
I tried to do a change directory and then do a tar of the directory: My program: system(cd /usr/apps); system(tar -cf tarfile.tar DDA/*); It looks like the cd command does not work ? Thanks in advance. __ Do You Yahoo!? Send FREE video

Re: how to change directory in AIX in Perl ?

2002-01-07 Thread Jeff 'japhy' Pinyan
On Jan 7, Families Laws said: I tried to do a change directory and then do a tar of the directory: Use the chdir() function. system(cd /usr/apps); That creates a new shell, exectes 'cd /usr/apps', and then closes the shell. End result: you've moved nowhere. -- Jeff japhy Pinyan

Password ---- cgi-perl-html

2002-01-07 Thread Luinrandir Hernson
I am trying to password protect part of my website. I have the password form page done. But how to I make the pages protected so you have to go through the password page? Do i do it by passing hidden inputs from page to page? How do I force people coming in around the password page to go through

Re: Password ---- cgi-perl-html

2002-01-07 Thread Eric
if you're running Apache, look into .htaccess for password protecting certain parts of your site.. no reason to make something harder than it has to be. ~Eric On Monday, January 7, 2002, at 07:58 PM, Luinrandir Hernson wrote: ect part of my website. I have the password form -- To

  1   2   >