Weekly list FAQ posting

2002-07-11 Thread casey
NAME beginners-faq - FAQ for the beginners-cgi mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email

mail filters

2002-07-11 Thread David Gerler
Hi, I am trying to setup mail filters on my domain that is on a virtual host. I have a copy of TPJ #18 (Summer 2000) and have read the article about mail filtering. The problem I am having is finding out where to put the .forward or .qmail file to direct mail to my script. I have

Re: mail filters

2002-07-11 Thread fliptop
David Gerler wrote: Hi, I am trying to setup mail filters on my domain that is on a virtual host. I have a copy of TPJ #18 (Summer 2000) and have read the article about mail filtering. The problem I am having is finding out where to put the .forward or .qmail file to direct mail

RE: Accessing Extra Information in die()

2002-07-11 Thread Camilo Gonzalez
Will $! suffice for you? -Original Message- From: John Pitchko [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 10:21 AM To: [EMAIL PROTECTED] Subject: Accessing Extra Information in die() Hello, I wrote a custom error message to be displayed in my CGI pages instead of the

RE: Accessing Extra Information in die()

2002-07-11 Thread Nikola Janceski
why aren't you using: use CGI::Carp 'fatalsToBrowser'; -Original Message- From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 11:27 AM To: 'John Pitchko'; [EMAIL PROTECTED] Subject: RE: Accessing Extra Information in die() Will $! suffice for

Fw: What is this string type? How to play with?

2002-07-11 Thread Jonathan
What Connie is looking for is something that translates an ordinary string to a urlencoded string, I don't know what does that but I got around the problem myself by using the modules: LWP::UserAgent; HTTP::Request::Common; Jonathan - Original Message - From: [EMAIL PROTECTED] To:

RE: Accessing Extra Information in die()

2002-07-11 Thread John Pitchko
I am, but I created my own custom Error subroutine/module to display information instead of just calling the die() function and displaying a bunch of crazy technical information to the user. As for $!, it only passes the type of error and not the file and line numbers. John Pitchko Data

Re: mail filters

2002-07-11 Thread fliptop
David Gerler wrote: Thanks. It seems to find it but it kills all mail delivery. This is what I am putting in the text file: |/home/gerleren/test.pl Where test is a test script copied from TPJ that should kill only specific email addresses (not the exact duplicate of TPJ

RE: Accessing Extra Information in die()

2002-07-11 Thread Bob Showalter
-Original Message- From: John Pitchko [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 12:42 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Accessing Extra Information in die() I am, but I created my own custom Error subroutine/module to

Re: mail filters

2002-07-11 Thread David Gerler
The following message was sent by fliptop [EMAIL PROTECTED] on Thu, 11 Jul 2002 11:11:01 -0400. David Gerler wrote: Hi, I am trying to setup mail filters on my domain that is on a virtual host. I have a copy of TPJ #18 (Summer 2000) and have read the article about mail

Re: What is this string type? How to play with?

2002-07-11 Thread Connie Chan
Hi David, Hehe... Thanks in advice. Anyway what I am looking for is making those stuff back to what they looks like when they come, that is, the $input in your script... However, may I have some questions about your sample ? =) my @variables = split(/[\\;]/, $input); ; has no problem, why

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Oops, let me make one small revision to my code: if (exists($form_vars{$name})) { # if this is the first of this form input name. should be if (!exists($form_vars{$name})) { # if this is the first of this form input name. Sorry about that all. Regards, David - Original Message -

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Sorry, one more oops $form_vars{$name} = [($form_vars{$name})] if (ref($form_vars{$name} ne ARRAY)); should be $form_vars{$name} = [($form_vars{$name})] if (ref($form_vars{$name}) ne ARRAY); Sorry about these, there were a few recommendations I've received, and I had not implemented them in

Executing cgi from perl script

2002-07-11 Thread McElwee, Shane
Hi, I want to execute a cgi script from a perl script that first updates the cgi script. The basic code I'm using to open and update the file is: print Content-type: text/html\n\n; open RESULT, template.cgi; while (RESULT) { s/Insert content here/$output/g; print; } close RESULT; The

Less than a second?

2002-07-11 Thread Octavian Rasnita
Hi all, I want to calculate how much time a Perl script runs. Can you tell me how to calculate using fractions of a second? The script may run in less than a second, but Perl always tell me 1 second, or 2 seconds, etc. Thank you. Teddy Center: http://teddy.fcc.ro/ Mail: [EMAIL PROTECTED]

Re: perl equivalent of `trap'

2002-07-11 Thread Felix Geerinckx
on Thu, 11 Jul 2002 06:43:34 GMT, Harry Putnam wrote: Probably get horse whipped for this one, but what is the perl equivalent of shell `trap' function. `perldoc -f trap' lets me know there isn't one of the same name. Where does one read about it? Read about 'Signals' in

perl help

2002-07-11 Thread Javeed SAR
HI, i want to push the contents of array MSG (Given below) to a file call testblat.txt. so that i can assign as follows: $message = testblat.txt ; How to do it?? my MSG = (Trigger activation mail notification for controlled action on VOB

Re: How to do a consecutive grep?

2002-07-11 Thread Harry Putnam
Jeremy Vinding [EMAIL PROTECTED] writes: @array = SOME_FILE; @res_grep1 = grep /pattern1/, @array; @res_grep2 = grep /pattern1/, @res_grep1; @res_grep3 = grep /pattern1/, @res_grep2; how about something like: @res = grep { /pattern1/ /pattern2/ /pattern3/ } SOME_FILE; Nobody has

Weekly list FAQ posting

2002-07-11 Thread casey
NAME beginners-faq - FAQ for the beginners mailing list 1 - Administriva 1.1 - I'm not subscribed - how do I subscribe? Send mail to [EMAIL PROTECTED] You can also specify your subscription email address by sending email to (assuming [EMAIL PROTECTED] is your email address):

re: open command

2002-07-11 Thread William Black
Hi all, I'm using the open command with the pipe. For some reason this doesn't work. Can anyone tell me why? open(MAIL,| mail -s $subject $contact[0]-{email}) || die can't create; William Black _ MSN Photos is the easiest

re: open command

2002-07-11 Thread Felix Geerinckx
on Thu, 11 Jul 2002 12:03:06 GMT, William Black wrote: I'm using the open command with the pipe. For some reason this doesn't work. Can anyone tell me why? open(MAIL,| mail -s $subject $contact[0]-{email}) || die can't create; Works for me. Could you be more specific wrt doesn't work?

re: open command

2002-07-11 Thread William Black
The info in the two vars are correct. What doesen't work is when the email is sent it doesn't include the subject line and I can't tell why. William From: Felix Geerinckx [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: re: open command Date: 11 Jul 2002 12:24:31 - on Thu, 11 Jul 2002

RE: Easy way to compare 2 perl lists (arrays)?

2002-07-11 Thread Bob Showalter
-Original Message- From: Rupert Heesom [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 5:54 AM To: 'Bob Showalter' Cc: [EMAIL PROTECTED] Subject: RE: Easy way to compare 2 perl lists (arrays)? Bob: I like your efficient solution, but I want to clarify what's

Re: Date and Time

2002-07-11 Thread zentara
On Wed, 10 Jul 2002 11:52:55 -0400, [EMAIL PROTECTED] wrote: This is what I have now. ... The only problem seems to be the use strict; directive if I take this out it works fine So I guess I need to know if the use strict; directive is really necessary and if so how do I get around it?

Re: require returns no value ?

2002-07-11 Thread zentara
On Thu, 11 Jul 2002 06:14:53 +0800, [EMAIL PROTECTED] (Connie Chan) wrote: Hi all, I have an array like this @path = ( 'C:\path1\script1.pl' , 'C:\path1\script2.pl' , 'C:\path2\script1.pl' , 'C:\path2\script2.pl' ); Then I tried this : require $_ for (@path); It goes fail... Questions

RE: open command

2002-07-11 Thread LoBue, Mark
-Original Message- From: William Black [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 5:32 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: re: open command The info in the two vars are correct. What doesen't work is when the email is sent it doesn't include

RE: search and replace problem

2002-07-11 Thread Nikola Janceski
You are only opening the file for read. If you want to change the file you have to write it somewhere. =) -Original Message- From: Johnson, Shaunn [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 10:52 AM To: [EMAIL PROTECTED] Subject: search and replace problem Howdy:

Need timegm sample

2002-07-11 Thread chris
use Time::Local; my $TimeInSeconds; #convert broken-down time to seconds in UTC $TimeInSeconds = timegm($sec,$min,$hour,$mday,$mon,$year,$wday,$yday); #snip snip snip When I use the following in perl 5.6.1, the script terminates immediately. What is wrong? $TimeInSeconds =

RE: Easy way to compare 2 perl lists (arrays)?

2002-07-11 Thread Rupert Heesom
Bob: I like your efficient solution, but I want to clarify what's actually happening in the line, especially the grep stuff. I know the { s// } is a substitution regexp. It's looking for a filename ending in .tiff, then substituting .pdf for .tiff. To me the subst regexp looks like a file

Script examples

2002-07-11 Thread zanardi2k2
Is there a resource for script examples on the Internet? I installed ActivePerl on a Win2k machines, are there any particular advice regarding using Perl on a Win32 system? Thank you all in advance. -- Zanardi2k2 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Can Perl interact with XML?

2002-07-11 Thread Rupert Heesom
My company is probably going to be putting a data infrastructure together using XML. A colleague of mine talks about PHP which interacts with XML. I would like to know if Perl interacts with XML at all? I have several textbooks on Perl, including the Perl Cookbook. I haven't found any

RE: Need timegm sample

2002-07-11 Thread Nikola Janceski
What no error messages? Just terminates? What about using -w or use warnings? are you printing something? More info required. -Original Message- From: chris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 9:17 PM To: [EMAIL PROTECTED] Subject: Need timegm sample use

passing hash to a subroutine

2002-07-11 Thread rory oconnor
Is it possible to pass a hash into a subroutine to be used as a local variable? I'm trying to do this: ($rows, %results) = Select($mytable, $where_f1, $compare1, $where_v1, @quick_check, %field_values); sub Select { my($db_table, $where_field, $comparison, $where_value,@fieldlist, %values) =

Re: Using grep with Win32 perl?

2002-07-11 Thread David T-G
Anders, et al -- ...and then Anders Holm said... % % [snip] % % Why do you think you can't do this? The command is all right and % there is not reason why would grep() work differently under Unix and % Windows. % % Jenda % % Jenda, I think he's thinking of the command line version of

Re: Can Perl interact with XML?

2002-07-11 Thread Janek Schleicher
Rupert Heesom wrote at Thu, 11 Jul 2002 13:49:56 +0200: My company is probably going to be putting a data infrastructure together using XML. A colleague of mine talks about PHP which interacts with XML. I would like to know if Perl interacts with XML at all? I have several textbooks on

Re: passing hash to a subroutine

2002-07-11 Thread George Schlossnagle
The last item that you pass to a perl subroutine can be a array or a hash, but none but the last, since oerl will greedy-match your arrays when you assign them in your subroutine. The way around this is to pass them in by reference: ($rows, %results) = Select($mytable, $where_f1, $compare1,

RE: Using grep with Win32 perl?

2002-07-11 Thread Powell, Ron
Slightly OT: I did a google search some time ago and found a grep command line util for windows... A quick google today produced this link: http://www.interlog.com/~tcharron/grep.html Personally, since switching to linux at home, I find myself trying to use all manner of unix commands on my

Re: changing %ENV in parent

2002-07-11 Thread David T-G
Peter, et al -- ...and then Peter Scott said... % % At 08:37 AM 7/9/02 -0500, David T-G wrote: % % ...and then Peter Scott said... % % % % At 09:33 AM 7/6/02 -0500, David T-G wrote: % % I want to add to $ENV{'PATH'} in the parent process from my script. ... % `myscript.pl bash` %

Re: Can Perl interact with XML?

2002-07-11 Thread Wiggins d'Anconia
Perl has a lot of resources for working with XML in most of the standard ways, aka DOM, SAX, etc. O'Reilly has a Perl and XML book that is a very good read for an experienced perl programmer (not advanced just experienced) which also provides a good overview of XML concepts in general. I

Re: Can Perl interact with XML?

2002-07-11 Thread Wiggins d'Anconia
Perl has a lot of resources for working with XML in most of the standard ways, aka DOM, SAX, etc. O'Reilly has a Perl and XML book that is a very good read for an experienced perl programmer (not advanced just experienced) which also provides a good overview of XML concepts in general. I

Re: require returns no value ?

2002-07-11 Thread Jenda Krynicky
I have an array like this @path = ( 'C:\path1\script1.pl' , 'C:\path1\script2.pl' , 'C:\path2\script1.pl' , 'C:\path2\script2.pl' ); Then I tried this : require $_ for (@path); It goes fail... Questions : 1. How can I know if a require is success or not ? 2. Anything wrong

Re: search and replace problem

2002-07-11 Thread Chris Ball
Shaunn == Shaunn Johnson Johnson writes: Shaunn But nothing is happening (that I can see). What am I doing Shaunn wrong? This is a FAQ. Your code seems fine in as far as it goes - it iterates through files, and modifies $_ with a regular expression occasionally. Here's the

Re: A few questions

2002-07-11 Thread Matija Papec
On 10 Jul 2002 11:06:03 -0400, [EMAIL PROTECTED] (Chas Owens) wrote: movie listing and when one item is selected via remote, 'system' invokes mplayer which leaves main gtk window blank after it finishes? :) Perl 5.6.x is not threaded, so anything that blocks (like system) will keep the gui

printing to 2 seperate places simultaneously

2002-07-11 Thread HENRY,MARK (HP-Roseville,ex1)
Hi All, I want a script to print log messages to a file, and within the same statement, to the screen (STDOUT) simultaneously. Can the print statement be coerced into doing this, or is there another way of achieving the same result? Many thanks, Mark -- To unsubscribe, e-mail: [EMAIL

Re: search and replace problem

2002-07-11 Thread Jeff 'japhy' Pinyan
On Jul 11, Johnson, Shaunn said: * open each file * search and replace the old pattern to a new pattern (should only be one occurrence) * close file You're not storing the results anywhere. You can't expect Perl to modify the file for you automagically. But nothing is happening (that I can

Re: passing hash to a subroutine

2002-07-11 Thread Jeff 'japhy' Pinyan
On Jul 11, rory oconnor said: Is it possible to pass a hash into a subroutine to be used as a local variable? I'm trying to do this: The arguments sent to a function are flattened into one big list. There's no way to know where your array ends and your hash begins. Furthermore, doing $x =

Re: Can Perl interact with XML?

2002-07-11 Thread Joe Raube
Also see the columns on xml.com http://www.xml.com/pub/q/perlxml -Joe --- Wiggins d'Anconia [EMAIL PROTECTED] wrote: Perl has a lot of resources for working with XML in most of the standard ways, aka DOM, SAX, etc. O'Reilly has a Perl and XML book that is a very good read for an

Re: passing hash to a subroutine

2002-07-11 Thread Jenda Krynicky
From: George Schlossnagle [EMAIL PROTECTED] The last item that you pass to a perl subroutine can be a array or a hash, but none but the last, since oerl will greedy-match your arrays when you assign them in your subroutine. The way around this is to pass them in by reference: ($rows,

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Connie, Something like the following is probably what you are looking for. Of course what you should be doing is using CGI.pm or some other tested form of input retrieval. my @variables = split(/[\\;]/, $input);

Re: Script examples

2002-07-11 Thread Connie Chan
You better know what do you need first.. but if you want to know what you can demand, you may reference to : C:\YourPerlFolder\html\site\lib\Win32 C:\YourPerlFolder\html\site\lib\Win32API after you know what are libs inside, you can look up example for certain purpose by search engine. Rgds,

RE: Am I being stupid here... or?

2002-07-11 Thread drieux
On Thursday, July 11, 2002, at 07:17 , Jason Frisvold wrote: Does this do what I think it does? Namely, converts the == or eq to the proper operator based on the type of call being made? jason thought I would toss this back at the list... [..] I presume you are asking about: or adopt a

Optimize some regex's

2002-07-11 Thread Jackson, Harry
Can anyone make this a bit faster for me. I am loading a database from Oracle into mysql (dont ask). These conversions are taking a long time and are making the browser time out. The $table_name[7] is a worklog that can be 2000 characters long and $table_name[2] is an epoch date. while

RE: Optimize some regex's

2002-07-11 Thread Shishir K. Singh
Try using the fetchrow_arrayref. I think it's faster as it does not have to copy the variables. Since your length is 2000, it may help a lot. -Original Message- From: Jackson, Harry [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 12:10 PM To: '[EMAIL PROTECTED]' Subject:

Re: printing to 2 seperate places simultaneously

2002-07-11 Thread Felix Geerinckx
on Thu, 11 Jul 2002 15:49:59 GMT, Mark Henry wrote: I want a script to print log messages to a file, and within the same statement, to the screen (STDOUT) simultaneously. Can the print statement be coerced into doing this, or is there another way of achieving the same result? If you have

SOLVED: RE: search and replace problem

2002-07-11 Thread Johnson, Shaunn
--thanks all (chris, jeff, nikola) --jeff: your suggestion worked like elfin magick. thanks! --(note: i had to do this twice ... in the search pattern --i forgot the $ in newpattern ... oops.) --anyways ... -X -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]

Re: Optimize some regex's

2002-07-11 Thread Jenda Krynicky
From: Jackson, Harry [EMAIL PROTECTED] Can anyone make this a bit faster for me. I am loading a database from Oracle into mysql (dont ask). These conversions are taking a long time and are making the browser time out. The $table_name[7] is a worklog that can be 2000

Re: printing to 2 seperate places simultaneously

2002-07-11 Thread Jenda Krynicky
From: HENRY,MARK (HP-Roseville,ex1) [EMAIL PROTECTED] I want a script to print log messages to a file, and within the same statement, to the screen (STDOUT) simultaneously. Can the print statement be coerced into doing this, or is there another way of achieving the same

removing non-printable char

2002-07-11 Thread Steven_Massey
Hi all I am trying to create a sub routine to remove non-printable chars from a string, and am stuck on how I should app roach this. Any thoughts ?? Much appreciated.. Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: removing non-printable char

2002-07-11 Thread Jeff 'japhy' Pinyan
On Jul 11, [EMAIL PROTECTED] said: I am trying to create a sub routine to remove non-printable chars from a string, and am stuck on how I should approach this. Well, you don't need a subroutine -- just a substitution. If you're using perl 5.6, you can do: $string =~ s/[[^:print:]]+//g;

Use vs Require

2002-07-11 Thread Jeff
I'm new to perl, but have a background in C. Can someone tell me what is the difference between 'use' and 'require'? When do you use one and not the other? Seems they both are comparable to a C header file (.h). Thanks in advance. Jeff

Matching IPs or robots

2002-07-11 Thread KEVIN ZEMBOWER
I'm trying to do a quick-n-dirty (well, I've been at work on it three hours now) analysis of Apache web logs. I'm trying to count the number of records from robots or spiders. For my purposes, a robot or spider is a request from either an unresolved IP address, or one that has bot, spider, crawl

RE: Use vs Require

2002-07-11 Thread Shishir K. Singh
I'm new to perl, but have a background in C. Can someone tell me what is the difference between 'use' and 'require'? When do you use one and not the other? Seems they both are comparable to a C header file (.h). Thanks in advance. use is resolved during compile time whereas require is

use strict - config file?

2002-07-11 Thread rory oconnor
I want to use strict in a script I'm writing. I have a separate config file I am using (require config.pl;) with a bunch of global variables. But my script doesn't seem to want to recognize those variables unless they are actually declared in the body of the script itself. I tried using my

Re: removing non-printable char

2002-07-11 Thread Steven_Massey
Jeff - thanks I will try it out. your answer raises another Q. what would I type in perldoc -format to be able to dig for that info ??? Jeff 'japhy' Pinyan [EMAIL PROTECTED] on 07/11/2002 05:42:40 PM Please respond to [EMAIL PROTECTED] To:[EMAIL PROTECTED] cc:

RE: printing to 2 seperate places simultaneously

2002-07-11 Thread Timothy Johnson
Or if you don't have the option of installing a new module, you can make a poor man's version with a sub. The example below will take a string passed to it and print it to tee.txt and the screen. ### sub Tee{ open(TEEFILE,tee.txt); print TEEFILE $_[0];

Re: removing non-printable char

2002-07-11 Thread Jeff 'japhy' Pinyan
On Jul 11, [EMAIL PROTECTED] said: what would I type in perldoc -format to be able to dig for that info ??? Regex-related stuff is in perlre. perldoc perlre -- Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734

Re: perl help

2002-07-11 Thread Tim Musson
Hey Javeed, My MUA believes you used Internet Mail Service (5.5.2653.19) to write the following on Thursday, July 11, 2002 at 5:06:22 AM. i want to push the contents of array @MSG (Given below) to a file call testblat.txt. Running Blat are you? -- just curious, why are you using perl to

RE: Use vs Require

2002-07-11 Thread Peter Scott
At 01:27 PM 7/11/02 -0400, Shishir K. Singh wrote: I'm new to perl, but have a background in C. Can someone tell me what is the difference between 'use' and 'require'? When do you use one and not the other? Seems they both are comparable to a C header file (.h). Thanks in advance.

RE: Use vs Require

2002-07-11 Thread Bob Showalter
-Original Message- From: Jeff [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 1:24 PM To: [EMAIL PROTECTED] Subject: Use vs Require I'm new to perl, but have a background in C. Can someone tell me what is the difference between 'use' and 'require'? When do you

Global/local variable declaration

2002-07-11 Thread Rory O'Connor
I want to use strict in a script I'm writing. I have a separate config file I am using (require config.pl;) with a bunch of global variables. But my script doesn't seem to want to recognize those variables unless they are actually declared in the body of the script itself. I tried using my

Re: use strict - config file?

2002-07-11 Thread Peter Scott
At 12:27 PM 7/11/02 -0500, rory oconnor wrote: I want to use strict in a script I'm writing. I have a separate config file I am using (require config.pl;) with a bunch of global variables. But my script doesn't seem to want to recognize those variables unless they are actually declared in the

Fw: Re: Date and Time

2002-07-11 Thread jffusion
first off let me say thank you for the help I know I am a pest, but I am learning a lot Anyway I fixed everything so it works fine in my editor However now it refuses to work in my browser. I keep getting an error 500 Which I can only assume is because of my html header. I checked the subject

Re: use strict - config file?

2002-07-11 Thread rory oconnor
Peter, Thanks so much for the help! Unfortunately I am not using 5.6. I'd like to, but it's not up to me to do the upgrading! Which parts are 5.6-only, and how can I work around? Thanks, Rory On Thu, 2002-07-11 at 13:09, Peter Scott wrote: At 12:27 PM 7/11/02 -0500, rory oconnor wrote: I

RE: What is this string type? How to play with?

2002-07-11 Thread Nikola Janceski
[offtopic] STOP THE CROSS POSTING MADNESS you will notice that I removed perl-cgi from this reply. Please use this to continue the thread. Thank you -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 2:01 PM To: Connie Chan; [EMAIL

Re: Global/local variable declaration

2002-07-11 Thread Connie Chan
Right, I have facing the same problem too... and I just use this method to overcome : # globalVars.pl use strict; sub tellPath { my ($request) = @_; my %GlobalVars; $GlobalVars{PathA} = '/usr/bin/perl/'; $GlobalVars{PathB} = '/usr/home/'; . if ($request)

Re: Global/local variable declaration

2002-07-11 Thread Jeff 'japhy' Pinyan
On Jul 11, Rory O'Connor said: I want to use strict in a script I'm writing. I have a separate config file I am using (require config.pl;) with a bunch of global variables. But my script doesn't seem to want to recognize those variables unless they are actually declared in the body of the

Re: Global/local variable declaration

2002-07-11 Thread Jeff 'japhy' Pinyan
On Jul 12, Connie Chan said: # globalVars.pl use strict; sub tellPath { my ($request) = @_; my %GlobalVars; $GlobalVars{PathA} = '/usr/bin/perl/'; $GlobalVars{PathB} = '/usr/home/'; . if ($request) { return $GlobalVars{$request} } else { return

source a script from with perl

2002-07-11 Thread Carson Wilcox
I have a need to source a ksh script from within a perl script. Does anyone know if this is possible and how to do it. Thanks, Carson -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: use strict - config file?

2002-07-11 Thread Peter Scott
At 01:19 PM 7/11/02 -0500, rory oconnor wrote: Peter, Thanks so much for the help! Unfortunately I am not using 5.6. I'd like to, but it's not up to me to do the upgrading! Which parts are 5.6-only, and how can I work around? Altered for 5.004... if your perl is older than that, it's time to

Re: Global/local variable declaration

2002-07-11 Thread Connie Chan
H Thanks alot, I just learnt 'our' from this case. But perhaps I still not know in depth of 'our', so I still have something wondering... What will happen when I use 'our' in the required file, and also so the same var name in the entire script ? Isn't it confusing ? Maybe I am using a

Re: use strict - config file?

2002-07-11 Thread rory oconnor
Thanks so much for your help Peter. I'm getting a grasp of this. However, I have been using a separate file containing subroutines shared by a few scripts. They have worked previously because I was just requiring it, and all my variables were global. I set up my config file as a package

Syntax error in Win32:CopyFile()

2002-07-11 Thread Rupert Heesom
Hi all: I'm stuck again! I'm trying to copy a file using Win32::CopyFile, and the ActiveState debugger actually lets me run the script without complaining Until I get to the said line! The stdout error I get is: C:\Perl\TIFFPDFperl -d tiffpdf.pl usage: Win32::CopyFile($from, $to,

Is there a perl module that allows access to Notes on NT box from a Red hat Box

2002-07-11 Thread FLAHERTY, JIM-CONT
Is there a perl module that allows access to Notes on NT box from a Red hat Box?

setting permissions in open

2002-07-11 Thread Wiggins d'Anconia
Couple questions about the default setting of permissions on files written with open Background: I have a long time running cgi script that takes multipart uploads of files and stores them to the local server. Below is *almost* the exact code I have written (post input checking,

Re: use strict - config file?

2002-07-11 Thread Peter Scott
At 03:02 PM 7/11/02 -0500, rory oconnor wrote: Thanks so much for your help Peter. I'm getting a grasp of this. However, I have been using a separate file containing subroutines shared by a few scripts. They have worked previously because I was just requiring it, and all my variables were

How to pipe perl script

2002-07-11 Thread mperl
hello, my current project involves piping data to the perl script. perlscript.pl | cat data_file but unfortunately, the data_file is printed out by cat command how would i pipe data to perl script so that only the program did the output? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: How to pipe perl script

2002-07-11 Thread Felix Geerinckx
on Thu, 11 Jul 2002 20:35:45 GMT, wrote: hello, my current project involves piping data to the perl script. perlscript.pl | cat data_file but unfortunately, the data_file is printed out by cat command If you want to pipe data *to* the Perl program, it should be on the right of the pipe

RE: How to pipe perl script

2002-07-11 Thread Nikola Janceski
you are piping the wrong way. cat data_file | perlscript.pl =) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 11, 2002 4:36 PM To: [EMAIL PROTECTED] Subject: How to pipe perl script hello, my current project involves piping data to

Re: setting permissions in open

2002-07-11 Thread Wiggins d'Anconia
So often your question has the answer :-)naturally after some more thought I checked to see if perl had a builtin for chmod, and to little surprise it did. So I am now using perl's builtin chmod and things are happy again, however, I am still curious about open's ability to do this rather

Re: Optimize some regex's

2002-07-11 Thread John W. Krahn
Jenda Krynicky wrote: From: Jackson, Harry [EMAIL PROTECTED] Can anyone make this a bit faster for me. I am loading a database from Oracle into mysql (dont ask). These conversions are taking a long time and are making the browser time out. The $table_name[7] is a

Re: removing non-printable char

2002-07-11 Thread John W. Krahn
Jeff 'Japhy' Pinyan wrote: On Jul 11, [EMAIL PROTECTED] said: I am trying to create a sub routine to remove non-printable chars from a string, and am stuck on how I should approach this. Well, you don't need a subroutine -- just a substitution. If you're using perl 5.6, you can do:

Re: How to pipe perl script

2002-07-11 Thread John W. Krahn
[EMAIL PROTECTED] wrote: hello, my current project involves piping data to the perl script. perlscript.pl | cat data_file but unfortunately, the data_file is printed out by cat command how would i pipe data to perl script so that only the program did the output? perlscript.pl

Re: Matching IPs or robots

2002-07-11 Thread John W. Krahn
Kevin Zembower wrote: I'm trying to do a quick-n-dirty (well, I've been at work on it three hours now) analysis of Apache web logs. I'm trying to count the number of records from robots or spiders. For my purposes, a robot or spider is a request from either an unresolved IP address, or one

Re: What is this string type? How to play with?

2002-07-11 Thread Connie Chan
Hi David, Hehe... Thanks in advice. Anyway what I am looking for is making those stuff back to what they looks like when they come, that is, the $input in your script... However, may I have some questions about your sample ? =) my @variables = split(/[\\;]/, $input); ; has no problem, why

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Connie, ; has no problem, why you would like to escape( \ )it ? I know that = and ; don't have a problem, I escape them because I escape every special character, that way I don't have to worry about what I do and don't need to escape. I know, bad habit (old habits die hard). Besides, if

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Oops, let me make one small revision to my code: if (exists($form_vars{$name})) { # if this is the first of this form input name. should be if (!exists($form_vars{$name})) { # if this is the first of this form input name. Sorry about that all. Regards, David - Original Message -

Re: What is this string type? How to play with?

2002-07-11 Thread perl-dvd
Sorry, one more oops $form_vars{$name} = [($form_vars{$name})] if (ref($form_vars{$name} ne ARRAY)); should be $form_vars{$name} = [($form_vars{$name})] if (ref($form_vars{$name}) ne ARRAY); Sorry about these, there were a few recommendations I've received, and I had not implemented them in

installing perl to specific directory - crucial

2002-07-11 Thread devetha
Hi, How do you install PERL to a specific directory? I'm using Unix and don't have permissions to /usr/local/bin. I followed the steps from perl.com but they didn't work. Could some provide me with directions of how to do this exactly? It's crucial that I get this down within the next hour

fastest regexp: split or (.*)?

2002-07-11 Thread Paul Tremblay
I am writing a script to parste rtf into xml and have a number of questions about regular expressions. The first is: I have this line: \sbknone\linemod0\linex0\cols1\endnhere \pard\plain text\par I want to split it at the expression \endnhere. I can either use @array = split(/endnhere/,2);

Re: installing perl to specific directory - crucial

2002-07-11 Thread Peter Scott
At 09:02 PM 7/11/02 +, devetha wrote: Hi, How do you install PERL to a specific directory? I'm using Unix and don't have permissions to /usr/local/bin. I followed the steps from perl.com but they didn't work. Could some provide me with directions of how to do this exactly? I do

  1   2   >