DBD::mysql again: last_insert_ids

2003-11-23 Thread william ross
hello,

Having somehow managed to install DBD::mysql on 10.3 without running 
into the obstacles that others have described here - which is always 
worrying - I now find that it  doesn't quite work. most functions are 
fine, but it fails to get a correct last_insert_id: instead it returns 
zero, the value for a failure-to-insert.

You can still get the correct value directly, which is odd:

print $dbh-{mysql_insertid};# 0
print $dbh-last_insert_id();# undef
print $dbh-do(SELECT LAST_INSERT_ID());   # 11, as it happens
This thoroughly breaks any application based on Class::DBI and I am, as 
usual, baffled. can anyone suggest a way to move forward?

thanks.

will

ps. this is with DBD::mysql 2.0419, the version you get by installing 
the Msql-mysql-bundle, and I'm still using the standard threaded perl 
5.8.1rc3.

Here's a test script in case someone is kind enough to show that the 
problem is confined to my own busted-up machine:



#!/usr/bin/perl

use strict;
use DBI;
my ($dbh, @row);

eval{
	$dbh = DBI-connect('DBI:mysql:database=dbitest;host=localhost', 
'someone', 'something', {'RaiseError' = 1});
};
die \nconnection failed: $@ if ($@);

print *** connected to database.\n;
print *** inserting row.\n;
my $sth2 = $dbh-prepare(INSERT into somethings (title) VALUES (?));
$sth2-execute('testy');
print *** mysql_insertid variable is:  , $dbh-{mysql_insertid} . 
\n;
print *** last insert id method gives:  . $dbh-last_insert_id . \n;
print *** SELECT LAST_INSERT_ID() gives: ;

print $dbh-do(SELECT LAST_INSERT_ID()) . \n;

print *** table contents:\n;

my $sth3 = $dbh-prepare(SELECT * FROM somethings where title = ?);
$sth3-execute('testy');
while ( @row = $sth3-fetchrow_array ) {
print join(' = ', @row) . \n;
}
print *** mysql_insertid variable is:  , $dbh-{mysql_insertid} . 
\n;



__END__

# in mysql:

create database dbitest;
grant all on dbitest.* to [EMAIL PROTECTED] identified by 'something';
use dbitest;
create table somethings (
id int not null auto_increment,
title varchar(255),
primary key (id)
);


head

2003-11-23 Thread Jerry Rocteur
Hi,

Why would a Perl Module installation wipe out a standard UNIX program 
'head' with a head Perl script which is completely unrelated to the 
real 'head' ??

I don't get it ... What next.

Regards,

Jerry



Re: head

2003-11-23 Thread Doug McNutt
At 20:20 +0100 11/23/03, Jerry Rocteur wrote:
Why would a Perl Module installation wipe out a standard UNIX program 'head' with a 
head Perl script which is completely unrelated to the real 'head' ??

In the old days there was a problem with head and HEAD. The perl installer was 
accustomed to a case sensitive file system which Apple's HFS+ is not.

I thought is was fixed but . . .

-- 
--  There are 10 kinds of people:  those who understand binary, and those who don't 
--


Re: DBD::mysql again: last_insert_ids (fixed)

2003-11-23 Thread william ross
hello again,

it's always the same. i bang my head against something for days, 
finally get around to asking about it here, and then fix it a few 
minutes later.

in this case the answer (for me at least) was to install DBD::mysql 
directly instead of using the outdated version that's in the 
Msql-mysql-bundle. The version currently on CPAN fails to build, but if 
you go back to an earlier version (2.9002 is the last that is reported 
to work with darwin) then it builds fine, fails three tests that I 
couldn't even find, and appears to just work.

this does mean that it can't be done through CPAN.pm. Download from 
here instead:

	http://search.cpan.org/~rudy/DBD-mysql-2.9002/

best

will

ps. I have applied Mr Moy's change to 
/System/Library/...blah.../Config.pm, which presumably helped.



On 23 Nov 2003, at 19:12, william ross wrote:

hello,

Having somehow managed to install DBD::mysql on 10.3 without running 
into the obstacles that others have described here - which is always 
worrying - I now find that it  doesn't quite work. most functions are 
fine, but it fails to get a correct last_insert_id: instead it returns 
zero, the value for a failure-to-insert.

snip



Re: head

2003-11-23 Thread william ross
...because the makers assumed a filesystem that would not treat head 
and HEAD as the same thing.

but i thought recent versions of LWP confined their improvements to 
/usr/local/bin, so who kno.

will



On 23 Nov 2003, at 19:20, Jerry Rocteur wrote:

Hi,

Why would a Perl Module installation wipe out a standard UNIX program 
'head' with a head Perl script which is completely unrelated to the 
real 'head' ??

I don't get it ... What next.

Regards,

Jerry




Re: head

2003-11-23 Thread Jerry Rocteur
IC.. Thanks for that..

A UNIX system that is not case sensitive doesn't sound like a UNIX 
system to me.. I wonder what else Apple is going to change in UNIX, 
soon we'll be cd \etc\httpd

I apologize to the wonderful Perl people for thinking something naughty 
about them when all along it is Apple.

Thanks for the prompt answer.. I just moved the perl head elsewhere... 
But I'm sure that will break things..

BTW, does anyone recommend something different than HFS+ to avoid this 
very annoying thingy ?

Thanks Apple.

Jerry

On Sunday, Nov 23, 2003, at 20:43 Europe/Brussels, Doug McNutt wrote:

At 20:20 +0100 11/23/03, Jerry Rocteur wrote:
Why would a Perl Module installation wipe out a standard UNIX program 
'head' with a head Perl script which is completely unrelated to the 
real 'head' ??
In the old days there was a problem with head and HEAD. The perl 
installer was accustomed to a case sensitive file system which Apple's 
HFS+ is not.

I thought is was fixed but . . .

--
--  There are 10 kinds of people:  those who understand binary, and 
those who don't --




Re: [OT] Old BBEdit question

2003-11-23 Thread wren thornton

--- Jim Correia [EMAIL PROTECTED] wrote:
 4.5.3 doesn't support language plug-ins (that
 capability was added 
 later.) Even so, I am unaware of third party CSS
 modules.

Okay, thanks. I could just set it to plain-text,
shouldn't be too annoying.

--- Jim Correia [EMAIL PROTECTED] wrote:
 If you own a copy of 4.5.3 you are eligible for
 upgrade pricing which 
 is substantially cheaper than retail.  (I don't know
 if this fits into 
 your budget or not.)

I'll have to look into that again, I forget how much
the upgrade costed.


--- Thilo Planz [EMAIL PROTECTED]
wrote:
 I know everyone has his favorite editor and that the
 matter is an 
 almost religious one, but if you are looking for a
 free and powerful 
 text editor to replace your proven, old BBEdit
 4.5.3, you should have a 
 look at JEdit (http://jedit.org). It rocks.

I've looked at jedit before and recall not being
particularly enthused by it. I've switched my
favourite browser in the past, so that's not all there
is to it, but I am a big fan of BBEdit. Recently I've
come to see the merits of TextEdit (OSX's SimpleText),
but I wonder how much of that is just because it's a
native X program rather than running under Classic...

--- Thilo Planz [EMAIL PROTECTED]
wrote:
 Another more light-weight (and very Mac OS X-like)
 alternative could be 
 the award-winning SubEthaEdit. It is not so
 feature-rich, but it does 
 CSS-syntax-high-lighting.

I'll have to look into that :)

~wren

__
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/


Re: head

2003-11-23 Thread Jerry Rocteur
BTW for those running Mac OS X with this head confusion, on 10.2.8 I'm 
seeing this kind of thing all over the place:

Rotating log files: system.logUnknown option: 1Usage: head [-options] 
url...-m method   use method for the request (default is 
'HEAD')-fmake request even if head believes method is 
illegal

Including the boot sequence if you boot in verbose mode..

Cheers,

Jerry
On Sunday, Nov 23, 2003, at 21:04 Europe/Brussels, Jerry Rocteur wrote:
IC.. Thanks for that..

A UNIX system that is not case sensitive doesn't sound like a UNIX 
system to me.. I wonder what else Apple is going to change in UNIX, 
soon we'll be cd \etc\httpd

I apologize to the wonderful Perl people for thinking something 
naughty about them when all along it is Apple.

Thanks for the prompt answer.. I just moved the perl head elsewhere... 
But I'm sure that will break things..

BTW, does anyone recommend something different than HFS+ to avoid this 
very annoying thingy ?

Thanks Apple.

Jerry

On Sunday, Nov 23, 2003, at 20:43 Europe/Brussels, Doug McNutt wrote:

At 20:20 +0100 11/23/03, Jerry Rocteur wrote:
Why would a Perl Module installation wipe out a standard UNIX 
program 'head' with a head Perl script which is completely unrelated 
to the real 'head' ??
In the old days there was a problem with head and HEAD. The perl 
installer was accustomed to a case sensitive file system which 
Apple's HFS+ is not.

I thought is was fixed but . . .

--
--  There are 10 kinds of people:  those who understand binary, and 
those who don't --





Re: head

2003-11-23 Thread Richard Cook
On Sunday, Nov 23, 2003, at 12:04 US/Pacific, Jerry Rocteur wrote:

A UNIX system that is not case sensitive doesn't sound like a UNIX 
system to me.. I wonder what else Apple is going to change in UNIX, 
soon we'll be cd \etc\httpd
It seems to me that there's no good reason to preserve case 
insensitivity in Mac OSX. The primary concern might be that Finder's 
toolbar and Find dialog (Command-F) do a case-insensitive search by 
default, since users might be accustomed to this. No?



Re: head

2003-11-23 Thread William H. Magill
On 23 Nov, 2003, at 15:04, Jerry Rocteur wrote:
A UNIX system that is not case sensitive doesn't sound like a UNIX 
system to me.. I wonder what else Apple is going to change in UNIX, 
soon we'll be cd \etc\httpd
It already has. Panther has stuck new users with bash instead of tcsh 
-- a very nasty, annoying and undocumented change. Drives support folks 
crazy since the default can't be changed.

BTW, does anyone recommend something different than HFS+ to avoid this 
very annoying thingy ?
Get a copy of OS X Server (Panther)'s install CD and format the disk as 
Case Sensitive. (This is supposedly different from the old UFS option, 
but I haven't tried it, so I can't say for certain. )

Supposedly, then you can simply install the Client without reformatting 
the disk and it just works.

At this point, the case sensitive file system is supported for OS X 
Server only, and then primarily for the purpose of supporting things 
like NSF file systems exported to real Unix boxes.

There ARE problems and issues.

One that I am aware of has to do with Retrospect -- it assumes a case 
insensitive file system. So if you have HEAD and head only one copy 
winds up on the tape.

Fortunately BRU is now available for OSX... unfortunately, it is still 
enterprise priced. They are supposedly working on a personal 
edition license as they have for assorted other *nix systems, but it 
does not exist yet.

Obviously, any command-line unix tool will deal with the case 
sensitive file system correctly. However, since I haven't had a chance 
to try it out yet, I don't know what the finder and other GUI oriented 
apps will do.

T.T.F.N.
William H. Magill
# Beige G3 - Rev A motherboard - 768 Meg
# Flat-panel iMac (2.1) 800MHz - Super Drive - 768 Meg
# PWS433a [Alpha 21164 Rev 7.2 (EV56)- 64 Meg]- Tru64 5.1a
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]


HTML to PDF converter

2003-11-23 Thread Mike Schienle
Hi all -

I need to batch convert a hundred or so HTML pages to PDF on a regular 
basis. I've looked on the web a bit, CPAN and the last year or so of 
The Perl Journal, but I'm getting more confused the longer I search :-) 
It looks like HTML::HTMLDoc is the way to go at this point. Can someone 
give me an idea if that's the most appropriate module? If not, are 
there other recommendations?

Mike Schienle