[7749] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1374 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 27 09:08:18 1997

Date: Thu, 27 Nov 97 06:01:03 -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, 27 Nov 1997     Volume: 8 Number: 1374

Today's topics:
     $( and $( - dont work as advertised??? <chris@ixlabs.com>
     Re: Any Perl-compatible database available <u2537@shurflo.com>
     Re: Backquote in Perl (brian d foy)
     Compiling perl <914398N@knotes.kodak.com>
     Embarrassing Perl Code (was PERL Hourly Rates) (brian d foy)
     Re: Embarrassing Perl Code (was PERL Hourly Rates) (Terry Michael Fletcher - PCD ~)
     FAQ? 5.004_04 "Illegal character \015 (carriage return) <rick@ihermes.com>
     Re: How To Test if number is ODD or EVEN? (brian d foy)
     Including nested .pl-files <averste@uni-muenster.de>
     Re: interpreted languages <emergent@cape.com>
     Re: IS THERE A DB INTERFACE INTO MS SQL SERVER? <rothd@xrxoxtxhx.xnxextX>
     Re: ntperl newbie <petri.backstrom@icl.fi>
     Re: perl bad for backgroud job? <maevans@io.com>
     Re: PERL Hourly Rates (brian d foy)
     Re: PERL Hourly Rates (brian d foy)
     Re: PERL Hourly Rates (brian d foy)
     Re: PERL Hourly Rates twod@not.valid
     Re: PERL Hourly Rates <keson@uswest.com>
     Re: PERL Hourly Rates (brian d foy)
     Problem with Blat in perl script amhardin@erols.com
     Re: Proxy Client (Abigail)
     Re: read from end of file (by line) (Scott Anthony Hamilton)
     Re: regexp problem (brian d foy)
     Re: Simulation & modeling (Andy Leigh)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 25 Nov 1997 18:50:59 -0800
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: $( and $( - dont work as advertised???
Message-Id: <347B8E93.5B1A@ixlabs.com>

The Perl 5 Desktop Reference define $) and $( as
the effective and real GID's of the current process, respectively.

In my usage on Solaris and Linux, however, I get a list of GID's the
current user belongs to!

On which systems are these variables set as documented, and how can
you *really* get the GIDs of the current process?


-Chris


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

Date: Tue, 25 Nov 1997 16:12:52 -0800
From: Thomas Beardshear <u2537@shurflo.com>
Subject: Re: Any Perl-compatible database available
Message-Id: <347B6984.24183B8A@shurflo.com>

I'm getting closer. I'm using Mysql. With the help of another user in
this group I've found a little more info. I've been poking around in the
logs and docs and found a reference to a '--log' option. This option
appends the results of a query to the log located in
/usr/local/mysql/data. EVERY time I run the script from the shell, the
logs are updated. They ARE NOT updated when I run the script from the
browser which means the query is most likely not executing. Can you
think of any tools I can use to follow the progress of a CGI script?

Andrew Ellerton wrote:
> 
> Thomas Beardshear wrote:
> >
> > Does ANYONE know of a Linux database compatible with Perl, CGI.pm and
> > Apache.
> >
> 
> Checkout http://www.hermetica.com/technologia/perl/DBI/index.html
> 
> > I want to query data from a database from a browser and I can't find
> > anyone or any support for the database I'm using.
> 
> Which Database is it? Which platform are you using? There's bound to be
> a way to do it, or at least kludge it.
> 
> >
> > I'm trying to find ANY database engine that will output database queried
> > data to a browser via a Perl CCI script successfully.
> 
> It shouldn't be too hard! There's plenty around, including free or cheap
> ones.
> 
> Andrew
> 
> --
> Andrew Ellerton                          andrewe@technologyXchange.com
> Software Engineer                                      +61 8 9367 7006
> International Technology Exchange                  Fax +61 8 9367 7343
> Australia                             http://www.technologyXchange.com


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

Date: Wed, 26 Nov 1997 07:42:02 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Backquote in Perl
Message-Id: <65gi3g$d0g@bgtnsc03.worldnet.att.net>

In article <880523064.10150@dejanews.com>, venkat5@hotmail.com wrote:

> could someone help in ,how to use cd(change directory) within backquotes.
> print `cd \dir1`; is not working. other  commands like dir are working.
> i am using Perl 5.001 under WinNT 4.0

remember that backticks do double-quotish interpolation:

#!/usr/bin/perl

$data_1 = `echo s\tu`;

print "data are $data_1";

$data_2 = `echo s\\tu`;

print "data are $data_2";

__END__
data are s u
data are stu

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 26 Nov 1997 10:20:01 +1100
From: Anthony Licciardi <914398N@knotes.kodak.com>
Subject: Compiling perl
Message-Id: <347B5D21.7601@knotes.kodak.com>

I have downloaded perl5 and extracted all the files into a directory. I
have run the Configure command followed by the config.sh command. I am
still unable to see the new directories where the libraries and
executable should have been put into. (these directories were specified
while running the Configure command) 
if anyone has done this could they please tell me where I went wrong. In
the end I just want an executable 'perl' program.
Thanks


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

Date: Wed, 26 Nov 1997 02:13:05 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Embarrassing Perl Code (was PERL Hourly Rates)
Message-Id: <65fuqk$drr@mtinsc03.worldnet.att.net>

In article <8c4t50eick.fsf@gadget.cscaper.com>, Randal Schwartz
<merlyn@stonehenge.com> wrote:

> >>>>> "twod" == twod  <twod@not.valid> writes:
> 
> twod> Is it not one of the unwritten rules about
> twod> contracting/consulting that you reserve the right to throw your
> twod> hands in the air and exclaim 'Who the hell wrote this junk and
> twod> why ? when maintaining code ?
> 
> twod> Believe me, someone will have said this about some of your code
> twod> in the past if you have been in the industry for a while - I'm
> twod> sure it's been said of some of my early work :)
> 
> I've said it about my *own* stuff when I've gone back later.
> Admittely, modern versions of Perl really make a lot of things easier
> that we had to do "by hand" earlier.

i'm always saying it of my own stuff :)

the scary part is when i say it the day after i wrote it.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: 26 Nov 1997 02:54:10 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: Embarrassing Perl Code (was PERL Hourly Rates)
Message-Id: <65g30i$fvj$1@news.fm.intel.com>

brian d foy (comdog@computerdog.com) so eloquently and verbosely pontificated:
> In article <8c4t50eick.fsf@gadget.cscaper.com>, Randal Schwartz
> <merlyn@stonehenge.com> wrote:
> 
> > I've said it about my *own* stuff when I've gone back later.
> > Admittely, modern versions of Perl really make a lot of things easier
> > that we had to do "by hand" earlier.

a few months ago, i was looking through a "guestbook" type script i had
from back in the days.  i was trying to disallow certain words from being
posted with a pattern match.  i had no perl book, no perl knowledge, no
one to ask questions (that i knew of).  i saw this type of pattern
match in a script:

/[Mm]ozilla/

and realized what the brackets did, but i didnt know a /i modifyer
existed, so to match all ways a word could be written, i did this:

/[Tt][Ee][Rr][Rr][Yy]/

i ROTFL when i saw that i did that.... :-0

i always find myself holding back the laughter when i read newbie scripts.
i wish more people could take it in stride, rather than get offended :-)

-- 
#!/usr/local/bin/perl -w
system("pod2html $0")&&die"Just another Perl hacker,\n";system("
lynx $0.html")&&die"Just another Perl hacker,\n";unlink"$0.html";

=head1 Just another POD hacker, tfletche@pcocd2.intel.com


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

Date: Tue, 25 Nov 1997 16:42:05 -0800
From: Rick Morlang <rick@ihermes.com>
Subject: FAQ? 5.004_04 "Illegal character \015 (carriage return)"
Message-Id: <347B705C.B0417E61@ihermes.com>

This has got to be a FAQ, doesn't it? I can't find reference to it
anywhere however.

I upgraded from 5.003 to 5.004_04 yesterday and several of my CGI
scripts are now broken due to DOS-style CRLF's present in the file. The
Perl 5.003 parser handled these fine, why is this different in 5.004?
Platform is Linux 2.0.31 on Intel.

--- Error Message ---
Illegal character \015 (carriage return) at ./acme2.cgi line 2.
(Maybe you didn't strip carriage returns after a network transfer?)
--- Error Message ---

Line 2 is a blank line, CRLF.

Yes, I know I can just do a "fromdos" or a "sed" and get the script to
work, but I can't go and call up or email my users who program Perl
scripts on DOS/Win based machines and tell them they need to do this. I
probably couldn't get half of them to understand in the first place.

This used to work. It doesn't now. I want it to work again, and I don't
want to have to maintain two seperate perl interpreters like I'm doing
right now. What should I do?

-------------------------------------
Rick   --   Hermes Internet Solutions




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

Date: Wed, 26 Nov 1997 02:30:37 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: How To Test if number is ODD or EVEN?
Message-Id: <65fvrg$drr@mtinsc03.worldnet.att.net>

In article <65f5pv$kj$1@dismay.ucs.indiana.edu>, bdwheele@indiana.edu
(Brian Wheeler) wrote:


> Before go and criticize people's __FREELY GIVEN HELP__, why don't you try to
> figure it out on your own?  odd/even is probably the most trivial problem
> there is.  Sorry if I'm ragging, but it really irks me when people get shitty
> with free advice.

i know that i'm a lone wolf on this issue, but i don't agree that Free is
synonymous with Acceptably Low Quality.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: 26 Nov 1997 07:50:07 GMT
From: "Michael Averstegge" <averste@uni-muenster.de>
Subject: Including nested .pl-files
Message-Id: <65gkbf$k6g@majestix.uni-muenster.de>


Hi, 

got a problem including nested files.
Imagine file a.pl, b.pl and c.pl.
a.pl includes b.pl and b.pl include c.pl each with "require <filename>.pl".

Problem calling "require ../<some relative parh>/b.pl" in a.pl works ofcourse. But calling"require ../<some relative path>/c.pl" in b.pl does not work, because
the current working directory is that of the first script (=a.pl).
I was very astonished when I found this. I still do no believe that perl works
that way (?).

But the problem I have, stays. c.pl is relative to b.pl, and that is ok.
It can not be, that each a_i.pl scripts is the same way relativ to c.pl
as b.pl is (but only if the relativ paths from a.pl to c.pl are the 
same as b.pl to c.pl it works). 

So, is there a way to include pl-files eachother relativ *with the working
directory of the just calling script* - and not the first calling script (=a.pl)?

Thank You.

Greetings
Michael
P.S. I am new to perl, may be I ask a stupid question. But I did not found a hint
        in O'Reilly but I need the simple feature. 



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

Date: Tue, 25 Nov 1997 21:39:12 -0500
From: "Jrm" <emergent@cape.com>
Subject: Re: interpreted languages
Message-Id: <65g21i$dd3$1@newsie2.cent.net>

>It isn't clear that they understood Scheme.
>To start with, they say "Scheme 7.3 [is a] pure interpreted that
>repeatedly parse[s] the source code as [it] run[s]", which I don't
>believe to be the case.  Surely it works from list structures?


MIT Scheme interprets ``S-Code'' which is a tagged list structure.
Each primitive syntactic form corresponds to an S-Code type.  For
instance, an scode-conditional has three elements:  the predicate,
the consequence, and the alternative.  When a form is passed to
the evaluator, it is first ``syntaxed'' (translated to S-Code), then
interpreted.

MIT Scheme by default makes no assumptions about what the user
might do with the code.  You can re-define ``built-in'' procedures,
change procedure values on the fly, etc.  This means that each and every
variable must be looked up each and every time it is used.  While this is
useful for pedagogic reasons, experienced programmers rarely use this
flexibility.

To give an example of what SF does, consider the form (eq? x 'foo).  When
syntaxed, this turns into a combination of 3 elements.  Element 1 is the
variable
EQ?, element 2 the variable X, element 3 the constant 'FOO.  Each time the
form is evaluated, EQ? is looked up and found to be the EQ? procedure.
SF, when encountering the same form (with USUAL-INTEGRATIONS turned on),
will create an scode primitive combination with the first element being the
EQ? procedure, the other elements being the same.  Now the variable lookup
for EQ? will no longer be done.  SF is also capable of doing beta reductions
(inline coding), and other source->source translations.

Code run through SF will perform faster than code that is not.  A typical
result is a factor of about 2.5 (depends on the application, of course).

I think that running code through SF on MIT Scheme (with the default setting
of USUAL-INTEGRATIONS) is reasonable because:

1. no experienced MIT Scheme programmer would neglect to do so, and
2. most lisp implementations by default cache ``built-in'' procedures.  (For
instance,
Common Lisp explicitly allows the system to cache ``built-in'' procedures
 in this way).

I would argue that not using the native compiler is kind of silly, but to
each his own.
However, I think that not using SF when using MIT Scheme borders on misusing
the
interpreter.

Donal Fellows asks:
>Is SF supplied with MIT Scheme, or at least mentioned in the
>documentation that comes with it?

The SF program comes with MIT Scheme.





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

Date: 26 Nov 1997 01:39:32 GMT
From: "Dave Roth" <rothd@xrxoxtxhx.xnxextX>
Subject: Re: IS THERE A DB INTERFACE INTO MS SQL SERVER?
Message-Id: <01bcfa0c$41ac1740$42906ec6@main2>


Jeremy D. Zawodny <jzawodn@wcnet.org> wrote in article
<347b21fd.445611475@igate.hst.moc.com>...
> [original author automagically cc'd via e-mail]
> 
> On Tue, 25 Nov 1997 10:46:11 -0800, "csa@netcom.com" <csa@netcom.com>
> wrote:
> 
> >Does anybody know of a module that would allow me to interface
> >into MS SQL SERVER on a Windows NT machine (besides the ODBC module)?

If you are on a Win32 platform you should consider using Win32::ODBC or
DBI::ODBC. But if you are adamant not to then consider some of the Sybase
extensions. MS SQL Server was originally based on Sybase's technologies.
dave
-- 
================================================================
Dave Roth                               ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@xrxoxtxhx.xnXeXt                       the illusion of integrity

 My email address is disguised to fool automailers. Remove the
                      X's 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: Tue, 25 Nov 1997 15:41:09 +0200
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: ntperl newbie
Message-Id: <347AD575.7005@icl.fi>

Coke wrote:
> 
> howdy, i'm new to perl, and am using ntperl 5.001, how do i get
> information from forms? the methods i have seen used by unix perl
> scripts dont appear to work.

The same "methods" work just fine. What, exactly, are you
trying? How, exactly, does your code fail? Any error messages?
If so, what are they? Do you use "use strict;" and "-w"?

Anyway, use the CGI.pm module in order to avoid having to 
reimplement something that has already been done, tested 
and is in use all over the world (UNIX, NT & other platforms):

  http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.htm

Check also out what's written about using Perl for writing CGI 
applications on the FAQ pages of

  http://www.perl.com

Get also a newer release, while you're at it. ;-)

CGI.pm usage sample:

   use CGI;
   my $query = new CGI;
   my $form_variable_value = $query->param('form_variable');

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: Tue, 25 Nov 1997 20:38:27 -0600
From: "Mark Evans" <maevans@io.com>
Subject: Re: perl bad for backgroud job?
Message-Id: <65g2o0$l03$1@nntp-2.io.com>


>However, after I ran it for couple of days, it seems like it
>is eating up more and more RAM as time goes.  Is there anything
>special about memory allocation in perl?  Any suggestion?
>
>Ernest
>esiu@cs.ualberta.ca

>
Memory Allocation is really a 'ignore it' in perl. What is important,
however, is to make sure you're not calling subroutines which never end
(i.e. a recursive routine gone bad). Memory is release when it is no longer
referenced. Watch for anonymous references and the like. Perl is probably
just as good as any for your task. Probably the same memory allocation
issues too!




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

Date: Wed, 26 Nov 1997 01:45:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: PERL Hourly Rates
Message-Id: <65ft6b$8ut@mtinsc03.worldnet.att.net>

In article <EK7EGp.4qr@ig.co.uk>, Jacqui Caren <Jacqui.Caren@ig.co.uk> wrote:

> In article <comdog-ya02408000R2411972104240001@news.panix.com>,
> brian d foy <comdog@computerdog.com> wrote:

> >CGI scripting is trivial.  

> But advanced perl programming requires a level of skill that takes

but i argue from the standpoint that advanced Perl programming is 
something different than CGI programming.  one's ability to program
Perl has no relevance on the complexity of the CGI.  one's ability
to implement the CGI may be greater with experience, but that still
doesn't change what the CGI is.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 26 Nov 1997 01:25:04 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: PERL Hourly Rates
Message-Id: <65fs0j$559@mtinsc03.worldnet.att.net>

In article <toutatis-ya023180002511970127040001@news.euro.net>,
toutatis@no.mail.please (Toutatis) wrote:



> Oh, by the way, there's a bug in your cgi program
> http://computerdog.com/Cgi/demo/wrap.cgi
> check your error log for a 500 response ;-)

i couldn't reproduce any error.  if you would like to submit a more helpful
bug report, please do so privately.  this sort of thing is not germaine to
the discussion.  i would respond in email but you've munged your address.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 26 Nov 1997 01:26:27 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: PERL Hourly Rates
Message-Id: <65fs35$559@mtinsc03.worldnet.att.net>

In article <MPG.ee40d0c90831263989693@news.concentric.net>, jdf@pobox.com
(Jonathan Feinberg) wrote:

> [This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
> 
> comdog@computerdog.com said...
> > CGI scripting is trivial.
> 
> Strong words from someone whose web page is broken.
> (Go take a looksee.)

please keep personal attacks in private mail.  if you would like to submit
a bug report, you'll have to be more specific since i deal with many
web sites.

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: 26 Nov 1997 01:11:11 GMT
From: twod@not.valid
Subject: Re: PERL Hourly Rates
Message-Id: <65fsvf$2rp$1@vnetnews.value.net>

Randal Schwartz (merlyn@stonehenge.com) wrote:
: the next time you write a quick hack... you may have to defend it in

Given the fact that I get paid by the hour, there is no such thing as a quick
hack - wrt time anyways :)

IAP
--
I am using anti-spam measures, please replace 'not.valid' with 'value.net'


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

Date: Tue, 25 Nov 1997 16:46:34 -0700
From: Kevin Eson <keson@uswest.com>
Subject: Re: PERL Hourly Rates
Message-Id: <347B635A.89C1FDA4@uswest.com>

twod@not.valid wrote:

> Jacqui Caren (Jacqui.Caren@ig.co.uk) wrote:
> : other techniques and tools is always a plus. There are many almost
> : competent perl progammers out there who write perl that works but
> : a good perl progammers shudders when they see it - I know I usually
> : do so when I am asked to "enhance" someones software.
>
> Is it not one of the unwritten rules about contracting/consulting that you
> reserve the right to throw your hands in the air and exclaim 'Who the hell
> wrote this junk and why ? when maintaining code ?
>
> Believe me, someone will have said this about some of your code in the past if
> you have been in the industry for a while - I'm sure it's been said of some
> of my early work :)

And I can humbly say that when I have gone back and looked at my own code
after several months, I have said, " What the hell was I thinking?!"

--
Kevin Eson
 ...............................
tarkus@dim.com   - personal
keson@uswest.com - professional
+==============================================================================+
| The views presented here are mine and mine alone.  They do not reflect the   |
| views of my employer nor do I speak for them.  My employer's involvement to  |
| my post is only as a provider of equipment and connection.                   |
+==============================================================================+




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

Date: Wed, 26 Nov 1997 02:08:14 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: PERL Hourly Rates
Message-Id: <65fuhi$drr@mtinsc03.worldnet.att.net>

In article <347AE90E.FF8D83CE@ixl.com>, Dan Boorstein <dboorstein@ixl.com>
wrote:

> brian d foy wrote:

> > CGI scripting is trivial.

> as an exercise, have your junior programmers write their own URLEncode
> and URLDecode routines, based on what they know (or even what they can
> divine from the RFC's). i think you'll find some get it right, some
> come close, and other simply don't know where to begin.

that's the case in any assignment i give them.  if i told them to write
a routine to add two numbers i would get the same result.  but it's
not that difficult to URL encode a string compared to some of the other
programming that they could be doing, like writing a complete client
application with a GUI.

> or do you think that this is not an integral part of CGI programming.
> oh sure, it's been done over and over to get the fastest, most generic,
> most terse yet readable snippet possible, but without it you have
> CGI-programming-minus-URL(En|De)coding. you have merely given your
> programmers a subset of CGI programming.

i understand your point, but once someone has written their URL
encode routines, s/he still has to write the application for which 
the client is paying.  my programmers log the time they spend in each
part of the project, and the time spent with CGI stuff is negligble.
most of their time is spent doing normal programming sorts of things
that don't have anything to do with CGI.  

> furthermore, do they know the difference between a GET and a POST,
> or has that already been taken care of for them:

this is HTTP, not CGI really.  to CGI it's the difference in where
the data are, which isn't a tough thing.  CGI doesn't need to know
the mechanism of data transfer through HTTP - it only needs to know
how the server is going to give it that information.

> do they form their own, non-parsed headers:

this is mostly HTTP as well, not CGI.  i never said HTTP was trivial,
although i probably would say such a thing. :)

> maybe they even do things outside of CGI programming, but
> to make the claim that "CGI scripting is trivial" based
> on what your junior programmers do is obviously not correct.

no, it's based on my experience with many different sorts of
programming environments.  CGI is one of the easiest with
which i've dealt.

> hope this doesn't come off as too aggressive, i am just
> attempting to vigorously defend my job as non-trivial, 

well, i think that is the crux of my statement - people see
"CGI Programmer" as a job description.  i think it is just a
skill set.  even "Perl Programmer" is a bit restrictive, since
you are saying that you only use Perl.  your job is certainly
non-trivial, but how much time do you really spend doing just
Common Gateway Interface routines?  

the skills that you learn while programming are easily transferable
to other languages and APIs.  i don't see any reason to label
yourself by a particular skill.  do you really program a URL encoding
routine *every* day, or do you do it once and use your library over
and over again?  how much of the work that you do is CGI and how
much is other sorts of programming?

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: 26 Nov 1997 03:40:37 GMT
From: amhardin@erols.com
Subject: Problem with Blat in perl script
Message-Id: <65g5nl$14l$1@orthanc.reference.com>

I am running perl scripts on an NT server. I am having a problem
with one of my scripts that registers them for our system then
presents a form to them for additional information. At the end
of the script (after all the HTML is completed) I make a call
to BLAT to send the user an email with the registration information.
The email is working fine, but the problem is that in the
HTML I am getting a message right in the middle of my form which
reads:    Sending C:\WINNT\blt55.tmp to xxxx@erols.com Subject:
xxxxx  Password Login name is xxxx@erols.com where the xxxx is 
data the user entered previously. 


The perl script is as follows:
push(@INC, "/cgi-bin/");
require 'cgi-lib.pl';
require 'data_lib.pl';
require 'adcustom.lib';  #my routines/hashes

&ReadParse (*in);
&FontStyles;
&PageSetup;
$backpage = "$ENV{'HTTP_REFERER'}";
&ContactInfoSetup;

 if ($in{'mailaddress'} eq "" || $in{'organization'} eq "" ) {
  # print error page;

 } else {
  &ValidateEmail;
  if ($emailfound == 1 ) {
    # print error page   
    exit;
  } else {
   &Postclientinformationtofile;
   # print form for more user information
  
   print "<form ACTION=/cgi-bin/adcontact.pl METHOD=POST>";    
   print "<TR VALIGN=TOP><TD ALIGN=RIGHT WIDTH=150 BGCOLOR=#FFFFFF><b>Send To:</b></TD>\n";
   print "<TD WIDTH=240 BGCOLOR=#EEEEEE><SELECT NAME=sendto>\n";
     &FillinSendDDLB;
   print "</SELECT></TD></TR>\n";

         #### this is where the "Sending C:\...." message
               is being written ######

   print "<TR VALIGN=TOP><TD ALIGN=RIGHT WIDTH=150 BGCOLOR=#FFFFFF><B>Phone</B></TD><TD WIDTH=240  BGCOLOR=#DDDDDD><input TYPE=text NAME=phone SIZE=12 VALUE=\"$adclient[8]\"></TD></TR>\n";
   
  
  print "</form>";
  print @FOOTER;
  print "</body>\n";
  print "</html>\n";
  
 } 
} # end of else statement

  open (MAIL, "| Blat.exe - -t $in{'mailaddress'} -s \"Registration Confirmation and Password\" -f amhardin\@erols.com");
  print MAIL "REGISTRATION CONFIRMATION \n";
  print MAIL "Thanks again for registering for the System.\n";
  print MAIL "Please use the following Account Id and Password when accessing your account:\n";
  print MAIL "Account Id: $id\n";
  print MAIL "Password: $id\n";
  print MAIL "To use your new account, return to Leg.Work at <http://ourwebsite/>^z\n";
  close (MAIL);
               

Am I using BLAT correctly? Can I use variable names in the
BLAT command? Why does it seem like the send command is being
executed before the entire HTML code has been completed?
Any help would be appreciated! 

Annie          


--

Posted using Reference.COM                         http://www.reference.com
Browse, Search and Post         Usenet and Mailing list Archive and Catalog.

Sift, Inc. accepts no responsibility for the content of this posting.


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

Date: 26 Nov 1997 03:59:53 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Proxy Client
Message-Id: <slrn67n7p8.44k.abigail@betelgeuse.wayne.fnx.com>

Aaron Young (aaron@soltec.net) wrote on 1548 September 1993 in
<URL: news:aaron-2511971800230001@pool2-036.wwa.com>:
++ 
++ 
++ I'll post the question again trying to be as clear as possible seeing as how
++ I obviously wasn't the first time.

All the answer to the HTTP stuff (which is an extremely simple protocol)
can be found in RFC 2068. I highly doubt you have problems with the
HTTP stuff; otherwise you wouldn't have posted your question here.

But I fail to spot a perl question in your posting.

Perhaps you can try again, and indicate what the _Perl_ problems
of what you attempt to do are?



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: 26 Nov 97 02:03:19 GMT
From: sah@uow.edu.au (Scott Anthony Hamilton)
Subject: Re: read from end of file (by line)
Message-Id: <sah.880509799@wumpus>

Dave Barnett <barnett@houston.Geco-Prakla.slb.com> writes:

>Scott Anthony Hamilton wrote:

>> sah@uow.edu.au (Scott Anthony Hamilton) writes:
>>
>> >I'm in the process of writing a small module for reading from
>> >the end of the file line by line to the beginning. Much like
>> >$scalar = <FH> but in reverse.
>>
>> >Before I go on, is there a perl trick which can accomplish this
>> >task with ease?
>>
>> I've had a reply to this from somebody who misinterpreted the
>> question. I may not have made myself clear enough.
>>
>> What I am looking to do is open a file, then read the last line,
>> the the 2nd last line, then the 3rd last line, and so on ...
>> until I read the first line in the file.

>I believe the following should do what you want:
>open (INPUT_FILE,"junk_input") or die "Cannot open file: $!\n";
>@file = reverse <INPUT_FILE>; # slurps the entire file (in reverse order)
>foreach $line (@file) { print $line; }

Dean Inada suggested (via email) a similar approach:

	for $scalar (reverse <FH>) { }

This works, but does it mean that, like the above approach, the entire
file is read into memory? I specifically want to avoid this. It is why
I want to read from the end of the file first, ie. anything of possible
interest to me will be at the end of the file.

--
Scott Hamilton / sah@uow edu au / KeyID C3107E75
87 FE 1D C3 DE 20 37 FB  6F 30 6A 8A D1 38 9A B5


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

Date: Wed, 26 Nov 1997 03:22:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: regexp problem
Message-Id: <65g2s8$2rm@bgtnsc03.worldnet.att.net>

In article <347B295C.1430@algonet.se>, rowanfan@algonet.se wrote:

> I want to replace all the links in a document with another link,
> I only want to change the href-attribute, the other shall be intact
> a) <a href="http://www.asd.com" target="top">
> b) <a target="out" href="http://www.asd.com">
> 
> how do I do it? I tried this, but it won4t work when the case is as in
> example b) above
> 
> $doc =~ s/\<a(.*?)href=(.*?)\s*(.*?)\>/&fixurl($1,$2,$3)/egs;

if you only want to change the HREF value, try isolating it from the
other parts by checking for the value delimiters ['"\s]

   #!/usr/bin/perl -w
   
   my @tests;
   
   push @tests, q|<a href="http://www.asd.com" target="top">|;
   push @tests, q|<a target="out" href="http://www.asd.com">|;
   
   foreach ( @tests )
     {
     m/(<a.*?href=['"])  #all the beginning stuff
       (.*?)             #the URL portion
       (['"\s].*?>)      #whatever is left
      /six;
   
         print "$1\n$2\n$3\n\n";
     }
   
   __END__

   <a href="
   http://www.asd.com
   " target="top">

   <a target="out" href="
   http://www.asd.com
   ">

-- 
brian d foy                                 <http://computerdog.com>
#!/usr/bin/perl
$_=q|osyrNewkecnaYhe.mlorsePptMskurj|;s;[NY.PM]; ;g;local$\=
qq$\n$;@pm=split//;while($NY=pop @pm){$pm.=$NY;$ny.=pop @pm}
$pm=join'',reverse($ny,$pm);open(NY,'>&STDOUT');print NY $pm


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

Date: Wed, 26 Nov 1997 06:29:42 GMT
From: andy@legion.demon.co.uk (Andy Leigh)
Subject: Re: Simulation & modeling
Message-Id: <347bbd46.1294395@news.demon.co.uk>

will@Starbase.NeoSoft.COM (Will Morse) wrote:

> If you mean something like GPSS, I think you could do it in perl,
> you might want to think about how your random numbers would work,
> but that is not a big deal.

That's about right. I'm aware that I could build simulations in GPSS
or MODSIM etc. Or I could splash out and buy a full-scale simulation
package. What I'm actually trying to do is 1) model future and
development data networks & 2) teach myself modelling and queueing
theory. Because I just "Need To Get The Job Done(tm)", I think I'll
plump for the full-blown solution. However, in my home/spare time, I
want to actually understand what's going on. The best way to do this
is to do a bit of coding.

> What I liked about GPSS (and I have to say it has been fifteen or 
> so years since I last used it) was that you could get the statistics
> associated with an object pretty easily.  Most of what I did with it
> was queueing stuff, which GPSS simulated easily.

GPSS and Modsim do seem to be the best choices for languages dedicated
to the task.

> Maybe we could give you a better answer if you gave us more idea
> want kinds of events and various magnitudes and parameters which
> would affect your simulation.  It might be helpful to know your
> system config as well.

What I want to do is build small snippets of functions which can be
used to model queues inside routers and switches. I know this is
ambitious, and the obvious answer is to use a pre-built language or
application. However, at the same time, I'd like to understand the
answers I get, so I want to have a dabble at trying small simulations
in Perl.
 
> Will
> 
> 
> In article <3476a48e.527680@news.demon.co.uk>,
> Andy Leigh <andy@legion.demon.co.uk> wrote:
> >I'm curious to know if anyone has built any Discrete-event simulations
> >using Perl. I know there are lots of languages well suited to such an
> >enterprise, but I'm a lousy programmer, and don't have time to learn
> >another language (I'm not exactly sparkling at Perl)
> >
> >I've had a look through a news archive and CPAN, but can't see any
> >relevant references. If you've done some experimenting or I've missed
> >an obvious thread, please let me know.
> >
> >--
> >Andy Leigh
> 
> 
> -- 
> # Copyright 1997 Will Morse.  Internet repost/archive freely permitted.
> # Hardcopy newspaper, magazine, etc. quoting requires permission.
> # 
> #      Gravity,                    #    Will Morse
> #      not just a good idea,       #    Houston, Texas
> #              it's the law.       #    will@starbase.neosoft.com
> #
> #   These are my views and do not necessarly reflect anyone else/
>  =========================================================================
>       By US Code Title 47, Sec.227(a)(2)(B), a computer/modem/printer
>       meets the definition of a telephone fax machine. By Sec.227(b)
>       (1)(C), it is unlawful to send any unsolicited advertisement to
>       such equipment, punishable by action to recover actual monetary
>       loss, or $500, whichever is greater, for EACH violation.
>  =========================================================================
> 



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

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

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