[8551] in Perl-Users-Digest
Perl-Users Digest, Issue: 2168 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 23 22:07:49 1998
Date: Mon, 23 Mar 98 19:00:30 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 23 Mar 1998 Volume: 8 Number: 2168
Today's topics:
Re: - Perl Script to Find & Display Matches.. - <roland@consol.de>
babelfish.altavista web client (enjoy) (Brock Sides)
books? <btokar@freespace.net>
Re: books? (A. Deckers)
Re: Disabling ^C Interrupt <spamsux-tex@habit.com>
Re: Going Rates for PERL Programming??? <zenin@archive.rhps.org>
How to instrument Perl a subroutine <langston@SLAC.Stanford.EDU>
Re: How to log input to different files in perl (Abigail)
Re: html parser <rouslan@erols.com>
http not able to execute .pl file ericw@recom.com
Re: http not able to execute .pl file (A. Deckers)
make test fails on io_xs.t <neil_livermore@hp.com>
Re: Need help with Win32 File Functions (Jeffrey Drumm)
Re: parsing perl <philen@ans.net>
Printing from Perl on NT box robert.abarbanel@boeing.com
Re: Ref to var in other sub? <zenin@archive.rhps.org>
Re: splicing element of a LoL <roland@consol.de>
SQL server and Perl bidyut@yahoo.com
Re: ts: unexpected behavior of "last" with "print" <merlyn@stonehenge.com>
Re: Unix Sendmail equivalent for Perl Win32 and NTMail (Mike King)
Re: Using perl code as a config file syntax? (Or, can r <philen@ans.net>
Re: Windows DLL support for perl (Chris Vogel)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Mar 1998 23:25:38 +0000
From: Roland Huss <roland@consol.de>
Subject: Re: - Perl Script to Find & Display Matches.. -
Message-Id: <m34t0pq9al.fsf@pirx.roland.consol.de>
James <James@cydaps.nospam.co.uk> writes:
> I guess that my method of 'storing' the matching vacancies is wrong, but
> can anyone help me out on this one as I am desperately trying to get
> this to work...
Hey, you got it. I won't write your script (sorry, it's a mess), but I
can point you to the holes, which I found and which you should fill.
> foreach $pair (@details) { ($id,$agency,$title) = split(/_/, $pair);
>
> if ($agency eq "ICL") {
> $results .= "<tr><td align=center>$id</td> <td
> align=center>$agency</td> <td align=center>$ title</td></tr>\n";
> $matchcount++;
> }
> }
Here you slurp in _all_ of your matches at once, in this case all
eleven. Remember, they are _all_ stored in $results from now on.
# Not in a loop....
> &PrintEntry;
> .
> .
> sub PrintEntry {
> $Count++;
> next if ($Count < $FORM{'first'});
> last if ($Count > $FORM{'last'});
> print "$results";
>
> }
This doesn't make really any sense. Your aren't in a loop, so where do
you want to escape from with 'last' or what is your 'next' item ? In
any case, you will print $results, which, as mentioned above, contains
all your matches (eleven so to speak). $Count++ doesn't make any sense
either. (Ok, from now on, you have the big 'one' in it. Take good care
of it ;-).
Probably you could try the following:
o Don't generate the $results in advance.
o Instead, in this first 'split' loop, store the
result in an array
o Use a loop like
for $i ($i=$FORM{'first'};$i<=$FORM{'last'};$i++) {
$res .= "<funky>".$array[$i]."</funky>";
}
to generate $results within it.
o Count up your boundaries with your form field for the next
page
However, these are just some hints, and might not heal your
script. Maybe you want to have a look at CGI.pm at CPAN, which does
much of the work you concentrated on in your example, namely the
generation of a valid (and nice) CGI response. Spare some time, read
the manual and you will like it. Really.
'hope this helps....
--
...roland
------------------------------
Date: Mon, 23 Mar 1998 19:31:20 -0600
From: opus@magibox.net (Brock Sides)
Subject: babelfish.altavista web client (enjoy)
Message-Id: <opus-2303981931200001@dave.magibox.net>
Just for s**ts and giggles, as they say, and to teach myself the LWP
library, I knocked out this simple little web client in about an hour this
morning. It takes the output of /usr/games/fortune (substitute something
appropriate on your own machine), feeds it to
babelfish.altavista.digital.com, then feeds the output back into the
babelfish. You can run it through the babelfish as many times as you like
with command line options: -f => French, -g => German, -p => Portuguese,
-s => Spanish, -i => Italian.
Running it kept me amused all afternoon.
Examples:
bash$ perl misfortune.pl -g
Dare to be naive.
-- R. Buckminster Fuller
Trauen zum Sein naiv -- R. Buckminster Fuller
Trauen to his naively -- R. Buckminster the Fuller
bash$ perl misfortune.pl -g -f
Flon's Law:
There is not now, and never will be, a language in which it is
the least bit difficult to write bad programs.
Gesetz Flon: Es gibt nicht jetzt und nie wird, eine Sprache sein, in
der es das wenige Bit ist, das schwierig ist, falsche Programme zu
schreiben.
Law Flon: There is not now and never, a language will be, in which it
is few bits, which are difficult to write false programs.
Loi Flon: Il n'y a pas maintenant et jamais, un langage sera, dans
lequel c'est peu de bits, qui sont difficiles d'ecrire des programmes
faux.
Law Flon: There is now and never, a language will be, in which it is
little of bits, which are difficult to write false programs.
#!/usr/local/bin/perl
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use HTTP::Headers;
%to = (-f => 'en_fr', #french
-g => 'en_de', #german
-i => 'en_it', #italian
-p => 'en_pt', #portuguese
-s => 'en_es'); #spanish
%from = (-f => 'fr_en',
-g => 'de_en',
-i => 'it_en',
-p => 'pt_en',
-s => 'es_en');
$language = shift || '-f';
$content = `/usr/games/fortune`; #substitute something appropriate here
print "$content\n";
$translation = &babel($content, $to{$language});
print "$translation\n";
$retranslation = &babel($translation, $from{$language});
print "$retranslation\n";
foreach (@ARGV) {
$translation = &babel($retranslation, $to{$_});
print "$translation\n";
$retranslation = &babel($translation, $from{$_});
print "$retranslation\n";
}
sub babel {
my $content = shift;
my $language_pair = shift;
$content = "doit=done&languagepair=$language_pair&urltext=".$content;
my $content_length = length($content);
my $header = new HTTP::Headers([Accept => 'text/html'],
[UserAgent => 'misfortune'],
[Content-type =>
'application/x-www-form-urlencoded'],
[Content-length => $content_length]);
my $request = new HTTP::Request 'POST',
'http://babelfish.altavista.digital.com/cgi-bin/translate?',
$header, $content;
my $ua = new LWP::UserAgent;
my $response = new HTTP::Response;
$response = $ua->request($request);
my $response_body = $response->content();
$response_body =~ m!<td align="left">\n\n(.+?)</td><td><img
border=0 src="/gifs/clear.gif" width="15" height="0"></td></tr>!s;
my $translation = $1;
return $translation;
}
--
Brock Sides opus@magibox.net http://www.magibox.net/~brock/
for(0..4){$humps="."x($_*2+1);$camel.="($humps)"}
"Jtsutona reP reh\nrekcah l"=~/$camel/s;
for(1..5){eval"print scalar reverse \"\$$_\""};
------------------------------
Date: Mon, 23 Mar 1998 19:28:34 -0500
From: bob tokarsky <btokar@freespace.net>
Subject: books?
Message-Id: <3516FE32.6D1D@freespace.net>
Can anyone recommend a good book for exploring PERL on a win95 system.
It seems to me that most books are directed towards those with unix
systems.
I would like to learn Perl and CGI on my machine at home before i
download my programs to the cgi-bin directory on my ISP.
I am into Java, Javascript and HTML and would like to become with
PERL to complete my web programming skills.
Any recommendations would be appreciated.
thanks
b.tokarsky
btokar@freespace.net
------------------------------
Date: 24 Mar 1998 01:00:58 GMT
From: Alain.Deckers@man.ac.uk (A. Deckers)
Subject: Re: books?
Message-Id: <slrn6he1e9.bji.Alain.Deckers@bashful.rediris.es>
In <3516FE32.6D1D@freespace.net>,
bob tokarsky <btokar@freespace.net> wrote:
>Can anyone recommend a good book for exploring PERL on a win95 system.
"Learning Perl on Win32 Systems" by Randal L. Schwartz, Erik olson &
Tom Christiansen (Sebastopol, CA: O'Reilly & Associates, 1997)
ISBN: 1-56592-324-3 (Also known as the Gecko book.)
You can also learn Perl from the Llama book, most of it is the same
whichever OS you use. See the following URLs for more information.
Alain
--
Perl reference: <URL:http://reference.perl.com/>
Perl language: <URL:http://language.perl.com/>
Perl archive: <URL:http://www.perl.com/CPAN/>
Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
------------------------------
Date: Mon, 23 Mar 1998 17:39:18 +0800
From: Austin Schutz <spamsux-tex@habit.com>
To: Chris Mihaly <cmihaly@fa.disney.com>
Subject: Re: Disabling ^C Interrupt
Message-Id: <35162DC6.5B82@habit.com>
> In several of my
> perl apps, I want I need to trap the interrupt and perform recovery
> operations. However, I need to disable interrupts during this recovery
> phase since if they continue to press ^C they kill the operations in
> this phase.
>
> I haven't figured out how I can do this? Any ideas?
>
> Thanks
> Chris
This is governed by the 'stty intr' setting on the process's
controlling pty. You should be able to do something along the lines of
`stty intr undef`; at the top of your script or
IO::Stty(\*STDIN,'intr',undef);
using the IO::Stty module should you need your code to be portable.
Austin
------------------------------
Date: 24 Mar 1998 02:18:04 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: Going Rates for PERL Programming???
Message-Id: <890706258.375750@thrush.omix.com>
Peter Perchansky <fp@pmpcs.com> wrote:
>snip<
: What I question is the pricing disctinction between tweeking another
: person's code and writing custom code.
:
: If it is the same programmer, why is their time worth less when tweaking?
I'd actually say it should be worth more if anything. There are far
more bad (aka sloppy, lazy, or just plain bad) programmers out there
then good, so unless you're "tweaking" your own code, 9 out of 10
times you're probably jumping into bad code.
Quite oftin, I'd much rather scrap the original code and start over
then try to do the "tweaks". It's oftin just easier to do it that
way... :-(
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: Mon, 23 Mar 1998 17:28:04 -0800
From: "Matthew D. Langston" <langston@SLAC.Stanford.EDU>
Subject: How to instrument Perl a subroutine
Message-Id: <35170C24.137CA4AB@SLAC.Stanford.EDU>
Hello all,
How do I write a Perl subroutine to instrument another Perl
subroutine?
Specifically, I want to write a module that will instrument (or wrap)
a subroutine in some way, e.g. perhaps by injecting
print "Entering subroutine foo()\n";
as subroutine foo's first statement.
The main requirement for the `instrumenting module' is that it
literally change the function definition for the symbol table entry
for the instrumented subroutine(s).
Note for you Emacs lisp hackers: I am looking for the Perl equivalent
of Emacs's `defadvice' feature.
Thank you for thinking about my question.
--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston@SLAC.Stanford.EDU
------------------------------
Date: 24 Mar 1998 00:57:59 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How to log input to different files in perl
Message-Id: <6f70en$hh9$1@client3.news.psi.net>
Normie (lars-n@hsr.no) wrote on MDCLXV September MCMXCIII in
<URL: news:3516A17B.F01531A6@hsr.no>:
++
++ I need the answers to be put in different files based on the different
++ names in the drop-down list. For example: the names in the drop-down
++ list are Cats, Dogs and Horses.
++ I want the information submitted to be put in cats.log, dogs.log and
++ horses.log
++ How do I do this ????
++ I am quite new to Perl and need help on writing the source-code for
++ this.
Please, don't ask for complete scripts. That's not the purpose of
this group. To me it looks your problems aren't just Perl problem,
but lack of a framework for your program. Set up the framework,
design your algorithm, and if you have *Perl* question about who
to implement certain things, come back.
Abigail
--
perl -we '%_ = map {local $_ = $_; y/a-z/n-za-m/; ($_, $_)} @_ = map {lc} <>;
print grep {$_{$_}} @_' < /usr/dict/words
------------------------------
Date: Mon, 23 Mar 1998 20:58:44 -0500
From: Rouslan Zenetl <rouslan@erols.com>
Subject: Re: html parser
Message-Id: <35171354.3D46E596@erols.com>
actually, as it turns out, i was looking for an html-beautifier. so far with
some help i found two. the bhtml and the Arachnophobia. both of them don't
indent html. i also found couple of threads on the web discussing whether it
is a good idea or not, but no real clues to what i need.
desperately seeking for ideas and pointers. thank you very much. didn't mean
to annoy.
regards,
zr
Abigail wrote:
> Rouslan Zenetl (rouslan@erols.com) wrote on MDCLXIV September MCMXCIII in
> <URL: news:351484A9.5B266CA3@erols.com>:
> ++ is there a perl-based html parser? or should i rather start looking
> ++ towards python?
>
> use HTML::Parser;
>
> Abigail
> --
> perl -wle '$, = " "; sub AUTOLOAD {($AUTOLOAD =~ /::(.*)/) [0];}
> print+Just (), another (), Perl (), Hacker ();'
------------------------------
Date: Mon, 23 Mar 1998 19:07:11 -0600
From: ericw@recom.com
Subject: http not able to execute .pl file
Message-Id: <6f70ru$bsb$1@nnrp1.dejanews.com>
have a weird one here... any help apprec.!
have a web page calling a password.pl file and get the error message:
"The server encountered an internal error or misconfiguration and was unable
to complete your request."
yet when i call the .pl script from the command line it works?
server is unix free bsd, perl is 5 and http is apache 1.2.4
any ideas and better yet answers much appreciated.
ps. other pl scripts work in this directory from both command line and web
pages, and all permissions are the same for working and non working.
thanks
eric
ericw@recom.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 24 Mar 1998 01:20:59 GMT
From: Alain.Deckers@man.ac.uk (A. Deckers)
Subject: Re: http not able to execute .pl file
Message-Id: <slrn6he2jr.bv8.Alain.Deckers@bashful.rediris.es>
In <6f70ru$bsb$1@nnrp1.dejanews.com>,
ericw@recom.com <ericw@recom.com> wrote:
>have a weird one here... any help apprec.!
>have a web page calling a password.pl file and get the error message:
>
>"The server encountered an internal error or misconfiguration and was unable
>to complete your request."
>
>yet when i call the .pl script from the command line it works?
Are you spitting out the Content-Type header at the right time?
Failing that, have a look at:
http://www.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html
(No offense intended, that's just the way the URL works out.)
Alain
--
Perl reference: <URL:http://reference.perl.com/>
Perl language: <URL:http://language.perl.com/>
Perl archive: <URL:http://www.perl.com/CPAN/>
Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
------------------------------
Date: Mon, 23 Mar 1998 16:26:33 -0800
From: Neil Livermore <neil_livermore@hp.com>
Subject: make test fails on io_xs.t
Message-Id: <3516FDB9.72B0@hp.com>
I've just installed perl5.004_04 on hp-ux 9.04.
When I run make test, one of the tests fails. This is io_xs.t.
The test output is:
1..4
not ok 1
Can't use an undefined value as a symbol reference at lib/io_xs.t line
28.
#
The error is:
lib/io_xs...........Can't use an undefined value as a symbol reference
at lib/io_xs.t line 28.
dubious
Test returned status 22 (wstat 5632, 0x1600)
DIED. FAILED tests 1-4
Failed 4/4 tests, 0.00% okay
The section of the test that it fails in is:
print "1..4\n";
$x = new_tmpfile IO::File or print "not ";
print "ok 1\n";
print $x "ok 2\n";
$x->seek(0,SEEK_SET);
print <$x>;
Any suggestions as to what is wrong?
------------------------------
Date: Tue, 24 Mar 1998 01:24:00 GMT
From: drummj@mail.mmc.org (Jeffrey Drumm)
Subject: Re: Need help with Win32 File Functions
Message-Id: <35170414.113788039@news.mmc.org>
On Mon, 23 Mar 1998 02:14:56 -0600, "Mark J. Danna" <mdanna@ghg.net> wrote:
>I am looking for a function(s) that returns Win32 file date and size as
>displayed in a directory command or in Windows Explorer. I believe that a
>dir filename.ext>>dir.txt can be used, but has anyone written any functions
>that returns these values?
>
>I am aware of the -x File Test (ref. page 121 "Learning Perl on Win32
>Systems, O'Reilly & Assoc.) and the stat Function (page 123), but these user
>Perl's Epoch age in the calculation for the creation/modification date. I
>would imagine that there is a better way since the Win32 already knows the
>date (and size). I also can't find any FAQ online that goes into detail
>with file/directory listing info.
>
>Any POSITIVE comment or suggestion is welcome and appreciated!!!
>
Epoch date values are converted to human-readable form with the localtime
and/or gmtime functions (Abigail being the only human I've come across that
doesn't need to convert them ;-)). See the documentation on those functions
to extract individual date/time elements, and pay particular attention to
the narrative below the example or you'll be back here asking Y2K
questions.
($size_in_bytes,$modify_date,$create_date) = (stat $filename)[7,9,10];
perldoc perlfunc says that element 10 of the stat list is NOT the creation
date of the file, but the date of the last inode change. However, it does
appear to represent the creation date in the NT/DOS world.
Good luck.
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center Information Services
420 Cumberland Ave, Portland, ME 04101
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented." -me
------------------------------
Date: Mon, 23 Mar 1998 19:06:18 -0500
From: Phillip Lenhardt <philen@ans.net>
To: Zenin <zenin@archive.rhps.org>
Subject: Re: parsing perl
Message-Id: <Pine.GSO.3.95.980323190408.14109L-100000@earn.aa.ans.net>
On 18 Mar 1998, Zenin wrote:
> Perl code editor...this is a noble, but hopeless cause. Even if you
> write it in perl (best choice, I'd say), you'd have never ending
> problems parsing perl code correctly. Yes, Emacs and others come
> close, but nothing is perfect. This is because, "Nothing but perl
> can parse perl".
Actually, perl can't even parse perl:
mybox:~> perl /usr/local/bin/perl
Unrecognized character \177 at /usr/local/bin/perl line 1.
mybox:~>
Of course, it goes without saying that, "Nothing but perl can parse Perl"
--although for some some reason they still bother to say it in the FAQ :)
-phil
--
In the long run, we are all dead. philen@ans.net
------------------------------
Date: Mon, 23 Mar 1998 19:48:52 -0600
From: robert.abarbanel@boeing.com
Subject: Printing from Perl on NT box
Message-Id: <6f73a2$f14$1@nnrp1.dejanews.com>
How do I open a filehandle for printing in Perl on NT?
I want to be able to do something like
open(P,"some way to designate a printer");
print P "this string goes to printer";
close P;
Or - I need some way to accomplish the equivalent on NT.
Thanks!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 24 Mar 1998 02:46:34 GMT
From: Zenin <zenin@archive.rhps.org>
Subject: Re: Ref to var in other sub?
Message-Id: <890707968.89003@thrush.omix.com>
[ posted & mailed ]
David DelGreco <david_delgreco@intuit.com> wrote:
: A little help understanding something please? Though as I write this, I
: think I see where I may have gone wrong.
Hehe, cool. :-)
: I'm writing a Perl app to run on a Persistent Perl on an Oracle web
: server. The thing caches the bytecode as well Perl itself, making for
: really quick responses. This pertains because, in caching the bytecode,
: it also caches any global var's declared.
Hmm...sound's a lot like the mod_perl Apache extension when used
with Apache::Registry.
: No prob, methinks, I'll just 'use strict', lexically scope everything
: and all will be well.
Should be.
: However, in keeping with the principal of laziness, I was hoping to make
: use of some formerly global hashes of hashes (now scoped in main() )
^^^^^^ ^^^^^^^^^^^^^^^^
Your thinking is incorrect. You can't have a global that is
scoped, or it isn't a global.
: without actually passing the hashes or reference to same every time I
: want to use them.
Use a package global.
: I've seen various error messages referring to, say main::myvar, and I've
: seen similar syntax in Ch. 4 of the camel book, all of which gave me the
: impression I could reference a var, hash, or array in another sub,
: something like this:
: use strict;
: main();
Why main()? Are you ever going to reuse main() or call it again?
This isn't C, so don't write C, write Perl. This isn't your problem
however, so I digress... :-)
: sub main() {
: my (%config);
This is your problem. Using my() here gives %config the lexical
scope of your main() function block. It can only be seen from
within that block. Any functions called within that block can not
even see %config because they (there code) are lexically outside
the main() block. If you defined mysub() inside the main() block,
this would work, but don't do that! :-)
>snip<
: sub mysub() {
: #Code2
: foreach (keys %main::config) { print }
: }
This isn't the same %config. This %config is the package global
%config in the main:: package. The other is a lexical scoped
%config, which isn't really in a "package" at all, nor can it
be reached via the package tree or any other meens except from
within it's lexically scoped block or though a reference. In
this case it's the main() function block.
: Is there a way to reference main's hash without passing it explicitly?
Only if it's made into a global.
: Have I overshot my lazy ambitions and will have to go pass some
: references?
Nope.
: Or am I just demonstrating my hazy concept of packages???
More a hazy concept of lexically scoped variables I'd say. Consider
this (even if I myself would remove the main() completely, it's your
code):
#!/usr/local/bin/perl
use strict;
use vars qw(%config);
use subs qw(main mysub);
main;
sub main {
...stuff that puts stuff in %config...
mysub;
}
sub mysub {
foreach my $key (keys %config) {
print "$key: $config{$key}\n";
}
}
__END__
Since everything here is in package main::, there is no reason
to need to fully qualify %config when used in mysub().
--
-Zenin
zenin@archive.rhps.org
------------------------------
Date: 23 Mar 1998 22:07:36 +0000
From: Roland Huss <roland@consol.de>
Subject: Re: splicing element of a LoL
Message-Id: <m3afahqcwn.fsf@pirx.roland.consol.de>
> @{$_}[$item] = '';
oops,
${S_}[$item] = '';
of course. (I wonder, why an array as lvalue in a scalar context
still works. Ok, not really an array, but it looks like.)
Since my girl friend is out of house (so I'm quite bored ;-), I still
have an open beer, and I'm too tired for bed, this this gimmick sprang
out of mind while playing around
foreach $d ( @data ) {
@{$d} = grep(defined,map(undef ${$d}[$_],@items) && @{$d});
}
Maybe not cleverer than before, but at least much less readable ;-)
(Hey, isn't there some one to lock the beer away ? ..... ;-)
--
...roland
------------------------------
Date: Mon, 23 Mar 1998 19:33:02 -0600
From: bidyut@yahoo.com
Subject: SQL server and Perl
Message-Id: <6f72cd$dqk$1@nnrp1.dejanews.com>
Hi There,
i have one problem. I used to access MSAccess97 from perl and used to update
records using ADODB. But now that i have changed to SQl server, it doesn't
work.
The code i wrote was
$Conn = CreateObject OLE "ADODB.Connection";
$Conn->Open("testsubqsl");
$RS = $Conn->Execute( "Select Download_HitCount from MiniWebFileUpload where
Indexname = '$indexname' and FileMiniWebAccount=
'$webaccount'");
$Count = $RS->Fields->count;
Now when Access97 is used, I am able to get the value for the count. but when
i use SQL server6.5, i get the following error.
CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
Can't call method "Field" without a package or object reference at
\scripts\file-download1.pl line 137.
Any help for this.
What can go wrong??
Thanks and regards
Bidyut
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 23 Mar 1998 17:37:12 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: tsatan@hotmail.com
Subject: Re: ts: unexpected behavior of "last" with "print"
Message-Id: <8chg4okjpj.fsf@gadget.cscaper.com>
>>>>> "tsatan" == tsatan <tsatan@hotmail.com> writes:
tsatan> open PW, "/etc/passwd" or die "cannot open pw: $!";
tsatan> while (<PW>) {
tsatan> print "root's pw is $1\n", last if /^root:([^:]*)/;
tsatan> }
I think you want
(print "root..."), last if /^root.../;
because otherwise, it's parsing like:
print ("root...", last) if /^root.../;
which is executing a "last" while it's gathering the arguments to
print. Probably not gonna print anything there.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 161 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 24 Mar 1998 01:36:05 GMT
From: m.king.garbage@praxa.garbage.com.au (Mike King)
Subject: Re: Unix Sendmail equivalent for Perl Win32 and NTMail
Message-Id: <35170dee.71758513@news.ozemail.com.au>
There is a utility called BLAT that you can get from their website.
Cheers
Mike
On Mon, 23 Mar 1998 17:16:17 -0500, "Dino Bozzo" <dbozz@istar.ca>
wrote:
>My mail server software is NTMail v3.0. How do I make my Perl scripts
>access the mail server to send email?
>
>Thanks,
>Dino Bozzo
>
>
------------------------------
Date: Mon, 23 Mar 1998 19:45:40 -0500
From: Phillip Lenhardt <philen@ans.net>
Subject: Re: Using perl code as a config file syntax? (Or, can require return more then one value?)
Message-Id: <Pine.GSO.3.95.980323193257.14109M-100000@earn.aa.ans.net>
My $0.02:
Using perl code as config file syntax is a two edged sword, on the one
hand, it makes it really easy to get stuff into your script, on the other
hand, it makes it really easy to get stuff into your script. I maintain a
fairly complicated set of perl scripts across several platforms with the
config files in perl. They are starting to become a curse. since it is so
easy to add stuff to the configs instead of messing with the monolithic
scripts, the line between platform implementation and general
configuration has become blurred. A config file is best for say, listing
directories to check for core dumps, but not so good for specifying the
command line to use for moving/removing them (say, /bin/rm here and
/sbin/rm there). Implementation details are best kept seperate from
configuration details large projects (or projects that will get large,
which is usually the case). One specifies what you want to do, the other
specifies how you do it. Blur them and it gets progressively more
difficult to add a new configuration option and I don't even like to talk
about how much harder porting to a new architecture/version gets.
By using any format other than perl code for configs you can make it
somewhat harder for the code gremlins to stab you behind the kneecaps.
-phil
--
In the long run, we are all dead. philen@ans.net
------------------------------
Date: Mon, 23 Mar 1998 20:02:00 +0100
From: C.VOGEL@LINK-GOE.de (Chris Vogel)
Subject: Re: Windows DLL support for perl
Message-Id: <6qRxsgTItSB@-sweet.link-goe.de>
Goettingen, Stardate 0893.17
Hi there,
josef_schiefer (Josef Schiefer) wrote in 35150511.9594A78E@mailcity.com on
23.03.98 following lines, starting with '*'
* I am looking for a possibility to call via perl functions from a Windows
* DLL.
Look for Win32::API on CPAN.
Chris.
--
Neulich im Fernsehen:
"Wir unterbrechen nun die Werbung fuer ein kurzes Stueck Programm..."
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 2168
**************************************