[6733] in Perl-Users-Digest
Perl-Users Digest, Issue: 358 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 23 21:07:16 1997
Date: Wed, 23 Apr 97 18:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 23 Apr 1997 Volume: 8 Number: 358
Today's topics:
Re: [Q] leading zeroes for a dollar amount <jstern@world.northgrum.com>
A contest: implement this in perl <leibman@inch.com>
case sensitive comparisons <lina@ty.com>
Re: deleting the current element from a list <rootbeer@teleport.com>
Re: DNS reverse lookup - gethostbyaddr() (Parillo)
Earn Upwards of $10000 per month <money@maker.com>
Re: Get Chars up to first | without splitting (Chipmunk)
Re: Getting a user's ip address? (Abigail)
Re: Getting a user's ip address? <leibman@inch.com>
Re: Help with Filehandles <gtk@walsh2.med.harvard.edu>
Re: Help with Filehandles <rra@stanford.edu>
Re: HTML Parser anywhere ? (Tad McClellan)
Re: Interpolating subroutine names? <dorman@s3i.com.ANTI-SPAM>
Re: Interpolating subroutine names? <dbenhur@egames.com>
Killer spam attack! Was:Re: Who will win? Borland or (Tung-chiang Yang)
Re: Lisp is neither (was Re: Ousterhout and Tcl lost th <erik@naggum.no>
Re: multiple STDOUT formats <rootbeer@teleport.com>
Need a round(EXPR, INT) subroutine (Frederic Desjarlais)
Re: No syntax errors, but still the thing won't run <rant@lp-llc.com>
Re: No syntax errors, but still the thing won't run (John Stanley)
Re: No syntax errors, but still the thing won't run <david@jemez.kellogg.nwu.edu>
Re: Output to a printer? (Geoffrey Hebert)
Re: Perl as its own metalanguage? (Terrence M. Brannon)
Re: Perl ODBC and IE 3.0x <rothd@roth.netX>
Printing to Files. <mcv@ikos.com>
raw input <slash@deil.de>
Re: switch and if (Abigail)
Re: sysopen object method in perl 5.001? <eryq@enteract.com>
Re: Troubles with IIS and ODBC <rothd@roth.netX>
Re: Troubles with IIS and ODBC <jzawodn@bgnet.bgsu.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Apr 1997 21:50:26 GMT
From: Jim Stern <jstern@world.northgrum.com>
Subject: Re: [Q] leading zeroes for a dollar amount
Message-Id: <335E8422.1CEB@world.northgrum.com>
(Copy emailed to poster.)
Ben Guerard wrote:
>
> Hi,
>
> Small asthetics problem here, folks...
>
> I have an order form script that works fine EXCEPT whenever the cents portion
> of the price ends in a zero (i.e. $6.30) the ouput truncates the trailing zero
> [as one would expect] (i.e. $6.3). I'd really like to add that zero. I've
> tried Math::BigFloat, but it's not giving me what I want (not even close). I
> can make a cheesy workaround, but I'd rather not "force" the zero
> [...]
perl -we 'printf "\$%.2f\n", 6.3'
That's the obvious answer. But I have some qualms about programs
that store monetary units in floating point. I'm not saying
it's always wrong but give a little thought to the possibility
of roundoff error. The alternative is to store amounts in
(integral) cents.
--
Jim Stern -- Views here are my own, not Northrop Grumman's. (El
Segundo, CA)
------------------------------
Date: Wed, 23 Apr 1997 17:54:27 -0400
From: Steve Leibman <leibman@inch.com>
Subject: A contest: implement this in perl
Message-Id: <335E8513.2D9@inch.com>
The item:
Check out http://www.inch.com/~leibman/usr/ and win yourself a USR 56k
modem.
The raison d'etre:
I often find that I need some (possibly silly) motivation to develop
specific skill sets.
I assume that at least a few other people in the world function the same
way I do.
The justification/disclaimer:
This is operating entirely within the rules of the contest (just making
it a little more convenient), and skill is more deserving than
randomness (or is it?).
Any [friendly] feedback would be appreciated.
------------------------------
Date: Wed, 23 Apr 1997 19:34:46 -0500
From: Lina Trivedi <lina@ty.com>
Subject: case sensitive comparisons
Message-Id: <335EAAA6.15D1@ty.com>
I am trying to read a text file through my perl script and find matchs
to certain strings, however, I am looking to make matches that are case
sensitive. Currently, my script is matching strings without
consideration to case. I have my script as follows:
if ($_ eq "$FORM{'userid'}") {
However this will match string to String or STRING or StrinG. Any clues
to help me out? Thanks!!!
Lina
lina@ty.com
------------------------------
Date: Wed, 23 Apr 1997 15:29:08 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Bob Shair <rmshair@uiuc.edu>
Subject: Re: deleting the current element from a list
Message-Id: <Pine.GSO.3.96.970423152741.12241G-100000@kelly.teleport.com>
On 23 Apr 1997, Bob Shair wrote:
> Is there an elegant (or just good) way to delete the current element
> from a list when in a foreach loop?
No; you should probably use a for loop, stepping through the indices, or
perhaps you need while or grep. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 23 Apr 1997 22:42:51 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: Re: DNS reverse lookup - gethostbyaddr()
Message-Id: <5jm39b$855@linet06.li.net>
Thanks.
It works, but I cannot find where the subroutine is.
Do you know the path and module name?
$Bill Luebkert (dbe@wgn.net) wrote:
: Roland wrote:
: >
: > I'am trying desperatly to convert a IP-Address to the corresponding
: > hostname with a perl-script...
: > All my experiments with gethostbyaddr() just returning a empty string
: > and I cannot find any examples of how to do, where can I find some
: > information about ?
: Assuming an address in $addr of the form "1.2.3.4":
: @dotted_addr = split (/\./, $addr);
: $packed_addr = pack ("C4", @dotted_addr);
: $host = gethostbyaddr ($packed_addr, 2);
: CC: Roland <roland@virtual.ch>
: --
: ,-/- __ _ _ $Bill Luebkert
: (_/ / ) // // DBE Collectibles
: / ) /--< o // // http://www.wgn.net/~dbe/
: -/-' /___/_<_</_</_ Email: dbe@wgn.net
------------------------------
Date: 23 Apr 1997 22:48:30 GMT
From: Great Opportunity<money@maker.com>
Subject: Earn Upwards of $10000 per month
Message-Id: <5jm3ju$7ut$1568@orb.direct.ca>
----------------------------------------------------------------------This message is being brought to you by Dynamic Mail - the easier and faster's
way to explodes your business on the internet. For more information please visit
our web site at : http://www.australia.net.au/~apexpi/dynamail.htm
----------------------------------------------------------------------
That's right!
NO Selling! NO Sales Pitches! Just simple distribution of full color
catalogs. Distribute catalogs to your friends and family, co-workers, or
any body who is interested in Video's and/or CD-ROM's. They will
appreciate not having a sales pitch thrown at them. Everybody loves
looking at catalogs and now you have the opportunity to cash in on this
business.
We will send you a full color catalog of the selection of Video's and
CD-ROM's. We will also send your information on how you can start your
own business for less than $30.
Just for taking a look at the video catalog we will send you a
certificate for $10 off your first order, should you decide to place an
order with us.
What's the risk? You receive a $10 off certificate just for looking at
the program. You get a full color catalog of VIDEO's/CD-ROM's. You also
receive information about an amazing financial opportunity.
Simply send $10 to D.S.I. Marketing Services Inc. Box 42167, Calgary,
Alberta, T2J 7A6
** If you are not happy with the information supplied to you simply send
everything back for a full refund. Our return policy is 30 days subject
to the discretion of D.S.I. Marketing Services Inc. **
------------------------------
Date: 23 Apr 1997 20:27:22 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Get Chars up to first | without splitting
Message-Id: <5jlrba$sfo$1@dartvax.dartmouth.edu>
In article <r567xelzlu.fsf@tvmaster.turner.com>
Mike Campbell <mcampbel@tvmaster.turner.com> writes:
> "christop@ozinter.co.jp" <christop@ozinter.co.jp> writes:
>
> > 001|something|something else|and some more
> >
> > - reading into $line a line at a time and I want to just put the 001 bit
> > into $FirstBit.
>
> ($FirstBit) = $line =~ /^(.*?)\|/;
>
> or
>
> $FirstBit = (split(/\|/, $line))[0];
or
($FirstBit) = split(/\|/, $line, 2);
Chipmunk
------------------------------
Date: Wed, 23 Apr 1997 21:59:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Getting a user's ip address?
Message-Id: <E942EL.Mo7@nonexistent.com>
On Wed, 23 Apr 1997 14:40:19 -0500, Ian Feldberg wrote in
comp.lang.perl.misc <URL: news:335E6598.1481@jhuapl.edu>:
++ Does anyone know of an easy way to get the ip address of a remote user
++ of a Perl script? That is, I'm writing a cgi script in perl and I want
++ to return different data depending on the ip address of the person who
++ invokes the script from within Netscape.
Uhm, those things are 2 different things. If you use a CGI script,
the "user" of the script is your web server, and is in general _local_.
There is an environment variable set with the IP address. Go ask
in comp.infosystems.www.cgi for it; it's a CGI question, not a Perl one.
Abigail
------------------------------
Date: Wed, 23 Apr 1997 18:34:55 -0400
From: Steve Leibman <leibman@inch.com>
Subject: Re: Getting a user's ip address?
Message-Id: <335E8E8F.1E04@inch.com>
Abigail wrote:
> Uhm, those things are 2 different things. If you use a CGI script,
> the "user" of the script is your web server, and is in general _local_.
>
> There is an environment variable set with the IP address. Go ask
> in comp.infosystems.www.cgi for it; it's a CGI question, not a Perl one.
>
yowsers. Theres a brusque response. Yes go to
comp.infosystems.www.cgi, not here,
but... the answer you're looking for is that you want the environment
variable
REMOTE_ADDR (The ip address of the client) or perhaps
REMOTE_HOST (hostname of client (if the client passed it with the http
request))
there's a bunch of others. See Steve Brenner's cgi-lib.pl at
http://www.bio.cam.ac.uk/web/form.html for more info on how to get env
variables, etc.
cheers.
-Steve Leibman
------------------------------
Date: 22 Apr 1997 15:26:02 -0400
From: Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu>
Subject: Re: Help with Filehandles
Message-Id: <w2u3ky7tbp.fsf@walsh2.med.harvard.edu>
[ Posted and mailed ]
Russ Allbery <rra@stanford.edu> writes:
>
> [ Posted and mailed. ]
>
> Philip Tanner <ptanner@doom.sw.stratus.com> writes:
>
> > I'd like to use the filehandle somehow to pass the filename to diff, but
> > am having problems doing that. I've declared diff with the use Shell
> > directive, but no matter how I pass the filehandle, it doesn't work.
>
> > I'd rather not have to hardwire the filename to a variable as it could
> > be either one of two names, and given the filehandle is already set to
> > the correct names(s), it makes sense to use it. Does anyone know what I
> > need to do to get this to work?
>
> diff needs the filename as a string, and file handles don't know their
> associated name. You'll have to keep track of the name yourself in an
> additional variable (initialize it when you open the file handle).
I've wondered why the FileHandle and IO:File modules don't provide
this. There's no reason I can see why the File *handle* can't be kept
as a tied scalar, and the file *name* accessed via an object method.
--
Gregory Tucker-Kellogg
Department of Biological Chemistry and Molecular Pharmacology
Harvard Medical School, Boston MA 02115
"Mojo Dobro" Finger for PGP info
------------------------------
Date: 23 Apr 1997 16:54:01 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Help with Filehandles
Message-Id: <qum67xdwb1i.fsf@cyclone.stanford.edu>
Gregory Tucker-Kellogg <gtk@walsh2.med.harvard.edu> writes:
> I've wondered why the FileHandle and IO:File modules don't provide this.
> There's no reason I can see why the File *handle* can't be kept as a
> tied scalar, and the file *name* accessed via an object method.
'cause at most you can know the file name you originally opened. It's
entirely possible that in the meantime you've renamed the file, deleted
it, or otherwise broken the assocation between that FileHandle and that
name, and if you then use the name the FileHandle thinks it's associated
with you get bogus results.
Once you have a file open in Unix, it's associated with a file descriptor,
not a name, and the name can change. The behavior of FileHandle and
IO::File follow that model.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: Wed, 23 Apr 1997 14:12:43 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: HTML Parser anywhere ?
Message-Id: <bvmlj5.7q7.ln@localhost>
Gisle Aas (aas@bergen.sn.no) wrote:
: Leon Brocard <lglb@doc.ic.ac.uk> writes:
: > Hmm, this is actually a rather good module, but I seem
: > to remember that the $p->asText (or whatever) didn't work
: > properly for tables - it didn't end table rows or table datas
: > with </TR> or </TD>, which kind of confuses any HTML parser.
: >
: > Any idea why / how this is? Leon.
: Because the HTML3.2 DTD says:
: <!ELEMENT table - - (caption?, tr+)>
: <!ELEMENT tr - O (th|td)*>
^
: <!ELEMENT (th|td) - O %body.content>
^
And those mean that the end tags for the associated element are
*allowed* to be omitted.
I think when you said "confuses any HTML parser", I think you
really meant "confuses any HTML browser" as most browsers do
NOT parse HTML correctly (though some say that Netscrape and IE
_define_ HTML, it ain't really so ;-).
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 23 Apr 1997 15:30:31 -0400
From: Clark Dorman <dorman@s3i.com.ANTI-SPAM>
Subject: Re: Interpolating subroutine names?
Message-Id: <dk9lta65k.fsf@s3i.com>
Andrew Johnson <ajohnson@gpu.srv.ualberta.ca> writes:
> Dan Bongert wrote:
> !
> ! I have a program that is going to call different subroutines
> ! based on the values of variables in an array.
> !
> ! Say I have this array:
> ! @items = (
> ! "foo",
> ! "bar",
> ! "baz",
> ! "bizarro",
> ! )
> !
> ! and I want to call dofoo, dobar, dobaz, and dobizarro.
> !
> ! what I want to do is something like this:
> ! &do$items[$loc];
> ! where $loc is a placeholder that tells where in the array I
> ! am.
> !
> ! Is something like this possible? I realize that this
> ! probably could be done just fine with a switch-like
> ! statement, but it feels like this should be possible.
>
> certainly, use eval:
>
> @items = (
> "foo",
> "bar",
> "baz",
> "bizarro",
> );
>
> foreach $loc (0..3) {
> eval "&do$items[$loc]";
> }
Personnally, I'd prefer to create a variable with the name of routine, and
use that. Is there anything wrong with this:
foreach $loc (0..3) {
my( $subname);
$subname = "do" . $items[$loc];
&$subname;
}
> sub dofoo {
> print "foo\n";
> }
> sub dobar {
> print "bar\n";
> }
> sub dobaz {
> print "baz\n";
> }
> sub dobizarro {
> print "ajsdonwejaaanejf\n";
> }
--
Clark (Please don't email replies)
------------------------------
Date: Wed, 23 Apr 1997 15:37:02 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Dan Bongert <herkimer@cs.wisc.edu>
Subject: Re: Interpolating subroutine names?
Message-Id: <335E8F0D.6B28@egames.com>
[mail&post]
Dan Bongert wrote:
> what I want to do is something like this:
> &do$items[$loc];
> where $loc is a placeholder that tells where in the array I am.
Sure, you can call the subroutine with a symbolic reference
and make the construction of its name as arbitrarily complex
as you want:
&{$subname}(@args); # call subroutine named in $subname.
For your example, try:
&{"do$items[$loc]"};
HTH
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"No, I'm not going to explain it. If you can't figure it out,
you didn't want to know anyway..." --Larry Wall
------------------------------
Date: Thu, 24 Apr 1997 00:16:48 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Killer spam attack! Was:Re: Who will win? Borland or Microsoft or Programmers?
Message-Id: <tcyangE948s1.9KF@netcom.com>
Followup-To: reset to poster. This ECP (Excessive CrossPosting)
was posted in:
comp.lang.perl.misc, comp.lang.c++,
comp.unix.advocacy, comp.os.linux.advocacy,
comp.lang.basic.visual, comp.lang.javascript,
comp.lang.tcl, comp.object,
comp.databases, comp.infosystems.www.advocacy,
comp.sys.amiga.advocacy, comp.os.ms-windows.advocacy,
comp.os.ms-w,
Note that the last group was not complete due to truncation of the
Newsgroups: line.
Please do not follow up this thread unless you trim off
irrelevant newsgroups from Newsgroups: or Followup-To: lines
if you are concerned about the quality of the newsgroups you
read.
--
Tung-chiang Yang tcyang@netcom.com
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.clever.net/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: 23 Apr 1997 23:14:33 +0000
From: Erik Naggum <erik@naggum.no>
Subject: Re: Lisp is neither (was Re: Ousterhout and Tcl lost the plot)
Message-Id: <3070826073518641@naggum.no>
* David Hanley
| Ok, so you found one example on one CPU. Great. Do you have any others?
amusing rejoinder.
| Accusing someone of being stupid, and making stupid arguments oneself
| does make someone look like a fool though; though it's not who you're
| insulting.
actually I don't generally accuse people of being stupid. I demonstrate
it. you, however, keep accusing people of being stupid, among a lot of
other irrelevant accusations.
| > (defun foo (x y) (declare (fixnum x y)) (+ x y))
| >
| > 0: cmp %g3, #x2
| > 4: tne %g0, #x13
| > 8: taddcctv %g0, %g1, %g0
| > 12: sra %o0, #x2, %o0
| > 16: sra %o1, #x2, %o1
| > 20: add %o0, %o1, %o0
| > 24: ld [%g4 + 135], %g2 ; fixnum-or-bignum
| > 28: jmp %g2 + 0
| > 32: xor %g0, #x1, %g3
| I'm glad that the usual C compiler will not produce the preceeding code.
| I'm glad the usual java compiler will not produce the preceeding code.
| First of all, it specifies fixnums, but appears to be performing the
| computation for all types--nice optimization.
the incoming arguments are in %o0 and %o1. they are shifted right two bits
because the type tag is in the two least significant bits. (actually, they
are in the lowest _three_ bits, but even and odd integers have different
type tags that conveniently overlap with the least significant bit of the
value. I told you tagged pointers were optimized in Lisp.) the result is
added together, and then that value is passed to a system function that
builds a bignum if necessary (i.e., the most significant bit, apart from
the sign bit is 1).
| And testing the number of parameters is only necessary due to the
| structure of lisp--berating C compilers for not doing this is silly.
again, you demonstrate a belligerent ignorance that is just astonishing.
what's wrong with asking whether it can be turned off? here's the same
function, now compiled with (declaim (optimize (speed 3) (safety 0))) in
effect:
0: add %o0, %o1, %o0
4: mov #x1, %g3
8: jmp %o7 + 8
12: nop
note that this does not handle bignums, but it does return the number of
return values to the continuation. it does not handle bignums because I
specified fixnum arguments, and I'm assumed to know what I'm doing if I use
(safety 0). note that this is the same as C cannot escape. I've had my
Lisp system crash with bad code compiled with (safety 0), but otherwise
not. I can't force a failing C program not to crash by tweaking a simple
declaration!
| Also, it appears that the whole function ought to be compiled to a single
| tail-recursive jump or inlined for that matter.
looks to me like the function it could have jumped to _is_ inlined. note
that the fixnum-or-bignum function is used by a lot of other functions.
| Perhaps you could try counting to 100 before responding to someone on the
| net? The time might be used to actually think about what you're posting,
| which might work wonders.
how far did you count?
| > Bastard Sex Therapist from Hell: "Read the F*cking Manual!"
|
| A freudinan message??
OK, so let's try another one.
#\Erik
--
if we work really hard, will obsolescence be farther ahead or closer?
------------------------------
Date: Wed, 23 Apr 1997 15:22:09 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Richard S. Guse" <fxrsg@Camelot.acf-lab.alaska.edu>
Subject: Re: multiple STDOUT formats
Message-Id: <Pine.GSO.3.96.970423152046.12241D-100000@kelly.teleport.com>
On Tue, 22 Apr 1997, Richard S. Guse wrote:
> How do I juggle multiple stdout formats?
There's no easy way. No, I take that back. The easy way is to re-write
them using (s)printf. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Wed, 23 Apr 1997 22:45:28 GMT
From: fdesjarl@chat.carleton.ca (Frederic Desjarlais)
Subject: Need a round(EXPR, INT) subroutine
Message-Id: <335e8fb2.27209720@bertrand.ccs.carleton.ca>
Hi,
How would you code a Perl4 (or 5) round function that takes a
'double' or 'float' as a parameter to be rounded and the number of
decimal places to round it to.
i.e. round(EXPR, INT) or round($double_number, 3)
Thanks,
Frederic
------------------------------
Date: Wed, 23 Apr 1997 15:05:04 -0700
From: Kevin Cotter <rant@lp-llc.com>
To: rootbeer@teleport.com, gtk@walsh2.med.harvard.edu, tchrist@mox.perl.com
Subject: Re: No syntax errors, but still the thing won't run
Message-Id: <335E8790.BCA@lp-llc.com>
I wanted to apoligize to Tom for my remarks earlier.
I have become very frustrated over my script. Did I post irrationally -
based on the response I'm getting from the group - YES. So I am sorry.
At the time I sent it, I felt I was being talked down to. The "In your
attempt to reinvent the wheel, you seem to have gotten a flat tire. :-)"
comment really got my goat.
I'm very new to programming so I guess I made Tom the scapegoat. Please
forgive me.
In closing, If I ever again have a script, that a -w shows no syntax
errors yet I still get an error 500 when running from the web, what
would be the best step for me to take in solving this problem.
On my knees in search of forgiveness,
Kevin Cotter
------------------------------
Date: 23 Apr 1997 22:44:45 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: No syntax errors, but still the thing won't run
Message-Id: <5jm3ct$b1a@news.orst.edu>
In article <335E5322.57D0@lp-llc.com>, Kevin Cotter <raven@lp-llc.com> wrote:
>
>Let me respond this way.
>
>First I (Kevin Cotter) wrote the message Tom Pheonix responded to.
If you are going to have a hissy fit when someone calls you by the
wrong name, don't post articles using the wrong name. The article Tom
replied to was posted by Tammy Cotter.
>I apoligize to anyone else in this newsgroup that is offended by my
>response. And sorry for taking up room in this newsgroup with my
>venting.
Apologizing in advance for acting like an asshole in public doesn't
excuse you.
------------------------------
Date: Wed, 23 Apr 1997 17:32:08 -0500
From: david <david@jemez.kellogg.nwu.edu>
Subject: Re: No syntax errors, but still the thing won't run
Message-Id: <Pine.HPP.3.95.970423172856.12586A-100000@jemez.kellogg.nwu.edu>
On Wed, 23 Apr 1997, Kevin Cotter wrote:
> Now, Excuse me Asshole :-) for trying to learn a new skill. I don't
> just want to use someones elses code without being able to understand
> what it's doing.
[ rest of rant snipped ]
Maybe you should switch to decaffeinated coffee...
--David
------------------------------
Date: Thu, 24 Apr 1997 00:31:48 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Re: Output to a printer?
Message-Id: <5jm8kc$70h$1@news3.microserve.net>
Well, you ask for other ways!
I would format as html, have him point his browser to it
and print from PC side.
xxbbell@voicenet.com (Bob) wrote:
> I need to output the result of a script in Unix to a printer.
>To make things complicated, my boss would really like it to go to
>printer that's on a Win95 network. I see two ways to do this: Either
>write a quick VC++ or VB program, or write a Unix program that puts
>the output in a file, and another VC++ or VB program that occasionally
>uses Net::FTP to get that file and output it to the printer. Anybody
>see another way, or can make a recommendation? Thanks. I haven't
>seen any CPAN modules referring to this.
> - Bob
> xxbbell@voicenet.comxx
> remove x's to reply
------- signature ----------
Check out the Perl site!
http://www.microserve.net/~soccer/
use password perlmisc
Geat tool for Developers>
------------------------------
Date: 23 Apr 1997 17:05:41 -0700
From: brannon@bufo.usc.edu (Terrence M. Brannon)
Subject: Re: Perl as its own metalanguage?
Message-Id: <ysizpvvlwai8.fsf@bufo.usc.edu>
Tom Christiansen <tchrist@mox.perl.com> writes:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, michaeli@dra.com writes:
> :Can you elaborate on this? In C++, at least, you can't overload based on
> :return type. I'm having trouble thinking of a construct in C that would
> :act differently based on a 'singular' or 'plural' context.
>
> int i = (1,2);
is this C syntax? what does it mean?
--
o============o Sending unsolicited commercial e-mail (UCE) to this address
Legal Notice is indication of your consent to pay me $120/hour for 1 hour
o============o minimum for professional proofreading & technical assessment.
terrence brannon * brannon@kappa.usc.edu * http://rana.usc.edu:8376/~brannon
------------------------------
Date: 23 Apr 1997 23:00:08 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: Re: Perl ODBC and IE 3.0x
Message-Id: <01bc5039$db7b7370$56906ec6@main2>
Paul Hanssen <paulh@sanford.com.au> wrote in article
<335db840.25945197@news.per.aone.net.au>...
> Hi there,
>
> I am accessing an ODBC database (Microsoft SQL Server 6.5) through
> Perl 5 (using the Win32::ODBC module). IIS 3 is our WWW server.
>
> It all works fine on Netscape 3+ but I keep getting an error
> containing the following message using Internet explorer 3.0x
>
> Could not Connect to DSN:
> Error: [18450] [] "[Microsoft][ODBC SQL Server Driver][SQL
> Server]Login failed- User: _ Reason: Not defined as a valid user of
>
> a trusted SQL Server connection. "
>
> Has anyone encountered this problem before ? If so, any suggestions ?
> Is it because IE 3 integrates too heavily with other Microsoft
> products ?
>
> BTW - We are NOT running a trusted connection to SQL Server.
In your DSN are you specifying a userid and password? If not I am wondering
if the IIS is using your userid from IExplorer (that just sounds like
something MS would do).
dave
--
================================================================
Dave Roth ...glittering prizes and
Roth Consulting endless compromises, shatter
rothd@roth.net the illusion of integrity
My email address is disguised to fool automailers. Remove the
trailing 'X' to send me email.
****************************************************************
Use of this message or email address for commercial purposes
(including "junk" mailings) is strictly prohibited and protected
under current international copyright laws and United States
Code, Title 47, Chapter 5, Subchapter II.
------------------------------
Date: Wed, 23 Apr 1997 17:22:24 -0400
From: Mitchell Verter <mcv@ikos.com>
Subject: Printing to Files.
Message-Id: <335E7D90.49BE@ikos.com>
Comrades in perl,
I thought I knew my perl, but I've been stuck on this problem for too
long. i have been trying to simply write to a file, but it seems that
some intermediate buffering is getting in my way.
!. I open up the file handle:
open (OFILE, ">$outfile");
2. I try to print to the file
print OFILE "$statement";
I've noticed that the file remains empty until maybe the 20th print
call. At that point, some of the text is dumped out into the file, but
some of it still remains in limbo. Therefore, I can not generate a full
file of text because some of it still seems to remain in a buffer
somewhere.
Does anyone have any idea what might be happening here and how I might
be able to fix it? Are there any buffers to flush? Can anyone help?
Please write me personally and/or post to this group if you can. Thanks
a heap.
-- Mitchell Verter
mcv@ikos.com
------------------------------
Date: Thu, 24 Apr 1997 01:13:22 +0200
From: Sascha Teske <slash@deil.de>
Subject: raw input
Message-Id: <335E9792.1CDDAFF3@deil.de>
hi everybody,
this is my first time "talking news" so sorry for my maybe dump behavior
I have a Problem i want to write an more intelligent chat and want to
use perl is there a way to get data before or without a newline "amen" ?
don't say RTFM to me, I DID !!!
thank you helper ...
slash@deil.de
------------------------------
Date: Wed, 23 Apr 1997 22:04:50 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: switch and if
Message-Id: <E942o2.4F@nonexistent.com>
On Wed, 23 Apr 1997 17:40:14 +0100, iqbal gandham wrote in
comp.lang.perl.misc <URL: news:335E3B6E.39D8@prestel.net>:
++ Hi
++
++ Is it better to use an if statement or switch, or doesn't it make much
++ difference.
Since there is no switch in Perl, it makes a lot of difference.
if will work, switch won't compile.
++ I have about eight if else statemants.
++
++ As far as I know if you use if statements then it checks through every
++ statement, whereis using the switch method you can fall out of the block
++ when say the pattern is met.
Well, if you use elsif, it will check every expression till one is true.
There is one condition where a switch can be faster, if your cases
are constant expressions (or non overlapping ranges) known at
compile time than the compiler could generate code which does a
binary search for the right block.
pp 104 - 105 of the Camel talks about switch-like constructs
in Perl.
Abigail
------------------------------
Date: Wed, 23 Apr 1997 17:02:32 -0500
From: Eryq <eryq@enteract.com>
To: Edward Henigin <ed@texas.net_nospam>
Subject: Re: sysopen object method in perl 5.001?
Message-Id: <335E86F8.481EBA46@enteract.com>
Edward Henigin wrote:
> Give us a f*cking working flock() for solaris and we'll stop
> using file existance.
I believe 5.004 does a proper emulation of flock(), using fcntl().
Actually, you probably always had the option of one when you
built Perl: just be sure to link in with whatever BSD libraries
Solaris provides, and make sure Perl can find it so it doesn't
attempt the (faulty|impossible) emulation of flock() with lockf().
Regards,
--
___ _ _ _ _ ___ _ Eryq (eryq@enteract.com)
/ _ \| '_| | | |/ _ ' / Hughes STX, NASA/Goddard Space Flight Cntr.
| __/| | | |_| | |_| | http://www.enteract.com/~eryq
\___||_| \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
|___/ |______/ of the homeless: http://www.streetwise.org
------------------------------
Date: 23 Apr 1997 23:04:56 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: Re: Troubles with IIS and ODBC
Message-Id: <01bc503a$87b67c20$56906ec6@main2>
Gordon Andrew Ross <gordonr@sfu.ca> wrote in article
<5jljm1$ne$1@morgoth.sfu.ca>...
> Hello,
>
> We've recently reinstalled NT 4.0 on our web server, and have run into
some
> difficulties. We're using Perl 5.001, Build 110, along with ODBC.pm.
This
> has worked flawlessly in the past, but something happened during the
> reinstall. Here's our error message:
>
> HTTP/1.0 200 OK
> Server: Microsoft-IIS/2.0
> Date: Tue, 22 Apr 1997 21:38:48 GMT
> Content-Type: application/octet-stream
> Can't load 'C:\Perl5\lib/auto/Win32/ODBC/ODBC.pll' for module
Win32::ODBC:
> 5 at
> C:\Perl5\lib/DynaLoader.pm line 450.
>
> at C:\Perl5\lib/Win32/ODBC.pm line 887
> BEGIN failed--compilation aborted at C:\Perl5\lib/KA/Administrator.pm
line
> 67.
> Connection closed by foreign host.
>
>
> Now then. ODBC.pll is located in that directory, we're running ODBC
> version 3.0, and the program runs fine from the command line.
Permissions
> are full control for the ODBC.pll file.
When you reinstalled 4.0 I presume you also reinstalled IIS. When you did
this did it change the default user account for the web service? Does the
*default web account* have (at least) read access to the odbc.pll & odbc.pm
files? Does the *default web account* have (at least) read access on your
\winnt\system32 directory and files (this is where the odbc manager and
odbc driver dll's live)?
dave
--
================================================================
Dave Roth ...glittering prizes and
Roth Consulting endless compromises, shatter
rothd@roth.net the illusion of integrity
My email address is disguised to fool automailers. Remove the
trailing 'X' to send me email.
****************************************************************
Use of this message or email address for commercial purposes
(including "junk" mailings) is strictly prohibited and protected
under current international copyright laws and United States
Code, Title 47, Chapter 5, Subchapter II.
------------------------------
Date: Wed, 23 Apr 1997 20:10:54 -0400
From: "Jeremy D. Zawodny" <jzawodn@bgnet.bgsu.edu>
To: Gordon Andrew Ross <gordonr@sfu.ca>
Subject: Re: Troubles with IIS and ODBC
Message-Id: <Pine.LNX.3.95.970423200913.27161B-100000@pizza.bgsu.edu>
On 23 Apr 1997, Gordon Andrew Ross wrote:
> Now then. ODBC.pll is located in that directory, we're running ODBC
> version 3.0, and the program runs fine from the command line. Permissions
> are full control for the ODBC.pll file.
Permissions on that file may be sufficient, but what about along the path
to the file? I've been bitten by that one more than once. Is the
C:\PERL\LIB directory (or you local equiv.) readable by the right user?
Is C:\PERL readable...
You get the idea.
You may have already checked this, but it's easy to overlook in NT and
Unix both.
Jeremy
---
Jeremy D. Zawodny
http://www.bgsu.edu/~jzawodn/
Computer Science Undergraduate, Bowling Green State University
"Lab-Tech: It's not just a job. It's an attitude!" -- Me
------------------------------
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 358
*************************************