[10869] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4470 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 21 04:07:20 1998

Date: Mon, 21 Dec 98 01:00:18 -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, 21 Dec 1998     Volume: 8 Number: 4470

Today's topics:
    Re: First German Perl Workshop 1.0 (J|rgen P|nter)
        Help!! Count and Subtract <noise@demon.net>
    Re: How do I catch this eval exception? <uri@sysarch.com>
    Re: List splitting into sections (Randy Kobes)
    Re: Mac, Perl, uploading, help! (Kent)
        Meaning of comp generated statement <ponce151@bellatlantic.net>
        Meaning of comp-generated statement -- amended <ponce151@bellatlantic.net>
    Re: Meaning of comp-generated statement -- amended <rich_guy@hotmail.com>
    Re: Nested sorting (Larry Rosler)
    Re: Nested sorting <uri@sysarch.com>
        Rather complicated, is this possible? Trying to "Glue"  <rich_guy@hotmail.com>
    Re: Sendmail <*johntalbert@home.com*>
    Re: Splitting a line at |'s (Adam Levy)
    Re: Stumped Perl Newbie - read all the FAQ's <rich_guy@hotmail.com>
    Re: Syntax Error...Not able to find. <uri@sysarch.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 21 Dec 1998 08:02:06 GMT
From: Juergen.Puenter@materna.de (J|rgen P|nter)
Subject: Re: First German Perl Workshop 1.0
Message-Id: <75kv9u$94v$3@penthesilea.Materna.DE>

In article <75dlmu$b0o@alice.gmd.de>, jc@gmd.de says...
>
>In <75abr0$hi4$3@penthesilea.Materna.DE> Juergen.Puenter@materna.de 
>(J|rgen P|nter) writes:


>It wasn't posted to clp.misc because that's the high-volume group where
>postings get drowned in the traffic and clp.moderated was added to the 
>clp hierarchy for exactly that reason. 

Personally I don't read clp.mod. clp.misc is good enough for me.
So in the future I'll have to read every Perl NG just to catch
announcements like this? Not a good idea, IMHO.


>And, yes, it wasn't posted to de.comp.lang.perl because 90% of the
>readership wouldn't be able to attend the workshop anyway (see below for
>details).
 ...
>If you've read the camel book and regularly consult the perl faqs (which, 
>btw, 90% of the people posting in de.comp.lang.perl won't do :-()) you 
>might qualify already.

Where did you get that figure? Are you sure about it? Somehow I
don't like this. It sounds too much like '90% of you are too lazy/
stupid/whatever to attend and the rest of you know where to look,
so we can safely ignore de.clp.' NOT! If there's a german workshop
coming up I expect it in clp.announce and, if it somehow does not
make it there, in the german Perl-NG. Who knows how many german 
JAPHs you'll miss with such a restricted announcement.


>But we expect the remaining 10% of the readership [of de.comp.
>lang.perl] to also follow at least clp.moderated...

Really? I'd expext them to read clp.misc, but not necessarily
clp.mod.


>>Roughly translated from http://www.gmd.de/Events/Perl-WS99/ :
>>"Since this is a meeting meant for experience-exchange, noone
>>who has not written larger Perl-programs will be allowed to
>>participate..."
>
>A more appropriate translation would be "we regret that due to the 
>_limited number of seats available_ we have to impose some 
>restrictions on possible participants."

More appropriate perhaps. But not what it says on the page.
My translation is quite close to the german text, which IMHO
reads like the limiting factor is knowledge alone. Why was 
something like your statement not put up on the page? It would
have made things much clearer.


Have a nice day
	Juergen Puenter



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

Date: Mon, 21 Dec 1998 08:00:18 +0000
From: David Stringer <noise@demon.net>
Subject: Help!! Count and Subtract
Message-Id: <qlaHUpASAgf2Ewfu@demon.net>

Give your basic script to help debug and we should be able to advise.

In article <hpcf2.1735$aY5.16105@news3.ispnews.com>, Matthew Foley
<mfoley@richmond.net> writes
>I need to write a script that will
>
>read a file
>count to see if there are 5 entries, if not stop
>if 5, subtract the first from 5th
>if = x do something
>if not drop/remove the first entry and stop
>
>

-- 
David Stringer
Philosophically unsound


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

Date: 21 Dec 1998 01:01:48 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: How do I catch this eval exception?
Message-Id: <x74sqqkp83.fsf@sysarch.com>

>>>>> "RD" == Rick Delaney <rick.delaney@home.com> writes:

  RD> Rick Delaney wrote:

  RD> Now I'm thinking that use'ing strict actually affects how the
  RD> script is compiled in the first place.  Is this right?  Can
  RD> someone explain how the pragmatic modules, in particular
  RD> strict.pm, are implemented?

pragmas and modules are slightly different beasts.  pragmas are actually
compiler directives.

use integer is an easy one to understand. all code compiled after that
is assume to be using integer math and not floating point math. it
actually does load a module that only toggles the $^H flag when imported
or unimported. 

use strict vars says that any variables in code that is compiled after
the pragma must be fully qualified globals or locals or my or declared
in a use vars. effectively after that variables must be declared to the
compiler before they are referenced. the strict.pm module also just
toggles bits in $^H. it is loaded at compile time so it can affect other
code at compile time. as in integer it uses the import/unimport subs to
actually do the bit toggling work rather and munging the symbol
tables. neither module needs to do any symbol table munging.

strict subs and refs are managed in a similar manner. in strict.pm this
code defaults strict to all 3:

sub import {
    shift;
    $^H |= bits(@_ ? @_ : qw(refs subs vars));
}


the doc for perlvar says this about $^H

     $^H     The current set of syntax checks enabled by use
             strict and other block scoped compiler hints.  See
             the documentation of strict for more details.


and strict.pm define some of the bits:

$strict::VERSION = "1.01";

my %bitmask = (
refs => 0x00000002,
subs => 0x00000200,
vars => 0x00000400
);


so this is a way to tell the compiler to behave differently. 

hth,

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 21 Dec 1998 07:21:31 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: List splitting into sections
Message-Id: <slrn77ru9d.s7a.randy@theory.uwinnipeg.ca>

On Sun, 20 Dec 1998 11:06:13 -0800, Darren <darrensweeney@eswap.co.uk> wrote:
>HI
>
>I am using DBI on a MySQL dB. When I return the results of a search i want
>only a predefined number to appear on a page, with links to the
>next/previous pages to be at the bottom of the listing.
>
>Does anyone know of a simple script/way to do this which I can then modify
>accordingly??

Hi,
   One way to do this in MySQL is to use LIMIT OFFSET,MAX in your
search query. For example, set the maximum number of results you
want on a page, then query the server and order the results in
some fashion. Set the OFFSET parameter according to the page
you're currently on - eg, if MAX is 50, then the first page would
have zero OFFSET, the second page an OFFSET of 50, etc. The OFFSET
parameter could be passed from page to page via a cgi hidden field,
and then a link set up either forwards or backwards getting
the next or previous set of results, according to what OFFSET is.
   You would also have to consider querying the server the first
time without the LIMIT restriction in order to get the total number
of results - this serves to first of all tell the client how many
results were obtained, and secondly, whether or not on a given
page to provide the next or previous results links.
   Other, perhaps quicker solutions, with fewer calls to the server,
would involve doing the query once without LIMIT and storing 
all the results in a temporary file, with chunks of it retrieved 
at a time according to an equivalent of the OFFSET and MAX parameters.

-- 
		Best regards,
		Randy Kobes

Physics Department		Phone: 	   (204) 786-9399
University of Winnipeg		Fax: 	   (204) 774-4134
Winnipeg, Manitoba R3B 2E9	e-mail:	   randy@theory.uwinnipeg.ca
Canada				http://theory.uwinnipeg.ca/


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

Date: 21 Dec 1998 05:50:16 GMT
From: maxilious@earthlink.net (Kent)
Subject: Re: Mac, Perl, uploading, help!
Message-Id: <maxilious-ya02408000R2012982149490001@news.earthlink.net>

In article <1dkb4sr.1yeld6117n9om2N@slip-32-100-246-98.ny.us.ibm.net>,
kpreid@ibm.net (Kevin Reid) wrote:

> Kent <maxilious@earthlink.net> wrote:
> 
> > Everytime I try to ulpoad a perl script with FETCH to my server the people
> > at the isp say it is corrupted.
> > 
> > Now when I upload my html to my regular dirs I have no problems with fetch
> > (set to raw data). I edit in BBedit light, should I be saving in a specific
> > format?
> 
> Send the file as text, so the line endings get converted properly.
> 


 I tried this and it still did not work. Could I be saving it wrong in bbedit?

Ken



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

Date: Mon, 21 Dec 1998 02:55:56 -0500
From: "Emma" <ponce151@bellatlantic.net>
Subject: Meaning of comp generated statement
Message-Id: <75kuvj$lm2@world5.bellatlantic.net>

SOMEONE, PLEASE HELP

I'm in deep waters trying to do a cgi form -- an area I'm not conversant
with. I did a form in HTML, then used a computer-generated system for the
cgi.

I can access the form from the server, fill it out and get a confirmation.
But I do not get any e-mail back -- thus I can't get the information entered
on my form.

The comp-generated report came back saying:
    $emailaddress = "ponce151\@bellatlantic.net";
$dateString = &getDate;	#local time of day
&read_input;				#read data contents
&print_HTMLheader;
$mailprog = "/usr/lib/sendmail -t";	#mail program on Server,change this to
postmail or blat.exe for Windows NT Servers
$maildone = ".\n";	# end of mail input

	open(MAIL, "| $mailprog") || HTMLError("$mailprog:  Can't open because
($!).");

I don't understand what I need to correct.

Thank you a million times! Ema

Results: I imagine the problem is on the last




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

Date: Mon, 21 Dec 1998 03:11:46 -0500
From: "Emma" <ponce151@bellatlantic.net>
Subject: Meaning of comp-generated statement -- amended
Message-Id: <75kvt8$njd@world5.bellatlantic.net>



>SOMEONE, PLEASE HELP
>
>I'm in deep waters trying to do a cgi form -- an area I'm not conversant
>with. I did a form in HTML, then used a computer-generated system for the
>cgi.
>
>I can access the form from the server, fill it out and get a confirmation.
>But I do not get any e-mail back -- thus I can't get the information
entered
>on my form.
>
>The comp-generated report came back saying:
>    $emailaddress = "ponce151\@bellatlantic.net";
>$dateString = &getDate; #local time of day
>&read_input; #read data contents
>&print_HTMLheader;
>$mailprog = "/usr/lib/sendmail -t"; #mail program on Server,change this to
>postmail or blat.exe for Windows NT Servers
>$maildone = ".\n"; # end of mail input
>
> open(MAIL, "| $mailprog") || HTMLError("$mailprog:  Can't open because
>($!).");
>
>I don't understand what I need to correct.
>
>Thank you a million times! Ema
>
>
>




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

Date: Mon, 21 Dec 1998 00:47:25 -0800
From: Ryan <rich_guy@hotmail.com>
Subject: Re: Meaning of comp-generated statement -- amended
Message-Id: <367E0B1D.7B3D@hotmail.com>

Emma wrote:
> 
> >SOMEONE, PLEASE HELP
> >
> >I'm in deep waters trying to do a cgi form -- an area I'm not conversant
> >with.

Maybe you can find something that's already working at  Matt's Script
Archive. Nothing fancy, but it'll help you understand, and not try and
guess how to code a script, as it's obvious that you need to know a lot
more before attempting such things.

> I did a form in HTML, then used a computer-generated system for the
> >cgi.
> >

Computer Generated System... ??

> >I can access the form from the server, fill it out and get a confirmation.

Cool. :-)

> >But I do not get any e-mail back -- thus I can't get the information
> entered
> >on my form.

Well, you're at a start. Have you read any FAQ's or any docs, or any
books, or anything?.. Or are you just trying to "tinker" and see if you
can made it work?

> >
> >The comp-generated report came back saying:
> >    $emailaddress = "ponce151\@bellatlantic.net";
> >$dateString = &getDate; #local time of day

from where?

> >&read_input; #read data contents

from where?

> >&print_HTMLheader;

from where?  cgi-lib.pl?.. or?>.. part of the script, or?

> >$mailprog = "/usr/lib/sendmail -t"; #mail program on Server,change this to
> >postmail or blat.exe for Windows NT Servers


Did you go into telnet and type "whereis sendmail", do you have
sendmail? Are you on a Unix, or do you need to install the blat on an NT
system?.. Did you do either, or look into either? Did you read the
README files that came with that script?

> >$maildone = ".\n"; # end of mail input
> >
> > open(MAIL, "| $mailprog") || HTMLError("$mailprog:  Can't open because
> >($!).");
> >


Now what?.. You've shown "parts" of the script, but nothing that can let
anyone know what is wrong, or more specifically; what is or isn't wrong,
needs to be set, and how to set it up.

> >I don't understand what I need to correct.

Sorry, neither do I. Try going to the site where you downloaded the
script from and looking there, or asking the person that wrote it, or
your webmaster, or someone that's used it, or someone that's willing to
look through it and take a few minutes with you to find out what server
you're running it on and where things are, etc.

> >
> >Thank you a million times! Ema
> >
> >
> >

Good luck. :-)
Ryan


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

Date: Sun, 20 Dec 1998 22:12:48 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Nested sorting
Message-Id: <MPG.10e786bfd33b00e698996f@nntp.hpl.hp.com>

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

In article <x7d85ekqa8.fsf@sysarch.com> on 21 Dec 1998 00:38:55 -0500, 
Uri Guttman <uri@sysarch.com> says...
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
>   LR> Non-negative floating-point numbers require some manipulation and 
>   LR> sorting as bit patterns, assuming IEEE-754 standard formatting.  I 
>   LR> haven't figured out yet how to do that for negative floating-point 
>   LR> numbers or, hence, reverse sorting.
> 
> unfortunately as we have discoverd, perl sux at random bit
> manipulations. vec only does power of 2 sized fields. this manipulation
> might blow away all the gains of the sort (for certain sizes of
> sorts). that is a well known issue, the constant or linear overhead of
> an algorithm counts less with greater data sets, but this overhead might
> be very big in perl. i think we should stay away from that until the
> numeric compare optimization is put in. then sort {$a <=> $b} will be as fast
> as the builtin sort.

No comprendo.  We already know that the alphabetic compare {$a cmp $b} 
is considerably slower than the default sort, so there is no 
optimization there, let alone for numeric compare.  Anyway, sorts are 
often used on compound keys from several fields, so stringifying is 
required.

It is possible that, until we learn more, floating-point numbers are not 
suitable for the stringifying technique.

>   LR> And now I know how to complement strings for reverse sorting.  Wow!
> 
> that was cool, larry. we definitely have to add it to our sort article.

Complementing strings for reverse default sorting looks like a practical 
use of a bitwise string operator.  I think that until now I've seen them 
used in JAPHs only.

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


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

Date: 21 Dec 1998 01:26:40 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Nested sorting
Message-Id: <x7yao2j9i7.fsf@sysarch.com>

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

  >> unfortunately as we have discoverd, perl sux at random bit
  >> manipulations. vec only does power of 2 sized fields. this
  >> manipulation might blow away all the gains of the sort (for certain
  >> sizes of sorts). that is a well known issue, the constant or linear
  >> overhead of an algorithm counts less with greater data sets, but
  >> this overhead might be very big in perl. i think we should stay
  >> away from that until the numeric compare optimization is put
  >> in. then sort {$a <=> $b} will be as fast as the builtin sort.

  LR> No comprendo.  We already know that the alphabetic compare {$a cmp
  LR> $b} is considerably slower than the default sort, so there is no
  LR> optimization there, let alone for numeric compare.  Anyway, sorts
  LR> are often used on compound keys from several fields, so
  LR> stringifying is required.

the optimization would be to recognize {$a <=> $b} and handle it
internally like the default sort, but do it numerically. i have seen p5p
talk about this and i think it is on the current todo list. i will try
to check that.

  LR> Complementing strings for reverse default sorting looks like a practical 
  LR> use of a bitwise string operator.  I think that until now I've seen them 
  LR> used in JAPHs only.

there are other uses for them, but this one is a good use that may get
more popular as stringifying sorts gets more well known.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Mon, 21 Dec 1998 00:24:43 -0800
From: Ryan <rich_guy@hotmail.com>
Subject: Rather complicated, is this possible? Trying to "Glue" this idea together!
Message-Id: <367E0586.1EAB@hotmail.com>

I have a few parts of code and subs that can be used in active/per user
sessions for carts, chats, and other such things to interact with the
client via a web browser. This works now, and can change depending on
what the user does, i.e., enter/creat session, knows what room/page and
all the user's data, no matter where they go, or what they do. This is
also attempting a few "ideas" as well as seeing if it's possible. For
now, it works via post or get/URL like so:
pathtoscript/script?TICKET=1-2-encrypted_password-randomnumbers_saved-command-change

But I want to know if it's possible to break down a long command line
passed to the script and use those exact parts as the commands. Liek
above, but more cryptic even!
such as:
pathtoscript/script?TICKET=12encryptedpasswordrandomnumbers_savedcommandchange

Kepe in mind, the first two digits can be from 1 decimal to 3 (i.e., 1
(001), 12 (012), 123, etc.), as well as the last "change" to have up to
a 3 char decimal range as well. This is challenging, because they are
contantly changing, yet they much match and be able to be broken down by
command, again, from one long line. Here's my idea, break it down using
"substr", depending on how long the length is on the variables it needs
to break down. (maybe this isn't possible, but...)

# I get the data...

 my(%Fields);
 DataFilter(\%Fields);

# Make sure they are in an active session.
 NotValidTicketError(2) if (!exists($Fields{"TICKET"}));

# Get the info, as it grabs it at present (this works of course)..
 ($file_number, $user_number, $pass, $session, $do_number, $change) =
  &DecodeThis ($Fields{"TICKET"});
 
sub CreateThis { # Create the user's ticket number (the way it's done
now) for them
                 # to use the site.
  my($file_number) = shift;
  my($user_number) = shift;
  my($pass) = shift;
  my($session) = shift;
  my($do_number) = shift;
  my($change) = shift;
 return ($file_number . "-" . $user_number . "-" . $pass . "-" .
$session . "-" . $do_number . "-" . $change);
}

# Break the URL down as it is done now
sub DecodeThis {
 return (split(/-/, shift));
}

# Ok, here's my idea. (I like this, because of the challenge, I know I
don't HAVE
# to change the way it works now, but this can be a useable idea in
other programs.

# This is just for example.
$capture = $file_number . $user_number . $pass . $session . $do_number .
$change;

$tmp_file_number = substr($capture,0,(length($file_number)));
$tmp_user_number =
substr($capture,(length($file_number)),(length($user_number)));
$tmp_pass = substr($capture,((length($file_number)) +
(length($user_number))),(length($pass)));
$tmp_session = substr($capture,((length($file_number)) +
(length($user_number)) + (length($pass))),(length($session)));
$tmp_do_number = substr($capture,((length($file_number)) +
(length($user_number)) + (length($pass)) +
(length($session))),(length($do_number)));
$tmp_change = substr($capture,((length($file_number)) +
(length($user_number)) + (length($pass)) + (length($session)) +
(length($do_number))),(length($change)));


### End
 So, this adds it all up perfectly, and I can have it create one long
line to be broken
 down. This will calculate how long each variable is, and know where to
break it down IF I use the present (working slipt on the -hyphen-) idea
I am using now. So, I can know how long each is to be, before breaking
it down.. that is,if I pull that info into the $capture string. So then,
is there any way to do this, or maybe be able to break it down from what
I have and make it workable? I'm really trying to figure this out to
make it work. I can't seem to "glue" this idea together from here.
Any ideas for ths crazy mission of mine?
Thanks!
Ryan.


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

Date: Mon, 21 Dec 1998 08:01:18 GMT
From: "John Talbert" <*johntalbert@home.com*>
Subject: Re: Sendmail
Message-Id: <ifnf2.1239$Uv.138@news.rdc1.va.home.com>

This is a multi-part message in MIME format.

------=_NextPart_000_001A_01BE2C8C.DBF89EA0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


    I am looking for a Win95/98 program compatable with SENDMAIL ( =
http://www.sendmail.org ).  I am using the latest version of Perl =
(downloaded it last night) and Apache 1.3.3 on a Win32 machine running =
Windows 95.  Can anyone help?

------=_NextPart_000_001A_01BE2C8C.DBF89EA0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 =
HTML//EN">
<META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 solid 2px; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
    <DIV><FONT color=3D#000000 size=3D2>I am looking for a Win95/98 =
program=20
    compatable with SENDMAIL ( <A=20
    href=3D"http://www.sendmail.org">http://www.sendmail.org</A> =
).&nbsp; I am=20
    using the latest version of Perl (downloaded it last night) and =
Apache 1.3.3=20
    on a Win32 machine running Windows 95.&nbsp; Can anyone=20
help?</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_001A_01BE2C8C.DBF89EA0--



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

Date: Mon, 21 Dec 1998 01:27:37 -0600
From: adrade@wwa.com (Adam Levy)
Subject: Re: Splitting a line at |'s
Message-Id: <adrade-2112980127370001@pool1-054.wwa.com>

In article <367D3E44.FDA9C016@home.com>, Rick Delaney
<rick.delaney@home.com> wrote:

> [posted & mailed]
> 
> Adam Levy wrote:
> > 
> > i'd use:
> > ($one,$two,$three) = split(/|/,$vartobesplit,3);
> 
> Why would you ever use that??

[blah, blah, blah; garbage, garbage, garbage]

> What you have written makes it look like you want to split on '|',

Funny, thats what the original poster wanted.

> which
> of course would be written as:
> 
>     ($one,$two,$three) = split(/\|/,$vartobesplit,3);

Of course I meant that, you self declared idiot. If you had read the
original post, splitting it up into three variables was the objective, not
the garbage you wrote about at the start of your critique. It was an
honest and accidental mistake. Calm down a little and save yourself a
heart attack.


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

Date: Mon, 21 Dec 1998 00:39:50 -0800
From: Ryan <rich_guy@hotmail.com>
Subject: Re: Stumped Perl Newbie - read all the FAQ's
Message-Id: <367E0956.28DF@hotmail.com>

Roger McIlmoyle wrote:
> 
> I've been trying to get perl to execute / generate HTML.
> 
> From the command line it generated a good html file that works.
> 
> When I call it from the browser (Microsoft's), I get a server 500 errror.
> I have: #! c:\Perl\5.005\bin\MSWin32-x86-object\perl.exe
> 
> as the first line, I have put the script where scripts can run on the IIS.
> 
> I would really appreciate a pointer.
> 
> #! c:\Perl\5.005\bin\MSWin32-x86-object\perl.exe
> print "Content-type: text/html\n\n";
> print <<EOM;
> <HTML>
> <HEAD><TITLE>Test page</TITLE></HEAD>
> <BODY>
> <H1>TEST PAGE</H1>
> EOM
> print <<EOM;
> </BODY>
> </HTML>
> EOM
> exit;

Are you using Windows then? I can only assume so. If so, the #! line
shoudn't need the path. Or from my experience, it never has! (however,
you can stil use the switches., i.e., -w -T, etc.).

Why not try and simple

#! /perl

print "Content-type: text/html\n\n";
print "Does THIS work even!?\n";

# End...

Run that from the browser and see if it works. Then (if it doesn't),
check your server's error logs to see what it says.
It can be may many things causing that error. Maybe your web server
isn't setup properly? For example, maybe you don't have the executable
extensions set to read and know it's a Perl script, like the file
extension .pl or .cgi, or .plx, or whatever. are these scripts ran in a
ScriptAliased directory? Are you saving them in binary or somethig?
Don't try ANYTHING complicated at all, or over two lines (if you can
help it!), until you KNOW it'll work at all. Go to http://www.perl.com
and read the FAQ sections. It's probably something more simple then you
think. I can tell you now, that most likely, it is simple enough to
where you shouldn't have posted your question here. Then again, maybe
it's your web server tweaking and someone might know it and be able to
help you. Of course, telling us what web server (exactly) you're running
migth help too.. Then again, that's another NG anyway. 
Good luck,
Ryan.


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

Date: 21 Dec 1998 01:06:33 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Syntax Error...Not able to find.
Message-Id: <x71zlukp06.fsf@sysarch.com>

>>>>> "KR" == Kevin Reid <kpreid@ibm.net> writes:

  KR> Uri Guttman <uri@ibnets.com> wrote:
  G> unlink (resellers.lock);
  >> ^^^^^^^^^^^^^^
  >> bareword for a file name. are you using -w?

  KR> It's not just a bareword, it's two barewords concatenated with the '.'
  KR> operator - which means the . disappears.

true. another reason i am against all barewords and i quote all
tokens. it lessens the possibility of confusion. a quoted string is just
that and can't be confused like the above example.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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