[24569] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6747 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 30 00:05:42 2004

Date: Tue, 29 Jun 2004 21:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 29 Jun 2004     Volume: 10 Number: 6747

Today's topics:
    Re: error logs... (Anno Siegel)
    Re: error logs... <johnjcarbone@nospam.hotmail.com>
    Re: error logs... (Anno Siegel)
    Re: error logs... <johnjcarbone@nospam.hotmail.com>
    Re: error logs... <spamtrap@dot-app.org>
    Re: error logs... <bxb7668@somewhere.nocom>
    Re: error logs... <johnjcarbone@nospam.hotmail.com>
        HTTP::Request, trailing slash <sebastian.baua@t-online.de>
    Re: HTTP::Request, trailing slash <noreply@gunnar.cc>
    Re: Indented text converted to arrays of arrays <tore@aursand.no>
        Looking for a certain regexp <ducott@hotmail.com>
    Re: Looking for a certain regexp <jurgenex@hotmail.com>
    Re: Looking for a certain regexp <ducott@hotmail.com>
    Re: Looking for a certain regexp <ducott@hotmail.com>
    Re: Looking for a certain regexp <emschwar@pobox.com>
    Re: Looking for a certain regexp <noreply@gunnar.cc>
    Re: Looking for a certain regexp <daedalus@videotron.ca>
    Re: Looking for a certain regexp <jurgenex@hotmail.com>
    Re: Looking for a certain regexp <ducott@hotmail.com>
    Re: Looking for a certain regexp <ducott@hotmail.com>
    Re: Looking for a certain regexp <ducott@hotmail.com>
    Re: Looking for a certain regexp <spamtrap@dot-app.org>
    Re: Looking for a certain regexp <spamtrap@dot-app.org>
    Re: Looking for a certain regexp <noreply@gunnar.cc>
    Re: Non-unique columns via ODBC driver <il.fogg@bigpond.nospam.net.au>
    Re: Nonblocking Pipe Open <nospam@bigpond.com>
    Re: Nonblocking Pipe Open <troc@pobox.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 29 Jun 2004 22:23:51 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: error logs...
Message-Id: <cbsq5n$fk0$1@mamenchi.zrz.TU-Berlin.DE>

John © <johnjcarbone@nospam.hotmail.com> wrote in comp.lang.perl.misc:
> 
> "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote
> >
> > Oh boy, are you not getting it!
> >
> > Anno
> 
> And I feel that neither are you.

There's the slight difference that my position is supported by wide
consent on this channel while yours isn't.  That's the community thing,
you know...

Anno


------------------------------

Date: Tue, 29 Jun 2004 23:03:04 GMT
From: "John ©" <johnjcarbone@nospam.hotmail.com>
Subject: Re: error logs...
Message-Id: <IymEc.21724$Av3.13625@nwrdny01.gnilink.net>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote
>
> There's the slight difference that my position is supported by wide
> consent on this channel while yours isn't.  That's the community thing,
> you know...
>
> Anno

And yes, wide reaching support is justification, correct?  The SS had wide
range support for the holocaust, so I guess that was correct too, since it
had a lot of supporters.  Two hundred years ago, slavery was supported by
almost every person in America (who was not a slave), so I guess that made
it right too.  Abortion is right or wrong only because of the supporters?

I understand your point. I understand you didn't like my disclaimer, and I
accept that. I made a request. You didn't like it, most others didn't like
it, fine I accept that and I am sorry that you don't... but I am not
changing. It was a simple request that is all... and it was my request, you
don't have to like it.  Just like I don't have to like all the guidelines
around here, remember they aren't rules or laws, I will not be sent to this
culture's 'jail'.

So why don't you just move on already.  If you read the top of this thread,
you'll see the question was answered and we all moved on.  Why can't you and
the rest of the gestapo?

Cheers,
John




------------------------------

Date: 29 Jun 2004 23:20:41 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: error logs...
Message-Id: <cbstg9$hso$1@mamenchi.zrz.TU-Berlin.DE>

John © <johnjcarbone@nospam.hotmail.com> wrote in part:

> ...The SS
> ...support for the holocaust
> ...slavery was supported by
> ...Abortion is right or wrong
> 
> ...but I am not changing
> ...and it was my request
> ...you don't have to like it
> ...I will not be sent to this culture's 'jail'.

You're already in.

> ...the rest of the gestapo

So who's throwing a hissy fit?

Anno


------------------------------

Date: Wed, 30 Jun 2004 00:17:27 GMT
From: "John ©" <johnjcarbone@nospam.hotmail.com>
Subject: Re: error logs...
Message-Id: <rEnEc.41604$aJ3.14900@nwrdny02.gnilink.net>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote
>
> You're already in.
>

>
> Anno

Says who? Are you Uday or Qusay?

lol .. I feel free as a bird.


Cheers,
John




------------------------------

Date: Tue, 29 Jun 2004 22:00:57 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: error logs...
Message-Id: <MKadnQd1X_5Gg3_dRVn-tw@adelphia.com>

John © wrote:

> I understand your point.

I don't think you do.

> I understand you didn't like my disclaimer, and I 
> accept that. I made a request. You didn't like it, most others didn't like
> it, fine I accept that

But you haven't accepted it - you're still whining about it.

The way I read your little "disclaimer" was, "Okay, I've read some of the
messages here and I think you're all a bunch of a**holes. Drop the attitude
when you're talking to me, because I'm special." No, you didn't use those
words, but the meaning was clear - you asked everyone to be nice, because
you clearly assumed they wouldn't be.

In short, you copped an attitude. You got slapped for it, and now you're
whining about getting slapped. Grow up.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: Wed, 30 Jun 2004 02:31:22 GMT
From: "bxb7668" <bxb7668@somewhere.nocom>
Subject: Re: error logs...
Message-Id: <I03oC9.K7I@news.boeing.com>

Could all of you folks please take your non-Perl related dispute to
another forum.  You're wasting bandwidth for those of use that don't
care.  Thank you.




------------------------------

Date: Wed, 30 Jun 2004 03:27:27 GMT
From: "John ©" <johnjcarbone@nospam.hotmail.com>
Subject: Re: error logs...
Message-Id: <zqqEc.23955$Av3.12072@nwrdny01.gnilink.net>


"Sherm Pendley" <spamtrap@dot-app.org> wrote
> In short, you copped an attitude. You got slapped for it, and now you're
> whining about getting slapped. Grow up.
>
> sherm--
>

C'mon sherm, the disclaimer was to some other person that didn't help at
all.  And yes, I 'copped an attitude' to it. I don't have a right to? If you
posted a question and people wrote nothing that helped but only bad mouthed
you, you would just take it? And who got slapped?  Maybe the guy was trying
to be helpful, but when you see him attempting to make fun of my use of PERL
(Instead of Perl), it tends to spoil the rest of his post in which he was
called a 'bully'.

And I did accept it, but people keep posting to it, so I am posting back.

The whiners are people WHINING about what I wrote... it's funny how I can't
complain, but I can have post after post after post after post (from a
handful) complaining... but then I am the whiner. Looks like there are a lot
more whiners here than me.

Look at the top of the thread. The post was made, the question was answered,
and we moved on. Yet others feel the need to put their two cents in....
fine, but don't expect me not to give my two cents back.  You are so
hypocritical... I am just supposed to sit her and let you say whatever you
want without expressing my opinion. You are 'righteous' and I am a whiner?
C'mon... who really needs to grow up. I am supposed to grow up and let it
go, but yet that doesn't apply to you or the others.

Don't you realize that you are whining about whining? So silly.

Cheers,
John




------------------------------

Date: Wed, 30 Jun 2004 00:25:32 +0200
From: Sebastian Bauer <sebastian.baua@t-online.de>
Subject: HTTP::Request, trailing slash
Message-Id: <cbsq8k$gfr$06$1@news.t-online.com>

Hi,

I try to wirte a script that downloads images from a webpage. I use

my $uagent  = LWP::UserAgent->new();
my $request = HTTP::Request->new(GET => "$url");
my $result  = $uagent->request($request);

but the problem is that - even if $url does not contain a trailing slash -
some a slash is added at the end. This behaviour keeps me from downloading
the file because the download is refused this way. I think it must be this
slash, if i try to get the file via Mozilla (without the slash) it works,
with Mozilla with the slash it does not. 

It would be great if anyone could help me out and tell me how to get rid of
the slash
Thx, Sebastian


------------------------------

Date: Wed, 30 Jun 2004 01:12:06 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: HTTP::Request, trailing slash
Message-Id: <2kebgjF1ccu9U1@uni-berlin.de>

Sebastian Bauer wrote:
> I try to wirte a script that downloads images from a webpage. I use
> 
> my $uagent  = LWP::UserAgent->new();
> my $request = HTTP::Request->new(GET => "$url");
> my $result  = $uagent->request($request);
> 
> but the problem is that - even if $url does not contain a trailing
> slash - some a slash is added at the end.

Where/when is the slash appended? Isn't $url what it is, and if it
contains a valid URL, the request is successful?

To make it easier to understand what you mean, please post a
*complete* program with a couple of valid URLs that your code fails to
get.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 30 Jun 2004 05:32:24 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Indented text converted to arrays of arrays
Message-Id: <pan.2004.06.30.03.32.20.328159@aursand.no>

On Tue, 29 Jun 2004 17:37:50 -0400, Brad Baxter wrote:
> I would like to take a table of indented text like the following:
> [...]

I needed help with something quite related to this, but I really don't
know if the answers I got will help you.

You can read the whole thread here:
<http://tinyurl.com/2mb39>


-- 
Tore Aursand <tore@aursand.no>
"Progress is made by lazy men looking for easier ways to do things."
 (Robert Heinlein)


------------------------------

Date: Tue, 29 Jun 2004 23:16:33 GMT
From: "Robert TV" <ducott@hotmail.com>
Subject: Looking for a certain regexp
Message-Id: <lLmEc.943558$oR5.475050@pd7tw3no>

Hi, has onyone ever created a regexp to match common credit card formulas? I
have been asked to "validate" some CC#'s we have on file. I do not know the
formulas by which credit cards are generated. All I know is Visa always
starts with 4, Mastercard with 5, and Amex with 3 I think. It would be nice
to have:

$cardtype = param('cardtype');
$cardnumber = param('cardnumber');

if ($cardtype eq "Visa") {
  unless ($cardnumber =~ /some valid visa formula/) {
    print "It's Good";
  } else {
    print "It's Bad";
  }
}

And so forth. You can find e-commerce websites all over the place that do a
basic check but I don't know the formulas used. At the very least, I would
like to validate the first number as being 4,5,3 etc. and that the scalar is
at least 13 characters long. I do not know how to match just the very first
char of a scalar ... can some one help me with this? EG:

$cardtype = param('cardtype');
$cardnumber = param('cardnumber');

if ($cardtype eq "Visa") {
  unless ($cardnumber =~ /first character is 4/ && $cardnumber =~ /at least
13 characters long/) {
    print "It's Good";
  } else {
    print "It's Bad";
  }
}

I am very new to writing regexp's and my present knowledge is limited to
validating characters used, not their positions. This was my best guess to
match 4 as first (untested):

unless ($cardnumber =~ /4.*/) { #does not match character length as 13
however
  print "It's Good";

} else {
  print "It's Bad";
}

Thank you all.
Robert




------------------------------

Date: Tue, 29 Jun 2004 23:29:13 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Looking for a certain regexp
Message-Id: <dXmEc.20139$x9.6951@nwrddc01.gnilink.net>

Robert TV wrote:
> Hi, has onyone ever created a regexp to match common credit card
> formulas? I have been asked to "validate" some CC#'s we have on file.
> I do not know the formulas by which credit cards are generated.

Why aren't you simply using the Business::CreditCard module?

jue




------------------------------

Date: Tue, 29 Jun 2004 23:29:55 GMT
From: "Robert TV" <ducott@hotmail.com>
Subject: Re: Looking for a certain regexp
Message-Id: <TXmEc.943653$oR5.116645@pd7tw3no>

"Robert TV" <ducott@hotmail.com> wrote:

> unless ($cardnumber =~ /4.*/) { #does not match character length as 13
> however
>   print "It's Good";
>
> } else {
>   print "It's Bad";
> }

I just wrote this regexp that seems to correctly match the first number as
4, although i'm not certain if it's the best way:

#!/usr/bin/perl

use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);

$thenumber = "46574656";

if ($thenumber =~ /^[4].*$/) {
  print "It's Good";
} else {
  print "It's Bad";
}
exit;

Now if I could only figure out how to match against a certain number if
characters (13) in the scalar. Your suggestions are appreciated.

Robert




------------------------------

Date: Tue, 29 Jun 2004 23:31:48 GMT
From: "Robert TV" <ducott@hotmail.com>
Subject: Re: Looking for a certain regexp
Message-Id: <EZmEc.906736$Pk3.698137@pd7tw1no>

"Jürgen Exner" <jurgenex@hotmail.com> wrote:

> Why aren't you simply using the Business::CreditCard module?

I do not own my own server or have the ability to install such modules that
are not bundled with Perl5. I have an account with a commercial web hosting
company and a cgi-bin to run my scripts. They will not install custom
modules for me : (

Robert




------------------------------

Date: Tue, 29 Jun 2004 17:39:43 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Looking for a certain regexp
Message-Id: <etou0wuhr28.fsf@fc.hp.com>

"Robert TV" <ducott@hotmail.com> writes:
> Hi, has onyone ever created a regexp to match common credit card formulas?

If you were to search for "Credit Card" on http://search.cpan.org/
you'd find Business::CreditCard which claims to 

      Validate/generate credit card checksums/names

You know, it's kinda rude to ask other people to search for you, when
you can just do the same thing yourself.

> I have been asked to "validate" some CC#'s we have on file.

Do you know what "validate" means?  Are you supposed to make sure
they're real credit card numbers, or just that they might be?
Business::CreditCard doesn't really validate cards; it just makes sure
that the credit card number is vaguely plausible.

> I am very new to writing regexp's and my present knowledge is limited to
> validating characters used, not their positions.

You should read 'perldoc perlretut', then.  'perldoc perlrequick' if
you're in a hurry.

> This was my best guess to
> match 4 as first (untested):

Why?  You can test it yourself, easily.

> unless ($cardnumber =~ /4.*/) { #does not match character length as 13

That will match a string with a literal '4' in it anywhere.

> however

That will cause a syntax error.

>   print "It's Good";
>
> } else {
>   print "It's Bad";
> }

Sounds like you've got an idea that regexes can do anything; they can
do a lot, but they're not ideal for everything.  Also, sometimes it's
clearer to express yourself not using a regex.  For instance, if what
you're concerned with is to find the length of a string, use the
length() function ('perldoc -f length' to find out more).

-=Eric
-- 
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
		-- Blair Houghton.


------------------------------

Date: Wed, 30 Jun 2004 01:36:37 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Looking for a certain regexp
Message-Id: <2kecunF1f2b7U1@uni-berlin.de>

Robert TV wrote:
> Jürgen Exner wrote:
>> Why aren't you simply using the Business::CreditCard module?
> 
> I do not own my own server

Okay.

> or have the ability to install such modules that are not bundled
> with Perl5.

Yes, you have.

> I have an account with a commercial web hosting company and a
> cgi-bin to run my scripts. They will not install custom modules for
> me : (

Have you asked? If they say no, then do it yourself.

     perldoc -q "own module"

     http://www.mail-archive.com/beginners%40perl.org/msg59382.html

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Tue, 29 Jun 2004 20:10:13 -0400
From: "Daedalus" <daedalus@videotron.ca>
Subject: Re: Looking for a certain regexp
Message-Id: <OvnEc.132633$rt5.1371604@wagner.videotron.net>

> I just wrote this regexp that seems to correctly match the first number as
> 4, although i'm not certain if it's the best way:
>
> #!/usr/bin/perl
>
> use CGI qw(:standard);
> use CGI::Carp qw(fatalsToBrowser);
>
> $thenumber = "46574656";
>
> if ($thenumber =~ /^[4].*$/) {
>   print "It's Good";
> } else {
>   print "It's Bad";
> }
> exit;
>
> Now if I could only figure out how to match against a certain number if
> characters (13) in the scalar. Your suggestions are appreciated.
>

>At the very least, I would
>like to validate the first number as being 4,5,3 etc. and that the scalar
is
>at least 13 characters long. I do not know how to match just the very first
>char of a scalar ... can some one help me with this? EG:
>

Instead of the * quantifier, you could use {12,} who will match 12 or more
charaters (plus the leading 4 = 13).

/^4.{12,}/  #but that would match much more than digits

Using character classes might be the answer

/^4[\d]{12,}/  # should match a string that begin with 4 plus 12 digit

DAE




------------------------------

Date: Wed, 30 Jun 2004 00:23:03 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Looking for a certain regexp
Message-Id: <HJnEc.20244$x9.13819@nwrddc01.gnilink.net>

Robert TV wrote:
> "Jürgen Exner" <jurgenex@hotmail.com> wrote:
>
>> Why aren't you simply using the Business::CreditCard module?
>
> I do not own my own server or have the ability to install such
> modules that are not bundled with Perl5.

Option 1: perldoc -q module: "How do I keep my own module/library
directory?"
Option 2: instead of reinventing the wheel just copy the (relevant subset
of) code from that module into your own program

jue




------------------------------

Date: Wed, 30 Jun 2004 01:18:42 GMT
From: "Robert TV" <ducott@hotmail.com>
Subject: Re: Looking for a certain regexp
Message-Id: <SxoEc.944187$oR5.823826@pd7tw3no>

"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote

> Have you asked? If they say no, then do it yourself.
>
>      perldoc -q "own module"
>
>      http://www.mail-archive.com/beginners%40perl.org/msg59382.html

Thank you Gunnar, that tutorial helped me install a .pm on the server and it
works great.

Robert




------------------------------

Date: Wed, 30 Jun 2004 01:22:35 GMT
From: "Robert TV" <ducott@hotmail.com>
Subject: Re: Looking for a certain regexp
Message-Id: <vBoEc.944215$oR5.796978@pd7tw3no>

"Eric Schwartz" <emschwar@pobox.com> wrote

> You know, it's kinda rude to ask other people to search for you, when
> you can just do the same thing yourself.

I didn't want people to do my work for me, I really didn't know where to
start with my research. I know very little about CPAN but am starting to
learn its a good resource.

> Do you know what "validate" means?  Are you supposed to make sure
> they're real credit card numbers, or just that they might be?
> Business::CreditCard doesn't really validate cards; it just makes sure
> that the credit card number is vaguely plausible.

I now have CPAN's CC validity module working.

> You should read 'perldoc perlretut', then.  'perldoc perlrequick' if
> you're in a hurry.

I'll have a look ty.
R




------------------------------

Date: Wed, 30 Jun 2004 01:25:16 GMT
From: "Robert TV" <ducott@hotmail.com>
Subject: Re: Looking for a certain regexp
Message-Id: <0EoEc.907307$Pk3.642080@pd7tw1no>

Thanx everyone, with your assistance I was able to install the CredCard.pm
module on the server and it's validating correctly with Gunnars tutorial on
maunual installations. I had to do a little bit of playing with the code to
get the validation to work inside an "if" condition, but it seems to work
now. Thanx again.

R




------------------------------

Date: Tue, 29 Jun 2004 22:16:52 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Looking for a certain regexp
Message-Id: <pOmdnalP3o4Kv3_dRVn-tA@adelphia.com>

Robert TV wrote:

> Hi, has onyone ever created a regexp to match common credit card formulas?

No, because it's not something you can check with a regexp, beyond the bare
minimum of verifying that it's 16 numeric characters, and (as you've found)
that the first character corresponds to one of the CC types you accept.

> I have been asked to "validate" some CC#'s we have on file.

The validation recipe is based in part on a checksumming algorithm, but even
that isn't a guarantee. All that will ensure is that a given number *could*
belong to a valid card, at some time in the past, present, or future. Even
if the number passes the checksum validation, it could belong to a card
that has been cancelled, overdrawn, expired, or one that has not yet been
issued to anyone.

There are also numbers used for testing purposes that pass checksumming, but
only pass muster with a bank when your merchant account is in a special
"testing" mode. Those exist so e-commerce apps can be tested without
racking up a bunch of charges on a valid card.

As others have mentioned, there's a CPAN module that will help with the
checksumming. For the rest, you'll have to establish a merchant account
with a bank that provides an API that you can use. (No, I don't know which
banks do... I haven't done e-commerce in many years. Anyone remember
Cybercash?)

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: Tue, 29 Jun 2004 22:22:17 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Looking for a certain regexp
Message-Id: <poGdnWFpYd6iuX_dRVn-sw@adelphia.com>

Robert TV wrote:

> I know very little about CPAN but am starting to learn its a good
> resource.

Did you know you can search module names & descriptions at
<http://search.cpan.org>? Very handy.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: Wed, 30 Jun 2004 05:16:19 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Looking for a certain regexp
Message-Id: <2keprdF17sspU1@uni-berlin.de>

Robert TV wrote:
> Gunnar Hjalmarsson wrote:
>> Have you asked? If they say no, then do it yourself.
>> 
>>     perldoc -q "own module"
>> 
>>     http://www.mail-archive.com/beginners%40perl.org/msg59382.html
> 
> Thank you Gunnar, that tutorial helped me install a .pm on the
> server and it works great.

You are welcome. It's a good option for people who run CGI scripts on
hosting accounts without shell access.

It's a pity that the above answer in the Perl FAQ does not mention the
'manual' variant. It leads to people being unnecessarily shut out from
using non-standard CPAN modules, and in effect stuck with Perl 4 style
scripts. :(

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Wed, 30 Jun 2004 00:31:40 GMT
From: I & L Fogg <il.fogg@bigpond.nospam.net.au>
Subject: Re: Non-unique columns via ODBC driver
Message-Id: <MRnEc.70833$sj4.21406@news-server.bigpond.net.au>

Yes, that's what I thought too. I traced the call down through the DBI 
and DBD modules which confirmed it.

If there's nothing I can do at the Perl level, is there anything I can 
do with ODBC (alternative function calls, different flags, etc).

Cheers, Iain

ctcgag@hotmail.com wrote:
> I & L Fogg <il.fogg@bigpond.nospam.net.au> wrote:
> 
>>The error message is:
>>
>>DBD::ODBC::db prepare failed: [Simba][Simba ODBC Driver]Non unique
>>column reference: Unused. (SQL-HY000)(DBD: st_prepare/SQLPrepare err=-1)
>>at ./dbcopy.pl line 346.
> 
> 
> It looks like this error originates with the ODBC driver itself, and Perl
> merely passes it along.  If that is the case, it is unlikely that there
> is much you can about from within Perl.
> 
> Xho
> 



------------------------------

Date: Wed, 30 Jun 2004 10:36:14 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Nonblocking Pipe Open
Message-Id: <32024995.shNSR4pgAq@GMT-hosting-and-pickle-farming>

J. Romano wrote:

> Gregory Toomey <nospam@bigpond.com> wrote in message
> news:<1107135.EWZglpOOTA@GMT-hosting-and-pickle-farming>...
>> I need to combine pipe open + make it non-blocking. The semantics I want
>> are:
>> 
>> # based on perlopentut
>>  open(NET, "ping 11.22.33.44 |", O_NONBLOCK )    || die "can't fork
>>  ping";
>>    while (<NET>) { print }
>>     close(NET)
>> 
>> which of course gets a syntax error.
>> Any idea how to achieve this?
> 
> 
> Dear Greg,
> 
>    To be able to read a command's output in a non-blocking manner, you
> can use the IPC::Open2 module together with IO::Select.  Here is a
> sample program that pings 127.0.0.1:
> 
> 
> #!/usr/bin/perl -w
> 
> use strict;
> use IPC::Open2;
> use IO::Select;
> $| = 1; # autoflush STDOUT
> 
> # Declare filehandles and command to use:
> my ($r, $w);
> my $cmd = 'ping 127.0.0.1';
> 
> # Open the process and set the selector:
> my $pid = open2($r, $w, $cmd);
> my $selector = IO::Select->new($r);
> 
> sleep 1;  # allow some time for request to process
> 
> # print out output from process, if any exists:
> while ($selector->can_read(0))
> {
>    my $char;
>    sysread($r, $char, 1);
>    print $char;
> 
>    unless ($selector->can_read(0))
>    {
>       sleep 1;  # allow some time for request to process
>                 # or else while loop will finish if there
>                 # there is a pause in the program
>    }
> }
> 
> __END__
> 
> 
>    I basically use IO::Select with the can_read() method to tell when
> output is waiting for me to read.  Note that I periodically sleep for
> some time in order to give the process enough time to output some
> text.  Without the sleep command, the while loop would exit as soon as
> ping produces a pause (because technically there is nothing waiting to
> be read during a pause).
> 
>    This script should work on Unix, but I'm almost entirely sure it
> won't work on Win32 platforms.
> 
>    Hope this helps,
> 
>    -- Jean-Luc


I'll give it a try.

I'm looking at writing a "domain diagnoser" that
- does  whois, dig & ping concurrently for a domain (& subdomains)
- interprets data from the subprocesses & and displays results in real time
- possibly uses an expert system to diagnose problems

gtoomey


------------------------------

Date: Wed, 30 Jun 2004 03:15:25 GMT
From: Rocco Caputo <troc@pobox.com>
Subject: Re: Nonblocking Pipe Open
Message-Id: <slrnce4ccg.hdf.troc@eyrie.homenet>

On Wed, 30 Jun 2004 10:36:14 +1000, Gregory Toomey wrote:
>
> I'm looking at writing a "domain diagnoser" that
> - does  whois, dig & ping concurrently for a domain (& subdomains)
> - interprets data from the subprocesses & and displays results in real time
> - possibly uses an expert system to diagnose problems

You may want to consider using POE instead of IO::Select if you plan to
do more complex things.  For example, it can help you avoid rewriting
an IO::Select loop if you choose to add a graphical interface later.

http://poe.perl.org/?POE_Cookbook has several examples, including
pinging multiple hosts, working with graphical interfaces, and managing
child processes.

http://poe.perl.org/?Poing has a program I wrote several years ago.
It's a multi-host ICMP pinger with response history.  I run it around
the clock to keep tabs on my internet provider.  You should see some of
the old screen shots.

By the way, I'm POE's principal author.
Here's your obligatory grain of salt.  :)

-- 
Rocco Caputo - http://poe.perl.org/


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6747
***************************************


home help back first fref pref prev next nref lref last post