Re: remove duplicate lines

2002-10-02 Thread John W. Krahn
John wrote: > > All, Hello, > This is the first time I've ever seen a bunch of guys reaching for bragging > rights on just how short theirs is...and to document it, too! Then you need to check out Perl golf. :-) http://perlgolf.sourceforge.net/ John -- use Perl; program fulfillment -- T

Re: mysql syntax problem

2002-10-02 Thread Michael Fowler
On Wed, Oct 02, 2002 at 09:25:43AM -0700, nkuipers wrote: > Could you also use quote() for this? Yes, $dbh->quote() can also be used for quoting strings. I generally don't suggest it because it's more awkward and makes for less readable code than placeholders. Michael -- Administrator

RES: cookies (FIX)

2002-10-02 Thread Ricardo Luiz Chamberline Maturana
The correct line does not have "double back slash". I use the line as the first line of my CGI script: print "Content-type: text/html\nSet-Cookie: PS=$PS;\n\n"; and it works fine. []´s Ricardo > - Mensagem original - > De: Ricardo Luiz Chamberline Maturana > Enviad

Re: Insertion and Quotes

2002-10-02 Thread Jessee Parker
- Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 02, 2002 10:15 AM Subject: Re: Insertion and Quotes > Jessee Parker wrote: > > > > > I tried doing this on my last run of data but things still got shifted > > over by the quotes w

Re: Insertion and Quotes

2002-10-02 Thread david
Jessee Parker wrote: > > I tried doing this on my last run of data but things still got shifted > over by the quotes when I look at the actual data. It's kind of strange, > when I run the same bit of code on some test info, it seems to work fine > (nothing is shifted) but when I run it again

Re: COUNT(*) performance

2002-10-02 Thread david
Davide Copelli wrote: > On a Mysql database of 6 records performs better : > > my $sth = $dbh->prepare(qq|SELECT count(id) FROM log WHERE (field1 = ? and > field2= ? )|); > $sth->execute( $a1, $a2 ); > $total = $sth->fetchrow_array(); > > or > > my $sth = $dbh->prepare(qq|SELECT id FROM lo

Re: size of a process in memory

2002-10-02 Thread david
Ana M2emarfagón wrote: > Hi all! > I'm new in perl, and I'm a little lost. > I want to find something, perl module, function, site to find it, ..., > that return me the size of a process in memory. I've the pid of the > process and need to now the size. > If possible, I need that work in Unix, Li

Re: Insertion and Quotes

2002-10-02 Thread Jessee Parker
> Use placeholders and your quoting troubles will be over forever ;-) > > E.g.: > > my $sql = "INSERT INTO atable VALUES (NULL, ?, ?)"; > my $sth = $dbh->prepare($sql); > $sth->execute($a_var, $another_var_with_embedded_quotes); > > -- > felix > > -- I tried doing this on my last

RE: mysql syntax problem

2002-10-02 Thread nkuipers
>Use placeholders: Could you also use quote() for this? "Ain't no blood in my body, it's liquid soul in my veins" ~Roots Manuva -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: COUNT(*) performance

2002-10-02 Thread Bob Showalter
> -Original Message- > From: Davide Copelli [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 02, 2002 8:58 AM > To: [EMAIL PROTECTED] > Subject: COUNT(*) performance > > > On a Mysql database of 6 records performs better : > > my $sth = $dbh->prepare(qq|SELECT count(id) FROM l

Re: COUNT(*) performance

2002-10-02 Thread Jenda Krynicky
From: "Davide Copelli" <[EMAIL PROTECTED]> > On a Mysql database of 6 records performs better : > > my $sth = $dbh->prepare(qq|SELECT count(id) FROM log WHERE (field1 = ? > and field2= ? )|); $sth->execute( $a1, $a2 ); $total = > $sth->fetchrow_array(); > > or > > my $sth

RES: cookies

2002-10-02 Thread Ricardo Luiz Chamberline Maturana
I use the line: print "Content-type: text/html\\nSet-Cookie: PS=$PS;\\n\\n"; and it works well. []´s Ricardo

RE: cookies

2002-10-02 Thread Robin Cragg
Hi Aman, I've had exactly the same problem. I strongly suspect it's an IE thing. I've not found a way round it other than looking at the HTTP_REFERER and removing cookies from pages that had not come from my site. R -Original Message- From: aman cgiperl [mailto:[EMAIL PROTECTED]] S

RE: remove duplicate lines

2002-10-02 Thread John
All, This is the first time I've ever seen a bunch of guys reaching for bragging rights on just how short theirs is...and to document it, too! That said, would one of you gurus take a bit of time and explain, in a tutorial sense, just what each bit of short, shorter, then shortest code does. It

Re: Is there a searchable archive for this list

2002-10-02 Thread ANIDIL RAJENDRAN
Hi, Thank you very much. This is exactly I was looking for. I love this list. Anidil Patinatiyil Rajendran Burlingame,California 650 730 8271 - Original Message - From: "Felix Geerinckx" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 01, 2002 10:10 AM Subject: Re:

Re: cookies

2002-10-02 Thread James Edward Gray II
On Wednesday, October 2, 2002, at 08:26 AM, aman cgiperl wrote: > I am not using CGI.pm I don't mean to be offensive here, but why would you not use a standard Perl module that's only purpose is to make coding CGI easier?! James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

cookies

2002-10-02 Thread aman cgiperl
Hi all I need to set a cookie which expires when the browser is closed. I am not using CGI.pm My earlier query for the same for responded by telling that if I am using CGI.pm, I can do so by omitting the expiry date, but if I do so, when I do print "Set-Cookie: cart=$cart domain=.domain.com\n";

COUNT(*) performance

2002-10-02 Thread Davide Copelli
On a Mysql database of 6 records performs better : my $sth = $dbh->prepare(qq|SELECT count(id) FROM log WHERE (field1 = ? and field2= ? )|); $sth->execute( $a1, $a2 ); $total = $sth->fetchrow_array(); or my $sth = $dbh->prepare(qq|SELECT id FROM log WHERE (field1 = ? and field2= ? )|); $sth

RE: e-mail

2002-10-02 Thread Kipp, James
I think you answered your own question :-) NET::POP3 to deal with the incoming mail and Net:SMTP to process the outgoing mail. Can also look at Mime::Lite > -Original Message- > From: Jerry Preston [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 02, 2002 8:35 AM > To: Beginners Perl

Re: e-mail

2002-10-02 Thread Kevin Meltzer
I usually suggest MIME::Parser for breaking up emails in to nice seperate parts. See if that fits your needs. As for fetching the mail, look at one of the POP modules, or Mail::IMAPClient or Mail::Cclient if you use IMAP. Cheers, Kevin On Wed, Oct 02, 2002 at 07:34:39AM -0500, Jerry Preston ([EM

e-mail

2002-10-02 Thread Jerry Preston
Hi! I need to be able to read incoming e-mail break down it's contents, input this data into an oracle table, do some numbers based on this data. Then generate a new e-mail and send it back. The only part that is new to me here is the e-mail. What is the best and or easiest way to deal with e-

RE: how to use 'open'

2002-10-02 Thread Kipp, James
umm.. I think you want to look at DBI or Win32::OLE perldoc DBI perldoc Win32::OLE > -Original Message- > From: Cacialli, Doug [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 01, 2002 5:57 PM > To: '[EMAIL PROTECTED]' > Subject: how to use 'open' > > > Lo, > > I apologize if this r

Re: remove duplicate lines

2002-10-02 Thread John W. Krahn
Sudarshan Raghavan wrote: > > On Wed, 2 Oct 2002, Sudarshan Raghavan wrote: > > > On Wed, 2 Oct 2002, John W. Krahn wrote: > > > > > "John W. Krahn" wrote: > > > > > > > > Sudarshan Raghavan wrote: > > > > > > > > > > On Wed, 2 Oct 2002, jontn_swift wrote: > > > > > > > > > > > This is a classic

Question about Mime::types

2002-10-02 Thread Aaron Petry
I 'm trying to make a program to handle mailing within our department. The program asks a bunch of questions about the message to be sent, reads the body for a text or html file, then looks up people's e-mail addresses in a database, and uses Net::SMTP to loop over the results of that

Re: remove duplicate lines

2002-10-02 Thread Sudarshan Raghavan
On Wed, 2 Oct 2002, Sudarshan Raghavan wrote: > On Wed, 2 Oct 2002, John W. Krahn wrote: > > > "John W. Krahn" wrote: > > > > > > Sudarshan Raghavan wrote: > > > > > > > > On Wed, 2 Oct 2002, jontn_swift wrote: > > > > > > > > > This is a classic case for my favorite one-liner: > > > > > > > >

Re: remove duplicate lines

2002-10-02 Thread Sudarshan Raghavan
On Wed, 2 Oct 2002, John W. Krahn wrote: > "John W. Krahn" wrote: > > > > Sudarshan Raghavan wrote: > > > > > > On Wed, 2 Oct 2002, jontn_swift wrote: > > > > > > > This is a classic case for my favorite one-liner: > > > > > > > > perl -e'while(<>){print unless $seen{$_}++}' outfile > > > > > >

size of a process in memory

2002-10-02 Thread Ana M.Marfagón
Hi all! I'm new in perl, and I'm a little lost. I want to find something, perl module, function, site to find it, ..., that return me the size of a process in memory. I've the pid of the process and need to now the size. If possible, I need that work in Unix, Linux and windows. Thanks in advance

Re: remove duplicate lines

2002-10-02 Thread John W. Krahn
"John W. Krahn" wrote: > > Sudarshan Raghavan wrote: > > > > On Wed, 2 Oct 2002, jontn_swift wrote: > > > > > This is a classic case for my favorite one-liner: > > > > > > perl -e'while(<>){print unless $seen{$_}++}' outfile > > > > You favourite one-liner can be even shorter > > perl -n -e 'prin

Re: mysql syntax problem

2002-10-02 Thread Steven_Massey
Michael Excellent - read DBI/placeholder thanks Michael Fowler

Re: remove duplicate lines

2002-10-02 Thread John W. Krahn
Sudarshan Raghavan wrote: > > On Wed, 2 Oct 2002, jontn_swift wrote: > > > This is a classic case for my favorite one-liner: > > > > perl -e'while(<>){print unless $seen{$_}++}' outfile > > You favourite one-liner can be even shorter > perl -n -e 'print unless $seen{$_}++' infile >outfile You

Re: remove duplicate lines

2002-10-02 Thread Sudarshan Raghavan
On Wed, 2 Oct 2002, jontn_swift wrote: > This is a classic case for my favorite one-liner: > > perl -e'while(<>){print unless $seen{$_}++}' outfile You favourite one-liner can be even shorter perl -n -e 'print unless $seen{$_}++' infile >outfile -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: remove duplicate lines

2002-10-02 Thread jontn_swift
This is a classic case for my favorite one-liner: perl -e'while(<>){print unless $seen{$_}++}' outfile On Wed, 02 Oct 2002 04:17:29 -0400, Sudarshan Raghavan wrote: > On Fri, 27 Sep 2002, waytech wrote: > >> hi, >> >> i want to remove duplicate lines from one file(original file), and sav

Re: mysql syntax problem

2002-10-02 Thread Michael Fowler
On Wed, Oct 02, 2002 at 09:06:16AM +0100, [EMAIL PROTECTED] wrote: > when i query a mysql db within a perl script > this works fine... > $sth = $dbh->prepare ("SELECT venue from base1 WHERE op = 'K Trevan'"); > > this doesn't.. > $sth = $dbh->prepare ("SELECT venue from base1 WHERE op = 'K O'Trev

mysql syntax problem

2002-10-02 Thread Steven_Massey
Hi all when i query a mysql db within a perl script this works fine... $sth = $dbh->prepare ("SELECT venue from base1 WHERE op = 'K Trevan'"); this doesn't.. $sth = $dbh->prepare ("SELECT venue from base1 WHERE op = 'K O'Trevan'"); i know the issue is 'K O'Trevan' in that the 2nd ' completes