Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Editor.cgi : Modifications

Quote Reply
Editor.cgi : Modifications
Hello Alex!

If I add after the line 314 the following

$data{'Meta_Description'} = $data{'Meta Description'};
$data{'Meta_Keywords'} = $data{'Meta Keywords'};
$data{'Number_of_Links'} = 0;
$data{'Has_New_Links'} = 'No';
$data{'Name'} =~ tr/_/ /;
eval { $res = $db->add_record (\%record); };
$@ and print "Fatal on line $.: $@" and next;
$res or print "Error on line $.: $Links: BSQL::error\n" and next;
$CAT_IDS{$values{'Name'}} = $res;
$CAT_REL{$res} = $data{'Related'};

It gives error. Hope you understand what I am doing. Could you help me?

Thanks.

------------------
rajani











Quote Reply
Re: Editor.cgi : Modifications In reply to
What sort of error does it give?

Cheers,

Alex
Quote Reply
Re: Editor.cgi : Modifications In reply to
Hi!

Software error:

Execution of /usr/..../editor.cgi aborted due to compilation errors. Smile

------------------
rajani











Quote Reply
Re: Editor.cgi : Modifications In reply to
Well, you have a couple of problems. You can't just cut and paste code from one module to another. You have variables like %data that are not defined (which is why you are seeing compilation errors).

Why don't you want to use the Import.pl script? If you make these changes, you won't be able to import in any backups you have.

Cheers,

Alex

1. The hash %data is not defined.
Quote Reply
Re: Editor.cgi : Modifications In reply to
Hello Alex!

So you see, your suggestion also does not work. You can see from my earlier messages that this also does not work.

Can you pl. tell me how can i get my database export from access get in to Links? There is no way.

Instead of all your deadly mods, I would rather be happy to get my website working. This is really bad and frustrating.

------------------
rajani











Quote Reply
Re: Editor.cgi : Modifications In reply to
hey alex.. maybe if you made Links SQL 1.1 without use strict.. mods would be ALOT easier to make Wink

but i guess it's more "safe" doing it with strict.. less chance of everything going KABOOM!

jerry
Quote Reply
Re: Editor.cgi : Modifications In reply to
The reason for 'strict' is so that you catch as much as possible that is not mod_perl compliant. For FastCGI and Mod_Perl you need to play by a different set of rules... The bigger programs get, and the more database connections they make the more attractive mod_perl starts to look.

But in porting my 'plain old text' files to SQL getting rid of the use strict makes it a _lot_ easier <G>

Anything new I do I try to keep 'strict'... since I do like the concepts of OOP and well defined routines.

I _hate_ redoing anything, so I'll even make very short routines portable, where the 'portability' takes more code than what I was trying to do, but then I can do things that almost look like normal language and makes reading the code really, really easy Smile

When I was working with Pascal, WAAAAAAY back when it was still new and 'daring' I had libraries of routines that I could cut/paste (this was before any sort of reusability standards, or modules, even before Turbo Pascal 1.0 ....) and while it took me longer to do my first class projects, by the end of the term (and every year after) I was just 'reusing' while everyone was always re-writing.

It was right around that time ... 1982-ish that reusability and modularity were begining to be considered "good" things <G> But almost everyone at the time ("real" people, not programmers) were using unstructured BASIC, and FORTRAN and COBOL and punched tape and cards were still all too common <G>

'C' was the language of PhD's in CS, and everyone on our campus who was 'anybody' in computing was 'hot' on Kermit. (If you remember, that was a machine-independent file transfer format that competed with xmodem on college campuses because it was 'free' as opposed to the Hayes program which was pretty pricey.... even with the modem.)

Anyway... I digress.... but you'll begin to appreciate how well-written DBSQL.pm is, and the benefits of 'strict' and OOP even in the 'anything goes' world of Perl.