[8319] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1935 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 19 22:12:32 1998

Date: Thu, 19 Feb 98 19:00:36 -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, 19 Feb 1998     Volume: 8 Number: 1935

Today's topics:
    Re: 5.004 bug? invisible object dereferencing <cdkaiser@delete.these.four.words.concentric.net>
        Avoiding $` <joegottman@nospam.worldnet.att.net>
    Re: Avoiding $` (Abigail)
    Re: CGI with Perl HTTP1.0 501 error (Martien Verbruggen)
    Re: Changing Scalar Variable Name in While (Andrew M. Langmead)
    Re: Changing Scalar Variable Name in While (Jonathan Feinberg)
    Re: Changing Scalar Variable Name in While (Martien Verbruggen)
    Re: Changing Scalar Variable Name in While <dformosa@st.nepean.uws.edu.au>
        Deleting GDBM records with perl (x6495)
        Detecting Video Settings <jphillips1@email.msn.com>
    Re: differences perl 4.0.1.8 -> 4.0.3.6 (Abigail)
    Re: Free CGI hosting (Pat Corrigan)
    Re: Free CGI hosting (Pat Corrigan)
    Re: Growing cucumbers - (prev Content-type Question) <matt.pryor@dial.pipex.com>
    Re: Growing cucumbers - (prev Content-type Question) (Nathan V. Patwardhan)
    Re: Hardware remote control <russell@martin.com.au>
    Re: HTTP_USER_AGENT List? <webmaster@fccj.cc.fl.us>
    Re: I need HELP!!!!!!! (Martien Verbruggen)
    Re: Internationalization (Mark-Jason Dominus)
    Re: Is perl and DBI good enough? <webmaster@fccj.cc.fl.us>
    Re: Look'n for a little help..... (Jonathan Feinberg)
    Re: need help on comparing variables <webmaster@fccj.cc.fl.us>
    Re: newby perl string processing Q <sgordon@athena.lbl.gov>
        PATH_INFO in perl for nt <jhedy@racingschools.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 20 Feb 1998 01:34:24 GMT
From: Cameron Kaiser <cdkaiser@delete.these.four.words.concentric.net>
Subject: Re: 5.004 bug? invisible object dereferencing
Message-Id: <6cimj0$sja@examiner.concentric.net>

Curtis Hrischuk <ceh@sce.carleton.ca> writes:

>Help. I am running Perl version is V5.0 patchlevel 4 subversion 4,
>Solaris 2.5.1.  The problem is that references to objects are
>invisibly dereferenced (in successive lines) which is causing me all
>sorts of grief. 

This may have nothing to do with this (awaiting all kinds of flames for
being a stupid git :-P), but references do 'spring into existence' when
used as lvalues (they just are 'undefined'). This allows you to get away with
(example from Programming Perl, p250):

$array[3]->{"English"}->[0] = "January";

by pulling up a hash reference on the fly, and then letting you assign to it.

--
Cameron Kaiser
cdkaiser at concentric dot net (it hasn't helped the spam yet though)
*** visit the Spectre Server at www.sserv.com
*** C64 software lives! www.computerworkshops.home.ml.org


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

Date: Thu, 19 Feb 1998 19:37:59 -0500
From: Joe Gottman <joegottman@nospam.worldnet.att.net>
Subject: Avoiding $`
Message-Id: <6cijbv$5gs@bgtnsc02.worldnet.att.net>

   As most Perl hackers know, using $`, $&, or $' anywhere in a program
can result in an enormous performance hit.  It is easy enough to get the
functionality of $& or $' by modifying the regular expression. If your
basic regular expression is /a+/, you can emulate $& by using /(a+)/ ,
and you can emulate $' by using /a+(?=(.*))/ (using positive lookahead
and saving the result, this is legal according to 'Mastering Regular
Expressions').  What is the best way of emulating $` ?


--
Joe Gottman
joegottman@nospam.worldnet.att.net

[Remove nospam to reply]




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

Date: 20 Feb 1998 01:19:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Avoiding $`
Message-Id: <6cilmd$633$5@client3.news.psi.net>

Joe Gottman (joegottman@nospam.worldnet.att.net) wrote on 1634 September
1993 in <URL: news:6cijbv$5gs@bgtnsc02.worldnet.att.net>:
++    As most Perl hackers know, using $`, $&, or $' anywhere in a program
++ can result in an enormous performance hit.  It is easy enough to get the
++ functionality of $& or $' by modifying the regular expression. If your
++ basic regular expression is /a+/, you can emulate $& by using /(a+)/ ,
++ and you can emulate $' by using /a+(?=(.*))/ (using positive lookahead
++ and saving the result, this is legal according to 'Mastering Regular
++ Expressions').  What is the best way of emulating $` ?

($`, $&, $') = /^([\x00-\xFF]*?)(a+)(?=([\x00-\xFF]*))/;

Alternatively, you can use:

$str =~ /(a+)/g;
$` eq substr $str, 0, pos ($str) - length $1;
$' eq substr $str, pos $str;


The latter is probably faster, but it sets pos(), which you may not want.


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: 19 Feb 1998 23:22:33 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CGI with Perl HTTP1.0 501 error
Message-Id: <6cierp$rq0$2@comdyn.comdyn.com.au>

In article <34EBDD89.504D@arkinfo.com>,
	Eric Lim <eric@arkinfo.com> writes:
> Anyone knows what is the problem when I run a Perl script located in
> Windows NT with IIS 4.0 ?

This has nothing to do with perl
Read some of the following documentation:

http://www.perl.com/CPAN/doc/FAQs/

Specifically the two FAQ's for CGI, and the Win32 FAQ.

Or ask at:

comp.infosystems.www.authoring.cgi

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: Thu, 19 Feb 1998 22:34:17 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <EonDD7.vF@world.std.com>

"Norman Bunn" <norman.bunn@mci.com> writes:

>Let me define the overall problem and see what the "best" solution is.  I
>have a series of parameters called PRO_01, PRO_02, PRO_03, etc. which
>contain strings delimited by colons.  However, some of the parameters are
>often empty depending on the buttons and checkboxes selected on the HTML
>form.  I want to determine which parameters are populated and store them in
>an array of arrays.

Why not turn the whole thing into an array of array initially, and
then worry about which elements are filled or empty?

use constant MAXELEM => 20;
for($elem = 0; $elem <= MAXELEM; $elem++) {
  my @array = split /:/, param("PRO_$elem");
  # perform any processing that you need to on this row of the array.
  $pro[$elem] = [ @array ];
}

And then $pro[0][0] would be "description00", $pro[2][1] would be
"part number02", etc. If PRO_17 is empty, and you don't handle it
between the split and the array assignment, then $pro[17][0] will
contain the undefined value.
-- 
Andrew Langmead


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

Date: Thu, 19 Feb 1998 15:28:22 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <MPG.f565ff3286d540e98970e@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

norman.bunn@mci.com said...
: Is there a way to change the name of a scalar variable while in a While?
: Though incorrect, I want to do something like:
: 
: $count = 1
: while ($count <= 20)
:     {
:     $pro$count = param('PRO_$count')
:     $count++
:     }

It looks like you need to learn some Perl fundamentals.  I strongly suggest 
that you obtain a copy of the book "Learning Perl," which will gently guide 
you to an understanding of the data types supported by Perl.  You may also 
start now by reading some of the documents that come with Perl, such as 
perldata, perlvar, and perlfaq4, all of which address your question.

If you are using CGI.pm (as you seem to be) then you may automatically turn 
CGI parameters into variables with same names.  See the CGI.pm documentation.

But do get "Learning Perl."

       http://www.ora.com/catalog/lperl2/

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 19 Feb 1998 23:50:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <6cigg4$s00$2@comdyn.comdyn.com.au>

In article <FD1H.7593$Yw.1580910@news.internetmci.com>,
	"Norman Bunn" <norman.bunn@mci.com> writes:

> The data is of the form:
> 
> PRO_00 => description00:part number00:price00
> PRO_01 => description01:part number01:price01
> PRO_02 => description02:part number02:price02
> 
> I want to split each of these and store it in a unique array.   And then I
> want to store the arrays in another array.

You should probably be using a hash, and array or hash references. You might
want to read up on perl data structures

perldoc perldata
perldoc perllol
perldoc perldsc
perldoc perlref

Alternatively, you can split up the key, so that you just have the
number left, and use that as an array index.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I'm desperately trying to figure out
Commercial Dynamics Pty. Ltd.       | why kamikaze pilots wore helmets - Dave
NSW, Australia                      | Edison 


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

Date: 20 Feb 1998 01:34:04 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <887938435.873248@cabal>

In <FD1H.7593$Yw.1580910@news.internetMCI.com> "Norman Bunn" <norman.bunn@mci.com> writes:

[...]

>I want to determine which parameters are populated and store them in
>an array of arrays.

>The data is of the form:

>PRO_00 => description00:part number00:price00
>PRO_01 => description01:part number01:price01
>PRO_02 => description02:part number02:price02

>I want to split each of these and store it in a unique array.   And then I
>want to store the arrays in another array.

You are so so close.  This is like one of thouse story problems given in
math books.  Like them the instructions on how to solve it are in the
problem themself.

Lets take it step by step.  'I want to _split_ each of these and _store_
it in a _unique_ array'.

The word split tells me to use the function split. Looking up split in the
documents perldoc -f spilt and we find out something like this.

($key,$value)=split /=>/,$line;

Now I store can store this in a hash (which is a bit more flexable then an
array)

$store{$key}=$value;

But before we do this lets takel your other problems, we can split up the
values again to get the fileds.

@feilds=split /:|\w/,$value;

Now we can store a refference in the hash (rather then $value).

$store{$key}=\@feilds;

Now we can put it in a loop,

while (<>) {
  ($key,$value)=split /=>/;
  my @feilds=split /:|\w/,$value;
  $store{$key}=\@feilds;
}




--
Please excuse my spelling as I suffer from agraphia see the url in my header. 
Never trust a country with more peaple then sheep. 
Support NoCeM http://www.cm.org/                   
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Thu, 19 Feb 1998 17:05:30 -0800
From: "Eric Aiken (x6495)" <eric.aiken@enduracorp.com>
Subject: Deleting GDBM records with perl
Message-Id: <34ECD6DA.7A79@enduracorp.com>

I am trying to understand how a GDMB record is deleted.

I have a perl script that will delete the record by it's key.  If
I print out the records, it's gone, however the file size never 
changes.  (ie the database continually grows larger and larger).

Am I missing something?  Is all the data associated with the key
deleted?  Do I need to manually delete each entry within the data
record then delete the key?

Help is appreciated.
-- 
=================================================================
Eric C. Aiken                   Title:  Systems Administrator
Endura Software Corp.           Work:   (206) 522-0055
115 NE 100th St.                Fax:    (206) 522-0053
Seattle, Wa 98125-8098          email:  eric.aiken@enduracorp.com
=================================================================


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

Date: Thu, 19 Feb 1998 14:38:45 -0500
From: "Jay Phillips" <jphillips1@email.msn.com>
Subject: Detecting Video Settings
Message-Id: <#GHIJFZP9GA.381@upnetnews02.moswest.msn.net>

Does anyone know a way to extract the video settings from the internet user
so to customize the page format for different types of displays ?




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

Date: 20 Feb 1998 01:25:40 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: differences perl 4.0.1.8 -> 4.0.3.6
Message-Id: <6cim2k$633$6@client3.news.psi.net>

Haig (rhaig@austin.ibm.com) wrote on 1633 September 1993 in
<URL: news:6cht4s$1tca$1@ausnews.austin.ibm.com>:
++ I'm looking for historical information about updates to perl4
++ (ver 4.0.1.8 -> 4.0.3.6) and the security & other implications
++ thereof.

The only perl for which no security leaks have been found is 5.004.
Read the CERT archives.

++ Why? you ask??
++ 
++ some internal customers are using 4.0.1.8 & I'm trying to come up with 
++ reasons for them to upgrade to at least 4.0.3.6. (the most recent
++ unsupported version)

When are they upgrading from smoke signals to rotary phones?
Do they "upgrade" to 5 year old versions of Wordperfect too?

++ Also, I'd be interested in what would have to be done to any arbitrary
++ perl4.0.1.8 script to make it run on perl5.  

Most of the times, nothing. And for the cases you have to do something,
it's mostly putting a backwack in front of a @ in a double quoted string.

++ I didn't come into the world of perl until perl5, so I don't have any 
++ first hand experience with perl4isms.
++ 
++ If there is a list already compiled list of what I'm looking for, then
++ send me a url & tell me to shut tf up.  I don't have a problem with that.

URLs? The Web was a big unknown in those days.... Pigeon carriers 
was the most common form of communication in the time 4.036 was around.

++ I'm looking through the patch36 in the perl4.0.3.6 code and it's giving
++ me some of what I want.  I just want to make sure I don't miss any glaring
++ problems with 4.0.1.8.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'


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

Date: 19 Feb 1998 23:20:15 GMT
From: corriganp@earthlink.net (Pat Corrigan)
Subject: Re: Free CGI hosting
Message-Id: <corriganp-1902981521020001@1cust172.tnt3.sfo3.da.uu.net>

I have a little project at http://home.earthlink.net/~corriganp/
It's a nursery rhyme for kids of all ages. I want to put in a quiz with 5
questions, multiple responses, and "how did I do?" at the end.
Interested?

<01bd37fb$37b57600$5a0e85ce@default>, "John Karr"
<Johncarryl@Sprintmail.com> wrote:

> Hello:
> 
> I have just completed learning the fundamentals of the Perl language. For
> practice,  I am now looking for a few companies that are currently hosting
> CGI scripts (designed by me) for FREE.  If you know any Internet sites that
> are offering this service, please give me a shout.
> 
> 
> 
> Thanks,
> John.

-- 
Pat Corrigan

corriganp@earthlink.net


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

Date: 19 Feb 1998 23:12:59 GMT
From: corriganp@NOSPAMearthlink.net (Pat Corrigan)
Subject: Re: Free CGI hosting
Message-Id: <corriganp-1902981513460001@1cust172.tnt3.sfo3.da.uu.net>

I have a little project at http://home.earthlink.net/~corriganp/. It's a
nursery rhyme for kids of all ages. I would like to put a 5-question quiz,
multiple response, with "how did I do?" at the end. 
Interested? 


In article <01bd37fb$37b57600$5a0e85ce@default>, "John Karr"
<Johncarryl@Sprintmail.com> wrote:

> Hello:
> 
> I have just completed learning the fundamentals of the Perl language. For
> practice,  I am now looking for a few companies that are currently hosting
> CGI scripts (designed by me) for FREE.  If you know any Internet sites that
> are offering this service, please give me a shout.
> 
> 
> 
> Thanks,
> John.

-- 
Pat Corrigan

corriganp@earthlink.net


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

Date: Fri, 20 Feb 1998 01:32:27 +0000
From: Matthew Pryor <matt.pryor@dial.pipex.com>
Subject: Re: Growing cucumbers - (prev Content-type Question)
Message-Id: <34ECDD2B.393FDBE8@dial.pipex.com>

Martien Verbruggen wrote, whilst suffering from
the effects of a fried breakfast consisting mostly of
halucinagenic fungi (perhaps):

> You should think of using a module. Go to CPAN,
>  and check if it's already there. If not, consider
>  writing one. I'd suggest a bundle of fertilisers:
>
>  Fertilise::Compost
>  Fertilise::Chemical
>  Fertilise::Crap

>  Also, use

>  Irrigate.pm
>  GreenHouse.pm</BLOCKQUOTE>

I've tried all of the above. Unfortunately
I just keep getting greenfly. And my
chickens have started getting sick. The next
door neighbour's complaining about the smell.
It's quite upsetting, believe you me.

As for slapping my system admin around the
head with a slightly moist cucumber (that's gone
off a bit), they're all just too darn soft and gooey
to cause any long term damage. It just messes up
his toupee. And then he gets slightly irritable and
threatens to dig up my vegetable patch and plant a
large bulbous turnip in its stead. Which WILL NOT
DO.

Martien, oh thee of New South Wales, where men
are men and sheep are slightly nervous - how do
you ensure that your hardy perenials survive these
difficult winter months? Not to mention your Zukinis (sp?)
and your squashes? And your small but perfectly formed
modules?

Matt, from his vegetable patch in the UK
Where it's bloody freezing.
Who, by the way, on behalf of all those embarking
on the long and thoroughly spankingly jolly journey
towards a well balanced knowledge of perl, would like
to thank the gurus who care for and nurture this newsgroup
for their patience, understanding and guidance. Who knows
where we'd all be without you. Thanks :-)




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

Date: 20 Feb 1998 02:03:38 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Growing cucumbers - (prev Content-type Question)
Message-Id: <6cio9q$ihk@fridge.shore.net>

Matthew Pryor (matt.pryor@dial.pipex.com) wrote:
: Martien Verbruggen wrote, whilst suffering from
: the effects of a fried breakfast consisting mostly of
: halucinagenic fungi (perhaps):

Ok ok.  We get the picture, already!  :-)

You're an extremely creative, college freshman who likes skipping
CS113 and screwing around with Usenet.  And probably even MUDDs.  This
is all well and good until you come knocking on our door four years
from now asking what print() does and why "+>" destroys the file
without you being able to read its contents first.

Read, learn, go to class, and for Pete's sake -- stay away from
halluncinogens (or at least on school nights)!  :-)

Followups set.

--
Nathan V. Patwardhan


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

Date: Fri, 20 Feb 1998 12:21:05 -0800
From: Russell Shaw <russell@martin.com.au>
Subject: Re: Hardware remote control
Message-Id: <34EDE5B1.A2C@martin.com.au>

Peter Samuelson wrote:
> 
> [Russell Shaw <russell@martin.com.au>]
> > The user accesses a "web page menu" on the remote PC using a Netscape
> > navigator browser.
> 
> Why Navigator, specifically?  Why a PC, specifically?
> 
> > The HTML web page has CGIs (common gateway interface thingies) that
> > activate programs written in PERL code. The PERL code does a
> > measurement and displays a result as a graph or numerical output on
> > the web page.
> 
> FYI, Perl is not normally spelled in all-caps.
> 
> I think you need to be asking this somewhere like
> comp.infosystems.www.authoring.cgi, as it's not really about Perl.  It
> seems to be about the possibility of embedding CGI commands in an HTML
> document.  I also suggest also that you look into SSI ("server-side
> includes") and perhaps Apache's enhanced version, XSSI.  Or, if you
> just have images that need to be dynamic, that you research the
> possibility of using CGI URLs in SRC= attributes.
> 
> > I have looked through books in bookshops but the amount of time
> > required and buying books to find this small piece of information in
> > the overwhelming stuff available is a challenge to say the least.
> >
> > Assumptions:
> >       I know C, some C++, and assembler.
> >       I haven't done HTML, Perl, or Java.
> 
> If you think finding the answer to the above is time consuming, you
> probably don't want to do the actual project.  You'll have to learn at
> least (1) Perl, (2) HTML, (3) CGI, and possibly (4) SSI.  Note that
> (1) is optional if you prefer to write your CGI in C++ (which I don't
> particularly recommend, but you do get to skip learning Perl).
> 
> --
> Peter Samuelson
> <sampo.creighton.edu ! psamuels>


I am investigating perl to use for platform indepency (the code would also perform the
main function and biggest chunk of the project). I stated using a PC and Netscape
simply as a starting point because thats what I have already got.
	I simply don't waste time learning things that I don't use. If its useful, I'll
learn it. I already know: assembler for ADSP2181 DSP, Z80, 8086, 8051, 6805Cxx, and
some 68000. Also know Turbo Pascal with OOP, C++, and others. Also getting into VHDL.
	I had advice from elsewhere that to get HTML to activate code in another
language, Java was needed. No one had even heard of perl. Precisely why I needed to
post here.


MARTIN COMMUNICATIONS Pty. Ltd
Unit 140, 45 Gilby Road, Mt. Waverley, Victoria 3149 Australia
PO Box 875 Mt. Waverley 3149
Ph. +61 3 9558. 9866   Fx. +61 3 9558.9393
http://www.ozemail.com.au/~mcomltd

    /\  /\  /\  /   / MARTIN COMMUNICATIONS
   /  \/  \/  \/   /  Russell Shaw, B.Eng, M.Eng, MIREE
  /   /\  /\  /\  /   VK3KRS
 /   /  \/  \/  \/    EMAIL: russell@martin.com.au


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

Date: Thu, 19 Feb 1998 20:18:00 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
Subject: Re: HTTP_USER_AGENT List?
Message-Id: <34ECD9C7.9B8EF413@fccj.cc.fl.us>

Baby steps first  :-)

Bill

PS - Love your 'one liners' :-)

Abigail wrote:

> Bill Jones (webmaster@fccj.cc.fl.us) wrote on 1632 September 1993 in
> <URL: news:34EB7232.2B0D3548@fccj.cc.fl.us>:
> ++ Using CGI.pm you could write your own and log the results...
>
> YM: Use LWP::UserAgent and create a few of your own....
>
> Abigail
> --
> perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'





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

Date: 19 Feb 1998 23:28:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: I need HELP!!!!!!!
Message-Id: <6cif7h$rq0$3@comdyn.comdyn.com.au>

Please read the following information on how to choose a good subject
line:

http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

In article <6ch956$3pt$1@newton.pacific.net.sg>,
	Eric <"Keric@pacific.net.sg"@pacific.net.sg> writes:
> Hi, I am a student studying in Singapore. Can anyone help with the
> project I am doing right now? I have to get 2 input from the HTML

Project? Do I hear 'homework'?

> document(windows 95/NT), add the 2 inputs using a simple perl
> script(Windows 95/NT) and then return the result to the HTML document.
> The interface can be kept simple. 

Are you serious? How are we supposed to know what you want? What you
describe there makes absolutely no sense.

> I hope anyone out there who have a working program can send them(perl &

There are thousands of working programs around that do a lot more than
what you want.

> HTML) to me via e-mail(attachment if size too big).

And how would that make it any smaller? Attachments actually make the
things bigger. Or did you mean compressed?

> I really need the codes!!!!

Write it. Why do you expect us to do the work for you? Why do you shout?

This post really makes it into the top 10 of clueless, lazy, and
off-topic posts of the last year.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | I took an IQ test and the results were
Commercial Dynamics Pty. Ltd.       | negative.
NSW, Australia                      | 


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

Date: 19 Feb 1998 17:25:49 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Internationalization
Message-Id: <6cibhd$js9$1@monet.op.net>
Keywords: Arthur carte Hanley suite

In article <6ci51c$pcl$1@nnrp1.dejanews.com>,  <schwern@starmedia.net> wrote:
>Here's a quick sketch of what I was thinking of doing if all else fails:
>
>#!/usr/local/bin/perl
>
># Our fictious module.
>use I18N::Strings;

Thought this might amuse you.  It is real code:

----------------------------------------------------------------
BEGIN { 
  $HOME = '/www/www.myclient.com/app';
  push @INC, $HOME;	    

  %I18N = ('' =>  { Vars =>
			{ EQUIPMENT => "$HOME/%LOCALE%",
			  GIFDIR => "/gifs/%LOCALE%/",
			},
		      },
	   FRENCH => { Append => '' , 
		       Vars => { CHARSET => Latin1 }}, 
	   GERMAN => { Append => '',
		       Vars => { CHARSET => Latin1 }}, 
	   FRANCE => { Forward => FRENCH }, # Use `FRENCH' instead.
	   GERMANY => { Forward => GERMAN },
	   UK => { Forward => '' },
	   );

}

use MyClient::I18N;
----------------------------------------------------------------

Now, program output is all through a set of templates.  When the
program wants to display an error message, it does something like:

	$TemplateVars::ERROR = USE_THE_MENU_DUMBASS;

	...

	$template->display(Package => TemplateVars);
	exit 0;

The template itself takes care of the mapping from tags like
USE_THE_MENU_DUMBASS to actual error texts:

	<html>
	<Head><title>Counter Locator</title></head>
	<body bgcolor="#ffffff">
	...
	
	{ %error_text = ( USE_THE_MENU_DUMBASS => 
                           q{Please select a location near you from the menu
                             before you press `locate counters.'},
                          QUIT_MESSING_WITH_THE_FORM =>
			    q{I\'m sorry; I don't recognize that location.
			      Please select again.}.,
			  ...
			);
	if ($ERROR) {
	  qq{<h1>Sorry!</h1><p>$error_text{$ERROR}</p>}
        } else { '' }


The internal codes ilke USE_THE_MENU_DUMBASS are never displayed; they
are translated to the appropriate language at the moment that the
template is evaluaetd and displayed.  One benefit of this is that you
can prepare the template in English and then hand it to the
translators and have them translate all the appropriate text in one
go; they don't have to tinker with any auxiliary files.


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

Date: Thu, 19 Feb 1998 20:57:17 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
Subject: Re: Is perl and DBI good enough?
Message-Id: <34ECE2FD.BE33A0F9@fccj.cc.fl.us>

[Posted and CC'ed via e-mail...]

I honestly feel your company has missed the
whole point of what the 'Internet' is/was/should be...

See below for a point-by-point summary -

Jonas Liljegren wrote:

> I continue here a discussion from the dbi-users mailinglist and
> comp.lang.perl.modules
>
> I wrote:
>
> Is it realistic to use perl with DBI for a large project for a big
> company? Should we use java servlets CGI instead of perl CGI?
>
> We had a meeting today about this. Maby I was bad at presenting perl,
> but
> they choosed servlets. I lost. :-(
>

Not the end of the world.  Perl will still be here when the projectneeds to
be rewritten :-)

> http://www.javasoft.com/marketing/collateral/servlets.html
>
> I thank you all for the answers about using perl in big projects. I
> would
> like to continue the discussion. I don't know if this is the proper
> place
> for that. But I continue for now.
>

Whether this continues or not is up to the 'others...'

> The goal is to have a development tool there you realy fast can put
> together different components. The components shold work together
> without
> side effects. New programmers have to be able to quickly understand a
> single component to make modifications.
>

Perl has many components you 'can put together...'

> 1. Java forces you to make structured programs. You don't have to invent
> a
> programming structure. The controls ar built in to the language.

Perl is as structured as you can stand it, but also makes allowancesfor less
experienced programmers 'who are just learning the ropes.'
All levels of programmers benefit from using Perl.

> 2. Java has many development tools. Drag'n drop programming interfaces.
> Meta-tools for object-oriented programming, documentation, version
> control
> etc. The graphical interface makes it somwhat easier to use without
> having
> to learn the details about it.

Must be a Windoze thing?  Hmmm...

> 3. I don't get it, but they din't seem to be impressed of CPAN, the perl
> community or the Perl Clinic. Like: "We can't depond on the free support
> fromhighschool students that wrote cool perl modules. We will get in the
> situation there we can't get help just becuse the programmer student has
> a
> paper to do." And the rule out the Perl Clinic because it doesn't sound
> serious enough. Six-packs and "money back" is not the type of support we
> seeks. We want dedicated professional programmers, tied with support
> contracts on a per year basis. The Perl clinic seems more like a hacker
> support for isolated fixes.

With all seriousness, Perl has become the SysAdmins language of choicenot
because of 'a money-back' slogan, but because it works -
consistently...

> We can't use modules at CPAN just like that. What kind of quality
> control has they gone through? Many of the DBD modules seems to be in
> alpha or beta stage. The price of the modules isn't an issue. The
> fact
> that the modules doesn't cost anything is not a plus, but their
> shifting
> quality is a minus. :-(

The code is in beta or alpha because Perl Module developers arean honest
crowd.  I myself am working on distributed Calendar
interface for Solaris, so my staff can access their Calendars
via a Web Browser, it stays in Alpha because it is always
changing, improving.  Perl people try hard not too
push bugware, vaporware, victimware...

The Internet community as a whole is self-policing,
if one of the developers distributes something bad,
it will only happen once before word gets out and
they are banned, black listed, if not severely
chastised...

> 4. The future. Is it better to take every chanse to build competence
> in
> java? There seems to be more java programmers availibel than perl
> programmers. At least in my company.

Hmmm, my expereince has shown me that just because everyoneis doing it is
not a good reason for me to do it too.

You must make your own choices and live with them.
Perl is not for everyone, either...

In a year or so, when the Java project is done, write back here
and let us know what your thoughts, as well as your company
management's thoughts are...

> The answers on this list tells me that there has been big projects with
> perl dbi. But is this the normal case? Maby most projects has been
> developed in C++ or other languages?

No, I can't say that a project is 'big' because it is a 'db' project.I
myself am using Perl to categorize and document an entire
FTP mirror - about 20GB - weekly; not a big project...
Most of the projects I have seen which are big revolve around
massive text processing - in which Perl kicks massive ass.
(IMHO :-)

> I would realy like a remedy for the points above. All you who has
> developed big programs: how do you structure the components to eliminate
> mistakes and enable fast development?

I would hazard a guess that if a person is a logical, generally
goodprogrammer in another langauge - they would be a logical, generally
good programmer in Perl.  Java, not Perl, can make you a good
programmer if you are a bad programmer.  Life doesn't work
that way...  But I would hazard a guess that Perl, at least,
would be more forgiving and allow a generally bad programmer
to produce reasonable solutions...
(IMHO)

> --
>  / Jonas Liljegren
>  mailto:jonas.liljegren@infohwy.se





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

Date: Thu, 19 Feb 1998 15:36:20 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Look'n for a little help.....
Message-Id: <MPG.f5661ccbe3f60e98970f@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

dstewart@fusion.ca said...
: PROBLEM: Use .htacess to send a user to a specific URL based on the user id
: they enter.

What part of this task is giving you trouble?  Do you need to know how to work 
with files in perl?

   perldoc perlfaq5
   perldoc perlfunc  (search for open, close, print)

If these references don't give you the information you need, please post some 
sample code that illustrates what's not working the way you think it should.

Hope this helps.
-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Thu, 19 Feb 1998 21:27:22 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
To: Jsgines <jsgines@aol.com>
Subject: Re: need help on comparing variables
Message-Id: <34ECEA09.8FDC9A3A@fccj.cc.fl.us>

[Posted and CC'ed via e-mail...]

I am not commenting on your code as I feel you have a basic direction to head in -
however what I would like to suggest is that you would probably want to look at who
logged in first, and work from there.  I see a lot of overhead code whcih may not
be needed; ie -

(rindex($_, "logged in")) ? &DoDataRoutines : next; # Next when there isn't a
match...

I believe this will eliminate the needless matching on PID, until you know
you have a good 'logged in' match...

HTH,
Bill


Jsgines wrote:

> I am writing a script that reads a log file.  each line in the log file has a
> different length and comes in the following format, the short script im writing
> follows afterwards:
>
> 980210 183036 (1814), Fax Server Initialized
> 980210 183036 (1814), Listening for a connection on TCP/IP port 28747
> 980210 183646 (1814), New connection from address 153.xxx.xxx.xxx
> 980210 183646 (1814), Fax service child has been born (PID=1866)
> 980210 183647 (1866), User "jsgines" logged in
> <snip data stream>

> .....starts all over again....
>
> the issue is that the "user name" to query is located in the fifth column, and
> the information I want is located in the following lines:
> ....(after locating user name in fifth column)....
> 980210 183851 (1866), Submit Title: HFC->6:40 test 021098
> 980210 183851 (1866), Submit Fax Target record (name=HFC CODA FAX)
> 980210 183851 (1866), New Status Phone Number Key: 000000630001
> 980210 183851 (1866), Parse of: 7036454395

<snip code>



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

Date: Thu, 19 Feb 1998 15:57:07 -0800
From: Shawn Gordon <sgordon@athena.lbl.gov>
To: b.oconnor@bendigo.latrobe.edu.auNOSPAM
Subject: Re: newby perl string processing Q
Message-Id: <34ECC6D3.5F550AAB@athena.lbl.gov>

Brian O'Connor wrote:

> How do I extract a particular field from a line of char delimited
> fields without assigning the whole lot to unused variables. eg
> 
> A password file, I want the 4th field(grp id)
> 
> I can
> 
> ($a,$b,$c,$d,$e,$f,$g) = split(/:/);
> 
> then use $d, but there must be a better way

Consider using regexps.  In the case you describe,
you can do the following (and I am sure there are many 
other ways):

($d) = /(?:	# open a grouping parenthesis
	.*?:	# do a non-greedy match of anything that ends in a ':'
	){3}	# close the group and match it exactly three times
	(.*?):	# capture the next match that ends in a ':' into $1
	/x;	# x is so I can include the comments!

See Mastering Reg. Expressions by Friedl for the entire scoop on this

shawn


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

Date: Thu, 19 Feb 1998 16:29:53 -0800
From: "John Hedy" <jhedy@racingschools.com>
Subject: PATH_INFO in perl for nt
Message-Id: <887934646.902252@slave1.aa.net>

We just set up an environment running NT with IIS 4.0.  We installed the
Activeware port of perl (5.003 build 315).

The problem is the way in which some of the environment variables are
resolving.  For example:  when calling a script such as
/cgi-bin/testcgi.pl/parm and then inside the script referencing the
PATH_INFO environment variable in hopes of seeing 'parm', instead I am
getting '/cgi-bin/testcgi.pl/parm'.

The PATH_TRANSLATED variable is just coming back as blanks.  I would have
expected this to come back with the full absolute path.

Is there something that needs to be done to get these environment variables
functioning in Perl in the NT IIS environment?  I was considering installing
Perl for ISAPI to see if this might fix the problem.

Any help is appreciated.

Thanks!

jhedy@racingschools.com




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

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

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