RE: Problems matching or parsing with delimiters in text

2005-03-28 Thread Graeme St. Clair
-Original Message- From: Offer Kaye [mailto:[EMAIL PROTECTED] Sent: Monday, March 28, 2005 12:17 PM To: Perl Beginners Subject: Re: Problems matching or parsing with delimiters in text On Mon, 28 Mar 2005 11:13:05 -0500, KEVIN ZEMBOWER wrote: > I'm trying to read in text lines from a file

RE: XML Generator DBI

2005-03-21 Thread Graeme St. Clair
-w is kind of pan-galactic and influences modules you're calling, regardless of their own 'warnings' settings. Try 'use warnings' without -w. See p861 in the camel 3rd edition. HTH, GStC. -Original Message- From: Mike Lesser [mailto:[EMAIL PROTECTED] Sent: Saturday, March 19, 2005 11:

Re: Tie::File problem (or is it just me?)

2005-03-07 Thread Graeme St. Clair
-Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Hendrik Maryns Sent: Monday, March 07, 2005 5:58 PM To: beginners@perl.org Subject: [Released] [Contains offensive content] Re: Tie::File problem (or is it just me?) John W. Krahn schreef: > Hendrik Maryns wrote: > >> Ke

RE: Invocation environment detection

2005-03-07 Thread Graeme St. Clair
You could detect OS by use of something like this:- if (($^O eq 'MSWin32') or ($^O =~ /cygwin/i)) { ... # works for me And perhaps context by this:- if defined $ENV{GATEWAY_INTERFACE} { ... # untested, in my case "CGI/1.1" in CGI, else undefined And there's a variable $^V that gives you your

RE: z/OS unicode problem.

2005-03-03 Thread Graeme St. Clair
This looks like a bug (hfff!) in your version of Perl. On my Windows XP combo Perl/Apache (ActivePerl 5.6.1 Build 635), it barfs on both expressions, thus:- #!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; use charnames ':full'; $a = "\N{LATIN S

RE: z/OS unicode problem.

2005-03-03 Thread Graeme St. Clair
Well, not exactly. The extra \x00 is only present in characters whose value <= 127, which actually does not include either A-grave; the lc one is \xe0, the uc \xc0. Otherwise, there is an increasingly elaborate encoding scheme, which may occupy 2, 3 or 4 bytes. I'll paraphrase part of it:- A 2-

RE: Load an hash from a text file

2005-03-01 Thread Graeme St. Clair
Try this - the 'g' at the end means 'global', that is, every occurrence of the target string. > > $line =~ s/\Q$replacement->[0]\E/$replacement->[1]/g; HTH, GStC. -Original Message- From: Web Solving [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 11:58 AM To: Charles K. C

RE: standardising spellings

2005-02-24 Thread Graeme St. Clair
-Original Message- From: Peter Rabbitson [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 2:01 PM To: beginners@perl.org Subject: Re: standardising spellings On Thu, Feb 24, 2005 at 06:01:50PM -, Dermot Paikkos wrote: > Hi, > > I have a list of about 650 names (a small

RE: Environment variables

2005-02-21 Thread Graeme St. Clair
The following works for me on a Windows XP box talking to a Solaris server:- BEGIN { if (($^O eq 'MSWin32') or ($^O =~ /cygwin/i)) { # $ENV{ORACLE_HOME} = q{C:/Oracle/Ora81}; # But Oracle::DBD will find it from the Windows registry anyway } else { $ENV{ORACLE_HOME} = q{/path/to/p

RE: Class::MethodMaker Query

2005-02-17 Thread Graeme St. Clair
I may well be in over my head here, but I just happened to be reading about this area only yesterday. I'm wondering if the section "References Don't Work As Hash Keys" on p265 of Camel 3rd edn applies here? HTH, GStC. -Original Message- From: Siddharth Uppal [mailto:[EMAIL PROTECTED] S

RE: Detect platform

2005-02-16 Thread Graeme St. Clair
I lifted the following out of (IIRC) CGI.pm, and it works on this XP SP1 m/c:- if (($^O eq 'MSWin32') or ($^O =~ /cygwin/i)) { ... I don't *know* that the Cygwin leg of the compare works, but considering where I got it, why wouldn't it?! Rgds, GStC. -Original Message- From: Daniel Ka

RE: Start reading from a specific line

2005-02-15 Thread Graeme St. Clair
Well, it is, you know. In my 3rd Edn, July 2000 printing, it's indexed about half way down the left column on p1011, where it is also described as $INPUT_LINE_NUMBER. Admittedly, the first reference (to p103) is off, as some refs are in this edn. But it's only just over onto p104. And p665 (cor

RE: Hash Getting Doubled?

2005-01-31 Thread Graeme St. Clair
Lawrence's emendation stopped the extra executions, but Jay's also preserved the original intent, which was to get the hash sorted according to $capval being purely numeric. Thanks to both, rgds, GStC. [cut] > my $counter = 0; > foreach $capval ( sort bynumber %capdef ) { > $counter++; # deb

RE: Hash Getting Doubled?

2005-01-31 Thread Graeme St. Clair
ry 31, 2005 5:02 PM To: Graeme St. Clair Cc: 'beginners@perl.org' Subject: Re: Hash Getting Doubled? > > What is going on that I haven't understood? > > Rgds, GStC. Your entire problem is : foreach $capval ( sort bynumber %capdef ) { Perhaps you want to sort by the

Hash Getting Doubled?

2005-01-31 Thread Graeme St. Clair
Combo ActiveState Perl 5.6.1 635 and Apache 1.0.xx from www.perl.apache.org . The following code goes round the foreach twice as often as I think it should. (I realise the code is probably not particularly stylish, but I'd prefer to leave that alone for the moment.)

Hang with Use Warnings and a Subroutine

2005-01-27 Thread Graeme St. Clair
I just solved a (to me) curious hang with Windows XP, ActiveState 5.8.6, Apache 1.3.27. On Submit, an HTML page calls a Perl script into a new page. The Perl script runs fine with use strict but not warnings. Add -w to the shebang line, or add 'use warnings', and it hangs without ever presentin

RE: Storing $DIGIT variables in arrays

2005-01-25 Thread Graeme St. Clair
I'm no expert on regex's, but IP @'s are not all that easy to match and validate at the same time. There is a good discussion of precisely this problem in Chap 4 of "Mastering Regular Expressions" by J E F Friedl, pub O'Reilly, at pp 123-125. He concludes:- "Sometimes it's better to take some o

RE: Naming Convention?

2005-01-24 Thread Graeme St. Clair
AIL PROTECTED] Sent: Saturday, January 22, 2005 11:02 AM To: Graeme St. Clair Cc: beginners@perl.org Subject: Re: Naming Convention? Graeme St. Clair wrote: > Is there any common convention governing names of variables defined in > a 'require'd 'blah.pl'? I'd li

RE: How to find regex at specific location on line

2005-01-24 Thread Graeme St. Clair
Perl Beginners Subject: Re: How to find regex at specific location on line Graeme St. Clair wrote: > Try the {} notation, that says how many whats are required before the > which (as it were). Perhaps something like:- > > if (/.{31,33}\|[BNPG]\|/){ > return 2; >

RE: How to find regex at specific location on line

2005-01-22 Thread Graeme St. Clair
Try the {} notation, that says how many whats are required before the which (as it were). Perhaps something like:- if (/.{31,33}\|[BNPG]\|/){ return 2; } Meaning, between 31 & 33 characters. Untested! HTH, GStC. -Original Message- From: Jason Balicki [mailto:

Naming Convention?

2005-01-21 Thread Graeme St. Clair
Is there any common convention governing names of variables defined in a 'require'd 'blah.pl'? I'd like to make use of such variables detectable to the naked eye in the scripts that 'require blah.pl'. Rgds, GStC.

RE: Neat Trick

2005-01-18 Thread Graeme St. Clair
Wow! I might just try these two for kicks, tho as nobody likely to inherit this from me is likely to be a Perl hand, I think I'll probably KISS for now. I don't necessarily disagree about '' vs qq{}. It's just that the rest of the code is styled with qq{}, and I thought it better to keep that go

Neat Trick

2005-01-18 Thread Graeme St. Clair
Or I thought so anyway. Gurus are at liberty to think otherwise ;-) I just had to make a single with 4 submit buttons (each with the same 'value' legend) out of 4 's each with its own 'hidden' field. I used the following to distinguish between them:- my $request = defined $formData->param(q{

RE: Missing output on browser

2004-12-21 Thread Graeme St. Clair
You may be getting a different set of environment variables in cgi than from the command line. I had to put a "BEGIN" block in all of my cgi scripts - to set environment - for the scripts to work in cgi... Jwm Interesting! I guess that explains the BEGIN block I recently inherited. Contex

RE: remote database access in perl

2004-12-13 Thread Graeme St. Clair
As someone else said, this is almost certainly a MySQL "problem". When you connect from a local machine, you are known to MySQL as 'fred'@'localhost', and you have a particular identity. When you connect from a remote m/c, you are 'fred'@'some.tcp.ip.addr', and you have a totally different identi

RE: Finding missing syntax element

2004-12-13 Thread Graeme St. Clair
From: Harry Putnam <[EMAIL PROTECTED]> > I'm working on a program with some 433 lines of perl code. > Some where in the course of editing today I've run up on an error that > I need some way to debug. > > the code includes >use diagnostics; > > And the message I get when I try to run it:

RE:[Contains content] OT topic concluded

2004-12-06 Thread Graeme St. Clair
, for which thanks! I'll try to get an explanation from our anti-spammers. Rgds, G. -Original Message- From: Jonathan Paton [mailto:[EMAIL PROTECTED] Sent: Monday, December 06, 2004 6:45 PM To: Graeme St. Clair Cc: [EMAIL PROTECTED] Subject: Re: [Released] [Contains offensive conten

RE: [Released] [Contains offensive content] RE: Building Network Redundancy into a Perl Client

2004-12-06 Thread Graeme St. Clair
Does anyone know why or where the phrase [Contains o f f e n s i v e content] is being inserted into these headers? I wouldn't care, except my employer's spam filter is holding them up for whatever reason, as it might be, use of the said phrase... Rgds, G. -Original Message- From: Joshua

RE: mysql timeout

2004-12-06 Thread Graeme St. Clair
There is a MySQL global variable called connect_timeout. Its default value is 5 minutes. Try searching www.mysql.com doc links for details. Rgds, GStC. -Original Message- From: Ing. Branislav Gerzo [mailto:[EMAIL PROTECTED] Sent: Monday, December 06, 2004 9:04 AM To: [EMAIL PROTECTED]

RE: Running Perl Scripts Via A Web Page

2004-11-30 Thread Graeme St. Clair
O'Reilly is your friend (IMHO). You need a good HTML book, and Musciano is its author. You need the "Camel book" ("Learning Perl", Schwartz et al), and probably the "Llama book" ("Programming Perl", Wall et al). I'm happy with them all. I haven't yet found a definitive Apache/CGI book, but you

RE: Adding to a Hash

2004-11-27 Thread Graeme St. Clair
to an earlier edition. Goodness knows why it didn't work, but I don't think I'll bother with it any more... -Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED] Sent: Friday, November 26, 2004 9:32 PM To: Graeme St. Clair Cc: '[EMAIL PROTECTED]' Subject:

Adding to a Hash

2004-11-26 Thread Graeme St. Clair
I've inherited an application that issues several different SQL requests, lovingly creating different lists of user-friendly column names for each of the different database column names that might be returned. To cut down future maintenance requirements, I thought I would generalise the HTML-emitt