[10513] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4105 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 29 15:06:33 1998

Date: Thu, 29 Oct 98 12:00:28 -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           Thu, 29 Oct 1998     Volume: 8 Number: 4105

Today's topics:
        $! ($ERRNO) -- setting it question <sam.berman@att.com>
        a2p doesn't handle multiline record processing right <sweth+perl@astaroth.nit.gwu.edu>
    Re: Checking Input for Exactly 2 numbers <support@counter.w-dt.com>
    Re: Help: Unknown error message <rgoeggel@atos-group.com>
    Re: Lets keep this ng for pics <david@kasey.umkc.edu>
        Login Name <mcgillanp@mndulu.ang.af.mil>
    Re: Login Name <rootbeer@teleport.com>
    Re: Perl & Y2K - booby trap code (John Moreno)
    Re: Perl & Y2K - booby trap code <uri@fastengines.com>
    Re: Perl & Y2K - booby trap code <uri@fastengines.com>
    Re: Perl & Y2K - booby trap code (Larry Rosler)
    Re: Perl & Y2K - booby trap code <merlyn@stonehenge.com>
    Re: Perl & Y2K - booby trap code <uri@fastengines.com>
        Perl Win32 DOS redirect problem <eeasterly@homecom.com>
    Re: Python fun <merlyn@stonehenge.com>
        Read/Write to same file. <usenet-replies@rocketmail.com>
    Re: Read/Write to same file. <rootbeer@teleport.com>
        Using Perl CGI to generate ASP? (David Bluestein II)
    Re: Using Perl CGI to generate ASP? <rootbeer@teleport.com>
    Re: Why is perl better than shell scripting language? (Larry Rosler)
        Win32:ODBC & differences in CGI vs. Non-CGI mbrumbaugh@my-dejanews.com
        Win32:ODBC & differences in CGI vs. Non-CGI mbrumbaugh@my-dejanews.com
        Yet another list of lists question <haverlan@agric.gov.ab.ca>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 29 Oct 1998 14:13:47 -0500
From: sam berman <sam.berman@att.com>
Subject: $! ($ERRNO) -- setting it question
Message-Id: <3638BE69.5C5FF786@att.com>

Folks,
   I realize that $! can be set to any number and by using POSIX I can
set it to a subset of defined constants.

  I am running on Solaris and want to use the error
(/usr/include/sys/errno.h)
ETIME (62) which is not in the POSIX list.

  Is there a way to do this without being concerned that the next
release of
Solaris will change the number (i.e., by using an operating system
defined
constant?

--
thanks  for your help,
sam



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

Date: Thu, 29 Oct 1998 19:57:08 GMT
From: Sweth Chandramouli <sweth+perl@astaroth.nit.gwu.edu>
Subject: a2p doesn't handle multiline record processing right
Message-Id: <oM3_1.1161$4%.18367794@fozzy.nit.gwu.edu>

	i just started playing with the a2p translator, and am
having some problems getting it to respond well to awk scripts
that use multiline records.  the following two-line awk script,
for example, doesn't work right when perl-ified:

BEGIN { OFS = "\t"; ORS = "\n\n"; FS = "\n"; RS = "" }
{ print NR, $1, $NF }

	the output variables seem to be getting set right, but
the FS and RS vars (which tell awk that the record is actually
composed of multiple lines, one per field) don't seem to be
translated to anything in the perl version.  is there an
equivalent concept in perl?  or would i just be better off
using a for loop to iterate through each line, and an if loop
to then decide whether that line was another field in the
same record, or the start of a new record altogether.  if i
did the latter, i was thinking of making each record into an
array, and the entire dataset into an array of arrays; is this
the right way to go?

	tia for any advice; if you could cc me directly on any
replies, i would appreciate it.

	-- sweth.

-- 
Sweth Chandramouli
IS Coordinator, The George Washington University
<sweth@gwu.edu> / (202) 994 - 8521 (V) / (202) 994 - 0458 (F)
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html">*</a>


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

Date: Thu, 29 Oct 1998 13:46:28 -0600
From: Mike <support@counter.w-dt.com>
Subject: Re: Checking Input for Exactly 2 numbers
Message-Id: <3638C613.2F23B474@counter.w-dt.com>

two digit number like 23 or 54 etc.

brian d foy wrote:

> In article <36376C1B.26C3B2CD@counter.w-dt.com>, Mike <support@counter.w-dt.com> posted:
>
> > How would you check the input then to make sure it has exactly two
> > numbers inputed. Not more not less.
>
> two numbers or one number with two digits?  if the latter, which base?
>
> --
> brian d foy                                  <comdog@computerdog.com>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>



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

Date: Thu, 29 Oct 1998 18:19:26 +0100
From: "Ronald Gvggel" <rgoeggel@atos-group.com>
Subject: Re: Help: Unknown error message
Message-Id: <71a891$p5d$1@news.pop-stuttgart.de>

Aidan Rogers wrote:
> 

> Can't locate loadable object for module Date::DataCalc in
> @INC (@INC includes ....)
> 

according to this error message you need at lease one "loadable
object" in order to use Date::DataCalc.

Maybe the install of Date::DataCalc was wrong.

HTH
Ronald


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

Date: Thu, 29 Oct 1998 19:28:15 +0000
From: David L Nicol <david@kasey.umkc.edu>
To: BigMac <bigmac@donalds.demon.nl>
Subject: Re: Lets keep this ng for pics
Message-Id: <3638C1CF.A109B766@kasey.umkc.edu>

BigMac wrote:

> >I guess I could write some kind of script that does it automaticly,
> >but how to filter out the occasional legit post?
> 
> >
> >It would take a few days to set up, and I'd have to not do other things
> >during that period
> 
> I guess your time-efford there would  instantly put you right up there with
> Peter, Gabriel, Rachael and all the other Saints....
> 
> But If that's asking 2 much, put me on your private mailing list..........
> 
> Big(I'll have a a side order of Blue Cheese with That)mac


I've decided to go the traditional route of simple vigilance, coupled
with an available and regularly posted FAQ.  The initial offender
somehow thought he had discovered an empty sex group and sent an
"invitation" to some other newsgroups.


But anyway, since you asked, 
the filter would run under innd as a "channel feed" with distribution
limited to the group(s) under its filtering.


This means you have a process that gets the filenames of the articles
on your local news spool and can them look them up on its own and read
them or whatever, and the process gets restarted by innd when it gets
behind or dies, and innd handles queueing.


I think the easiset way to filter would be by size.  Files under the
threshold size are ignored, ones above are checked to see if they
contain
attached images.

Then the sender and the sender's posting-host are compared against
the registration list.  There would have to be a web and/or e-mail
protocol for registering yourself and the news server you use. 
Registered
senders may post images, as it is assumed that they will be on-topic.

A posting that has made it this far is an image posted by an
unregistered
user, so you either forward it directly to <posting-host>@abuse.net
or set up something that will do that with one mouseclick and display
it to the administrator.



Maybe append the articles and "nasty-gram buttons" to a html page that
can be cleared.  Sort of like a guestbook.


 
______________________________________________________________________
 David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
        "So I woke up one morning and realized I'd become a cop."


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

Date: Thu, 29 Oct 1998 13:26:23 -0600
From: "Patrick L. McGillan" <mcgillanp@mndulu.ang.af.mil>
Subject: Login Name
Message-Id: <3638c2ef.0@news.globalpac.com>

Hi,
Is there a way to get the users login name from somewhere using perl. Said
user is logged in on a win95 station to a NT server. What about a NT
workstation user.


Patrick





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

Date: Thu, 29 Oct 1998 19:48:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Login Name
Message-Id: <Pine.GSO.4.02A.9810291146400.3421-100000@user2.teleport.com>

On Thu, 29 Oct 1998, Patrick L. McGillan wrote:

> Is there a way to get the users login name from somewhere using perl.

Sounds as if you want to use getpwuid and the special $< variable; see
perlvar and perlfunc for details.

> Said user is logged in on a win95 station to a NT server. What about a
> NT workstation user.

I hope that those things work properly in the Win32 port. (And you're not
talking about something like a remote user over a web connection, I hope!
:-) Good luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 29 Oct 1998 14:08:24 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <1dhnz45.zc291zsc7cmmN@roxboro0-017.dyn.interpath.net>

Randal Schwartz <merlyn@stonehenge.com> wrote:

> >>>>> "Joergen" == Joergen W Lang <jwl@_munged_worldmusic.de> writes:
> 
> Joergen> Here's an example someone came up with after a discussion in
> Joergen> de.comp.lang.perl. This uses localtime to get a 4-digit year without
> Joergen> having to do number formatting.
> Joergen> I'm not sure if it meets the requirements of the original poster,
> Joergen> which a glance at dejanews did not bring up but I like it as a
> Joergen> quick workaround.
> 
> Joergen> my $four_digit_year = ((split / /, localtime)[4]);      
> 
> I don't think you want either "4" or / / there. Witness:
> 
-snip code example [I couldn't test, since I don't have the module]-
 
> The year is field 7 when day of month is less than 10 and field 6
> otherwise.
> 
> One solution would be using -1 there.  Another would be using /\s+/
> so that the multiple spaces don't make multiple delimiters.
> 
> In any case, your code wasn't tested.  Just like some of mine that
> later turns out to be wrong. :)

I tested his example - it worked.

$four_digit_year = ((split / /, localtime)[4]);
print $four_digit_year;

Produces 1998, setting the clock forward to 2001 and I get 2001.

-- 
John Moreno


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

Date: 29 Oct 1998 14:12:03 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <sarvhl36v3w.fsf@camel.fastserv.com>

>>>>> "Z" == Zenin  <zenin@bawdycaste.org> writes:

  Z> Uri Guttman <uri@sysarch.com> wrote:

  Z> : i don't deny there are gotme's. yesterday i was stuck trying to get a
  Z> : slice from a hash ref. i have done this before but the syntax flew out
  Z> : of my brain. it took a little while longer than i wanted to get it
  Z> : right. that is my most recent gotme.

  Z> 	It does help to always be thinking of how you *want* the data,
  Z> 	and not how the data is stored.  If you want a single value its
  Z> 	got a $, want a list its got an @, etc.  This rule applies
  Z> 	regardless of the "real" type.

i know about the leading @. my problem was getting the hash ref as a
slice. if i want a single value i would have used -> but my brain didn't
convert to the @{$hashref}{key1,key2} syntax quickly. i just wrote it
here (correctly), with no trouble after wasting time yesterday
rediscovering it. that is why it is a gotme to me!

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: 29 Oct 1998 14:19:52 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <sarsog76uqv.fsf@camel.fastserv.com>

>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:

  IZ> [A complimentary Cc of this posting was sent to Uri Guttman 
  IZ> <uri@sysarch.com>],
  IZ> who wrote in article <x7n26fe2cy.fsf@sysarch.com>:
  >> that is more a bug IMO. i dislike the implied quoting of => anyway and i
  >> try not to use it.

  IZ> But perl has a convenient non-quoting version of =>, why not use it?

i like the look of => but not always its quoting. i like to see quotes
on my strings. in general i am against bare words as hash keys. this is
a visual style thing and not a syntax or semantic thing with me. i
always hated dangling statements in C and i always used {} for both
visual and bug proofing reasons. i am glad larry made {} mandatory in
perl.

the concepts of visual understanding of code is related to what i wrote
about the psycology of code in a another post. each individual brain
has its preferred way of doing I/O, processing and deep thinking. my way
likes to see in code lots of white space, 80 columns or less,
underscores and not mixed case, etc. it is not right or wrong but it is
me.

check out more of this brain philosophy at http://www.ptpinc.org/ i have
taken several seminars with them and the insight i have gained into how
brains work has been very enlightening.

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Thu, 29 Oct 1998 11:23:41 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <MPG.10a26097c171794f989849@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <x7n26fe2cy.fsf@sysarch.com> on 29 Oct 1998 11:53:33 -0500, 
Uri Guttman <uri@sysarch.com> says...
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
> 
>   LR> Command line:
> 
>   LR> perl -we '...' (correct) is not the same as perl -ew '...'
>   LR> (wrong).  In this respect, Perl command-line processing differs
>   LR> from the Unix norm, in which any number of single-letter
>   LR> no-argument options may be mixed with one single-argument option,
>   LR> in any order.
> 
> what do you mean by -e taking no argument? -e takes the next argument as
> perl code. so -ew is trying to execute 'w'. nothing about this differs
> from the unix norm. it is not the same as the filename args at the end
> of the option list. the code string *IS* the arg to -e. this is document
> just fine. it behaves the same as with -i needing to be put at the end
> of single letter option groups so it either get a null suffix or the one
> you want.

It's difficult to pin this down without access to that part of POSIX 
that deals with commands (POSIX.2, if I read my HP-UX docs correctly).  
>From the HP-UX intro(1):

<QUOTE>
Unless otherwise noted, commands ... accept options and other arguments 
according to the following syntax:

  name [ option (s) ][ cmd_arg (s) ]
 ...
    option ...
      -no_arg_letter
         A single letter representing an option without an argument.
      -no_arg_letters
         Two or more single-letter options combined into a single
         command-line argument.
      -arg_letter<>opt_arg
         A single-letter option followed by a required argument where:
           arg_letter
             is the single letter representing an option that requires
             an argument,
           opt_arg
             is an argument (character string) satisfying the preceding
             arg_letter,
           <>    represents optional white space.
</QUOTE>

The case in question (two or more single-letter options combined, where 
one of them requires an argument) is not in this grammar.  So I checked 
the behavior of a 'typical' multi-option command, pr(1).

  pr -dh foo /etc/passwd
  pr -dhfoo /etc/passwd

each print a double-spaced listing of /etc/passwd headed 'foo'.

  pr -hd foo /etc/passwd

prints a single-spaced listing of /etc/passwd headed 'd' and complains 
about not being able to open file 'foo'.

  pr -hdfoo /etc/passwd

prints a single-spaced listing of /etc/passwd headed 'dfoo'.

Conclusion:  Standard Unix/POSIX options processing seems to require the 
required-argument option to be last, with or without a white-space 
separator, as you said.  The 'perl' command seems to conform to this, as 
you said.  'Got-me', as I said.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 29 Oct 1998 19:44:19 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <8czpaftapg.fsf@gadget.cscaper.com>

>>>>> "John" == John Moreno <phenix@interpath.com> writes:

John> $four_digit_year = ((split / /, localtime)[4]);
John> print $four_digit_year;

John> Produces 1998, setting the clock forward to 2001 and I get 2001.

Did you try setting the clock to a day with one digit?  I bet you didn't. :)

    use Date::Manip;

    for ("1 Oct 98", "10 Oct 98") {
      my $date = ParseDate($_);
      my $secs = UnixDate($date, "%s");
      print "$_ => ", join("#", split / /, localtime $secs), "\n";
    }

==>

    1 Oct 98 => Thu#Oct##1#00:00:00#1998
    10 Oct 98 => Sat#Oct#10#00:00:00#1998

My first example was flawed because I forgot about the colons in the
time. :)

But here, for 10 Oct, year is #4, and for 1 Oct, year is #5.

The problem is that the split of / / counts two consecutive spaces as
*two* delimiters.  You really need either " " or /\s+/ there, or use -1.
But this all seems crazy when:

	$year = 1900 + (localtime)[5];

works just fine.

-- 
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: 29 Oct 1998 14:53:53 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <sarlnlz6t66.fsf@camel.fastserv.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> The case in question (two or more single-letter options combined, where 
  LR> one of them requires an argument) is not in this grammar.  So I checked 
  LR> the behavior of a 'typical' multi-option command, pr(1).

but it is a well known grammar in the unix world. and it is the last
option in a GROUP of single letter options that can be required to have
an argument. you can have multiple groups like that but since the
beginning options in a group must be single letter, you rarel see this
since you can group them into one.

  LR> Conclusion:  Standard Unix/POSIX options processing seems to require the 
  LR> required-argument option to be last, with or without a white-space 
  LR> separator, as you said.  The 'perl' command seems to conform to this, as 
  LR> you said.  'Got-me', as I said.

but you seemed to think -e didn't take an argument, i.e. it was a single
letter option.

perl -ew 'code' didn't work you said. this is not a gotme (s/me/you) but
a misunderstanding of -e. -e came from sed and other programs and always
took an option of the code to execute. so it had to follow the option
(with or without spaces depended on the option parser used by the
program). since you could have an argument with no preceding space, the
argument had to be immediately following it with no other option letters
between them.

you might have been feeling it was like tar where each option letter
which takes an argument grab the next space separated token. there ALL
the options are single letters in a single group.

uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Thu, 29 Oct 1998 14:29:28 -0500
From: Eddie Easterly <eeasterly@homecom.com>
Subject: Perl Win32 DOS redirect problem
Message-Id: <3638C218.5B4A650D@homecom.com>

Here is my program:

====
# build_dat.pl
print "Handling inetp...\n";
exit;
====

When I run it from the DOS commandline (using ActivePerl for Win32), I
get the expected result.  But when I run it like this:

build_dat.pl > file.out

The file.out is created in the same directory, but is 0 bytes !!!  What
gives?!  How do I properly redirect output to a file?

-- 
______________________________________________________________________
Edd!e Easterly, IV     eeasterly@homecom.com    HomeCom Communications
Software Engineer     http://www.homecom.com               Atlanta, GA


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

Date: Thu, 29 Oct 1998 19:03:41 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Python fun
Message-Id: <8c90hzur5n.fsf@gadget.cscaper.com>

>>>>> "John" == John Porter <jdporter@min.net> writes:

John> Speak for yourself, monkey boy.  :-)

John> 	# iterate over the cartesian product of two vectors.
John> 	sub map2(&$$) {
John> 		my( $code, $a1, $a2 ) = @_;
John> 		my @result;
John> 		for my $i1 ( @$a1 ) {
John> 		for my $i2 ( @$a2 ) {
John> 			push @result, $code->( $i1, $i2 )
John> 		}
John> 		}
John> 		@result
John> 	}

John> That's pretty enough for me.

But map would take it one further:

    sub map2(&$$) {
	my ($code, $a1, $a2) = @_;
	map { my $a1 = $_; map { $code->($a1,$_) } @$a2 } @$a1;
    }

    print map2 { "<@_>" } [qw(fred barney)], [qw(work bowling home)]

It's unfortunate that I have to name the outer iterator just to
access it for the inner, but I'm willing to live with that.

-- 
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: Thu, 29 Oct 1998 14:02:14 -0500
From: Debbie Whitten <usenet-replies@rocketmail.com>
Subject: Read/Write to same file.
Message-Id: <3638BBB6.B833EC69@rocketmail.com>

Hello,

I was playing with reading from and writing to the same file. I got
sysopen, tell, seek, and syswrite to work. The file looks like this:

user::password
user2::password2
user3::password3

The idea was that if user2 changed their password, the 2nd line in the
file would be overwritten with the new info.

The problem I ran into was if my new info is shorter than the old, I
still have leftover characters after my syswrite.

If my new line is longer than the original, I overwrite part of the next
line.

Is there a way around this, or will this only really work for
fixed-length lines? [I thought I had done this in C a long time ago, but
maybe not!]

Here's the code, thanks:

#!/usr/bin/perl

#
# Bugger.
# This only works if the line you're replacing is the same length
# as what you're replacing it with.
#

use FileHandle;

sysopen TEST, "test", O_RDWR;

TEST->autoflush(1);

$i = 0;
while (($line[$i] = <TEST>) !~ /^jeeves[:]/) {
        $i++;
        if (eof(TEST)) {
                exit(0);
        }
}

$byte = tell TEST;
$len = length $line[$i] ;
$byte2 = $byte - $len;

print "Line: $line[$i] ends at byte $byte\n";
print "Starts at byte $byte2.\n";
print "Length was $len.\n";

$err = seek TEST, $byte2, 0;
if (! $err) {
        print "seek: $!\n";
}
syswrite TEST, "HELL", 4, 0;
close (TEST);

Here's the file I used:

new::ZGViYmlldw==
debbiew::ZGViYmlldw==
jeeves::amVldmVz
admin::bmV3
new2::ZGViYmlldw==


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

Date: Thu, 29 Oct 1998 19:27:10 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Read/Write to same file.
Message-Id: <Pine.GSO.4.02A.9810291125570.3421-100000@user2.teleport.com>

On Thu, 29 Oct 1998, Debbie Whitten wrote:

> The problem I ran into was if my new info is shorter than the old, I
> still have leftover characters after my syswrite.

Sounds as if you want the FAQ's entry on editing line-oriented files with
Perl. It's in section five. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 29 Oct 1998 13:19:53 -0600
From: dbii@mudpuddle.com (David Bluestein II)
Subject: Using Perl CGI to generate ASP?
Message-Id: <dbii-2910981319530001@darwin.mudpuddle.com>

There was a post a long time back about using a Perl CGI script on Windows
to generate an ASP page that was then properly processed by IIS. I tried
putting the VBScript code in my Perl output, but it wasn't processed by
IIS and just came out as text. 

Is there something I need to do to the CGI to have IIS treat it as
generating an ASP page that should be processed?

Thanks-

ii

-- 
David H. Bluestein II                  President
dbii@mudpuddle.com                     Interactive Internet
                  http://www.interaction.net/
-        Specializing in Designing Interactive Websites        -
-              and Searchable Internet Databases               -


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

Date: Thu, 29 Oct 1998 19:13:33 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Using Perl CGI to generate ASP?
Message-Id: <Pine.GSO.4.02A.9810291113000.3421-100000@user2.teleport.com>

On Thu, 29 Oct 1998, David Bluestein II wrote:

> Is there something I need to do to the CGI to have IIS treat it as
> generating an ASP page that should be processed?

This sounds as if you're trying to configure your server to do something.
The docs, FAQs, and newsgroups about your server should be able to help
you. Goodluck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 29 Oct 1998 11:49:04 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Why is perl better than shell scripting language?
Message-Id: <MPG.10a2668f9bf3af0d98984a@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <comdog-ya02408000R2910981442240001@news.panix.com> on Thu, 
29 Oct 1998 14:42:24 -0400, brian d foy <comdog@computerdog.com> says...
> 
> tools have appropriate tasks, and can only be discussed in terms of
> those tasks.  perhaps you wanted to aska question like "why is Perl
> better for doing X".  there are certainly areas in which Perl sucks,
> but that's true with anything.

Besides 'appropriate tasks', there is another criterion by which tools 
can be discussed, the level of discourse.

For shells, the level of discourse is rather high.  The primitive 
operands are files, and the primitive operators are commands (each of 
which -- with only a few 'built-in' exceptions -- invokes a separate 
process).

While Perl can also operate well at that level of discourse, the 
primitive operands include values, from aggregates down to bytes.  (You 
don't have to invoke 'expr' to evaluate 2 + 2, for example.)  And the 
primitive operators (including built-in functions, such as 'sort') are 
powerful enough not to require separate processes.

[This may also lead to an order-of-magnitude performance improvement.]

When the level of discourse gets down to bits, or to memory-mapped I/O 
registers, for example, Perl gets overwhelmed and one has to resort to 
lower-level languages such as C, the portable assembly language 
(sometimes made accessible via Perl modules, of course).

[This may also lead to an order-of-magnitude performance improvement.]

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 29 Oct 1998 19:38:38 GMT
From: mbrumbaugh@my-dejanews.com
Subject: Win32:ODBC & differences in CGI vs. Non-CGI
Message-Id: <71ag7u$rn6$1@nnrp1.dejanews.com>

All,

The following piece of code work fine from the MS-DOS prompt:

use Win32::ODBC;

print "Content-type: text/html\n\n";

if (!($db = new Win32::ODBC("dbtest")))  ### FAILS HERE
{
   print "Error: " . Win32::ODBC::Error() . "\n";
}

$query = "select AcctPassword, FirstName, LastName, Title, OrganizationName,
Address, City, State, ";
$query .= "Country, WorkPhone, FaxNumber from accounts where
AccountId='mattb\@execpc.com'";

if ($db->Sql($query)) {
   print "LocationSQL failed\n";
   print "Error: " . $db->Error() . "\n";
   $db->Close();
   exit;
}

while ($db->FetchRow()) {
   undef %Data;
   %Data = $db->DataHash();
   $password = $Data{AcctPassword};
   $firstname = $Data{FirstName};
   . . .
   $faxnumber = $Data{FaxNumber};
}

However, it does not run via cgi.  (The cgi file is in a directory with other
working CGI scripts.)  I get the following error message when I try to load
the web page:

Error: [-1023] [] "[Microsoft][ODBC Paradox Driver] '(unknown)' isn't a valid
path. Make sure that the path name is spelled correctly and that you are
connected to the server on which the file resides."

Thanks in advance for any insight.

mattb@execpc.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 29 Oct 1998 19:38:49 GMT
From: mbrumbaugh@my-dejanews.com
Subject: Win32:ODBC & differences in CGI vs. Non-CGI
Message-Id: <71ag8a$rn9$1@nnrp1.dejanews.com>

All,

The following piece of code work fine from the MS-DOS prompt:

use Win32::ODBC;

print "Content-type: text/html\n\n";

if (!($db = new Win32::ODBC("dbtest")))  ### FAILS HERE
{
   print "Error: " . Win32::ODBC::Error() . "\n";
}

$query = "select AcctPassword, FirstName, LastName, Title, OrganizationName,
Address, City, State, ";
$query .= "Country, WorkPhone, FaxNumber from accounts where
AccountId='mattb\@execpc.com'";

if ($db->Sql($query)) {
   print "LocationSQL failed\n";
   print "Error: " . $db->Error() . "\n";
   $db->Close();
   exit;
}

while ($db->FetchRow()) {
   undef %Data;
   %Data = $db->DataHash();
   $password = $Data{AcctPassword};
   $firstname = $Data{FirstName};
   . . .
   $faxnumber = $Data{FaxNumber};
}

However, it does not run via cgi.  (The cgi file is in a directory with other
working CGI scripts.)  I get the following error message when I try to load
the web page:

Error: [-1023] [] "[Microsoft][ODBC Paradox Driver] '(unknown)' isn't a valid
path. Make sure that the path name is spelled correctly and that you are
connected to the server on which the file resides."

Thanks in advance for any insight.

mattb@execpc.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 29 Oct 1998 12:50:39 -0700
From: Gordon Haverland <haverlan@agric.gov.ab.ca>
Subject: Yet another list of lists question
Message-Id: <3638C70F.7D27321D@agric.gov.ab.ca>

Hi.
  I'm playing with some splines (piecewise polynomials).
Within each segment, we have some number of coefficients
representing the polynomial.  So $coeff[0] is the
array of coefficents on the first segment of the spline.

I want to pass this array to a subroutine, and thinking a bit
about efficiency, I figured a reference might be better.

  $f[0] += &subroutine( $begin, $end, \@coeff[$i] );

I must be goofing somewhere in how I read the docs, because
in the subroutine I need this in order to get the number
of elements in the array:
  local( $begin, $end, $r_coeff ) = @_;
  ...
     = $#{$r_coeff->[0]}
or to access the j'th element
     = $$r_coeff[0][$j]

How should a person be doing this?  (I've looked in perldoc,
man and dejanews, so if it is in the docs somewhere, my brain
isn't working.)

Gordon Haverland
haverlan @ agric.gov.ab.ca


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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 4105
**************************************

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