[18034] in Perl-Users-Digest
Perl-Users Digest, Issue: 194 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 1 18:06:14 2001
Date: Thu, 1 Feb 2001 15:05:18 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <981068718-v10-i194@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 1 Feb 2001 Volume: 10 Number: 194
Today's topics:
backtick and CGI on Netscape Enterprise Server <yves.delaunois@village.uunet.be>
Re: best way to remove arbitrary HTML from input variab <nospam@nospam.com>
calling API's within Perl pepite@hotmail.com
Re: Can anyone give a quote on Perl/CGI Programming? (David H. Adler)
Re: CGI.pm <SeeReply-To@eaglerock-is.com.invalid>
Re: finding pop mail server given an email address nobull@mail.com
Re: Fish v Fishing lessons - again! (was: Installing an <lmoran@wtsg.com>
Re: forcing compile errors on undeclared vars? <dan@tuatha.sidhe.org>
Re: forcing compile errors on undeclared vars? <mischief@velma.motion.net>
Re: getting a match within a string? <godzilla@stomp.stomp.tokyo>
Re: getting a match within a string? <anonymous@anonymous.anonymous>
HELP firewall changed lopez@abqato.abq.sc.philips.com
Re: how to split *gz file <peter.sundstrom@eds.com>
Re: Integrating Perl into Javascript <rbfitzpa@my-deja.com>
Re: Just a quick question re: temp files? egwong@netcom.com
Looking for info on %ENV eggrock@my-deja.com
Re: Looking for info on %ENV <aqumsieh@hyperchip.com>
Re: Looking for info on %ENV eggrock@my-deja.com
Re: making a mail reciving script <mischief@velma.motion.net>
Module accessing windows image scanners via Twain <raymund_hofmann@my-deja.com>
my $varName becomes undefined <SeeReply-To@eaglerock-is.com.invalid>
Re: Net::Telnet, How do i 'print' Arrow Keys? (Richard J. Rauenzahn)
Re: Newbie Problem with setting environment variables a <doronn@nrt.co.il>
Re: pass http_referer info dtbaker_dejanews@my-deja.com
Re: Perl and SQL Programmers Needed-URGENT (David H. Adler)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 1 Feb 2001 22:15:06 +0100
From: "Yves Delaunois" <yves.delaunois@village.uunet.be>
Subject: backtick and CGI on Netscape Enterprise Server
Message-Id: <3a79d262$0$20285$73bec57d@news.be.uu.net>
I've got a CGI doing something like that :
--------------------------
my $cmd = 'some_command -flag -flag $some_value' ;
my $out = qx{$cmd} ;
my $rc = $? >> 8 ;
my $msg = $! ;
print "Content-Type text/plain \n\n" ;
print "Command return code : $rc\n" ;
print "Error message : $msg\n" ;
print "Command output : $out\n" ;
--------------------------
Launching the script from the command line works perfectly good : $rc==0,
$msg=='' and $out is the expected output of some_command.
If for one or another reason, the command exit code is not null, I get the
corresponding value in $rc.
Running the script as a CGI gives the following result :
$rc == -1
$msg == "no child process"
$out == the normal output of some_command, which means that the command
was successfully executed (the program I use only returns codes 0, 1 and 2
anyhow).
The CGI runs with perl 5.6 on HP-UX 10.20, Netscape Enterprise Server
3.6SP3.
It seems like the child process forked by Perl to execute the command in the
backticks (or qx{} here) disappears before the implied wait() has a chance
to get the corresponding signal.
Is NES doing something like automatically catching signals to prevent bad
CGIs to create zombies ?
Can somebody tell me a way I can catch the actual exit code of my command
within the CGI ?
Btw, I tried opening a pipe (open (KID,"-|") followed by a fork() - exec()
=> it gave exactly the same error ($rc gotten at close(KID)).
I don't have the problem when running ActivePerl 5.005 and Apache on
WindowsNT
I'm gratefull to anybody who can help.
------------------------------
Date: 1 Feb 2001 21:09:33 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: best way to remove arbitrary HTML from input variable
Message-Id: <95cjad$c3a$0@216.155.32.127>
In article <95bnb0$7mb$0@216.155.32.127>, The WebDragon
<nospam@nospam.com> wrote:
| I've cobbled together a small perl CGI.pm script to submit "review
| requests" to our mailing list by users of the website looking to request
| a review of one of the 3200 third-party maps we have on the site (Unreal
| Tournament) We're only at about 35% reviewed at the moment.. they keeps
| making and submitting them faster than we can review them :)
|
| One thing I've noticed though, is that the user is able to include
| html-style tags in the input fields of the forms.. and I'd like to strip
| that stuff out before sending it onwards.
|
| I'm *sure* there's an appropriate (and fast) module that can accomplish
| this.. what I'm not sure of is whether that would be one of the
| HTML::Parser package like HTML::Filter, or something else..
|
| has anyone experienced anything along these lines and can point me to
| the better choices of module in order to do this? I've been poking
| around in the modules, docs, FAQ's, and web sites, but there's just TOO
| much info to sort thru it all and I'm just hoping that someone has a
| direct clue (or clues) they could point me to.
On second thought I'm thinking this is a stupid question, and I should
just use HTML::Parser
excepting this,
| On the other hand, the content of these fields will be stufffed into a
| plain-text e-mail body with no MIME or HTML-formatting whatsoever..
| should I even be worrying about this? (:
I'll run with that (HTML::Parser).
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Thu, 01 Feb 2001 21:50:31 GMT
From: pepite@hotmail.com
Subject: calling API's within Perl
Message-Id: <95cln2$equ$1@nnrp1.deja.com>
I'm using a new method to call my API's I use to invoke lynx which used
cpu and memory for nothing so with object oriented PERL something like
the following can be done. My problem is though that when the webpage
calling the API is hosted on the same machine as the API it is taking
useless time and energy (on the machine) because it goes through the
web calls a page hosted in the same place as the calling program. So
there is a way to put a GET on a file but all it does is return the
text within the file and you cannot pass parameters too it. How can I
pass parameters through this kind of call to a file and receive a
response. I would appreciate if you guys responded to pepite@hotmail.com
#!/usr/bin/perl
$|=1;
require '../inc/variable.inc';
require '../inc/functions.lib';
&init_apollo;
$url = $ip . "/cgi-bin/api/get-profile.cgi?BAR=SOFX&PAR=RINGUET";
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
$ua = LWP::UserAgent -> new;
$request = HTTP::Request->new(GET => $url);
$response = $ua->request($request);
$xxx = $response -> content;
if($response->is_success)
{
print "\n\n\n";
print "[$xxx]";
}
else
{
print $response->error_as_HTML;
}
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 1 Feb 2001 22:37:25 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: Can anyone give a quote on Perl/CGI Programming?
Message-Id: <slrn97jp95.rf0.dha@panix2.panix.com>
On Thu, 18 Jan 2001 18:07:30 -0000, Hazel Robinson wrote:
>I 'm busy on a project right now for a client
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently
to "news.announce.newusers", you might have already known this. :) (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
There is a Perl Jobs Announce list that may be more helpful to you. See
<http://www.pm.org/mailing_lists.shtml> for details.
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Despite his tendency to become sidetracked in debates with invisible
giraffes, he was an exemplary player, and rarely licked anyone without
prior permission - Diablo on Shazam Twix
------------------------------
Date: Thu, 01 Feb 2001 15:32:51 -0600
From: Ray DeGennaro <SeeReply-To@eaglerock-is.com.invalid>
Subject: Re: CGI.pm
Message-Id: <SeeReply-To-3EA638.15325101022001@[216.227.56.89]>
In article <3a748ad3.3673190@news.planet.nl>, mustbe@pdelahunta.cjb.com
(Paul Delahunta) wrote:
> I have a form wich's method = POST and action= "../form.pl?number=714"
Why the "?number=714" and not just a hidden form var? I don't think
this is valid HTML.
--
.=================================================================.
| =-=-=-=-=-=-= Eagle Rock Information Systems Corp =-=-=-=-=-=-= |
| -=-=-=-=-=-=- web and database business solutions -=-=-=-=-=-=- |
| <http://www.eaglerock-is.com> <mailto:info@eaglerock-is.com> |
| Chicago Area Office: 630-577-7158 (voice) 503-905-8153 (eFax) |
.=================================================================.
------------------------------
Date: 01 Feb 2001 19:08:49 +0000
From: nobull@mail.com
Subject: Re: finding pop mail server given an email address
Message-Id: <u9n1c6w79a.fsf@wcl-l.bham.ac.uk>
soumitra <soumitra123@my-deja.com> writes:
> given an email address how do I find
> out if that address allows pop mail access
> and what is the pop mail server name for that address.
Replace the bit before the "@" with "postmaster" and send a e-mail
asking.
> hhh@jjkjkj.com
> how can I find if jjkjkj.com allows pop access and if yes what is the
> name of the pop3 server for jjkjkj.com
> I got hold of the following code to find the mx records for a host.
In theory this information could be stored in DNS using SRV RRs:
You can fetch the SRV RRs using Net::DNS:
my $srv = $res->query('_pop3._tcp.jjkjkj.com','SRV')
I don't know of a Perl module that implements the rest of RFC2782
resolving rules although it would be fairly simple to write (I may
have a go for fun).
Of course the real problem is that I don't think anyone bothers to
create these records.
Also you'd have to assume that the pop3 user name was the same as the
e-mail addres - this is not always the case, but then again it is
reasonable to assume that it would be the case where SRV records exist.
It would be nice if IO::Socket::INET handled SRV lookups transparently.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 01 Feb 2001 16:22:39 -0500
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Fish v Fishing lessons - again! (was: Installing and using modules when you're not root?)
Message-Id: <6okj7t46g6l8qp7kgkipjd6vebve64ht08@4ax.com>
On Thu, 01 Feb 2001 10:45:35 -0500, brian d foy <comdog@panix.com>
wrote wonderful things about sparkplugs:
>In article <4bti7t85p8m8vo4n6b0l4fnql7deshfm42@4ax.com>, Lou Moran
><lmoran@wtsg.com> wrote:
>
>> http://www.perldoc.com --Now with 50% RTFM!
>
>that should be STFM (search the fine manual). ;)
Oh yeah there's 50% MORE STFM...
--
"> thanks in advance !!!
If you are going to do anything 'in advance' it should be RTFM."
--swiped from a nobull clp.misc post
Lou Moran <lmoran@wtsg.com>
------------------------------
Date: Thu, 01 Feb 2001 19:31:08 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: forcing compile errors on undeclared vars?
Message-Id: <0Qie6.166437$P82.20078368@news1.rdc1.ct.home.com>
iwelch@my-deja.com wrote:
> In article <G_%d6.165942$P82.19896267@news1.rdc1.ct.home.com>,
> Dan Sugalski <dan@tuatha.sidhe.org> wrote:
>> iwelch@my-deja.com wrote:
>>
>> > I presume the silence means that the answer here is "no". It is
>> > impossible to require definition at compilation time when a variable
>> > name contains a module identifier...
>>
>> The answer is, in fact, no. Fully qualifying a variable name is enough
>> to make strict happy.
>>
> Looks like we need a
> use superstrict;
> pragma. Is there a way to formally suggest this, or has this already
> been suggested to the Perl community?
For what reason do you want this? It won't happen for perl 5, but it
might for perl 6 if you have a really good reason. Or something else
might be made available that does what you're looking to get done.
Dan
------------------------------
Date: Thu, 01 Feb 2001 20:51:14 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: forcing compile errors on undeclared vars?
Message-Id: <t7jj226j2rnt5b@corp.supernews.com>
iwelch@my-deja.com wrote:
> In article <G_%d6.165942$P82.19896267@news1.rdc1.ct.home.com>,
> Dan Sugalski <dan@tuatha.sidhe.org> wrote:
>> iwelch@my-deja.com wrote:
>>
>> > I presume the silence means that the answer here is "no". It is
>> > impossible to require definition at compilation time when a variable
>> > name contains a module identifier...
>>
>> The answer is, in fact, no. Fully qualifying a variable name is enough
>> to make strict happy.
>>
> Looks like we need a
> use superstrict;
> pragma. Is there a way to formally suggest this, or has this already
> been suggested to the Perl community?
I like the idea to make it a new pragma as opposed to changing the
functionality of the existing 'use strict'. There are various places
to make suggestions such as this. The Perl 5 Porters list would be
a good place to start, unless you want to wait for Perl 6. I'm
not sure where to become an active member of the list from the top
of my head, but I'm sure someone else can say. Taking a look at
http://www.perl.com couldn't hurt in locating it, either.
Chris
--
Christopher E. Stith
Parking for people we like only. All other vehicles will be vandalized.
------------------------------
Date: Thu, 01 Feb 2001 11:22:59 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: getting a match within a string?
Message-Id: <3A79B793.FE2340A0@stomp.stomp.tokyo>
alazarev1981@my-deja.com wrote:
(various snippage)
> I need to create a new file, the name of which
> is a pattern found in a line from another file
> that already exists.
You have provided no sample data from your
existing database file. It is impossible to
check your match syntax for correctness.
> my(@xmlFileArray);
> open(XMLFILE, "<blah.xml");
> $i=0;
> while(<XMLFILE>) {
> $xmlFileArray[$i] = $_;
> $i++;
> }
> close(XMLFILE);
> open(XMLFILE, "<blah.xml");
> foreach(@xmlFileArray) {
> if($_ =~ / <Member number="\d{4}-\d{3}" status="\w+">$/) {
> ############
> # i need to make a new file with a name that matches
> # the \d{4}-\d{3} pattern in the if condition above
> ############
> $newXMLFileName = m/\d{4}-\d{3}/;
> print "$newXMLFileName\n"; # prints the number 1???!!!
> }
> }
> close(XMLFILE);
You have a lot of code there which is not needed.
There is no need to create an array nor any need
to open your file twice. A significant amount
of code can be removed, helping this to be
more simple, less error prone, quicker and
more memory efficient.
With your failure to include representative data,
only presumptions can be made on your data structure.
Based on this:
"...<Member number="\d{4}-\d{3}" status="\w+">$/)"
My presumption is some lines of your database
contain a format:
<Member number="(4 digits-3 digits)" status="(letters/numbers)">
Another presumption is there are other lines
not written in this format.
Open your database.
while <FILEHANDLE>
{
$test = substr ($_, 1, 13);
if ($test eq "Member number")
{
$new_file = substr ($_, 16, 8);
print "New File Is: $new_file\n";
}
}
close (FILEHANDLE);
That is all there is to this. Quite simple,
quick and efficient; no regex engine invoked.
Should your Member number contain data other
than digits and a hyphen, which it should
not based on your variable name and posted
match syntax, another test can be added,
if passes 'Member number' test:
$test = substr ($_, 16, 8);
$test =~ tr/0123456789-//d;
if ($test eq "")
{
pull your new file name here...
If you are looking for precisely seven
digits and a hyphen as shown by your
code, a substring and length check
of your member number would exclude
data less than or greater than a
desired length of eight, with some
extra coding to verify contents.
Unfortunately, you provide no sample data
with which to work leading to this need
to include extra code samples and discussion,
to cover possibilities. See how complex this
becomes when you do not politely provide data
samples and presumptions are to be made with
no choice? This annoys me, significantly.
A test script is below my signature to better
exemplify what happens.
Godzilla!
--
TEST SCRIPT:
____________
#!perl
print "Content-type: text/plain\n\n";
open (FILEHANDLE, "test.txt");
while (<FILEHANDLE>)
{
$test = substr ($_, 1, 13);
if ($test eq "Member number")
{
$new_file = substr ($_, 16, 8);
print "New File Is: $new_file\n";
}
}
close (FILEHANDLE);
exit;
CONTENTS OF TEST.TXT:
_____________________
This is data not to include
<Member number="1234-567" status="active">
This is data not to include
<Member number="5678-910" status="active">
This is data not to include
<Member number="7654-321" status="active">
This is data not to include
PRINTED RESULTS:
________________
New File Is: 1234-567
New File Is: 5678-910
New File Is: 7654-321
------------------------------
Date: Thu, 01 Feb 2001 11:42:23 -0800
From: Anonymous <anonymous@anonymous.anonymous>
Subject: Re: getting a match within a string?
Message-Id: <3A79BC1F.2E2EE1D6@stomp.stomp.tokyo>
Godzilla! wrote:
> alazarev1981@my-deja.com wrote:
I have a minor syntax error to correct.
> Open your database.
> while <FILEHANDLE>
This should read,
while (<FILEHANDLE>)
as shown in my test script,
> while (<FILEHANDLE>)
A lack of a parenthetical while
syntax will cause problems which
result in a core dump to your
script directory. Be sure to note
my syntax error.
Godzilla!
--------== Posted Anonymously via Newsfeeds.Com ==-------
Featuring the worlds only Anonymous Usenet Server
-----------== http://www.newsfeeds.com ==----------
------------------------------
Date: 01 Feb 2001 15:19:36 -0700
From: lopez@abqato.abq.sc.philips.com
Subject: HELP firewall changed
Message-Id: <jc6ae8682rr.fsf@abqato.abq.sc.philips.com>
How to I tell perl the firewall has changed? I have made changes to
Net/libnet.cfg for the http prosy information but that does not have
any ftp firewall information. Where is the ftp firewall information
stored.
--
Robert.Lopez@Philips.com
------------------------------
Date: Fri, 2 Feb 2001 10:56:16 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: how to split *gz file
Message-Id: <95cm20$nlk$1@hermes.nz.eds.com>
"Ying Hu" <yhu@mail.nih.gov> wrote in message
news:3A799410.D29F62@mail.nih.gov...
> I want to split *.gz file into more *.gz files. For example,
> split big.gz into small1.gz, small2.gz, small3.gz, small4.gz ...
What's wrong with the split command?
man split
------------------------------
Date: Thu, 01 Feb 2001 18:59:20 GMT
From: igotlooks.com <rbfitzpa@my-deja.com>
Subject: Re: Integrating Perl into Javascript
Message-Id: <95cbm1$4jm$1@nnrp1.deja.com>
Perl CGI will do this no problem, PHP will do it even easier. You have
to learn how to generate HTML on the fly and it's self explanatory from
there.
In article <95c73g$vum$1@nnrp1.deja.com>,
curious@ems.att.com wrote:
> Hello...
>
> My first question...Is it possible?
>
> Scenario:
>
> Here at work we have the following situation:
>
> 1. A software system creates a form for user input.
>
> 2. I have created a form to dynamically change choices in a list box.
>
> 3. Those listboxes can and will change their data over time [store
data
> in a text file.
>
> 4. I want to possibly use perl to open the txt file on the web
server,
> populate variables when the form loads up, use javascript to import
the
> data stored in perl variables, then use javascript with populate the
> listboxes with the data from the text file.
>
> I know how to do this with .asp, but unfortunately the whole web
server
> that I am trying to implement this on is a Netscape Server on a
Solaris
> system.
>
> All I want to do is import data from a file [dynamically] into my
> Javascript...
>
> Is this possible or should I just get used to the fact that I will
have
> to "hard-code" the data [from the text file] and continously update
it?
> I would like the server to do the updating, not me....
>
> Thanks in advance for your help.
>
> George
>
> Sent via Deja.com
> http://www.deja.com/
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 01 Feb 2001 22:26:19 GMT
From: egwong@netcom.com
Subject: Re: Just a quick question re: temp files?
Message-Id: <fole6.2372$tv5.46527@news.flash.net>
Robert Cooper <rob.cooper@djstore.co.uk> wrote:
> Apologies for just dropping into the group and posting - but I'm in need
> of an answer to a quick question which the scripts authors aren't
> prepared to discuss (grrr...)
>
> Basically, I'm wondering why the "main" shopping script for our site
> generates its output to a temporary file, then sends that file out to
> the client?
>
> (Perl 5 NT btw)
There's your answer. No doubt your developer knows how completely flaky
and unreliable NT is :)
Seriously, I have no idea why anyone would do this. The html is written
to disk before being sent to the user? It sounds like a debugging method
(and not a particularly useful one) that was never turned off. It most
certainly will not be as fast as just spitting the output to the user.
By the way, if your developer isn't willing or able to talk about
programming decisions and methods (like writing output to disk first),
start looking for one who will. The developer works *for you*, not the
other way around. Of course don't be suprised when you're billed for
the hour he spend explaining the minutia of the script to you.
HTH, Eric
------------------------------
Date: Thu, 01 Feb 2001 19:02:21 GMT
From: eggrock@my-deja.com
Subject: Looking for info on %ENV
Message-Id: <95cbrl$4og$1@nnrp1.deja.com>
Greetings,
I'm looking to see if there is a way to set (some) values from %ENV so
that they remain even after the process has died.
I haven't seen anything promising so far, and I want to avoid system,
exec and backticks if possible.
thanks!
B
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 01 Feb 2001 19:46:09 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Looking for info on %ENV
Message-Id: <7au26ekwzh.fsf@merlin.hyperchip.com>
eggrock@my-deja.com writes:
> I'm looking to see if there is a way to set (some) values from %ENV so
> that they remain even after the process has died.
perldoc -q environment
--Ala
------------------------------
Date: Thu, 01 Feb 2001 20:57:44 GMT
From: eggrock@my-deja.com
Subject: Re: Looking for info on %ENV
Message-Id: <95cik1$bm5$1@nnrp1.deja.com>
In article <7au26ekwzh.fsf@merlin.hyperchip.com>,
Ala Qumsieh <aqumsieh@hyperchip.com> wrote:
>
> eggrock@my-deja.com writes:
>
> > I'm looking to see if there is a way to set (some) values from %ENV
so
> > that they remain even after the process has died.
>
> perldoc -q environment
>
> --Ala
>
Perfect! That's what I needed to know!
Definitely not what I wanted to hear tho... :(
Thank you!
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 01 Feb 2001 21:32:22 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: making a mail reciving script
Message-Id: <t7jlf669b5rd62@corp.supernews.com>
flash <bop@mypad.com> wrote:
> i need to copy /var/spool/mail/smash
> to my directory
> then i need to seperate differant enteries how would i do this?
> does anyone have experiance doing this?
Do you really need to copy anything to your directory? Net::POP3
can login to a POP3 server and return to you the individual
messages, even to separate disk files if you don't want to hold
them in memory.
Chris
--
Christopher E. Stith
Try not. Do, or do not. The Force is binary. -- Yoda,
The Empire Strikes Back (paraphrased)
------------------------------
Date: Thu, 01 Feb 2001 20:18:51 GMT
From: Raymund Hofmann <raymund_hofmann@my-deja.com>
Subject: Module accessing windows image scanners via Twain
Message-Id: <95cgb0$99d$1@nnrp1.deja.com>
I am looking for a script / module to control a image scanner
(OS:W2000) via the Twain protocol.
On CPAN I could not find anything.
In the beginning i need quite simple operation:
Scan the image, operating the ADF (Auto Document Feeder)
Archive it in JPEG Format
Until all Documents Processed
To do it from scratch, i guess, would involve using Win32::API to
interface to the twain DLL (if possible, because of the data types the
function calls may require), setting up any parameters, doing the scan
and using the GD Graphics Lib for doing the JPEG compression.
But this is a quite common task, so maybe it was already done by
someone.
--
Raymund Hofmann
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 01 Feb 2001 15:28:39 -0600
From: Ray DeGennaro <SeeReply-To@eaglerock-is.com.invalid>
Subject: my $varName becomes undefined
Message-Id: <SeeReply-To-34BE2E.15283901022001@[216.227.56.89]>
In the script below, the variable $destfile is undefined three times
it's used in the:
# Make sure the output filename is unique and open the file
until (sysopen OUTPUT, $destdir . $destfile, O_CREAT|O_EXCL) {
# Rename filename.ext to filename###.ext
$destfile =~ s/(\d*)(\.\w+)/($1||0) + 1 . $2/e;
# Could be another error beside 99 identical filenames
$1 >= MAX_OPEN_TRIES and error($q, "Unable to open: " . $destfile);
}
section. This is probably a RTFM/brain-cramp, but I'm stumped.
Ray
#!/usr/bin/perl -wT
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Fcntl qw(:DEFAULT :flock); # Needed for O_CREAT|O_EXCL
use constant BUFFER_SIZE => 16384;
use constant MAX_FILE_SIZE => 1572864; # 1.5 MB
use constant MAX_OPEN_TRIES => 100;
$CGI::DISABLE_UPLOADS = 0;
$CGI::POST_MAX = MAX_FILE_SIZE;
my $q = new CGI;
$q->cgi_error and error($q, "Error transferring file: " .
$q->cgi_error);
open FILE, "/tmp/testupload5.in" or die $!; #DEBUG
$q->save)\*FILE); #DEBUG
print $q->header("text/html"); #DEBUG
# Get the form vars we need
my $wwizmstr = $q->param("wwizmstr");
my $origfile = $q->param("file") || error($q, "No file
specified.");
my $destdir = $q->param("destdir") || error($q, "No destination
directory set.");
print "wwizmsrt = |" . $wwizmstr . "|"; #DEBUG
print "origfile = |" . $origfile . "|"; #DEBUG
print "destdir = |" . $destdir . "|"; #DEBUG
# Initialize other vars
my $buffer = "";
my $destfile = $origfile;
my $fhandle = $q->upload($origfile);
print "<hr>"; #DEBUG
print "destfile = |" . $destfile . "|"; #DEBUG
# Clean-up dest file name
$destfile =~ s/[^\w.-]/_/g; # Convert bad characters to _'s
print "destfile = |" . $destfile . "|"; #DEBUG
$destfile =~ s/_+/_/g; # Convert multiple _'s to a single _
print "destfile = |" . $destfile . "|"; #DEBUG
if ($destfile = ~ /^(\w[\w.-]*)/) { # Obvious? If not, check the else {}
$destfile = $1;
}
else {
error($q, "Invalid filename; files must start with a letter or a
number!");
}
print "destfile = |" . $destfile . "|"; #DEBUG
print "<hr>"; #DEBUG
# Make sure the output filename is unique and open the file
until (sysopen OUTPUT, $destdir . $destfile, O_CREAT|O_EXCL) {
# Rename filename.ext to filename###.ext
$destfile =~ s/(\d*)(\.\w+)/($1||0) + 1 . $2/e;
# Could be another error beside 99 identical filenames
$1 >= MAX_OPEN_TRIES and error($q, "Unable to open destination file:
" . $destfile);
}
print "Writing to: |" . $destdir . $destfile . "|"; #DEBUG
# Turn off CR/LF translations for non-Unix clients
binmode $fhandle;
binmode OUTPUT;
# Write the file
while (read($fhandle, $buffer, BUFFER_SIZE)) {
print OUTPUT $buffer;
}
print "Write complete"; #DEBUG
# Close the file
close OUTPUT;
# Display the resulting HTML
print $q->h1("Success!"),
$q->end_html;
sub error {
my($q, $reason) = @_;
print $q->h1("Error"),
$q->p("Upload failed: "),
$q->p($q->i($reason)),
$q->end_html;
exit;
}
--
.=================================================================.
| =-=-=-=-=-=-= Eagle Rock Information Systems Corp =-=-=-=-=-=-= |
| -=-=-=-=-=-=- web and database business solutions -=-=-=-=-=-=- |
| <http://www.eaglerock-is.com> <mailto:info@eaglerock-is.com> |
| Chicago Area Office: 630-577-7158 (voice) 503-905-8153 (eFax) |
.=================================================================.
------------------------------
Date: 1 Feb 2001 19:32:31 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: Net::Telnet, How do i 'print' Arrow Keys?
Message-Id: <981055950.788118@hpvablab.cup.hp.com>
"Stefan Bach" <stefan.bach@web.de> writes:
>> Why don't you consult your vendor's documentation? Alternatively, go
>> look up the codes a VT100 generates and under what conditions it will
>> do that.
>
>And _where_ should I look thaht up?
>
<OFF TOPIC>
http://www.google.com/search?q=vt100+escape+codes&hl=en&lr=&safe=off
</OFF TOPIC>
Rich
--
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant | I speak for me, | 19055 Pruneridge Ave.
Development Alliances Lab| *not* HP | MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014
------------------------------
Date: Thu, 1 Feb 2001 00:56:59 +0200
From: "Doron Nissimi" <doronn@nrt.co.il>
Subject: Re: Newbie Problem with setting environment variables and hashes
Message-Id: <95a581$gf3$1@news.netvision.net.il>
Maybe you can try:
$ENV{SSDIR} = "SET SSDIR=\\\\GCHE1\\DEVLPMNT\\SourceSafe
Databases\\Renaissance Apps";
instead...
- Dozy
<scottpa@my-deja.com> wrote in message news:958r74$1l8$1@nnrp1.deja.com...
> Hi,
> Hope you can help. I am trying to set a new environment variable on
> Win95 before calling a program. I found an example on the ng and tried
> it but I am getting an error message and I am not sure what it means.
>
> Can you tell me what I am doing wrong.
>
> Thanks,
> Alan
>
> CODE:
> %ENV{SSDIR} = "SET SSDIR=\\\\GCHE1\\DEVLPMNT\\SourceSafe
> Databases\\Renaissance Apps";
>
>
> D:\MyDocuments\perl>perl x
> Can't use subscript on hash deref at x line 1, near "{SSDIR}"
> (Did you mean $ or @ instead of %?)
> Execution of x aborted due to compilation errors.
>
>
> Sent via Deja.com
> http://www.deja.com/
------------------------------
Date: Thu, 01 Feb 2001 21:32:21 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: pass http_referer info
Message-Id: <95ckl5$dmm$1@nnrp1.deja.com>
In article <95c8og$dht$1@bcrkh13.ca.nortel.com>,
"Jason Wong" <wo_ah_ho@yahoo.com> wrote:
> Here's the case
>
> a.html b.html c.cgi
>
> where b.html is the form
>
> how can i get the a.html url and pass it to c.cgi (the easier the
better)
>
---------------
this is probably off-topic for this group, you'll get more response in a
cgi group.
whats the connection between a.htm and b.htm? If b.htm is the one
posting data to your script, then the b.htm URL will be available
via HTTP_REFERER but there is no "history". If there is no connection
between a and b you'll probably have to use javascript in a.htm to set a
cookie. it is a very easy one-liner... just look up cookie in any
javascript doc.
D
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 1 Feb 2001 22:34:17 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: Perl and SQL Programmers Needed-URGENT
Message-Id: <slrn97jp39.rf0.dha@panix2.panix.com>
On Fri, 26 Jan 2001 22:27:37 GMT, Jeff Garnett wrote:
> Venture needs Perl & SQL programmers for immediate work.
You have posted a job posting or a resume in a technical group.
Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.
Had you read and understood the Usenet user manual posted frequently
to "news.announce.newusers", you might have already known this. :) (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Please do not explain your posting by saying "but I saw other job
postings here". Just because one person jumps off a bridge, doesn't
mean everyone does. Those postings are also in error, and I've
probably already notified them as well.
If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.
There is a Perl Jobs Announce list that may be more helpful to you. See
<http://www.pm.org/mailing_lists.shtml> for details.
Yours for a better usenet,
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Chipmunks are go! - Madness
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 194
**************************************