[10989] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4589 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 8 12:07:24 1999

Date: Fri, 8 Jan 99 09:00:15 -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           Fri, 8 Jan 1999     Volume: 8 Number: 4589

Today's topics:
    Re: "internal server error" (Tony Greenwood)
        ActivePerl cgi problem jim@researchdesk.com
        ANNOUNCE: DbFramework-1.05 <paul@miraclefish.com>
        How do I find the path of the script calling me? aazeemi@hotmail.com
        JPL Java/Perl Lingo <kam@caesun.msd.ray.com>
    Re: line noise <bradw@newbridge.com>
        prog1 lookalike in Perl? <hniksic@srce.hr>
    Re: Someone asked how to capitalise first letter of eac (Tad McClellan)
    Re: Sorting by 2 fields (Tad McClellan)
    Re: Web page lay out module (Clay Irving)
    Re: Why Is Perl not a Language? <mike@crusaders.no>
        {ANNOUNCE] new module Puppet::Body <domi@barrayar.grenoble.hp.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 09 Jan 1999 00:48:03 GMT
From: paxton@cyberstrider.org (Tony Greenwood)
Subject: Re: "internal server error"
Message-Id: <369ca5be.19659733@news.freeserve.co.uk>

** CyberSTrider Web Services http://web.cyberstrider.net ** 
 

>> >Let's see.... you don't have -w, you don't have "use strict", you do
>> 
>> Niether do I.. what do they do ?
>
>Gives warning message on suspect code and enforces a stricter syntax.

haaa fanx

>> >everything yourself instead of using modules written by people with a
>> 
>> Same here.. I still don't understand what a module is or how to use
>> them
>
>"use" them and then call their functions, fairly simple.

I said I don't know how to use them.. your answer to use them is
therefore a little confusing
>

>> I "think" I have the appropriate enviroment though so I am one up on
>> the original poster :)
>
>Trying to learn perl by doing CGI programming (especially for someone
>with no programming experience) is like trying to learn to ride a

I have ten years programming experience... you are having a bad day
arn't you

>> >Please crawl under a rock and wither away. You make me sick.
>> 
>> Hmm not the best sig I ever came accross...
>
>Not a sig or it would have been preceded by a proper sigdash (two dashes
>followed by a single space on an otherwise blank line).

I see humour goes right over your head...Whoooosh!
>
>> .
>> BTW it isn't sarcasm.. I really don't know the answers to the above..
>> .
>Then you need to read some more.

I agree, I just hope I don't have to read bad mannered posts too often
>
>>      Cheers.....!ynoT 
>>  CyberSTrider Web Services
>> http://web.cyberstrider.net
>
>You seem to be missing a sigdash, would you like to borrow one?

What for?

Thanks for your response, but your post was of no help at all, however
I think you already knew that, this would leave me to wonder why you
posted it, sarcasm, an attempt to have a go at me, perhaps to look
clever, well didn't that backfire :)

Now shall we drop this before you show yourself up anymore?

 .



     Cheers.....!ynoT 
 CyberSTrider Web Services
http://web.cyberstrider.net


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

Date: Fri, 08 Jan 1999 16:10:52 GMT
From: jim@researchdesk.com
Subject: ActivePerl cgi problem
Message-Id: <775am9$8qr$1@nnrp1.dejanews.com>

When I try to use ActivePerl for a cgi, I get:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request.
Please contact the server administrator, you@your.address and inform them of
the time the error occurred, and anything you might have done that may have
caused the error.

malformed header from script. Bad header=: d:/apache/cgi-bin/cgitest.cgi



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

Apache/1.3.3 Server at localhost Port 80

The perl script runs fine standalone and the html produced ( I put the html in
a file) looks fine when I bring it up in a browser by accessing the file.

Any help ?

thanks

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


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

Date: 8 Jan 1999 16:33:04 GMT
From: Paul Sharpe <paul@miraclefish.com>
Subject: ANNOUNCE: DbFramework-1.05
Message-Id: <775c00$95$1@play.inetarena.com>

Recently submitted to PAUSE

  file: $CPAN/authors/id/P/PS/PSHARPE/DbFramework-1.05.tar.gz
  size: 24518 bytes
   md5: 8565a4b40fe51d3084382248b87e9590

DbFramework is a collection of classes for manipulating Mysql
databases.  The classes are loosely based on the CDIF Data Model
Subject Area.  There are methods for representing data model objects
as HTML and a class which can be subclassed to add persistency to Perl
objects.  See the POD for further details.

The module includes a CGI application which provides an HTML forms
interface for manipulating Mysql databases.

Prerequisites
=============

  Alias
  CGI
  DBI
  Msql-Mysql-modules
  ePerl (for dbforms.cgi)

6-1-1999                    Paul Sharpe          <paul@miraclefish.com>
-----------------------------------------------------------------------
RELEASE 1.05

= INTERFACE
  Table
    - New method dbh($dbh) (added pod for AUTOLOAD() method)
    = Improved form and template support
      - new() now takes list of form rather than template definitions 
        and evals configuration from config.pl files.
      - New method read_form()
      - More pod  
  - Default output templates now handle foreign keys by replacing them
    with columns from the related table.
  - <DbValue> template tag can now contain a list of attributes to be
    substituted for values.
  dbforms.cgi
    - fills values from related table for foreign keys in default
      output template.
    - Now handles user-defined forms.




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

Date: Fri, 08 Jan 1999 15:57:18 GMT
From: aazeemi@hotmail.com
Subject: How do I find the path of the script calling me?
Message-Id: <7759ss$84a$1@nnrp1.dejanews.com>

Howdy All,

Pardon me if this question has been asked before.

I have two perl scripts - A and B.

Script A calls script B.  Script A lives in multiple locations.  From within
script B, how can I find the pathname of script A which just called me?

I would appreciate a reply directly to my email address.

Thanks for you help in advance,
Aamer Azeemi


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


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

Date: Fri, 08 Jan 1999 10:54:00 -0500
From: Karin Moffett <kam@caesun.msd.ray.com>
Subject: JPL Java/Perl Lingo
Message-Id: <36962A18.92DE30DA@caesun.msd.ray.com>

I am trying to interface Java with Perl. I have installed the latest
stable version of Perl
5.005_02. My understanding is that I need to run install-jpl, but I
can't seem to find this anywhere in my installation.

Does anyone know if this is something separate I need to download? I
though it was supposed to be included in my current version of Perl.
There could be some other install script I need to run prior to
install-jpl. Help!!!

Any assistance is greatly appreciated. If possible please e-mail
responses to kam@caesun.msd.ray.com.

Thanks



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

Date: 08 Jan 1999 11:42:09 -0500
From: bj <bradw@newbridge.com>
Subject: Re: line noise
Message-Id: <op1sodlbtsu.fsf@kannews.newbridge.com>

abigail@fnx.com (Abigail) writes:

> Bart Lateur (bart.lateur@skynet.be) wrote on MCMLV September MCMXCIII in
> <URL:news:3695cf16.27798750@news.skynet.be>:
> \\ bj wrote:
> \\ 
> \\ >OTOH, the lack of a formal, legal support requirement makes the
> \\ >"suits" nervous and upset at times.
> \\ 
> \\ Does the "legal support requirement" actually help in commercial
> \\ products? It's my (limited) experience that it's not the top notch
> \\ people that do the technical support, to put it politely. Yet, those
> \\ support problems may be the toughest of all.

> Top notch isn't always what one needs. But being able to call adequate
> support when you have a problem, and knowing there will be someone
> available to help you has its merits.

I made a simplar point privately. Mission critcial stuff may require
support contracts that at least guarantee a response time. I would
certainly put pretty well all the equipement in the data center into
this category, and most of the services that run on them. OTOH, I
would claim that development work should not require the same
guarantee, especially wrt to production stuff we are using Perl for.

Convincing the suits of this is an issue though.

bj


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

Date: 08 Jan 1999 17:38:52 +0100
From: Hrvoje Niksic <hniksic@srce.hr>
Subject: prog1 lookalike in Perl?
Message-Id: <kig90fdzplv.fsf@jagor.srce.hr>

Is there a Perl equivalent of the Lisp PROG1 form?  PROG1 is very
useful when you want to do something along the lines of:

    (value, commands...)

and have the whole expression return value.  For example:

# $change is a global boolean variable, initialized by the time &foo()
# is invoked.
sub foo ($)
{
  my $new;
  $_ = shift;
  /^begin/ && ($change = 1);
  $new = $change ? "# $_" : $_;
  /^end/   && ($change = 0);
  $new;
}

In Lisp, I would have written the same code approximately like this:

(defvar change)
(defun foo (x)
  (and (match "^begin" x) (setq change t))
  (prog1 (if change (concat "# " x) x)
    (and (match "^end" x) (setq change nil))))

which would be equivalent to:

sub foo ($)
{
  $_ = shift;
  /^begin/ && ($change = 1);
  prog1 ($change ? "# $_" : $_,
         /^end/ && ($change = 0));
}

PROG1 evaluates all the forms sequentially, but returns the result of
the first form, thus removing the need for a local variable $new.  So
it acts sort of like Perl's `,' operator, except it returns the first,
not the last value.

Is there an elegant way to emulate PROG1 in Perl?  I can think of
using parens and dereferncing them with ()[0] to get the first value,
but it doesn't look elegant to me.


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

Date: Fri, 8 Jan 1999 09:57:37 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Someone asked how to capitalise first letter of each word
Message-Id: <ht9577.dum.ln@magna.metronet.com>

Andrew Mayo (andrew@geac.co.nz) wrote:
: I can't find the posting now, but as a newbie it struck me as an interesting
: problem (and raised some issues). 


   Those are characteristics of most Frequently Asked Questions,
   not just that one...

   ... which is why they get Asked Frequently  ;-)


: The problem was to take something like
: 'hello there' and turn it into 'Hello There'.


   Perl FAQ, part 4:

      "How do I capitalize all the words on one line?"


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 8 Jan 1999 09:53:20 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Sorting by 2 fields
Message-Id: <gl9577.dum.ln@magna.metronet.com>

Robert Young (rob@webteacher.com) wrote:

: Here is the FAQ example of how to sort by 2 fields:

: @sorted = sort { field1($a) <=> field1($b) ||
:  field2($a) cmp field2($b) ||
:  field3($a) cmp field3($b)
:  } @data;


   That sorts by 3 fields  ;-)


: Now, here is my routine.  Basically, I have a :: delimited database,
: which can be sorted by a user-specified field.

: better way to do this.  The user specified sort field is called
: $reportSort (stored as the field number), and the sort order (ascending
: vs. descending) is called $reportOrder (0/1).


   I chose different variable names below.


: My question is, how can I use the example from the FAQ above to include
: a secondary sort in my routine, for a field specified as $reportSort2 in
: the sequence $reportOrder2 ?

: If my question is not clear, I have included some examples below.


   And if your question _is_ clear, you have still included
   some examples below    ;-)

[ snip code and data ]


: If the user chose to sort by State, then by Last name, both in ascending
: order:
: $reportSort=5;
: $reportOrder=0;
: $reportSort2=2;
: $reportOrder2=0;

: After running the routine, the results should look like this:

: 126::George::Getty::1 Tombstone Ln.::Burton::ME::01355
: 124::Eddie::Stoll::4 Burger Rd.::Newton::ME::01332
: 123::Carol::King::123 Main St.::Brighton::VA::54321
: 125::Bruce::Lasling::67 Sturgis Ave::Arlington::VA::56043
: ===========================

: Many many bows and thanks to the person that answers my question.


   You're welcome.


----------------------------------------
#!/usr/bin/perl -w
use strict;

my(@entries) = <DATA>;
chomp(@entries);

my $col1 = 5;      # number of the primary sort column
my $descending1=0; # descending order if true

my $col2 = 2;      # number of the secondary sort column
my $descending2=0; # descending order if true

@entries =         # Schwartzian Transform
      map { $_->[0] }
      sort { ($descending1 ? $b->[1] cmp $a->[1] : $a->[1] cmp $b->[1]) or
             ($descending2 ? $b->[2] cmp $a->[2] : $a->[2] cmp $b->[2])
           }
      map { [$_, (split /::/)[$col1,$col2]] }
      @entries;

foreach (@entries) {
   print "$_\n";
}


__DATA__
123::Carol::King::123 Main St.::Brighton::VA::54321
124::Eddie::Stoll::4 Burger Rd.::Newton::ME::01332
125::Bruce::Lasling::67 Sturgis Ave::Arlington::VA::56043
126::George::Getty::1 Tombstone Ln.::Burton::ME::01355
----------------------------------------


   Since the numeric fields in your sample data are all the same
   number of digits, an ASCIIbetical sort will work for those too.

   There is still a lot of work happening in the sort{} block,
   but I cannot think of how to reduce it and retain the
   ascending/descending option...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 8 Jan 1999 11:47:54 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Web page lay out module
Message-Id: <775crq$aan@panix.com>

In <Pine.GSO.4.03.9901071828050.711-100000@mhz.it.earthlink.net> Hong Zhang <zhangh@corp.earthlink.net> writes:

>I am looking for a GOOD web page lay out module,
>commercial or free. CGI.pm can not be used to gernerate
>complex web page. TableLayout is good but not enough.


Arrghf!

Damn, I just spit my coffee on my screen...

-- 
Clay Irving
clay@panix.com


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

Date: 8 Jan 1999 16:45:55 GMT
From: Trond Michelsen <mike@crusaders.no>
Subject: Re: Why Is Perl not a Language?
Message-Id: <775co3$b2e$1@romeo.dax.net>

On 8. Jan 11:28, Bart Lateur wrote:

>>>  1) no user interface
>>Ha ha, oh the influence of Microsoft. A language, scripting or not,
is a set
>>of rules defining a grammar for expressing ideas, and nothing to do
with user
>>interfaces. These days to write programms most people use an editor
of some
[...]
> You misunderstood me (you too).
> I ment the programs you write with Perl, not the programs you write
Perl
> with.
> You are talking about the IDE. I am not.

Sure you can make programs with user interfaces with Perl. 
Any kind of text-only "press a key to continue" programs are a user
interface, but you were probably thinking of a Graphical User
Interface?

Any kind of web-page with a form is a Graphical User Interface.
But, if you want to make a more traditional user-interface you can use
some of the X11::Fvwm:: modules or Tcl::Tk. I haven't done this myself,
so I don't know exactly how easy it is to use these modules, but they
are there.

I mostly use perl for scripting purposes myself, creating programs that
need as little user intervention as possible, but that merely means
that my _programs_, not my _programming language_, are GUI-less, don't
you agree?

-- 
  // Trond Michelsen
\X/  mike@crusaders.no


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

Date: 8 Jan 1999 16:31:23 GMT
From: Dominique Dumont <domi@barrayar.grenoble.hp.com>
Subject: {ANNOUNCE] new module Puppet::Body
Message-Id: <775bsr$5j$1@play.inetarena.com>


Hello


Puppet::Body is a utility class that is used (and not inherited like
the deprecated Puppet::Any) to manage dynamic has-a relations between
objects.

This class results from the split of the deprecated Puppet::Any.

It provides the following features :

- An event log display so derived object may log their activity
- A Debug log display so derived object may log their "accidental" 
  activities
- A set of functions to managed "has-a" relationship between Puppet objects.
- A facility to store data on a database file tied to a hash.

Suggested DSLI entry in the Perl Module list:

Puppet::Body   adpO  Handles permanent data, has-a relations and logs DDUMONT

About Puppet body classes

Puppet classes are a set of utility classes which can be used by any
object.  If you use directly the Puppet::Body class, you get the plain
functionnality.  And if you use the Puppet::Show class, you can get
the same functionnality and a Tk Gui to manage it.


I'd like people who use this module for their application to drop me a
short note about what they're using this module for.

Cheers

-- 
Dominique_Dumont@grenoble.hp.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 4589
**************************************

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