Re: using perl in a c code

2003-12-04 Thread Tassilo von Parseval
On Wed, Dec 03, 2003 at 05:17:01PM -0600 Dan Muey wrote:

> Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also!

In order to make your C code more portable across several versions of
the perlapi, you could use Devel::PPPort.

perl -MDevel::PPPort -eDevel::PPPort::WriteFile

will create ppport.h in the current directory. You could take this file
and #include it in your source code. Many macros and some functions from
recent perls are thus also available in older perls.

With this (it corresponds to the -b switch of h2xs) it's relatively easy
to write XS or XS-alike code that runs under many Perl versions.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~;eval


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Send in POST method

2003-12-04 Thread max4o
Hi all,
my simple question is, is there a package that can help me to open URL and
send parametters via POST method, not with GET?

Thanks.
Milen H.
-
This mail is from: <[EMAIL PROTECTED]>
-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Send in POST method

2003-12-04 Thread Casey West
Hi.

I'm in the employ of Casey West, a list admin, to assist you with your
question. I've taken the liberty to search Google using the Subject line
you provided in your email to the list. I hope one of the links below
will be of service to you.

Sadly Google hasn't given us a nice, legal API for searching newsgroups,
so you may also want to try these searches.

 http://groups.google.com/groups?q=Perl+Send+POST+method
 http://groups.google.com/groups?q=Send+POST+method+group%3Acomp.lang.perl.*

If you didn't get any useful results below, there's a chance your
Subject line was not specific enough, or not detailed enough. For
example, the following subject lines are not very good choices.

  Subject: Doubt
  Subject: HELP!
  Subject: Problem

On the other hand, it's possible that your question is unique, or the
search needs a human touch to get just the right results.

Enjoy!

Perl.org Beginners' Lists, 0 results.
  Searched: site:nntp.x.perl.org inurl:perl.beginners -inurl:show_headers Send POST 
method

Perl.org Lists, 10 results.
  Searched: site:nntp.x.perl.org -inurl:show_headers Send POST method

  [1] nntp.perl.org - perl.cpan.testers (79633)
   http://nntp.x.perl.org/group/perl.cpan.testers/79633
 ... f make request even if head believes method is illegal ... use
 this content-type for POST, PUT, CHECKIN ... proxy settings from
 environment -H  send this HTTP ...

  [2] nntp.perl.org - perl.perl6.announce (347)
   http://nntp.x.perl.org/group/perl.perl6.announce/347
 ... by answering each question in a separate post with a ... to
 multiple dispatch there were no such method to find. ... or more
 of the following options: * Send money to ...

  [3] nntp.perl.org - perl.modules (14951)
   http://nntp.x.perl.org/group/perl.modules/14951
 ... you start with Method # 1 and add METHOD # 2 as ... Remember
 though, the more you send out the more potential ... surprised
 when I found my medium size post office box ...

  [4] nntp.perl.org - perl.perl6.announce (328)
   http://nntp.x.perl.org/group/perl.perl6.announce/328
 ... most stuff from Schwern's cursor his post is worth ... is
 negotiable." and noted that he counted method dispatch under ...
 Because you asked us to send you our answers ...

  [5] nntp.perl.org - perl.perl6.announce (325)
   http://nntp.x.perl.org/group/perl.perl6.announce/325
 ... method { ... ... But so far everybody has ignored that post...
 ... If you did like it, please consider one or both of the
 following options: * Send money to the Perl ...

  [6] nntp.perl.org - perl.libwww (5126)
   http://nntp.x.perl.org/group/perl.libwww/5126
 ... is given: http://somesite.com/prog/adduser";
 method="post">   Female
  http://nntp.x.perl.org/group/perl.cvs.p5ee/366
 ... target_widget = $context->widget($target_wname);
 $target_widget->$method(@args); } my ... So we have to send a
 hidden ... behavior that browsers will post values # in ...

  [8] nntp.perl.org - perl.perl6.announce (349)
   http://nntp.x.perl.org/group/perl.perl6.announce/349
 ... In a subsequent post he noted that it seems ... Quite what's
 wrong with class Object { method CLONE returns ... one or more of
 the following options: * Send money to ...

  [9] nntp.perl.org - perl.mvs (1190)
   http://nntp.x.perl.org/group/perl.mvs/1190
 ... Form >  > Upload Form >
  enctype="multipart ...
 I'm trying to send images to the ...

  [10] nntp.perl.org - perl.perl5.summary (15)
   http://nntp.x.perl.org/group/perl.perl5.summary/15
 ... adds also that every related message she'll send to p5p ...
 was the consequence of this first post, where we learned why a
 specific comparison method is needed ...

search.cpan.org, 10 results.
  Searched: site:search.cpan.org Send POST method

  [1] search.cpan.org: Net::POP3 - Post Office Protocol 3 Client class ...
   http://search.cpan.org/search?module=Net::POP3
 ... Net::POP3 - Post Office Protocol 3 Client class (RFC1939 ...
 When a method states that it returns a value, failure will be
 returned as undef or ... Send the USER command ...

  [2]   Version: 2.011 Date: 2000/06/17 ...
   http://search.cpan.org/src/KWILLIAMS/Apache-AuthCookie-2.011/Changes
 ... directive "{YourAuth}Secure" which will secure
 cookies (ie only send them over ... 02/11 04:46:59 The login forms
 may now use the POST method instead of ...

  [3] search.cpan.org: LWP - The World-Wide Web library for Perl
   http://search.cpan.org/perldoc?LWP
 ... For instance, we will send HTTP::Request s both to ftp ... The
 method is a short string that tells what kind of ... The most
 common methods are GET, PUT, POST and HEAD ...

  [4] search.cpan.org: lwpcook - The libwww-per

RE: remove control chars

2003-12-04 Thread Bob Showalter
Kipp, James wrote:
> Doesn't quite work. Notice I need to keep any newline ( "\n" ) chars.

Sorry, I missed that in the original post. Jeff gave you the fix.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Timing several processes

2003-12-04 Thread Akens, Anthony
AIX 5.1, actually.  Though eventually linux, windows,
and possibly other OS's will be in the mix.

I'm writing this with the idea of it being very "modular"
in that each server will do it's own "check" ever 15
minutes or so, and that the webserver will only "connect"
and grab that data when someone goes to the page (using
a cgi to parse it up and display it in a heirarchical
fashion).  The server will access the data via NFS (the
NFS exports are already in place due to another project)

Writing to a file gives me a history of data should any
individual box go down.  (Especially the "webserver" in
this case, since it is periodically taken offline during
the course of any given week due to its role in the
overall project these machines run)

I also plan on the actual programs that are called to be
set up in a config file.  Something along the lines of:

APP1_HANDLE = "sar"
APP1_EXEC = "sar 5 5"
APP1_LOG = "/log/monitor/delta/sar.out"
APP1_PARSE = "/log/monitor/parse_sar.pl"
APP1_SUMMARY = "/log/monitor/delta/sar.summary"

I'm planning on figuring out how to put all of those into
a hash, and then using a foreach loop to exec each one, and
another foreach loop to wait for each to complete, and a
final foreach loop that runs the "parse" for each one and
generates a summary.  The summary files will all be in a
"standard" format that the webserver will use to genrate
its display.

I had not thought of stderr from the commands, so
you're right that catching it is something I need to
think on.

The other bit I'm working on is to make an "options"
file for each server (generated before the summaries
are parsed) that contains info like number of processors,
and tuning options (set with schedtune and vmtune, etc)
that can be used by the "APP_PARSE" scripts in calculating 
results.  (Thrashing detection, etc).

I know, it's all a little complex, but the individual
pieces are fairly simple in design.  And in the end it
will meet the goal that management put forth, which is
what keeps me paid :)

-Tony

-Original Message-
From: drieux [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2003 7:24 PM
To: Perl Perl
Subject: Re: Timing several processes



On Dec 3, 2003, at 10:49 AM, Akens, Anthony wrote:
[..]
> print "Running vmstat\n";
> defined(my $vmstat_pid = fork) or die "Cannot fork: $!"; unless 
> ($vmstat_pid) {
>   exec "vmstat 5 5 > /log/monitor/delta/vmstat.out";
>   die "cannot exec vmstat: $!";
> }
> print "Running sar\n";
> defined(my $sar_pid = fork) or die "Cannot fork: $!";
> unless ($sar_pid) {
>   exec "sar 5 5 > /log/monitor/delta/sar.out";
>   die "cannot exec date: $!";
> }
> print "Waiting...\n";
> waitpid($vmstat_pid, 0);
> waitpid($sar_pid, 0);
> print "done!\n";
[..]

I presume you are working on a solaris box?
have you thought about

timex sar 5 5
timex vmstat 5 5

and you will notice that the sar command will
take about 25 seconds and the vmstat about 20.

but then there is that minor nit about

exec "vmstat 5 5 > /log/monitor/delta/vmstat.out"
or  die "cannot exec vmstat: $!";

since in theory exec WILL not return, so if it failed
why not keep it in the proper context...

Then there is that Minor Nit about not controlling 'stderr' which can
lead to things like:

vladimir: 60:] ./st*.plx
Running vmstat
Running sar
sh: /log/monitor/delta/vmstat.out: cannot create
sh: /log/monitor/delta/sar.out: cannot create
Waiting...
done!
vladimir: 61:]

So while you are in the process of learning
fork() and exec() why not think a bit more
agressively and go with say a pipe to pass
back the information so as not to buy
the IO overhead of writing to files?

While the following was written for a command
line 'let us get interactive' type of solution,
it might be a framework you could rip off
and use:





ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Databases - MS Sql Server Desktop Engine

2003-12-04 Thread Jenda Krynicky
From: "Paul Kraus" <[EMAIL PROTECTED]>
> I can't figure out how to connect to the database engine with odbc.

It's easiest if you first create a DNS using the "Data Sources 
(ODBC)" applet in "Administrators tools".

Se the docs of DBD::ODBC for examples how to connect then.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Perl and MS Access

2003-12-04 Thread Johnson, Shaunn
Howdy:

I think I've seen it, but I don't know where -

Isn't there a method to use Perl to connect to
some MS Access database and extract the
data into some other format (say, text).  I've
done it with Oracle and PostgreSQL ... I don't
know if MS Access is too different (mostly because
I live and play on a Unix / Linux box and avoid
Microsoft if I can help it).

Is this possible, and if so, where are the docs?
(I'm currently at perl.org ...)

Thanks!

-X


Re: Perl and MS Access

2003-12-04 Thread Casey West
Hi.

I'm in the employ of Casey West, a list admin, to assist you with your
question. I've taken the liberty to search Google using the Subject line
you provided in your email to the list. I hope one of the links below
will be of service to you.

Sadly Google hasn't given us a nice, legal API for searching newsgroups,
so you may also want to try these searches.

 http://groups.google.com/groups?q=Perl+Perl+MS+Access
 http://groups.google.com/groups?q=Perl+MS+Access+group%3Acomp.lang.perl.*

If you didn't get any useful results below, there's a chance your
Subject line was not specific enough, or not detailed enough. For
example, the following subject lines are not very good choices.

  Subject: Doubt
  Subject: HELP!
  Subject: Problem

On the other hand, it's possible that your question is unique, or the
search needs a human touch to get just the right results.

Enjoy!

Perl.org Beginners' Lists, 0 results.
  Searched: site:nntp.x.perl.org inurl:perl.beginners -inurl:show_headers Perl MS 
Access

Perl.org Lists, 10 results.
  Searched: site:nntp.x.perl.org -inurl:show_headers Perl MS Access

  [1] nntp.perl.org - perl.jobs (1136)
   http://nntp.x.perl.org/group/perl.jobs/1136
 ... You’ll develop, manage and document high quality perl
 components and MS Access front-ends for a content production
 framework using relational database (Oracle ...

  [2] nntp.perl.org - perl.macperl.anyperl (242)
   http://nntp.x.perl.org/group/perl.macperl.anyperl/242
 ... To: Macperl  Message-ID:
 <[EMAIL PROTECTED]> Subject:
 MS Access database and perl From: info ...

  [3] nntp.perl.org - perl.jobs (1188)
   http://nntp.x.perl.org/group/perl.jobs/1188
 ... Desired skills: Sybase MS Access Previous experience working
 with large databases and ... e-mail resume to
 [EMAIL PROTECTED], citing “Perl data programmer ...

  [4] nntp.perl.org - perl.macperl.anyperl
   http://nntp.x.perl.org/group/perl.macperl.anyperl
 ... 23:47:34 +0100, 19. 242, MS Access database and perl,
 info#multi-graphics.nl, Fri, 28 Feb 2003 21:15:12 +0100, 6. 241,
 perl and my internal ...

  [5] nntp.perl.org - perl.cpan.workers (108)
   http://nntp.x.perl.org/group/perl.cpan.workers/108
 ... Hansen) References:
 <[EMAIL PROTECTED]> On ... is the only one
 with physical access (it's in ... att.net (12.122.2.53) 1635.209
 ms 1658.336 ms ...

  [6] nntp.perl.org - perl.ldap (417)
   http://nntp.x.perl.org/group/perl.ldap/417
 ... from the > Net::LDAP::Examples link on
 http://perl-ldap.sourceforge ... don't use port 389 for > LDAP
 access (I think ... The MS web site has a document about it, and
 ...

  [7] nntp.perl.org - perl.mvs (1113)
   http://nntp.x.perl.org/group/perl.mvs/1113
 ... Brad Van Duser EDS - BellSouth Account MS 6J72 BSC 675 West
 ... had hoped to be able to deploy Perl 5.8.0 ... a web server
 that you have control and access to (perhaps ...

  [8] nntp.perl.org - perl.perl5.porters (83490)
   http://nntp.x.perl.org/group/perl.perl5.porters/83490
 ... an error when someone attempts to access what is ... 31
 00:44:34.0 +0200 +++ e:\buildperl\perl\av.c ... META
 NAME=3D"Generator" CONTENT=3D"MS Exchange Server ...

  [9] nntp.perl.org - perl.cpan.testers (74268)
   http://nntp.x.perl.org/group/perl.cpan.testers/74268
 ... to be able to run it, you need a Windows machine and you need
 to have access toMS SQL Server ... A simple 't/use.t' that says: >
 >#!usr/bin/env perl -w >use ...

  [10] nntp.perl.org - perl.ldap (503)
   http://nntp.x.perl.org/group/perl.ldap/503
 ... However, when I run this using MS personal web server it
 crashes the webserver. ... I think the DATA filehandle is the
 magic perl way to access the  non ...

search.cpan.org, 10 results.
  Searched: site:search.cpan.org Perl MS Access

  [1]     

Compile help...

2003-12-04 Thread NIPP, SCOTT V (SBCSI)
I am trying to compile a 64bit Perl with Largefiles support.  I am
seeing the following error during the 'make test'.  Any help would be most
appreciated.  This is version 5.6.1 on HP-UX 11i.  The compile is being
performed with the HP ANSI C compiler.

lib/syslfs..skipped: writing past 2GB failed: process limits?

Thanks again.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 64 bit Perl memory test...

2003-12-04 Thread Casey West
It was Thursday, December 04, 2003 when Bakken, Luke took the soap box, saying:
: > how they were monitoring and/or determining this.  Basically, 
: > I would like
: > help with a Perl test script to use memory until Perl reaches 
: > it's memory
: > limit.  This will help me to know when I have things right so 
: > I don't have
: > to keep going back to the end users and tell them "OK, try it now".
: > Thanks in advance for any help.
: 
: use strict;
: my $bigbuf;
: my $buf;
: open IN, '/dev/random' or die "Can't open random device: $!";
: while( read(IN, $buf, 16384) > 0 ) {
: $bigbuf .= $buf;
: }

The original poster was having trouble with data from Oracle, not the
filesystem.  I'm not quite sure what you're trying to demonstrate
here.

  Casey West

-- 
Shooting yourself in the foot with Oracle
You decide to shoot yuourself in the foot and go out to buy a gun -
except the gun won't work without "deploying" a shoulder holster
solution, and relational titanium alloy bullets, and body armour
infrastructure, and a laser sight assistant, and a retractable arm
stock application, and an enterprise team of ballistics experts and a
chiropodist.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[First Response Service] Re: 64 bit Perl memory test...

2003-12-04 Thread Casey West
Hi.

I'm in the employ of Casey West, a list admin, to assist you with your
question. I've taken the liberty to search Google using the Subject line
you provided in your email to the list. I hope one of the links below
will be of service to you.

Sadly Google hasn't given us a nice, legal API for searching newsgroups,
so you may also want to try these searches.

 http://groups.google.com/groups?q=Perl+64+bit+Perl+memory+test%2E%2E%2E
 
http://groups.google.com/groups?q=64+bit+Perl+memory+test%2E%2E%2E+group%3Acomp.lang.perl.*

If you didn't get any useful results below, there's a chance your
Subject line was not specific enough, or not detailed enough. For
example, the following subject lines are not very good choices.

  Subject: Doubt
  Subject: HELP!
  Subject: Problem

On the other hand, it's possible that your question is unique, or the
search needs a human touch to get just the right results.

Enjoy!

Perl.org Beginners' Lists, 0 results.
  Searched: site:nntp.x.perl.org inurl:perl.beginners -inurl:show_headers 64 bit Perl 
memory test...

Perl.org Lists, 9 results.
  Searched: site:nntp.x.perl.org -inurl:show_headers 64 bit Perl memory test...

  [1] nntp.perl.org - perl.golf (2093)
   http://nntp.x.perl.org/group/perl.golf/2093
 ... the size of the basic perl structures vary quite a bit in 32-
 versus 64-bit perl). ... In contrast, my 49 solution uses 129M of
 memory to > solve test 24 (the ...

  [2] nntp.perl.org - perl.dbi.announce (137)
   http://nntp.x.perl.org/group/perl.dbi.announce/137
 ... (note that perl itself must also be built in 64 bit mode for
 ... Improved syb_err_handler handling (thanks to Matthew Persico)
 Fixed memory leak when opening ...

  [3] nntp.perl.org - perl.cpan.testers (32341)
   http://nntp.x.perl.org/group/perl.cpan.testers/32341
 ... mips4 -TARG:platform=ip32'; > perl -V:ccflags ...
 RLIM32_INFINITY 0x7fff #elif (_MIPS_SZLONG == 64) ||
 (_MIPS_SIM == _ABIN32 ... Convert the given 32 bit limit spec ...

  [4] nntp.perl.org - perl.perl6.internals (14713)
   http://nntp.x.perl.org/group/perl.perl6.internals/14713
 ... at]sidhe.org>,  Subject ...
 packfile (on disk) or in the bytecode (in memory). ... 32-bit
 number of bytes (or maybe 64-bit) DATA: arbitrary ...

  [5] nntp.perl.org - perl.perl5.summary (64)
   http://nntp.x.perl.org/group/perl.perl5.summary/64
 perl.perl5.summary (64). ... it may be a bit outdated though ...
 Weekly summaries are published on http://use.perl.org/ and on a
 mailing list, which subscription address ...

  [6] nntp.perl.org - perl.perl5.porters (84975)
   http://nntp.x.perl.org/group/perl.perl5.porters/84975
 ... I can't seem to get Solaris to build as 64 bit. ...
 perl5/5.8.2/sun4-solaris-thread-multi-64/CORE privlib ... perl
 will # require -Ilib tags: TAGS perl emacs/e2ctags ...

  [7] nntp.perl.org - perl.perl5.changes (9220)
   http://nntp.x.perl.org/group/perl.perl5.changes/9220
 ... item Calls to external programs - -=item Memory allocation -
 -=item ... Perl on OS/390 - -=item Build, Test, Install Perl ...
 over 4 - -=item 64-bit perl on Solaris. ...

  [8] nntp.perl.org - perl.cvs.parrot (5413)
   http://nntp.x.perl.org/group/perl.cvs.parrot/5413
 ... c From: mrjoltcola[at]cvs.perl.org (Melvin ... char
 *yy_c_buf_p = (char *) 0; @@ -225,64 +293,100 @@ * instead ...
 YY_G(yy_c_buf_p); /* cast for 8-bit char's */ + *YY_G ...

  [9] nntp.perl.org - perl.perl5.porters (70689)
   http://nntp.x.perl.org/group/perl.perl5.porters/70689
 ... We won't be including . I'll use memmove ...
 Checking how to print 64-bit integers... ... Checking the format
 strings to be used for Perl's internal types... ...

search.cpan.org, 10 results.
  Searched: site:search.cpan.org 64 bit Perl memory test...

  [1] search.cpan.org: README.tru64 - Perl version 5 on Tru64 ( ...
   http://search.cpan.org/~jhi/perl-5.8.1/README.tru64
 ... the toke.c gcc likes to have a lot of memory, 256 megabytes
 ... include and -Dloclibpth=/some/lib and before running "make
 test" setting your ... 64-bit Perl on Tru64. ...

  [2] Revision history for Perl extension BerkeleyDB.
   http://search.cpan.org/src/PMQS/BerkeleyDB-0.25/Changes
 ... 0.14 21st January 2001 * Silenced the warnings when build with
 a 64-bit Perl. ... or database failed, there was a small memory
 leak. ... A thread-enabled Perl it could ...

  [3] search.cpan.org: README.solaris - Perl version 5 on Solaris ...
   http://search.cpan.org/~rgarcia/perl-5.6.2/README.solaris
 ... To compile a 64-bit application on an UltraSparc with ...
 malloc has trouble allocating more than 2GB of memory. ... common
 error when trying to build perl on Solaris ...

  [4]   If you read this

RE: 64 bit Perl memory test...

2003-12-04 Thread Bakken, Luke
> It was Thursday, December 04, 2003 when Bakken, Luke took the 
> soap box, saying:
> : > how they were monitoring and/or determining this.  Basically, 
> : > I would like
> : > help with a Perl test script to use memory until Perl reaches 
> : > it's memory
> : > limit.  This will help me to know when I have things right so 
> : > I don't have
> : > to keep going back to the end users and tell them "OK, 
> try it now".
> : >   Thanks in advance for any help.
> : 
> : use strict;
> : my $bigbuf;
> : my $buf;
> : open IN, '/dev/random' or die "Can't open random device: $!";
> : while( read(IN, $buf, 16384) > 0 ) {
> : $bigbuf .= $buf;
> : }
> 
> The original poster was having trouble with data from Oracle, not the
> filesystem.  I'm not quite sure what you're trying to demonstrate
> here.
> 
>   Casey West

It's bad enough that your spamming the list with useless posts, but here
you're demonstrating a complete inability to read what a person wants.
He said:

"Basically, I would like help with a Perl test script to use memory
until Perl reaches it's memory limit."

That is exactly what this bit of code does - it fills $bigbuf with data
in 16K chunks until the OS kills it for using too much memory.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: First Steps Perl DB programming (was: Re: first steps - read from files and make linklist)

2003-12-04 Thread Jonathan Jesse
Sorry for being off topic.  I am slowly trying to learn the basics and 
then eventually move over to the work on the SQL side of things.  Thanks 
for the idea for the book, I'll look into that along with the 
documentation.

On Wed, 3 Dec 2003 13:01:54 -0700, Wiggins D Anconia 
<[EMAIL PROTECTED]> wrote:



Hello list,
I am as well a beginner to Perl and am currently working my way through
the LLama and I have also purchased the Camel and am looking through it.
My goal is to be able to do some programming for a MySQL database that I
am in charge of running.  Any help along with the previous message would
be great.
Your question, other than context, is really completely different. In
general the canned response of,
"You will want to become familar with the DBI module available from
CPAN. It is a generic Perl interface that uses engine specific drivers
to control any of numerous types of engines, MySQL being one of those."
Should get you most of the way there, assuming you then go and read the
documentation for DBI. ORA also has a book "Programming the Perl DBI"
that is excellent coverage of the material if you are into the whole
book thing.
http://search.cpan.org/~timb/DBI-1.39/DBI.pm

http://danconia.org


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Beta Testing a Robot

2003-12-04 Thread Wiggins d Anconia


> > I don't quite understand why the first response is sent back to the list
> > rather than just the OP though?
> 
> Why do you send your responses (answers to questions) to the list
instead of
> to the OP? So that others can benefit, and so that it will be in the list
> archives when someone else has the same question and searches the archives
> before posting (like that ever happens! :-)
> 
> I agree with Casey making his robot send to the list for this same reason.
> Though it doesn't benefit those who didn't post the question (and answers
> seldom do, since people who can answer questions normally don't need the
> answers), they'll be in the archive when someone else comes and tries to
> search for this same question (or a similar one).
> 

But then you really are talking about an automated FAQ generator and at
that point it might be easier to put up a web site, throw all of the
first responses there, and point them to a web site, provide the meta
search on the site as a text box, but then we are back to all of the
other solutions The fact that the messages are archived presents at
least two problems, since they are merely just links to results on
common search sources which take up a lot of space for someone and
increases the download amount for *all posters* (caveat: who use SMTP)
(13/14 kb a piece is not lite by any means), and may very quickly become
outdated, then the amount of crud someone must wade through if they are
one of the few that actually check the archive first has gone up greatly.

I would use a Perl meta-search in a heart beat, but don't think that a
mailing list is necessarily a forum for it, at least not at 13/14 kb a
pop. How about a first response that has a single link in it that sends
a user to the results of the meta-search on a page, or maybe even
throwing that link in the footer of the message when it hits the list. 

http://danconia.org



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



hostname

2003-12-04 Thread Thomas Browner
Is there away to find all of the hostname on a lan with use of perl?

 

Thanks,

 

Thomas

 



[First Response Service] Re: hostname

2003-12-04 Thread Casey West
Hi.

I'm in the employ of Casey West, a list admin, to assist you with your
question. I've taken the liberty to search Google using the Subject line
you provided in your email to the list. I hope one of the links below
will be of service to you.

Sadly Google hasn't given us a nice, legal API for searching newsgroups,
so you may also want to try these searches.

 http://groups.google.com/groups?q=Perl+hostname
 http://groups.google.com/groups?q=hostname+group%3Acomp.lang.perl.*

If you didn't get any useful results below, there's a chance your
Subject line was not specific enough, or not detailed enough. For
example, the following subject lines are not very good choices.

  Subject: Doubt
  Subject: HELP!
  Subject: Problem

On the other hand, it's possible that your question is unique, or the
search needs a human touch to get just the right results.

Enjoy!

Perl.org Beginners' Lists, 7 results.
  Searched: site:nntp.x.perl.org inurl:perl.beginners -inurl:show_headers hostname

  [1] nntp.perl.org - perl.beginners (54768)
   http://nntp.x.perl.org/group/perl.beginners/54768
 ... Previous | Next | Toggle headers Newsgroups: perl.beginners
 Message-ID: <3FA32B75 ... Maybe something like this: > > %commands
 = ('sol'=>{'hostname' => [1,'uname -n ...

  [2] nntp.perl.org - perl.beginners (54781)
   http://nntp.x.perl.org/group/perl.beginners/54781
 ... Previous | Next | Toggle headers Newsgroups: perl.beginners
 Message-ID ... Maybe something like this: > > %commands =
 ('sol'=>{'hostname' => [1,'uname -n'], > 'os ...

  [3] nntp.perl.org - perl.beginners (54759)
   http://nntp.x.perl.org/group/perl.beginners/54759
 ... Previous | Next | Toggle headers Newsgroups: perl.beginners
 Message-ID: <049FA0234069D945B133B9B4FB64C77501E69B92 ... print
 $1}' | wc -l Command: hostname uname -n ...

  [4] nntp.perl.org - perl.beginners (54763)
   http://nntp.x.perl.org/group/perl.beginners/54763
 ... Previous | Next | Toggle headers Newsgroups: perl.beginners
 Message-ID ... Maybe something like this: %commands =
 ('sol'=>{'hostname' => [1,'uname -n'], 'os' => [2 ...

  [5] nntp.perl.org - perl.beginners (54762)
   http://nntp.x.perl.org/group/perl.beginners/54762
 ... Previous | Next | Toggle headers Newsgroups: perl.beginners
 Message-ID: <3FA2EEFD ... commands, "Tie::IxHash"; >> >commands =
 ('sol'=>{'hostname' =>'uname -n ...

  [6] nntp.perl.org - perl.beginners (54758)
   http://nntp.x.perl.org/group/perl.beginners/54758
 ... Previous | Next | Toggle headers Newsgroups: perl.beginners
 Message-ID ... > > tie my %commands, "Tie::IxHash"; > > >commands
 = ('sol'=>{'hostname' =>'uname -n ...

  [7] nntp.perl.org - perl.beginners (45405)
   http://nntp.x.perl.org/group/perl.beginners/45405
 ... Previous | Next | Toggle headers Newsgroups: perl.beginners
 Message-ID ... my $remote = IO::Socket::INET->new( > PeerAddr =>
 "server hostname", > PeerPort => "9284 ...

Perl.org Lists, 10 results.
  Searched: site:nntp.x.perl.org -inurl:show_headers hostname

  [1] nntp.perl.org - perl.cpan.testers (97786)
   http://nntp.x.perl.org/group/perl.cpan.testers/97786
 ... 9 Aug 2003 05:25:21 - Message-ID:
 <[EMAIL PROTECTED]> Cc:
 MIKER[at]cpan.org Subject: FAIL Sys-Hostname-FQDN-0.02 sun4 ...

  [2] nntp.perl.org - perl.cpan.testers (97820)
   http://nntp.x.perl.org/group/perl.cpan.testers/97820
 ... 05:58 -0700 (PDT) To: Josts Smokehouse
  cc:
  Subject: Re: FAIL
 Sys-Hostname-FQDN-0.02 ...

  [3] nntp.perl.org - perl.qpsmtpd (626)
   http://nntp.x.perl.org/group/perl.qpsmtpd/626
 ... lc($recipient->host); use IO::Socket; foreach my $hostname (
 @check_vrfy ) { if ($hostname =~ /^(w]+)$/hostname = $1; # cleanse
 the taint } my $VRFY ...

  [4] nntp.perl.org - perl.daily.news (767)
   http://nntp.x.perl.org/group/perl.daily.news/767
 ... [25]Net-MDNS-Server-0.03 -- Perl extension for a multicast DNS
 server * [26]PAR-0.75 -- Perl Archive Toolkit *
 [27]Sys-Hostname-FQDN-0.05 -- Get the short or ...

  [5] nntp.perl.org - perl.beginners (54768)
   http://nntp.x.perl.org/group/perl.beginners/54768
 ... Maybe something like this: > > %commands = ('sol'=>{'hostname'
 => [1,'uname -n'], > 'os' => [2,'uname -s'], > 'osver' =>
 [3,'uname -r'], > 'osrel' => [4,'cat ...

  [6] nntp.perl.org - perl.dbi.users (21008)
   http://nntp.x.perl.org/group/perl.dbi.users/21008
 ... JDBC Proxy Sponge DBI 1.38-nothread dispatch trace level set
 to 2 DEBUG: connecting to JDBC using this conn string --
 dbi:JDBC:hostname=lintest.somedomain.com ...

  [7] nntp.perl.org - perl.perl4lib (1487)
   http://nntp.x.perl.org/group/perl.perl4lib/1487
 ... The cookbook also suggested 

RE: Beta Testing a Robot

2003-12-04 Thread Guay Jean-Sébastien
> I don't quite understand why the first response is sent back to the list
> rather than just the OP though?

Why do you send your responses (answers to questions) to the list instead of
to the OP? So that others can benefit, and so that it will be in the list
archives when someone else has the same question and searches the archives
before posting (like that ever happens! :-)

I agree with Casey making his robot send to the list for this same reason.
Though it doesn't benefit those who didn't post the question (and answers
seldom do, since people who can answer questions normally don't need the
answers), they'll be in the archive when someone else comes and tries to
search for this same question (or a similar one).


> Another concern is that the
> response comes from your address, or at least uses your name [...]

I agree with you there, that should be changed. Maybe put "First response
<[EMAIL PROTECTED]>" as the name the e-mail comes from, instead of
in the subject line (or something like that)?


J-S

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



64 bit Perl memory test...

2003-12-04 Thread NIPP, SCOTT V (SBCSI)
I have been asked to get a 64bit version of Perl compiled and
working under HP-UX 11i.  I have found some helpful hints on actually
compiling this successfully.  The reason for the 64bit version is memory
utilization.  My users have a script that processes an Oracle database of
about 15 million records, and they informed me that the process requires
about 5GB of memory.  When attempting to run this in the standard (32bit)
Perl, the process would fail at about 1GB of memory usage.  I am not sure
how they were monitoring and/or determining this.  Basically, I would like
help with a Perl test script to use memory until Perl reaches it's memory
limit.  This will help me to know when I have things right so I don't have
to keep going back to the end users and tell them "OK, try it now".
Thanks in advance for any help.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: hostname

2003-12-04 Thread Bob Showalter
Thomas Browner wrote:
> Is there away to find all of the hostname on a lan with use of perl?

Getting a list of host names involves querying some kind of nameserver or
directory service. What kind of LAN? What kind of hosts?

You can query DNS to get the hosts in a domain using nslookup, dig, host, or
similar. For example:

   host -l mydomain.com

If you want to talk to the resolver directly from Perl, you can use the
Net::DNS module.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 64 bit Perl memory test...

2003-12-04 Thread Casey West
It was Thursday, December 04, 2003 when Bakken, Luke took the soap box, saying:
: > It was Thursday, December 04, 2003 when Bakken, Luke took the 
: > soap box, saying:
: > : > how they were monitoring and/or determining this.  Basically, 
: > : > I would like
: > : > help with a Perl test script to use memory until Perl reaches 
: > : > it's memory
: > : > limit.  This will help me to know when I have things right so 
: > : > I don't have
: > : > to keep going back to the end users and tell them "OK, 
: > try it now".
: > : > Thanks in advance for any help.
: > : 
: > : use strict;
: > : my $bigbuf;
: > : my $buf;
: > : open IN, '/dev/random' or die "Can't open random device: $!";
: > : while( read(IN, $buf, 16384) > 0 ) {
: > : $bigbuf .= $buf;
: > : }
: > 
: > The original poster was having trouble with data from Oracle, not the
: > filesystem.  I'm not quite sure what you're trying to demonstrate
: > here.
: 
: "Basically, I would like help with a Perl test script to use memory
: until Perl reaches it's memory limit."

I missed that part, yes.

: That is exactly what this bit of code does - it fills $bigbuf with data
: in 16K chunks until the OS kills it for using too much memory.

Excellent.

  Casey West

-- 
Good Idea: Playing the piccolo in a marching band.
Bad Idea:  Playing the piano in a marching band. 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: hostname

2003-12-04 Thread Helgi Briem
Thomas Browner wrote:
> Is there away to find all of the hostname on a lan with use of perl?

Portable to most systems:

use Sys::Hostname;
my $host = hostname;

or (on Windows systems):

my $host = $ENV{COMPUTERNAME};

or (on *nix systems):

my $host = $ENV{HOSTNAME};

-- 
Helgi Briem Tæknideild  Landssíminn EHF
[EMAIL PROTECTED]
Sími: 550-7466 GSM: 896-7466


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[First Response Service] Re: Compile help...

2003-12-04 Thread Casey West
Hi.

I'm in the employ of Casey West, a list admin, to assist you with your
question. I've taken the liberty to search Google using the Subject line
you provided in your email to the list. I hope one of the links below
will be of service to you.

Sadly Google hasn't given us a nice, legal API for searching newsgroups,
so you may also want to try these searches.

 http://groups.google.com/groups?q=Perl+Compile+help%2E%2E%2E
 http://groups.google.com/groups?q=Compile+help%2E%2E%2E+group%3Acomp.lang.perl.*

If you didn't get any useful results below, there's a chance your
Subject line was not specific enough, or not detailed enough. For
example, the following subject lines are not very good choices.

  Subject: Doubt
  Subject: HELP!
  Subject: Problem

On the other hand, it's possible that your question is unique, or the
search needs a human touch to get just the right results.

Enjoy!

Perl.org Beginners' Lists, 1 results.
  Searched: site:nntp.x.perl.org inurl:perl.beginners -inurl:show_headers Compile 
help...

  [1] nntp.perl.org - perl.beginners (55901)
   http://nntp.x.perl.org/group/perl.beginners/55901
 ... dan[at]mathjunkies.com> CC: Perl Beginners http://nntp.x.perl.org/group/perl.inline
 ... 1981, Inline::Java 0.42 installation help,
 Alain.Chiorboli#motorola.com, Thu, 11 Sep 2003 09 ... 1978, Re:
 Finished Build Compile Stage but can't use, jacoby#life-medien ...

  [2] nntp.perl.org - perl.dbi.users
   http://nntp.x.perl.org/group/perl.dbi.users
 ... 21017, Please help Me, huutri80#netscape.net, Tue, 18 Nov 2003
 15:58:06 ... 21002, Re: Perl 5.8.1 and DBD::Informix compile error
 - SvOK_off, tvilliers#lastminute.com, ...

  [3] nntp.perl.org - perl.inline (1947)
   http://nntp.x.perl.org/group/perl.inline/1947
 ... Hope they help  though they didn't help me to get it to
 compile. Even a deliberately inserted error didn't crash the
 compilation. ...

  [4] nntp.perl.org - perl.inline (1952)
   http://nntp.x.perl.org/group/perl.inline/1952
 ... scripts to > compile Java programs without having to launch a
 new > Java virtural machine for each compile request. > > Thanks
 for your help, > > Phil Crow ...

  [5] nntp.perl.org - perl.inline (1951)
   http://nntp.x.perl.org/group/perl.inline/1951
 ... to allow Perl scripts to compile Java programs without having
 to launch a new Java virtural machine for each compile request.
 Thanks for your help, Phil Crow ...

  [6] nntp.perl.org - perl.perl6.language.subs (310)
   http://nntp.x.perl.org/group/perl.perl6.language.subs/310
 ... proto-types only fulfills a tiny niche, which is mainly to
 offer compile-type checking ... parameters, since in this realm,
 the current proto-types are of no help. ...

  [7] nntp.perl.org - perl.mvs
   http://nntp.x.perl.org/group/perl.mvs
 ... 1144, Re: Help where is this archive library m ? How can I
 compile now ? Change Makefile ? ... 1143, Help where is this
 archive library m ? How can I compile now ? ...

  [8] nntp.perl.org - perl.recdescent (259)
   http://nntp.x.perl.org/group/perl.recdescent/259
 ... This will help tremendously. ... > when i tried that, however,
 i ran into the "did not compile, > which can't happen!" :-/
 problem. ...

  [9] nntp.perl.org - perl.dbi.users (20700)
   http://nntp.x.perl.org/group/perl.dbi.users/20700
 ... them is the bundled C compiler on HP-UX - but that can't
 compile Perl so ... V' from your working versions of Perl + DBI +
 DBD::Informix, it may help me - thanks. ...

  [10] nntp.perl.org - perl.perl6.language.objects (581)
   http://nntp.x.perl.org/group/perl.perl6.language.objects/581
 ... a simple pragma module to write and would again serve to help
 clarify the ... that *need* it, as well as allowing for the
 possibility of compile time optimization ...

search.cpan.org, 10 results.
  Searched: site:search.cpan.org Compile help...

  [1] search.cpan.org: Pod2WinHlp - generate Windows Help and/or HTML ...
   http://search.cpan.org/~pvhp/Pod2WinHlp-0.02/README
 ... COMPILING HELP ^. ... To compile help convert perlpod to
 perl.rtf in a directory with perl_eg.hpj then type: hcw
 perl_eg.hpj at the command line. ...

  [2] # TODO Bootstrap code for Dependencies require 'm/Makefile.pm'; ...
   http://search.cpan.org/src/PARDUS/Zoidberg-0.40/Makefile.PL
 ... install' => ['compile'], 'all' => [qw/compile test install/],
 'cpan' => [qw/compile installdeps test install/], },help' => {
 'compile' => 'Prepare all files ...

  [3]  ...
   http://search.cpan.org/src/TIMB/DBD-Oracle-1.14/README.help
 ... SCO - For general help enabling dynamic ... applications with

RE: 64 bit Perl memory test...

2003-12-04 Thread Bakken, Luke
> how they were monitoring and/or determining this.  Basically, 
> I would like
> help with a Perl test script to use memory until Perl reaches 
> it's memory
> limit.  This will help me to know when I have things right so 
> I don't have
> to keep going back to the end users and tell them "OK, try it now".
>   Thanks in advance for any help.

use strict;
my $bigbuf;
my $buf;
open IN, '/dev/random' or die "Can't open random device: $!";
while( read(IN, $buf, 16384) > 0 ) {
$bigbuf .= $buf;
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Compile help...

2003-12-04 Thread Bakken, Luke
>   I am trying to compile a 64bit Perl with Largefiles 
> support.  I am
> seeing the following error during the 'make test'.  Any help 
> would be most
> appreciated.  This is version 5.6.1 on HP-UX 11i.  The 
> compile is being
> performed with the HP ANSI C compiler.
> 
> lib/syslfs..skipped: writing past 2GB failed: process limits?
> 
>   Thanks again.

Read up on per-user limits and the ulimit command.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Perl and MS Access

2003-12-04 Thread Thomas Bätzler
Hello Shaunn,

> I think I've seen it, but I don't know where -
> 
> Isn't there a method to use Perl to connect to
> some MS Access database and extract the
> data into some other format (say, text).

That works fine with the DBD::ODBC module. If you
have got large records in the database, you should
set $dbh->{LongReadLen} to the maximum record size,
otherwise the records will be truncated.

HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Beta Testing a Robot

2003-12-04 Thread Guay Jean-Sébastien
> and may very quickly become
> outdated, then the amount of crud someone must wade through if they are
> one of the few that actually check the archive first has gone up greatly.

You've got a good point there. I didn't see it from that point of view, but
now that I do, I agree that this is not really that useful. Perhaps, as you
said, just send to the OP since it will only be useful at the moment the
question was asked.

Also, if the person who posts a question didn't Google it first, a list
member can ask them to do it in less lines than including a Google search in
a message to the list... 


You've got me on your side, Wiggins. :-)

J-S

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Beta Testing a Robot

2003-12-04 Thread Bob Showalter
Casey West wrote:
> I'm beta-testing a robot that searches Google when new questions are
> posed to the beginners' lists.  I have no idea if it will be useful.

I'm not thrilled with the bot traffic, but at least it can be easily
filtered out now. Perhaps the bot should only address questions that have
gone unanswered for a while?

I wonder if the folks who take the time to craft a good subject line are the
same who will check the FAQ and do a Google search anyway, and vice-versa.

I do like Wiggins' idea of adding a link to the message when it gets posted.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: remove control chars

2003-12-04 Thread Rob Dixon
James Kipp wrote:
>
> I have some C code that I need to convert to perl
> and I am pressed for time, which is why I am posting this.

Erm. Sorry to spoil the party an' all, but the answer
is surely to go to your management and say that you need
extra time? Many homework questions to the group have been
trounced. Surely it is worse to freely support someone
else's paid employment?

I'll happily back down here if nobody agrees, but surely..?

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Beta Testing a Robot

2003-12-04 Thread Tom Kinzer
I also admire the effort and the good intentions, but,

 I think most Perl programmers can handle a Google search, and the bot
just creates unnecessary traffic on the list.  At a minimum, it should only
send to the original poster, not the whole list. 

my $2Cents;

-Tom Kinzer


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: remove control chars

2003-12-04 Thread Tom Kinzer
Hah! I'm unemployed right now, so how about a contract?!?  ;)

--Tom Kinzer
--Perl Gun for Hire--

-Original Message-
From: Rob Dixon [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 04, 2003 8:56 AM
To: [EMAIL PROTECTED]
Subject: Re: remove control chars


James Kipp wrote:
>
> I have some C code that I need to convert to perl
> and I am pressed for time, which is why I am posting this.

Erm. Sorry to spoil the party an' all, but the answer
is surely to go to your management and say that you need
extra time? Many homework questions to the group have been
trounced. Surely it is worse to freely support someone
else's paid employment?

I'll happily back down here if nobody agrees, but surely..?

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: 64 bit Perl memory test...

2003-12-04 Thread NIPP, SCOTT V (SBCSI)
Unfortunately, there is no /dev/random in HP-UX.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-Original Message-
From: Bakken, Luke [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 04, 2003 9:36 AM
To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Subject: RE: 64 bit Perl memory test...


> how they were monitoring and/or determining this.  Basically, 
> I would like
> help with a Perl test script to use memory until Perl reaches 
> it's memory
> limit.  This will help me to know when I have things right so 
> I don't have
> to keep going back to the end users and tell them "OK, try it now".
>   Thanks in advance for any help.

use strict;
my $bigbuf;
my $buf;
open IN, '/dev/random' or die "Can't open random device: $!";
while( read(IN, $buf, 16384) > 0 ) {
$bigbuf .= $buf;
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Fix the Root Problem - Re: Beta Testing a Robot

2003-12-04 Thread drieux
On Dec 4, 2003, at 7:23 AM, Christopher G Tantalo wrote:
[..]
This does seem like a good idea, but for some of us who
can not access the web from work, this just makes it worse.
[..]

Personally I am neutralish in this debate about the bot,
but I think that Christopher has put the scary part on
the table that we should all be worried about.
Most of us started with the premise:

have you done a web-search?
have you checked the c-pan?
have you checked the On-Line Perl Docs at...
since for us, we think of the web as the store house
of knowledge that we can pluck tastey bits from.
There are folks I know who are 'living on' UUCP
connections, the old fashion way, for whom an
HTTP connection is not going to be happening. So
yes, I can come up with at least one scenario in
which Christopher's case Could Be Occurring.
There is some room to negotiate solutions here.

I adopted the strategy of hanging out code sample
on my webPage to save on the throughput to the list.
{ and to let me find my answers later on, when I
needed to get some Little Arcanea that I rarely use... }
But clearly as Christopher has pointed out that
may not be the panacea that I had hoped for. Also
as those watching Google Performance will note,
at best they can scan some sites maybe once a month
if that, so there are issues with our root assumptions
that we need to work on...
On Christopher's side of the line, to argue with
his management that for 'professional reasons'
web-access would be an improvement in productivity,
since clearly being able to 'google it' will help
answer various technical issues much faster.
Clearly we must all support a campaign slogan Like

Bigger Routers! Faster Pipes!
A FOT ( fiber optic Terminal ) in
every garage and Work Place.
Until then I guess we will just have to keep improvising.

ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: 64 bit Perl memory test...

2003-12-04 Thread david
Scott V Nipp wrote:

> Unfortunately, there is no /dev/random in HP-UX.

fortunately, you don't need /dev/random. any of the following should eat up 
all of your machine's memory sooner or later:

[panda]# perl -e '$#a={}'
[panda]# perl -e '$a[{}]=1'
[panda]# perl -e '$#a+=0x while 1'
[panda]# perl -e '$i.=0x0x while 1'

david
-- 
s,.*,<<,e,y,\n,,d,y,.s,10,,s
.ss.s.s...s.sss.s.ss
s.s.s...s...s..s
...s.ss..s.sss..ss.sss.s
s.s.s...ss.sss.s
..s..sss.s.ss.sss...
..ssss.sss.sss.s

,{4},"|?{*=}_'y!'+0!$&;"
,ge,y,!#:$_(-*[./<[EMAIL PROTECTED],b-t,
.y...,$~=q~=?,;^_#+?{~,,$~=~
y.!-&*-/:[EMAIL PROTECTED] ().;s,;,
);,g,s,s,$~s,g,y,y,%,,g,eval

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: 64 bit Perl memory test...

2003-12-04 Thread NIPP, SCOTT V (SBCSI)
Will this tell me how much memory is used at the point of failure?

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-Original Message-
From: david [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 04, 2003 1:11 PM
To: [EMAIL PROTECTED]
Subject: RE: 64 bit Perl memory test...


Scott V Nipp wrote:

> Unfortunately, there is no /dev/random in HP-UX.

fortunately, you don't need /dev/random. any of the following should eat up 
all of your machine's memory sooner or later:

[panda]# perl -e '$#a={}'
[panda]# perl -e '$a[{}]=1'
[panda]# perl -e '$#a+=0x while 1'
[panda]# perl -e '$i.=0x0x while 1'

david
-- 
s,.*,<<,e,y,\n,,d,y,.s,10,,s
.ss.s.s...s.sss.s.ss
s.s.s...s...s..s
...s.ss..s.sss..ss.sss.s
s.s.s...ss.sss.s
..s..sss.s.ss.sss...
..ssss.sss.sss.s

,{4},"|?{*=}_'y!'+0!$&;"
,ge,y,!#:$_(-*[./<[EMAIL PROTECTED],b-t,
.y...,$~=q~=?,;^_#+?{~,,$~=~
y.!-&*-/:[EMAIL PROTECTED] ().;s,;,
);,g,s,s,$~s,g,y,y,%,,g,eval

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: 64 bit Perl memory test...

2003-12-04 Thread Bakken, Luke
>   Will this tell me how much memory is used at the point 
> of failure?

See code.

> > Unfortunately, there is no /dev/random in HP-UX.

But there is a /dev/zero

use strict;
$|++;
my $mem;
my $bigbuf;
my $buf;
open IN, '/dev/zero' or die "Can't open random device: $!";
while( $mem += read(IN, $buf, 1048576) ) {
print "$mem\n";
$bigbuf .= $buf;
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: using perl in a c code

2003-12-04 Thread Dan Muey
> Dan Muey wrote:
> 
> [snip]
> 
> > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also! Great! 
> > Awesome! Perfect! One little catch now is it'd be nice to just do 
> > ./test  or ./test name=value&name2=val2 instead of ./test -e ''
> > Or ./test
> > 
> 
> this can easily be solve by adding:
> 
> char* nothing[] = {"","-e1"};
> 
> along the top of the program and then change:
> 
> >>perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
> 
> to:
> 
> perl_parse(my_perl, NULL, 2, nothing, (char **)NULL);
> 

Nice! Thanks for the help david. This is very cool!

> david
> -- 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: using perl in a c code

2003-12-04 Thread Dan Muey
> On Dec 3, 2003, at 3:17 PM, Dan Muey wrote:
> [..]
> > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also!
> 
> just wait until you have to remember,
> 
>   did this work with gcc2.X or only with gcc3.Y...
>   and how exactly did I get it to build for the DogBertOS???
> 
> Before you get too lost, you may want to start into
> learning how 'make' works so that you can simply do
> 
>   make
>   make test
>   make bug_fix
>   make the_right_way
>   make with_fewer_bugs
>   make again_and_again
> 
> It will help you with your project builds...

Good idea.

> 
> > Great! Awesome! Perfect! One little catch now is
> > it'd be nice to just do ./test  or ./test name=value&name2=val2
> > instead of
> > ./test -e ''
> > Or ./test
> > 
> 
> Oh sure, now you need to learn how to
> 
>   a. parse char **argv by hand
>   b. deal with tweeking char **env
> 

Maybe, except I'm trying to just send it to CGI as input.
Before you go nuts about that just humor me for a sec.

> You wanted to give up a Perfectly LOVELY
> 
>   Getopt::Long
> 
> cultural heritage to go throwing waka-waka
> just to impress young women with your studly
> cross coding, uh, "issues"???
> 
> > I'll have to look into that, I know it has something to
> > do with perl_parse() and #include stdio I just don't know the
> > details...yet :)
> 
> Think THERAPY!
> 

See you ther! :)

> ciao
> drieux

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: using perl in a c code

2003-12-04 Thread Dan Muey
> On Wed, Dec 03, 2003 at 05:17:01PM -0600 Dan Muey wrote:
> 
> > Doh! I was on 5.5, 5.8 just worked for me to, 5.6.1 also!
> 
> In order to make your C code more portable across several 
> versions of the perlapi, you could use Devel::PPPort.
> 
> perl -MDevel::PPPort -eDevel::PPPort::WriteFile
> 
> will create ppport.h in the current directory. You could take 
> this file and #include it in your source code. Many macros 
> and some functions from recent perls are thus also available 
> in older perls.
> 
> With this (it corresponds to the -b switch of h2xs) it's 
> relatively easy to write XS or XS-alike code that runs under 
> many Perl versions.

Excellent info, thanks!

> 
> Tassilo

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: using perl in a c code

2003-12-04 Thread Dan Muey
> Dan Muey wrote:
> 
> > > On Dec 1, 2003, at 6:22 AM, Ramprasad A Padmanabhan wrote: [..]
> > > > Instead Can I just embed this perl code  in my c 
> program I will be 
> > > > happy if someone can give some links to examples
> > > on the net
> > >
> > > 
> >
> > That is very very sexxy! I was reading the part at: 
> > 
> http://www.perldoc.com/perl5.6/pod/perlembed.h> tml#Adding-a-Perl-interp
> > reter-to-your-C-program
> >
> > Which will let you run perl code/file containing perl code 
> supplied as 
> > an argument. Very cool.
> >
> > What I was wondering about was how to execute some perl 
> code *inside* 
> > the c program instead of takign it via ARGV. I  think eval_pv and 
> > eval_sv have somethgin to do with it but I'm a bit cloudy there.
> 
> HI Dan,
> 
> This is probably where you want to focus more, then, because 
> it is [probably] critical.  Just taking a sorta wild guess 
> here, I'm going to guess that these are casts to numerical 
> and string types.  Certainly that distinction underlies the 
> biggest difference between Perl and C.  Where Perl abstracts 
> the difference between number and string, C strictly enforces 
> type differences.  Strings are seen as arrays.  Anytime you 
> are passing information between perl and C, you have to keep 
> this distinction in mind.  So if my stab in the dark is on 
> the mark, these two functions you cite should be interfaces 
> to that type-specific syntax and declaration protocol..  
> Don't know the details, as I haven't ventured into that 
> territory, but these may be worthwhile leads to follow up.

Very good leads for sure! Details Details, I hope old Rube will be proud!

> 
> Joseph
> 
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Finding Hosts On Lan - Re: hostname

2003-12-04 Thread drieux
On Dec 4, 2003, at 8:18 AM, Bob Showalter wrote:
Thomas Browner wrote:
Is there away to find all of the hostname on a lan with use of perl?
[..]
You can query DNS to get the hosts in a domain using nslookup, dig, 
host, or
similar. For example:

   host -l mydomain.com

If you want to talk to the resolver directly from Perl, you can use the
Net::DNS module.
first forgive the brief prefatory rant:


Bad BOB! Not Nice Bob! No Cookie!

since what Bob has done with that 'host -l mydomain.com'
is oblige us to go back and REALLY work out what in
the DNS is a 'host' and what is the bloat in the
DNS that is not actually a Host, not in the sense
that most folks would think of.
At one end of the problem are all the 'jet direct'
printer server devices that Hopped OUT at me, and
while I love them, and they are cute, and they
simplify the process of getting network printers
up and available, do we REALLY want to include,
or exclude them, from our notion of 'hostneff'.
Then there is that stack of stuff that comes
back as SRV entries, I mean do you really consider
	_ldap._tcp.mydomain.com

to be a 'real host'? And Oh my GOD, there's
the different 'terminal servers' that we use
for headless severs to connect to, are they
really 'hosts'?
Then there are all of those DHCP entries, whether
or not the license is active...
At which point, of course, we could get bogged
down in the usual problems of multi-homed hosts
that have more than one NIC in them...
So a part of the unpleasantry, is what exactly
is 'finding hosts on a Lan' really a question about...
ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



RE: Finding Hosts On Lan - Re: hostname

2003-12-04 Thread Bob Showalter
drieux wrote:
> On Dec 4, 2003, at 8:18 AM, Bob Showalter wrote:
> > Thomas Browner wrote:
> > > Is there away to find all of the hostname on a lan with
> use of perl?
> [..]
> > You can query DNS to get the hosts in a domain using nslookup, dig,
> > host, or similar. For example:
> > 
> >host -l mydomain.com
> > 
> > If you want to talk to the resolver directly from Perl, you can use
> > the Net::DNS module.
> 
> first forgive the brief prefatory rant:
> 
>   
>   Bad BOB! Not Nice Bob! No Cookie!
>   

Oy vey!

> 
> since what Bob has done with that 'host -l mydomain.com'
> is oblige us to go back and REALLY work out what in
> the DNS is a 'host' and what is the bloat in the
> DNS that is not actually a Host, not in the sense
> that most folks would think of.

$ host -ltA mydomain.com (:~)

[snip...]

> So a part of the unpleasantry, is what exactly
> is 'finding hosts on a Lan' really a question about...

No argument there.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: 64 bit Perl memory test...

2003-12-04 Thread david
Scott V Nipp wrote:

> Will this tell me how much memory is used at the point of failure?

no, it does not. you will have to do that manually. either watch the script 
in top or ps or write something like:

#!/usr/bin/perl -w
use strict;

my $m = 1024 * 1000;
my $i = '';

for($m * 100, $m * 200, $m * 300, $m * 400,
$m * 500, $m * 600, $m * 700, $m * 800){

print "Allocating $_ bytes memory...\n";

$i = 0 x $_;

undef $i;
}

__END__

the amount of memory that this script is capable of utilizing at the time of 
testing does not equal to the amount of memory that are allowed by the OS 
though. for example, if the script failed when asking for 800mb of memory, 
does it mean the OS is unable to find 800mb of memory or does it mean the 
process is not allowed to allocate this much memory? you might have better 
luck finding a tool designed for testing memory allocation for your 
machine. 

david
-- 
s,.*,<<,e,y,\n,,d,y,.s,10,,s
.ss.s.s...s.sss.s.ss
s.s.s...s...s..s
...s.ss..s.sss..ss.sss.s
s.s.s...ss.sss.s
..s..sss.s.ss.sss...
..ssss.sss.sss.s

,{4},"|?{*=}_'y!'+0!$&;"
,ge,y,!#:$_(-*[./<[EMAIL PROTECTED],b-t,
.y...,$~=q~=?,;^_#+?{~,,$~=~
y.!-&*-/:[EMAIL PROTECTED] ().;s,;,
);,g,s,s,$~s,g,y,y,%,,g,eval

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: 64 bit Perl memory test...

2003-12-04 Thread NIPP, SCOTT V (SBCSI)
Nope...  No /dev/zero either in 11i.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-Original Message-
From: Bakken, Luke [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 04, 2003 1:25 PM
To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: 64 bit Perl memory test...


>   Will this tell me how much memory is used at the point 
> of failure?

See code.

> > Unfortunately, there is no /dev/random in HP-UX.

But there is a /dev/zero

use strict;
$|++;
my $mem;
my $bigbuf;
my $buf;
open IN, '/dev/zero' or die "Can't open random device: $!";
while( $mem += read(IN, $buf, 1048576) ) {
print "$mem\n";
$bigbuf .= $buf;
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: 64 bit Perl memory test...

2003-12-04 Thread NIPP, SCOTT V (SBCSI)
Very interesting...  Running this script it dies at the 800MB
attempt.  However, watching this process in top, memory usage is actually
double the amount that is being tested.  In top, the last memory amount
prior to it dying is 1400MB.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



-Original Message-
From: david [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 04, 2003 2:17 PM
To: [EMAIL PROTECTED]
Subject: RE: 64 bit Perl memory test...


Scott V Nipp wrote:

> Will this tell me how much memory is used at the point of failure?

no, it does not. you will have to do that manually. either watch the script 
in top or ps or write something like:

#!/usr/bin/perl -w
use strict;

my $m = 1024 * 1000;
my $i = '';

for($m * 100, $m * 200, $m * 300, $m * 400,
$m * 500, $m * 600, $m * 700, $m * 800){

print "Allocating $_ bytes memory...\n";

$i = 0 x $_;

undef $i;
}

__END__

the amount of memory that this script is capable of utilizing at the time of

testing does not equal to the amount of memory that are allowed by the OS 
though. for example, if the script failed when asking for 800mb of memory, 
does it mean the OS is unable to find 800mb of memory or does it mean the 
process is not allowed to allocate this much memory? you might have better 
luck finding a tool designed for testing memory allocation for your 
machine. 

david
-- 
s,.*,<<,e,y,\n,,d,y,.s,10,,s
.ss.s.s...s.sss.s.ss
s.s.s...s...s..s
...s.ss..s.sss..ss.sss.s
s.s.s...ss.sss.s
..s..sss.s.ss.sss...
..ssss.sss.sss.s

,{4},"|?{*=}_'y!'+0!$&;"
,ge,y,!#:$_(-*[./<[EMAIL PROTECTED],b-t,
.y...,$~=q~=?,;^_#+?{~,,$~=~
y.!-&*-/:[EMAIL PROTECTED] ().;s,;,
);,g,s,s,$~s,g,y,y,%,,g,eval

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Beta Testing a Robot

2003-12-04 Thread Wiggins d Anconia


> It was Wednesday, December 03, 2003 when Casey West took the soap box,
saying:
> : I'm beta-testing a robot that searches Google when new questions are
> : posed to the beginners' lists.  I have no idea if it will be useful.
> : :-)
> 
> I should like to make an important note. This bot is not intended to
> deter people from answering questions. Indeed, the goal of this list is
> still to give detailed, useful answers to questions. Specific answers
> that really help people.
> 
> This robot is intended as a First Response Service, something that can
> help the questioner between the time they ask a question and the time
> they receive a good answer, from a human. My goal is that the archives
> from this list and others, and the web itself will be of further
> assistance, perhaps even adding a spark of creativity to some code or
> thought process. Therefore I hope this robot will bring that information
> a small step closer to the list.
> 
> So please, keep answering those questions. The robot doesn't do such
> a great job at answering questions, only guesses at where the
> technical information might be, which is still a very useful service
> as far as I can see.
> 
> Finally, the subject lines from the robot have been altered to show what
> it really is, a First Response System. Think of a person in cardiac
> arrest. First Response does some very general, well tested attempts at
> saving the patient. Sometimes they're successful, but the patient still
> needs to see the doctor, maybe even ER. That's what we're here for. :-)
> 
>   Casey West
> 
> PS: For all who asked, I'll show the source code in due course.
> 

I don't quite understand why the first response is sent back to the list
rather than just the OP though?  Using your analogy it seems like the
first response is *also* trying to save the doctors at the same time,
which would seem to get in their way. Another concern is that the
response comes from your address, or at least uses your name, which will
eventually (though maybe the subject will stem this, since it just went
in) cause me to ignore all posts from "Casey West" which would be a bad
thing.

Personally I use the list through SMTP and don't have a thread/filter
option for about half the time I am reading it (don't worry early next
year I intend to write a web mail client that I can use that will do
these things ;-)) which means the automated messages get in the way more
than they help *me*. 

I do like the idea of sending help back to the OP, and I appreciate your
time and efforts as admin of the list(s), just throwing out my $.02

http://danconia.org


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Beta Testing a Robot

2003-12-04 Thread Casey West
It was Thursday, December 04, 2003 when Wiggins d Anconia took the soap box, saying:
: 
: 
: > It was Wednesday, December 03, 2003 when Casey West took the soap box,
: saying:
: > : I'm beta-testing a robot that searches Google when new questions are
: > : posed to the beginners' lists.  I have no idea if it will be useful.
: > : :-)
: > 
: > I should like to make an important note. This bot is not intended to
: > deter people from answering questions. Indeed, the goal of this list is
: > still to give detailed, useful answers to questions. Specific answers
: > that really help people.
: 
: I don't quite understand why the first response is sent back to the list
: rather than just the OP though?  Using your analogy it seems like the
: first response is *also* trying to save the doctors at the same time,
: which would seem to get in their way. Another concern is that the
: response comes from your address, or at least uses your name, which will
: eventually (though maybe the subject will stem this, since it just went
: in) cause me to ignore all posts from "Casey West" which would be a bad
: thing.
: 
: Personally I use the list through SMTP and don't have a thread/filter
: option for about half the time I am reading it (don't worry early next
: year I intend to write a web mail client that I can use that will do
: these things ;-)) which means the automated messages get in the way more
: than they help *me*. 
: 
: I do like the idea of sending help back to the OP, and I appreciate your
: time and efforts as admin of the list(s), just throwing out my $.02

Thanks for the input, it's most valuable.  That's the point of
testing, after all.  :-)

  Casey West

-- 
When a cat is dropped, it always lands on its feet; when toast is
dropped, it always lands with the buttered side facing down. I propose
to strap buttered toast to the back of a cat; the two will hover,
spinning inches above the ground. With a giant buttered-cat array, we
could power entire metropolitan areas.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Beta Testing a Robot

2003-12-04 Thread Casey West
It was Wednesday, December 03, 2003 when Casey West took the soap box, saying:
: I'm beta-testing a robot that searches Google when new questions are
: posed to the beginners' lists.  I have no idea if it will be useful.
: :-)

I should like to make an important note. This bot is not intended to
deter people from answering questions. Indeed, the goal of this list is
still to give detailed, useful answers to questions. Specific answers
that really help people.

This robot is intended as a First Response Service, something that can
help the questioner between the time they ask a question and the time
they receive a good answer, from a human. My goal is that the archives
from this list and others, and the web itself will be of further
assistance, perhaps even adding a spark of creativity to some code or
thought process. Therefore I hope this robot will bring that information
a small step closer to the list.

So please, keep answering those questions. The robot doesn't do such
a great job at answering questions, only guesses at where the
technical information might be, which is still a very useful service
as far as I can see.

Finally, the subject lines from the robot have been altered to show what
it really is, a First Response System. Think of a person in cardiac
arrest. First Response does some very general, well tested attempts at
saving the patient. Sometimes they're successful, but the patient still
needs to see the doctor, maybe even ER. That's what we're here for. :-)

  Casey West

PS: For all who asked, I'll show the source code in due course.

-- 
"I have traveled the length and breadth of this country and talked
with the best people, and I can assure you that data processing is a
fad that won't last out the year."
 -- The editor in charge of business books for Prentice Hall, 1957


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Beta Testing a Robot

2003-12-04 Thread Christopher G Tantalo
Casey West wrote:

I'm beta-testing a robot that searches Google when new questions are
posed to the beginners' lists.  I have no idea if it will be useful.
:-)
I'm going to watch it closely and hope it is.  I'll remove it if I
find that it does a bad job.
 Casey West

This does seem like a good idea, but for some of us who can not access 
the web from work, this just makes it worse.  I signed up for the list, 
to see others questions and responses, as well as post my questions and 
receive answers through email.  With the bot giving responses with links 
that I can not access, it just makes it more frustrating, since others 
will not feel the need to respond since the bot gave links.
If it wasnt for the corp nazis here, I would love this bot!
Chris

--
---
Just Your Friendly Neighborhood
_SPIDEY_


-
The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. 

Thank you. Paychex, Inc.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Beta Testing a Robot

2003-12-04 Thread Shaw, Matthew
My $0.02 on this:

While it may be a worthwhile personal pursuit to write a script that
provides relevant results from google based on the text of someone's
email/news posting/etc, I don't think this is the forum for it. These
are very busy lists to start with and this essentially will result in
doubling the 'new' traffic to the list with information that is
irrelevant to anyone but the original poster. The irrelevancy of the
auto responder will increase when faced with questions by folks that are
so far off that they're not even asking the right question to begin
with(seems to be somewhat common in these groups). For these people,
investigative questioning is the only correct response and an
autoresponder (with a lot of text - read: information overload) will
only confuse them more.

 If anything, the response should go directly to the poster, not to the
list. IE: 

Your question has been posted to the XXX List, while you're waiting for
someone to respond, try out these links from google.com that may or may
not be relevant to your query:

1.  
...
10.  

Also, googling should be the first resort of any technical person. I
think the list FAQs should be updated in Section 2, Question 9 'Other
Tips Before Posting To The List' with something like:

_1._ Try to google.com with your question first! Google has extremely
relevant search results and may preclude asking your question to the
list. 

Tossing his copper in the pot,
Matt Shaw
Technical Architect
xwave, An Aliant Company
Bus: 506-389-4641 (Mctn)
Bus: 506-444-9639 (Fred)
Cel: 506-863-8949
[EMAIL PROTECTED]


> -Original Message-
> From: Casey West [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, December 03, 2003 3:41 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Beta Testing a Robot
> 
> 
> I'm beta-testing a robot that searches Google when new 
> questions are posed to the beginners' lists.  I have no idea 
> if it will be useful.
> :-)
> 
> I'm going to watch it closely and hope it is.  I'll remove it 
> if I find that it does a bad job.
> 
>   Casey West
> 
> -- 
> Good Idea: Kissing a loved one.
> Bad Idea:  Kissing a total stranger. 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Beta Testing a Robot

2003-12-04 Thread Casey West
It was Wednesday, December 03, 2003 when Casey West took the soap box, saying:
: I'm beta-testing a robot that searches Google when new questions are
: posed to the beginners' lists.  I have no idea if it will be useful.
: :-)
: 
: I'm going to watch it closely and hope it is.  I'll remove it if I
: find that it does a bad job.

Thank you for your timely and useful responses, they're under
consideration.  Until a decision has been reached (and re-coded), the
bot will be temporarily suspended.

  Casey West

-- 
"I'm just glad it'll be Clark Gable who's falling on his face and not
Gary Cooper."
 -- Gary Cooper on his decision not to take the leading role in "Gone
With The Wind."


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Beta Testing a Robot

2003-12-04 Thread Chuck Fox
Casey,

I would like to chime in on the side of sending the search results 
directly to the poster.  In most cases, the poster is at the mercy of 
the search engine they choose. Whereas, you have the advantage of  
knowing where to search.  Please do not abandon this work.  A digest -- 
to which, one may subscribe -- of this activity may also prove useful in 
the long run to the lurkers like myself.

Thanks for the cool and interesting approach to getting an answer out to 
the questioner.

Chuck

[EMAIL PROTECTED] wrote:

It was Wednesday, December 03, 2003 when Casey West took the soap box, saying:
: I'm beta-testing a robot that searches Google when new questions are
: posed to the beginners' lists.  I have no idea if it will be useful.
: :-)
: 
: I'm going to watch it closely and hope it is.  I'll remove it if I
: find that it does a bad job.

Thank you for your timely and useful responses, they're under
consideration.  Until a decision has been reached (and re-coded), the
bot will be temporarily suspended.
 Casey West

 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



[REBUILT] Re: Beta Testing a Robot

2003-12-04 Thread Casey West
It was Thursday, December 04, 2003 when Chuck Fox took the soap box, saying:
: Casey,
: 
: I would like to chime in on the side of sending the search results 
: directly to the poster.  In most cases, the poster is at the mercy of 
: the search engine they choose. Whereas, you have the advantage of  
: knowing where to search.  Please do not abandon this work.  A digest -- 
: to which, one may subscribe -- of this activity may also prove useful in 
: the long run to the lurkers like myself.

Fear not!  I've received a lot of good feedback, and here are the
results.

  http://bfr.caseywest.com

The First Response System is no longer going to the mailing list.
It's also not going to the OP.  If you notice, the new footer on all
the list postings points to a redirection URL.

  http://learn.perl.org/first-response

You can subscribe to the RSS feed.

  http://bfr.caseywest.com/index.rdf

Your can search the site and read all the archives if you like, as
well.  We'll see how this approach works out.  I've yet to get the FAQ
updated, but I will.

: Thanks for the cool and interesting approach to getting an answer out to 
: the questioner.

I hope it works. The goal is to be helpful, after all. :-)

: -- 
: To unsubscribe, e-mail: [EMAIL PROTECTED]
: For additional commands, e-mail: [EMAIL PROTECTED]
:  

Aah, there it is.

  Casey West

-- 
Usenet is like Tetris for people who still remember how to read. 
  -- Button from the Computer Museum, Boston, MA


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Reduce file size with Imager

2003-12-04 Thread Eamon Daly
Hi, all. I'm using Imager to create gifs, but the resultant
file sizes are /huge/. I'm writing the files out like so:

$img->write(type => 'gif',
max_colors => 16,
gif_eliminate_unused => 1,
data => \$data) or die $img->errstr;

I've verified that the resulting color table /is/ only 16
colors. Even so, I've opened the resulting files in several
different graphic editors and saved, and those files are an
order of magnitude smaller than the ones Imager produces.

I've tried defining a color map and used several different
variations on make_colors and translate, but the files still
seem abnormally large. Is this just a limitation in libgif?
Any suggestions?


Eamon Daly





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Pattern matching

2003-12-04 Thread B. Fongo
Hi

I'm writing a script that will connect to an ftp server (Redhat mirror), 
and download new versions of all packages that are on my machine. First 
of all, the script collects information about all the packages installed 
on my machine in an array (installed_packages). Then its goes on to get 
a list of all packages in a direcory on the ftp server and store it in 
an array (@remote_packages).

The next step is for me to select those packages from @remote_packages 
if  found in @installed_packages and newer that the one in 
@installed_packages.

for instance:

@remote_packages = qw(perl-5.8.0-88.3.i386.rpm  samba-2.2.7-5.7.0.i386.rpm);
@installed_packages = qw(perl-5.8.0-80.3.i386.rpm 
samba-2.2.7-5.8.0.i386.rpm);

In this example, the remote package perl is newer, so it should be 
stored in a third array; to be download. The below isn't complete, and 
I'm not sure of  how to get the pattern matching correctly.

==

sub select_newer {
my (@remote_packages, @installed_packages);
(@remote_packages, @installed_packages) = @_;
foreach (@installed_packages){
 my $i = grep {$_} @remote_packages && ;
}
I'll appreciate any help

Babs

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Fwd: Pattern matching

2003-12-04 Thread drieux


Begin forwarded message:

From: drieux <[EMAIL PROTECTED]>
Date: December 4, 2003 8:11:46 PM PST
To: "B. Fongo" <[EMAIL PROTECTED]>
Subject: Re: Pattern matching
On Dec 4, 2003, at 7:09 PM, B. Fongo wrote:

sub select_newer {
my (@remote_packages, @installed_packages);
(@remote_packages, @installed_packages) = @_;
foreach (@installed_packages){
 my $i = grep {$_} @remote_packages && ;
}
I'll appreciate any help
that's not going to work the way you would like
since perl does not take in two arrays like that.
What you will need is a bit of indirection
by dealing with references.
sub select_newer {
my ($remote_packages, $installed_packages) = @_;
foreach (@$installed_packages){
 my $i = grep {$_} @$remote_packages && ;
}
You can now pass in the two arrays as

	my $need_list = select_newer([EMAIL PROTECTED], [EMAIL PROTECTED]);

then iterate over it in the class form of

foreach my $pkg ( @$need_list)
{
# do the stuf with it.
}
That being said, you might want to think about a
strategy of something like
 my @remote_packages = qw(perl-5.8.0-88.3.i386.rpm
samba-2.2.7-5.7.0.i386.rpm bob-5.3.2.4.1.rpm);

 my @installed_packages = qw(perl-5.8.0-80.3.i386.rpm
 samba-2.2.7-5.8.0.i386.rpm  bob-5.3.2.4.1.rpm);


my $need_list = check_lists([EMAIL PROTECTED] , [EMAIL PROTECTED]);

foreach my $pkg (@$need_list)
{
print "need $pkg\n";
}

#
#
sub check_lists
{
my ($src, $dst) = @_;

#Making a quick pick hash
my %src_hash = map { $_ => 1 } @$src;

my @need_list;

foreach my $key ( @$dst )
{
push(@need_list, $key)
unless(exists($src_hash{$key}));
}

[EMAIL PROTECTED];

} # end of check_lists
Or are you expecting that you MIGHT get into the case where
you have downloaded and installed 'a newer version' say
the case where you installed
	bob-5.4.pm

and do not want to 'back rev' yourself??

ciao
drieux
---




ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: Beta Testing a Robot

2003-12-04 Thread R. Joseph Newton
Guay Jean-Sébastien wrote:

> ...
> Though it doesn't benefit those who didn't post the question (and answers
> seldom do, since people who can answer questions normally don't need the
> answers),

I would not assume that at all.  Programming is an extremely open-ended art and
set of skills.  I think the veterans on the list benefit as well as newbies from
the discussions.  Since there are always many approaches to take to any problem,
we all gain fresh insigths from the interchange.

Joseph




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Beta Testing a Robot

2003-12-04 Thread drieux
On Dec 4, 2003, at 8:41 PM, R. Joseph Newton wrote:
Guay Jean-Sébastien wrote:
...
Though it doesn't benefit those who didn't post the question
(and answers seldom do, since people who can answer questions
normally don't need the answers),
I would not assume that at all.  Programming is an extremely
open-ended art and set of skills.  I think the veterans on the
list benefit as well as newbies from the discussions.  Since
there are always many approaches to take to any problem,
we all gain fresh insigths from the interchange.
[..]

I'd underscore that a few more times. Think about the
context of perl - it is internet glue - so there is
stuff always rolling over the rollers from all sorts
of directions, DBI, Unix, Cgi, Win32, .
So there is always more stuff to play with
each time around. As an illustration I finally broke down
and downloaded the POE and crawled through it,
to see if it really would make me all warmUndtFuzzy...
While it is intrinsically true that IF I happen
to know an answer, then I don't need that one answered,
but there may as R. Joseph points to it, a 'fresh insight'
that comes from seeing N-ways to solve that 'one question'.
ciao
drieux
---

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: First Steps Perl DB programming (was: Re: first steps - read from files and make linklist)

2003-12-04 Thread R. Joseph Newton
Jonathan Jesse wrote:

> Sorry for being off topic.  I am slowly trying to learn the basics and
> then eventually move over to the work on the SQL side of things.  Thanks
> for the idea for the book, I'll look into that along with the
> documentation.

Very good strategy.  One study at a time.  Learning perl from a basics-first
approach will put you in a much stoinger position when you get to applying your
skills.

Joseph



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Beta Testing a Robot

2003-12-04 Thread R. Joseph Newton
Casey West wrote:

> I'm beta-testing a robot that searches Google when new questions are
> posed to the beginners' lists.  I have no idea if it will be useful.
> :-)
>
> I'm going to watch it closely and hope it is.  I'll remove it if I
> find that it does a bad job.
>
>   Casey West

Hi Casey,

I'm getting in on this sorta late, but here's my $0.02 worth:

I don't mind getting the bot responses.  I guess I may be in a minority
on this subject though.

One thing I do see is a fairly broad spectrum search that sometimes
shoots pretty wide of the mark.  There are a couple branches to this, in
my view:

1.  The search seems to respond to boilerplate with equal or greater
weight than to the meat of the question.  I se the same problem with the
perldoc -q implementation on my computer.  I've got some thoughts on
approachesw to this, but I'll defer them to later, because they are
pretty speculative.

2.  There may be benefit to using a prioritized search pattern with the
significant content of the search string.  I have been working on an
archive manager for my record of this list [actually a generalized
mailbox archive manager, and here is the approach I took.

I actually had three search options:  Precise phrase [case-insensitive],
all words, and any words.  The current search pattern seem to be more of
an all words search.  It might help to narrow that down to demand
matches on mutliple words.

Within my all words serach, I also used a priority queue system for
ordering response by significance.

Here I scan the file keeping a count of total matches found, and
ensuring that each word was matched at least once:  Note that each entry
in the hash pointed to by $found_in, and loaded by iterative calls to
this routine has a 'count' element.

input:
$regexes--anonymous array of search strings
$file_key--anonymous array of message sequences numbers
$files--anonymous hash of filenames, keyed by the above $file_keys
$found_in--anonympous hash to be loaded with  filenames, keys, and
counts

sub seek_all_words_in_file {
  my ($regexes, $file_key, $files, $found_in) = @_;

  my $file = $files->{$file_key};
  open IN, $file or die "Could not open $file $!";
  my $matchcount = {};
  $matchcount->{$_} = 0 foreach @$regexes;
  my $line;
  $line =  until $line and $line eq "\x0A";
   #  This gets me past a header
section of the file I'm scanning
  my $total_count;
  while (defined ($line = )) {
foreach my $regex (@$regexes) {  #   get match counts per
line of each regex
  if (my $line_match_count = () = $line =~ /$regex/gi) {
$matchcount->{$regex} += $line_match_count;
  }
}
  }
  my $matched_all = 1;
  for (@$regexes) {
$matched_all = 0 if not $matchcount->{$_};   #  filters if any words
are missing
  }
  return if not $matched_all;
  my $count;
  $count += $matchcount->{$_} for @$regexes;
  $found_in->{$file_key}->{filename} = $file if not
$found_in->{$file_key};
  $found_in->{$file_key}->{count} = $count;
}

The calling function uses the above scanning routine thusly:

...
  while (my $file_key = shift @$file_keys) {
seek_all_words_in_file($regexes, $file_key, $message_files,
$found_in);
  }
  display_search_results($found_in, $search_dialog);
...
handing it off to the following sub.  Keep an eye on the hash pointed to
by $best_bets, since that is the actual priority queue mechanism:


sub display_search_results {
  my ($found_in, $search_dialog) = @_;

  our $message_viewer;
  our $message_list;
  my $best_bets = {};
  foreach my $file_key (keys %$found_in) {
my $file = $found_in->{$file_key};
my $line_count = $file->{count};
$best_bets->{$line_count} = [] if not $best_bets->{$line_count};
push @{$best_bets->{$line_count}}, $file_key;
  }
  $message_list->delete('all');
  my $match_count = 0;
  foreach my $priority_level (sort {$b <=> $a} keys %$best_bets) {
foreach my $file (sort {$b <=> $a} @{$best_bets->{$priority_level}})
{
  my $details = get_message_info($file);
  add_message_to_tree($file, $details, $message_list, $file)
}
  }
  set_viewer_status('sort', 'none');
}

Of course this still somewhat lacks subtlety.  For one thing there is no
weighting for the balance of search words in the file being searched.
It might be better to give extra "points for files that had all words in
roughly equal quantity.  Between precise phrase and all words is also
another standard, that I hadn't really tried to explore.  That would be
"words in order'.  Something like this might be best with the record
separator set to a period, so that it would scan text on a
sentence-by-sentence basis, looking for all words in the same order as
the search phrase, even if intermingled with other text.  Unlike the
above, I haven't built or tested this but a general algorithm for the
regex might be:

my $regex = quotemeta shift @search_words;
regex .= ".*$word" while my $word = quotemeta shift @search_words;

Whcih should render a regex th