Re: Fw: PLEEEEEEEASE READ!!!

2001-12-02 Thread Roger C Haslock
OT: Such people should have their e-mail priveleges removed. - Roger - - Original Message - From: "Dean Theophilou" <[EMAIL PROTECTED]> To: "lynn bui" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, December 02, 2001 4:57 AM Subject: RE: Fw: PLEEEASE READ!!! > When I feel li

Re: Hoax filter [was: Fwd: Fw: PLEEEEEEEASE READ!!!]

2001-12-04 Thread Roger C Haslock
I am thinking of the mechanics of chain mail. The intent of these hoaxes is that they propagate: that they are propagated by humans. Typically they have a lot of addressees, and within them they have a nesting of quoted emails, also with a lot of addressees. Mail to a group such as this will oft

Re: problems with gd.pm

2001-12-13 Thread Roger C Haslock
http://aspn.activestate.com/ASPN/Modules/dist_html?dist_id=8887 GD 1.33 Interface to Gd Graphics Library CPAN Released: Author: LDS PPM Platforms: Linux Windows Version: GD 1.27.2 Perl Version: 5.6 Release Date: PP

Re: I need some concepts about binmode

2001-12-31 Thread Roger C Haslock
I quote from perlfaq5:- How do I randomly update a binary file? If you're just trying to patch a binary, in many cases something as simple as this works: perl -i -pe 's{window manager}{window mangler}g' /usr/bin/emacs However, if you have fixed sized records, then you might do something more

Re: Question regarding placing specific items with a file

2001-12-31 Thread Roger C Haslock
Trivially, you can wrap each Virtual host section in its own IFDefine bracket, and append that to httpd.conf. More tidily, you can open a temp file, prefix it with IFDefine, write all the VHost data to it, close it with /IFDefine, and append that to httpd.conf. Does it matter if there are succes

Re: Tables in CGI

2002-01-15 Thread Roger C Haslock
I was watching this correspondance earlier, and wondering why you are not using fetchrow_hashref. I now wonder why you get all the rows of data bundled into a single array. Does your interface have now way of returning data one row at a time? A simple solution to your problem would go along the l

Re: Tables in CGI

2002-01-17 Thread Roger C Haslock
Sorry. That line should probably be foreach (0..$#columns) Odd message, though. - Roger - - Original Message - From: "Gerry Jones" <[EMAIL PROTECTED]> To: "Roger C Haslock" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, January 17, 20

Re: mkdir in cgi-script

2002-01-20 Thread Roger C Haslock
In this case I think you drop into shell `mkdir -p $fullpath`; # And check for errors!!! - Roger - - Original Message - From: "Rene Verharen" <[EMAIL PROTECTED]> To: "Beginners-CGI List" <[EMAIL PROTECTED]> Sent: Saturday, January 19, 2002 5:01 PM Subject: mkdir in cgi-script > Hi, >

Re: wildcard for unix????

2002-02-04 Thread Roger C Haslock
try chmod 0755 *.* - Roger - - Original Message - From: "Luinrandir Hernson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, February 03, 2002 8:54 PM Subject: wildcard for unix What is the global wildcard for unix? I'm trying to chmod 755 all f

Re: More "Succintification"

2001-06-07 Thread Roger C Haslock
I have found the series of articles, eg http://www.oreillynet.com/pub/a/network/2001/05/18/perl_redflags.html to be most helpful for such problems - Roger - - Original Message - From: "Teresa Raymond" <[EMAIL PROTECTED]> To: "beginnerperllist" <[EMAIL PROTECTED]> Sent: Thursday, June

Re: Regex question

2001-06-11 Thread Roger C Haslock
Perhaps something like my $string = '/blabla/dir/nextdir/name.txt'; $string =~ /(.+)([^\/]*)$/; my $everythinguptoandincludingthelastslash = $1; my $everythingbeyondthelastslashtotheendoftheline = $2; # [^\/] == notaslash (escaped by a backslash) # [...]* == zero or more of them # $/ == endoflin

Re: error message

2001-06-13 Thread Roger C Haslock
What it means is:- Your script crashed before finishing making a page. If you are using CGI.pm, plant 'end_html;exit;' at various places through your script until it generates something legible. The error can be located that way. BTW, I endorse the fatalsToBrowser recommendation. - Roger -

Re: MS SQL Server access

2001-06-13 Thread Roger C Haslock
You do not say how far you have got with the database interface: and outline of your script would be helpful. You probably realise you need to 1) connect to the database 2) prepare the select statement 3) execute the sstatement 4) loop round the rows until exhausted. 5) disconnect from the datab

Re: MySQL access

2001-06-13 Thread Roger C Haslock
mented, download it from CPAN (using PPM or otherwise). I trust this helps a bit. - Roger - - Original Message - From: "Derek Harding" <[EMAIL PROTECTED]> To: "Roger C Haslock" <[EMAIL PROTECTED]> Sent: Wednesday, June 13, 2001 3:03 PM Subject: Thanks > Hi Roger, &g

Re: mystery

2001-06-14 Thread Roger C Haslock
Sally Possibly you uploaded it as a DOS file. Delete what you have uploaded, and upload it again, in binary. If that makes no difference, possibly you got it as a DOS file, in which case it will have to be cleaned of pairs. Something else you might try is editing the first line from #!/.../per

Re: beginner's addressbook tutorial - level of presentation

2001-06-14 Thread Roger C Haslock
Ladies and Gentlemen I find the general level of detail here a bit advanced for a 'beginner'. My mind whirls with questions such as 'Why "our $variable"?' 'Why "class"?' 'Why not CGI.pm?' Can the presentation not be simplified so that we see the solution to the primary problem first, and then

Re: beginner's addressbook tutorial - level of presentation

2001-06-15 Thread Roger C Haslock
d if so, why? Regards - Roger - - Original Message - From: "fliptop" <[EMAIL PROTECTED]> To: "Roger C Haslock" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, June 14, 2001 6:19 PM Subject: Re: beginner's addressbook tutorial - lev

Re: binaries of DBI, DBD::mysql, CGI

2001-06-15 Thread Roger C Haslock
MySQL, Apache and Perl are all available for Windows. I do a fair amount of such stuff on Windows (but don't tell my Linux freinds). You shouldn't need a C compiler, but I too would like to know of a free/shareware one; I last used Topspeed under DOS. - Roger - - Original Message - From:

Re: formatting and writing to file: getting the params

2001-06-19 Thread Roger C Haslock
You have > foreach my $name ( $cgi->param ) > {print "$name\t" . $cgi->param( $name ) . "\n"; > } You have to be careful with CGI::param; it returns a scalar for a scalar, and an arrayref for a list. May I suggest something like my %params = $cgi->Vars; foreach (keys %params) { my $para

Re: reg cgi pgm running

2001-06-28 Thread Roger C Haslock
I recommend you test your program from the command line first. When it works from the command line, find an iplanet newsgroup for advice on iplanet. - Original Message - From: "nila devaraj" <[EMAIL PROTECTED]> To: "Hal Wigoda" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, J

Re: very funny

2001-08-08 Thread Roger C Haslock
A masterful statement! Can we guide the beginners into classifying their problem before posting it? This might filter some of their confusion, and lead them to ask a more pertinent question. eg 1I don't know how to do this in any language 2I could do this in APL, BCPL, C, Delphi, ..., bu

Re: Cookies and Security

2001-08-08 Thread Roger C Haslock
Your script will be multiply concurrent, will it not? That is, several users may be executing the same [instance of the] script. How are you going to tell them apart? I know CGI.pm retains values from a previous invocation, but have never understood how to differentiate between the separate users

Re: search and return a value from a table

2001-08-09 Thread Roger C Haslock
What sort of database engine are you using? If this has an SQL interface, you would write something like select age from tablename where name='zzz'; ... and you would post the query to an SQL group. See recent 'very funny' discussion: this is not a perl query. - Roger - - Original Message

Fw: very funny

2001-08-09 Thread Roger C Haslock
Roger - - Original Message - From: "Steve Girolami" <[EMAIL PROTECTED]> To: "Roger C Haslock" <[EMAIL PROTECTED]> Sent: Wednesday, August 08, 2001 7:28 PM Subject: Re: very funny > How about a FAQ or message board? is there one available for newbies? Or >

Re: A better way for ugly code?

2001-08-10 Thread Roger C Haslock
I would devise several hashes, keyed on the name of the CGI parameter: eg error_string{'name_first'}='The First Name field was either blank or contained illegal characters. Please go back and re-enter it.'; regexp_string{'name_first'}='^(\w[\w ]*)$'; ... and then construct a loop to check them

Re: Help on script

2001-08-21 Thread Roger C Haslock
You say you are new to programming. Perl is not an easy language for a programming novice. Most tutorials will show you how to accomplish, in Perl, something you already know in another language. There are few tutorials on the use of modules because all well-written modules have, as part of their

Re: Help on script

2001-08-22 Thread Roger C Haslock
I have cut your script down (see below) 1) You don't need ARGV (and were using it wrongly); use $filename = 'C:\Perl\bin\folder\princess.txt'; instead. 2) You do need to open and cloae the file being read (INPUT, below) 3) You need double quotes around strings containing variables; single quote

Re: File upload problems still!

2001-08-23 Thread Roger C Haslock
Just an aside, but what is the point of format => 'Application/msword' ? Anyone can rename their file to look like '*.doc', and you can only determine the file content when you have uploaded it ( at which point you SHOULD check). Regards - Roger - - Original Message - From: "Ryan Davis

Re: How does Apache invoke Perl interpreter: OT please don't reply

2001-08-24 Thread Roger C Haslock
Anything in the cgi-bin (or similar) directory is assumed to be an executable script. If it is a perl script (starts with #!//perl), then perl gets called. The interpreter then runs as a separate process. (You can try `ps -efl` to see whats happening) Does this help? - Roger - - Original Me

Re: directory listing of document root?

2001-08-28 Thread Roger C Haslock
Surely, if you have control of your directory structure, you can use $ENV{DOCUMENT_ROOT}. There is no absolutely general solution, and you must be aware of what virtual hosting may do to your path. - Roger - - Original Message - From: "Robert Bunn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED

Re: Counting all the files on a system

2001-08-30 Thread Roger C Haslock
Hi I'm not sure why you want to look at /etc/fstab: why is it not sufficient to recurse from '/'? Also, remember to skip /dev. Cheers - Roger - - Original Message - From: "Westlake, Andy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 30, 2001 1:02 PM Subject: Coun

Re: Help me !

2001-09-06 Thread Roger C Haslock
I'm not sure the other answers you have had address all the problem. They have all addressed the problem of (possibly multiple) whitespace (\s) at the end of a line. You have asked to remove all the newline characters in a string. I would propose $string =~ s/\n//g; The s does a substitute; the

Re: adding array elements

2001-09-08 Thread Roger C Haslock
How about > use strict; > my @data = qw/ 1 2 3 4 5 9 /; > my @sum = (0,0); > map { $sum[$_%2 ] += $data[$_] } ( 1..$#data ); > print $sum[0]; ... or sum such? - Roger - - Original Message - From: "Curtis Poe" <[EMAIL PROTECTED]> To: "David Draley" <[EMAIL PROTECTED

Re: STDIN loop help

2001-09-10 Thread Roger C Haslock
Would something like this help? $i=1 while(my $line=) { chomp $line; push @integer,$line; # push a scalar onto the array print "Enter another integer, please: "; last if ++$i>=10; } - Original Message - From: "David Draley" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent:

Re: Security Suggestions Please!

2001-09-18 Thread Roger C Haslock
om: "Grierson, Garry (UK07)" <[EMAIL PROTECTED]> To: "Roger C Haslock" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, September 18, 2001 3:20 PM Subject: RE: Security Suggestions Please! > 1) Ok point taken. > > 2) Mabey a little unclear here:

Re: Pls help me 2 troubleshoot

2001-09-19 Thread Roger C Haslock
When you write $searchengine = $q-> param("$se{searchengine}"); %se = { "av" => "AltaVista", "yh" => "Yahoo", "gg" => "Google"}; ... why do you define %se after you have used it, instead of before? Why do you redefine it on every call to the subroutine? Why

Re: Pls help me 2 troubleshoot

2001-09-19 Thread Roger C Haslock
: my %se = { "av" => "AltaVista", "yh" => "Yahoo", "gg" => "Google"}; my $searchengine = $q-> param('searchengine'); my $search = new WWW::Search ($se{$searchengine }); Regards - Roger - ---

Re: Volunteer Project

2001-09-20 Thread Roger C Haslock
I have some time free: Can you give an idea of what is wanted. - Roger - - Original Message - From: "Mark Bergeron" <[EMAIL PROTECTED]> To: "Gary Stainburn" <[EMAIL PROTECTED]>; "Bradley M. Handy" <[EMAIL PROTECTED]>; "Teresa Raymond" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursd

Re: structure of scripts (newbie Q)

2001-09-20 Thread Roger C Haslock
My preference is to have subroutine prototypes first, commented to explain their purpose and mode of use. The subroutine declarations can be hived off to a separate file, which is 'included'. The main body of the code can then be presented. (All of this is assuming there is no need to create a fun

Re: How to ck for null set w/ Checkboxes

2001-09-25 Thread Roger C Haslock
Teresa I seem to remember such an enquiry a couple of weeks ago in this group. The answer I saw, and I believe to be correct, is that, if a CGI param has not been given a value, its name will not appear in $q->param(). You therefore need a local list of CGI param names in order to check whether t

Re: Find and delete

2001-10-01 Thread Roger C Haslock
First note > my $wordtodelete = "[Deletethis]; should have a trailing quote mark, like this > my $wordtodelete = "[Deletethis]"; Perhaps you need something like my $wordtodelete = "\[Deletethis\]"; - Roger - - Original Message - From: "Verhare" <[EMAIL PROTECTED]> To: <

Re: Replacing carriage returns in a variable

2001-10-01 Thread Roger C Haslock
Something like this? my $othercharacter = 'Z'; $yourvariable =~ s/\r/$othercharacter/g; # \r is carriage return # /g at the end means do them all - Roger - - Original Message - From: "Guy Tubbs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 01, 2001 4:53 PM Subject

Re: Replacing carriage returns in a variable

2001-10-02 Thread Roger C Haslock
advances to the next line, and used without a carriage return, enabled e.e.cummings to write his non-stop paragraphing. - Roger - - Original Message - From: "Guy Tubbs" <[EMAIL PROTECTED]> To: "Roger C Haslock" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]&

Re: $variable manipulation question

2001-10-02 Thread Roger C Haslock
If you are sure its a string, maybe you can use 'unpack', and then 'join'. - Roger - - Original Message - From: "Shannon Murdoch" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 02, 2001 11:20 AM Subject: $variable manipulation question > Hi all, > > I'm trying to ge

Re: I want out, but I'm no idiot.

2001-10-27 Thread Roger C Haslock
Just a suggestion, but could someone set up a newsgroup for those that want out, but can't make it. (And someone else arrange their swift transfer to it!) - Roger - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Global Variables

2001-11-02 Thread Roger C Haslock
1) You can use Constants:- use constant BUFFER_SIZE=> 4096; use constant ONE_YEAR => 365.2425 * 24 * 60 * 60; use constant PI => 4 * atan2 1, 1; use constant DEBUGGING => 0; use constant ORACLE => '[EMAIL PROTECTED]'; use constant USERNAME

Re: printing lines chunk

2001-11-11 Thread Roger C Haslock
while ($line =~ s/([^\r]{60})[^\r]/$1\r/){ ; # as long as 60 characters are not followed by a \r, put one in } - Original Message - From: "Pedro A Reche Gallardo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, November 09, 2001 7:27 PM Subject: printi

Re: Split a line with Multiple data types

2001-11-13 Thread Roger C Haslock
>> Obviously, split(/ /, $line) doesn't produce the array I really want. I don't understand the word 'obviously': what results are you getting? Have you tried the safer split /\s+/, $line; # split on any sequence of whitespace - Roger - - Original Message - From: "Matt Richter" <[

Re: Redirecting STDOUT to a variable...

2001-11-29 Thread Roger C Haslock
$datacapture = `$command`; $successorfailure = $?; - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, November 28, 2001 4:57 PM Subject: RE: Redirecting STDOUT to a variable... > Hi > Thanks, but I need