[17208] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4630 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 16 14:06:10 2000

Date: Mon, 16 Oct 2000 11:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <971719514-v9-i4630@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 16 Oct 2000     Volume: 9 Number: 4630

Today's topics:
    Re: "Lite" Perl book required <jeff@vpservices.com>
    Re: "Lite" Perl book required <james@NOSPAM.demon.co.uk>
    Re: [ Wildly OT ] Re: Japanese Girl Has PERL Request. <russ_jones@rac.ray.com>
    Re: A Simpler perlish way <russ_jones@rac.ray.com>
    Re: CGI scripts - paths and URLs <jeff@vpservices.com>
        check by a cgi <nuno@rccn.net>
    Re: check by a cgi <kistler@gmx.net>
    Re: check by a cgi <camerond@mail.uca.edu>
        Disk Quotas <rob@robdon.com>
    Re: Giant Array Delay (beginner) <godzilla@stomp.stomp.tokyo>
    Re: HELP- CGI <jeff@vpservices.com>
        htmldiff per_winkvist@my-deja.com
        IO::Socket falls over under Perl 5.6.0 <ralawrence@my-deja.com>
    Re: IO::Socket falls over under Perl 5.6.0 <kistler@gmx.net>
    Re: IO::Socket falls over under Perl 5.6.0 (John J. Trammell)
    Re: Is perl object oriented? <pdcawley@bofh.org.uk>
    Re: Japanese Girl Has PERL Request. <lmoran@wtsg.com>
    Re: MS Access <jeff@vpservices.com>
    Re: newbie: pws and active perl <msimcich@accesstools.com>
        Perl Module Installation <bh_ent@my-deja.com>
    Re: perl objects and methods <godzilla@stomp.stomp.tokyo>
    Re: Poered by perl (Michel Dalle)
        prob with -F switch stevezaz@my-deja.com
    Re: prob with -F switch (John J. Trammell)
    Re: prob with -F switch nobull@mail.com
    Re: Problem writing form field data to new HTML page <jeff@vpservices.com>
    Re: Problem writing form field data to new HTML page nobull@mail.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 16 Oct 2000 08:07:08 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: "Lite" Perl book required
Message-Id: <39EB199C.DA3E636F@vpservices.com>

"Randal L. Schwartz" wrote:
> 
> >>>>> "Martien" == Martien Verbruggen <mgjv@tradingpost.com.au> writes:
> 
> >> Elements of Programming Perl by Stephen Johnson, available from Manning
> >> Books
> 
> Martien> Andrew L. Johnson
> 
> Martien> and I agree :)
> 
> For non-programmers, I also agree.  Andrew targeted the non-programmer
> audience well, teaching both elements of programming and an
> introduction to programming in Perl.
> 
> However, for programmers already versed in language such as C or awk,
> you probably could skip all the parts of that redundancy, and spend
> your first 40 hours concentrating on just Perl.  I think I know a book
> or two that does that, and rather effectively I'm told. :)

I second those two recommendations.  The second one, obscurely mentioned
by Randal, is, unless I am mistaken _Learning Perl_ from O'Reilly, an
excellent introduction to Perl for those with some Unix or other
programming background and probably a good companion to Johnson's book
in any case.

-- 
Jeff


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

Date: Mon, 16 Oct 2000 18:30:10 +0100
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: "Lite" Perl book required
Message-Id: <ant161710209fNdQ@oakseed.demon.co.uk>

In article <39EB199C.DA3E636F@vpservices.com>, Jeff Zucker
<URL:mailto:jeff@vpservices.com> wrote:
> "Randal L. Schwartz" wrote:
> > 
> > However, for programmers already versed in language such as C or awk,
> > you probably could skip all the parts of that redundancy, and spend
> > your first 40 hours concentrating on just Perl.  I think I know a book
> > or two that does that, and rather effectively I'm told. :)
> 
> I second those two recommendations.  The second one, obscurely mentioned
> by Randal, is, unless I am mistaken _Learning Perl_ from O'Reilly, an
> excellent introduction to Perl for those with some Unix or other
> programming background and probably a good companion to Johnson's book
> in any case.

I learnt Perl from "Learning Perl" and found it a breeze. Most certainly
"lite" but also entertainingly written, which I think was the intention.
Prior to getting into Perl I had not had much experience with UNIX, only
a little C and no awk at all, but despite that I found "Learning Perl"
almost too "lite". I would read it on the train to/from work, read it
in bed, in the bath, wherever; flipping the pages faster and faster in
a hungry desire to find out more. When I finished, I felt like I'd just
had a light snack, and needed to consume more. I'm not saying that I felt
dissatisfied, because Learning Perl will teach you enough to write your
own programs with confidence. However, I would advise you to get
"Programming Perl" on your bookshelf before you finish "Learning Perl"
so that you can launch straight into it.

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: Mon, 16 Oct 2000 10:19:55 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: [ Wildly OT ] Re: Japanese Girl Has PERL Request.
Message-Id: <39EB1C9B.4ED16A1E@rac.ray.com>

David Steuber wrote:
> 
> Jeff Zucker <jeff@vpservices.com> writes:
> 
> ' Old enough to have memory lapses apparently. :-)
> 
> Like they said about woodstock, if you remember the '70s, you weren't
> there ;-).
> 

I've been told (since I was there and I don't remember it) that
Woodstock was in the '60's and the phrase is "If you remember the
'60's then you weren't there."

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Mon, 16 Oct 2000 11:35:11 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: A Simpler perlish way
Message-Id: <39EB2E3F.EA8891D0@rac.ray.com>

Jody Fedor wrote:
> 
> Bart Lateur wrote in message <49fhusk7mbm0ejsu395g8f99mgr6am2u8n@4ax.com>...
> >Jody Fedor wrote:
> >
> >>if ($yr%4 == 0) {$days[1] = 29} else {$days[1] = 28};
> >
> >This rule is too simple. 
> 
>         Are there going to be any years in our lifetime (from 2000 - 2070)
> that would fail the simple rule version of checking year mod 4?
> 

If Pope Gregory had only worried about calendars that would didn't
have to run beyond his lifetime, by now the winter equinox would be in
July.
 
I wrote some of that two-digit-year code that "couldn't possibly still
be running in 2000" and I also worked on some extremely difficult,
tedious, time consuming and unforgiving conversions of some
two-digit-year code that "couldn't possibly still be running in 2000."

If you have a script which is going to run long enough to care about
individual leap years, how do you know that it won't still be running
in 2100? Do it right or some other poor slob will have to fix it. And
if there's any justice in the universe, it'll be you, either in this
life or on the next turning of the wheel.

-- 
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747

Quae narravi, nullo modo negabo. - Catullus


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

Date: Mon, 16 Oct 2000 08:14:28 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: CGI scripts - paths and URLs
Message-Id: <39EB1B54.69604D30@vpservices.com>

John wrote:
> 
> I want to place CGI scripts on a secure server which links to html files on
> a physically different server (i.e. my virtual server) is this possible?
> The original script was written using a path to the html pages (it assumed
> the folder was on the same physical server) but now that it's not can I just
> put in a URL instead of the path?

"CGI", "HTML", "server", "links", are all words having to do with the
world wide web and the internet and have no relevance in themselves to 
Perl.  If you are talking about using a script to create a web page that
has hypertext links, then the answer is it doesn't matter where the
target of those links is located.  If you are talking about a script
that opens a physical file, does something to it and produces an HTML
page from the results, then no, you can not just use a URL to open a
file instead of a local path.  You could, depending on where the file is
located use Perl's LWP or an FTP related module to do that.

-- 
Jeff


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

Date: Mon, 16 Oct 2000 16:50:09 +0100
From: Nuno Goncalves <nuno@rccn.net>
Subject: check by a cgi
Message-Id: <Pine.BSF.4.21.0010161648500.52354-100000@atlas.rccn.net>

Hi there !!
Does anyone know how can a cgi check if a client's browser has javascript
enabled ??

	thanks

		Best regards,
			Nuno



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

Date: Mon, 16 Oct 2000 19:31:23 +0200
From: Per Kistler <kistler@gmx.net>
To: Nuno Goncalves <nuno@rccn.net>
Subject: Re: check by a cgi
Message-Id: <39EB3B6B.E4C167C1@gmx.net>

Hi Nuno

When you offer the form you may add a small javascript which changes a
variable so that
you from that value can see later in the cgi whether javascript run or
not. Just
one possibility...

Per.

Nuno Goncalves wrote:
> 
> Hi there !!
> Does anyone know how can a cgi check if a client's browser has javascript
> enabled ??
> 
>         thanks
> 
>                 Best regards,
>                         Nuno

-- 
Per Kistler, Zuerich, Switzerland
------------------------------------------------------------------------


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

Date: Mon, 16 Oct 2000 13:03:18 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: check by a cgi
Message-Id: <39EB42E6.1F5AC74A@mail.uca.edu>

Per Kistler wrote:
> 
> Hi Nuno
> 
> When you offer the form you may add a small javascript which changes a
> variable so that
> you from that value can see later in the cgi whether javascript run or
> not. Just
> one possibility...

Alternatively, if you get a lot of complaints that the browser did not
do what it was supposed to with the javascript, this is a good
indication that the clients did not have it enabled/available/working.

Cameron

-- 
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu


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

Date: Mon, 16 Oct 2000 19:10:50 +0200
From: "Rob Donovan" <rob@robdon.com>
Subject: Disk Quotas
Message-Id: <39eb3690_1@news.newsfeeds.com>

Hi,

Anyone know a module/command for checking disk quotas.

I'm trying to write a perl script to upload files to my web site and I need
to check that I have enough disk space (/quota) left before I upload the
file.

The platform is Linux.

I know about the 'quota' command but this just displays the info, I need it
to be passed back to perl (say the total amount available or used).

Thanks,

Rob Donovan (rob@robdon.com)






-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Mon, 16 Oct 2000 09:08:13 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Giant Array Delay (beginner)
Message-Id: <39EB27ED.10AD9BE8@stomp.stomp.tokyo>

Anno Siegel lost count on his fingers:
 
> Godzilla! provided a stunningly clever solution:
 
> >Split your large correctly delimited file into six
> >files, each roughly ten kilobytes. Name these files
> >0.dat through 5.dat, inclusively. Which file is opened,
> >zero through five, will be determined by a random number.

> >This method enhances your random quality by random selection
> >of a file and, random selection of text to print.
 
> Enhances?  It biases the random selection, unless all partial files
> have the same number of records.  Even if they do, it "enhances"
> nothing.


Have you considered more practice in counting
with your fingers? Clearly there is a need for
you to practice more.


Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: Mon, 16 Oct 2000 08:26:50 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: HELP- CGI
Message-Id: <39EB1E3A.F08CBE3C@vpservices.com>

Fraser wrote:
> 
> Hi can someone help?
> Trying to write a Perl CGI script on a UNIX system so people could log
> onto a URL using a browser, enter a name and sort direction, to sort the
> /etc/passwd file on the unix system and return the passwd file sorted in
> the appropriate direction (Up or Down) in a html page and information
> about name entered- logged to a file on system.

Your question fits very completely in the set of questions in the
category "If you need to ask about that, don't do it."  Do you really
want to be opening up your passwd file over the web starting from such a
low level of understanding of the process?  Perl can do what you are
asking but it does it in a way that assumes *you* know what *you* are
doing.  Perhaps you do know that, but your question is not phrased in a
way to give any confidence that you have done anything other than think
about the issues in an extremely general way.

Sorry, I don't give loaded guns to 5 year olds, even if they ask me how
to shoot themselves in the foot.  (Well, ok, I don't give loaded guns to
anyone, but that's a different topic).

-- 
Jeff


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

Date: Mon, 16 Oct 2000 15:56:18 GMT
From: per_winkvist@my-deja.com
Subject: htmldiff
Message-Id: <8sf8eu$jkf$1@nnrp1.deja.com>

Hi,

http://www.cpan.org/authors/id/B/BW/BWEILER/HtmlDiff-2.1

is a cool perl script which uses unix diff to compare two files and
show the output in HTML. However, how do I get this to work under NT ?
I have downloaded the GNU diffutil 2.7 and got perl 5.005_03.

Any clues ?

Rgds,
    Per Winvkist


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 16 Oct 2000 16:54:14 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: IO::Socket falls over under Perl 5.6.0
Message-Id: <8sfbrh$mtn$1@nnrp1.deja.com>

Consider this line:

    $socket = IO::Socket::INET->new( PeerAddr       => $site,
                                     PeerPort       => $port,
                                     Proto          => "tcp",
                                     Type           => SOCK_STREAM
                                     Timeout        => 5 );

under Perl 5 it worked fine. But i've just updated to 5.6.0 and now get:

syntax error at ./getsites.pl line 440, near "SOCK_STREAM
                                     Timeout"
Execution of ./getsites.pl aborted due to compilation errors.

I tried installing the latest version of IO::Socket and it refuses to
build under Linux 2.2.16 and gcc version egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release). I get the error:

cc -c  -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -
D_FILE_OFF
SET_BITS=64 -O2     -DVERSION=\"1.20\" -DXS_VERSION=\"1.20\" -fpic -
I/usr/local/
lib/perl5/5.6.0/i686-linux/CORE -DI_POLL  IO.c
In file included from /usr/local/lib/perl5/5.6.0/i686-
linux/CORE/perl.h:24,
                 from IO.xs:9:
/usr/local/lib/perl5/5.6.0/i686-linux/CORE/config.h:2306: warning:
`I_POLL' rede
fined
*Initialization*:1: warning: this is the location of the previous
definition
IO.xs: In function `XS_IO__Seekable_getpos':
IO.xs:208: `sv_undef' undeclared (first use in this function)
IO.xs:208: (Each undeclared identifier is reported only once
IO.xs:208: for each function it appears in.)
IO.xs: In function `XS_IO__File_new_tmpfile':
IO.xs:252: `sv_undef' undeclared (first use in this function)
make: *** [IO.o] Error 1

I'm a little lost. Can anyone help at all?

Thanks!

Rich


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 16 Oct 2000 19:28:06 +0200
From: Per Kistler <kistler@gmx.net>
To: Richard Lawrence <ralawrence@my-deja.com>
Subject: Re: IO::Socket falls over under Perl 5.6.0
Message-Id: <39EB3AA6.4360AC18@gmx.net>

Hi Richard

You might have noticed in between, but it needs a comma after
SOCK_STREAM.

Per.

Richard Lawrence wrote:
> 
> Consider this line:
> 
>     $socket = IO::Socket::INET->new( PeerAddr       => $site,
>                                      PeerPort       => $port,
>                                      Proto          => "tcp",
>                                      Type           => SOCK_STREAM
>                                      Timeout        => 5 );
> 
> under Perl 5 it worked fine. But i've just updated to 5.6.0 and now get:
> 
> syntax error at ./getsites.pl line 440, near "SOCK_STREAM
>                                      Timeout"
> Execution of ./getsites.pl aborted due to compilation errors.


-- 
Per Kistler, Zuerich, Switzerland
------------------------------------------------------------------------


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

Date: 16 Oct 2000 17:26:09 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: IO::Socket falls over under Perl 5.6.0
Message-Id: <slrn8ulk60.4tc.trammell@nitz.hep.umn.edu>

On Mon, 16 Oct 2000 16:54:14 GMT, Richard Lawrence
<ralawrence@my-deja.com> wrote:
>Consider this line:
>
>    $socket = IO::Socket::INET->new( PeerAddr       => $site,
>                                     PeerPort       => $port,
>                                     Proto          => "tcp",
>                                     Type           => SOCK_STREAM
>                                     Timeout        => 5 );
>
>under Perl 5 it worked fine.

Wow, Perl knows how to insert missing commas?  Who'da thunk it?

-- 
John J. Trammell
johntrammell@yahoo.com


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

Date: 16 Oct 2000 16:30:04 +0100
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: Is perl object oriented?
Message-Id: <m14s2cvm6b.fsf@rt158.private.realtime.co.uk>

tjla@guvfybir.qlaqaf.bet (Gwyn Judd) writes:

> I was shocked! How could brian d foy <brian@smithrenaud.com>
> say such a terrible thing:
> 
> >all the important features needed for OO are in Perl (although some
> >may miss their favorite features) although the bondage and discipline
> >are absent.
> 
> Oh Yeah? Well some of us *like* the Bondage and Discipline...oh wait
> this isn't alt.java.whips.and.chains.beat.beat.beat is it? whoops

And the bondage and discipline isn't *that* hard to add if you want to
(assuming someone else has already done it), check out Damian's
Class::Contract, or my own Interface_Polymorphism module which allows
you to declare that a class of yours implements a named interface, and
to have it checked that it does, at compile time (and which I really
must document some time)


-- 
Piers


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

Date: Mon, 16 Oct 2000 11:09:03 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Japanese Girl Has PERL Request.
Message-Id: <5g6mus8ehtt0jk36kv3bjoqts0neml9gsf@4ax.com>

On Fri, 13 Oct 2000 12:22:52 -0500, Russ Jones
<russ_jones@rac.ray.com> wrote wonderful things about sparkplugs:

>brian d foy wrote:
>> 
>> you should thank porn site operators.  they are the ones that
>> push the technology.  seriously.  you should see some of the
>> network setups the big sites have.  they push a serious amount
>> of bits.
>> 
>
>Brian's got a point. Home VCR technology was greatly influenced by the
>porn industry, and particularly by Sony's reluctance to license the
>superior Beta format. I remember reading a report that said that some
>massive percent of all web traffic was porn. And they've sure been
>leaders in pop-up browser window technology. (So I've been told.)


Since we are already completey off topic let me add that ALL modern
media has been advanced through pornography.  Photography, video,
computers, the internet, you name it. Someone, somewhere wants to see
nekkid folks.




"Well that explains everything fish-bulb" --Bart Simpson
lmoran@wtsg.com
Registered Linux user number 187055


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

Date: Mon, 16 Oct 2000 08:18:44 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: MS Access
Message-Id: <39EB1C54.67197E61@vpservices.com>

c_glensmith@my-deja.com wrote:
> 
> Please Help! I'm new to Perl (and new to MS Access!)

If you are new to Perl then one of the first things you should learn is
how to research questions you have about Perl.  For example, if you
searched the internet or the archives of this newsgroup at
www.dejanews.com, you would find hundreds of articles on the topic you
have mentioned.

> I need to read & write records in a MS Access
> database from a Perl script.
> 
> Are there extensions for this?, 

You use a module called DBI.pm and the DBD::ODBC driver that works with
it.  However you would do well to go to a database group to learn about
how limited Access is in terms of using it for multiple users in a web
environment.

> what Perl Version do
> I need ( for Windoze NT)?

any version of perl though the one at www.activestate.com will be most
common and easiest to use.

-- 
Jeff


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

Date: Mon, 16 Oct 2000 16:03:13 GMT
From: Michael Simcich <msimcich@accesstools.com>
Subject: Re: newbie: pws and active perl
Message-Id: <MPG.1454c6c23ba758b9896c5@news>

Peter, can you specifically mention what you changed in your setup? I 
have exactly the same setup and issues here, perl files want to do 
download rather than execute, on Win98/ActivePerl. I suspect it's the 
cgi-bin script mappings but I'd rather hear what you did before I alter 
them.

Thanks

-- 
Michael Simcich
AccessTools

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <39e6c085.6301451@news.arnhem.chello.nl>, overbeek@chello.nl 
says...
> >documentation for how to set up script mappings and how to set up 
> >virtual directories
> >
> >hint: the problem is *probably* that the script mapping is set up for 
> >the server - but not for the /cgi-bin virtual directory itself .. you 
> >may need to do this manually from the PWS administration tool
> >
> >-- 
> >  jason -- elephant@squirrelgroup.com --
> 
> Thanks, its working now!!
> 
> Pieter Overbeeke
> 



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

Date: Mon, 16 Oct 2000 17:17:08 GMT
From: bh <bh_ent@my-deja.com>
Subject: Perl Module Installation
Message-Id: <8sfd6b$o4m$1@nnrp1.deja.com>

Are there any known problems or issues regarding Module installation
for Oracle databases for perl 5?  I am currently running perl 5.005.03.


Any assistance would be greatly appreciated!

Drew Myers
perotsystems

--

bh


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 16 Oct 2000 08:57:20 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: perl objects and methods
Message-Id: <39EB2560.EA75BBB3@stomp.stomp.tokyo>

nobull@mail.com answers himself:

(references to himself removed by yesbull)

> Godzilla! administers a dose of reality:

> > > Is it possible to change the above class to set "$Testing->{id}" with
> > > "$Testing->id=20"?

> > An answer is slapping you across your face.
 
> Godzilla's answer to everything is to slap people accross the face.
 
> > What prevents you from "testing" this
> > to discover an answer? Fear?
 
> Once again Godzilla propounds the Cargo Cult mentality.  The OP is
> asking "how can I get planes to come to my island?".  Rather than
> explaining how to charter an aircraft Godzilla recommends you build
> something that looks like an airport.  When the planes don't come
> presumably one should conclude that there are no planes.
 
> BTW: correct answer is "Yes, Perl (as of 5.6) has lvalue subroutines.
> And yes, they work as object methods. But they are still
> experimental. See perlsub for details".



I can write troll articles infinitely better than
yours with half my brain tied behind my back, Frank.

Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: Mon, 16 Oct 2000 17:18:16 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Poered by perl
Message-Id: <8sfdb6$mds$2@news.mch.sbs.de>

In article <nrrlusoshcmh0jp7odfcqg3uo8vkufs49r@4ax.com>, Bart Lateur <bart.lateur@skynet.be> wrote:
>Joonas wrote:
>
>>Where can i find "Povered by Perl" logos.
>
>"povered"? You mean you're poorer now, because of Perl?

Visions of poor Perl pouring out "powered" logos float through
my mind. I must get some sleep...

Michel.


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

Date: Mon, 16 Oct 2000 15:48:09 GMT
From: stevezaz@my-deja.com
Subject: prob with -F switch
Message-Id: <8sf7vn$j4r$1@nnrp1.deja.com>

I am trying to run Perl with -a -n switches to read through a text file
and split each line into the @F array.I would like to change the
default field delimiter with -F switch but it doesn't work.I have tried
quotes backslashes and everything else.
Has anyone had this problem and what is the solution.
Thanks!


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 16 Oct 2000 16:15:45 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: prob with -F switch
Message-Id: <slrn8ulg21.4nk.trammell@nitz.hep.umn.edu>

On Mon, 16 Oct 2000 15:48:09 GMT, stevezaz@my-deja.com <stevezaz@my-deja.com>
wrote:
>I am trying to run Perl with -a -n switches to read through a text file
>and split each line into the @F array.I would like to change the
>default field delimiter with -F switch but it doesn't work.I have tried
>quotes backslashes and everything else.
>Has anyone had this problem and what is the solution.

What have you tried?  What is the data?  What do you get?  What
OS are you using?

-- 
John J. Trammell
johntrammell@yahoo.com


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

Date: 16 Oct 2000 18:22:40 +0100
From: nobull@mail.com
Subject: Re: prob with -F switch
Message-Id: <u91yxgvgyn.fsf@wcl-l.bham.ac.uk>

stevezaz@my-deja.com writes:

> I am trying to run Perl with -a -n switches to read through a text file
> and split each line into the @F array.I would like to change the
> default field delimiter with -F switch but it doesn't work.I have tried
> quotes backslashes and everything else.

Works fine for me.  Maybe you have a problem with your shell.  What
shell are you using?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Mon, 16 Oct 2000 08:55:22 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Problem writing form field data to new HTML page
Message-Id: <39EB24EA.CD217A85@vpservices.com>

rspratt@my-deja.com wrote:
> 
> Hi there,
> 
> I am fairly new to CGI/PERL (so much so, I haven't yet worked out what
> the difference is). 

Well, try to think of it this way:  if your question is about how to
create an HTML form, or about the general process of how browsers and
servers communicate, or if the question you are asking would have the
same answer regardless of whether the CGI script was written in Perl or
in C++, then it isn't a Perl question.

> The CGI script I am using was downloaded from a library

Perl's motto (or one of them) is TMTOWTDI -- there's more than one way
to do it.  Unfortunately this sometimes means there are 99 wrong ways to
do it.  Getting scripts from unknown resouces on the web before you have
the ability to evaluate them is very risky for this reason.  Fortunately
there is something called CPAN -- the Comprehensive Perl Archive Network
that includes modules most of which have been tested by hundreds of Perl
experts.  In contrast to other scripts, these have been pre-evaluated by
people who know how to evaluate. 

> so I don't
> really have a good understanding of how or why it works. In short, I am
> having trouble taking data from an html form and getting my CGI script

Aha!  CGI.  That is the area where there are the most bad scripts out
there and fortunately also the area covered already by an excellent CPAN
module called CGI.pm that, in fact, comes with standard as part of all
modern perls.

> Here's the HTML page that calls the script:
> 
> [snip of HTML that is fine]
>
>  $cl = $ENV{'CONTENT_LENGTH'};

Ouch!

>    read(STDIN, $_, $cl);

Ouch! Ouch! Ouch!

Here is what you want to do:

#!/usr/local/bin/perl -Tw
$|++;
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
my $name    = param('name')    || '';
my $address = param('address') || '';
print
    header, start_html,
    "name    = $name<br>",
    "address = $address<br>",
    end_html
;

There is very extensive documentation for the CGI.pm module both online
and included witht he module itself.

-- 
Jeff


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

Date: 16 Oct 2000 18:03:03 +0100
From: nobull@mail.com
Subject: Re: Problem writing form field data to new HTML page
Message-Id: <u966msvhvb.fsf@wcl-l.bham.ac.uk>

rspratt@my-deja.com writes:

> I am fairly new to CGI/PERL (so much so, I haven't yet worked out what
> the difference is). 

You have not lurked in this group long enough.

"CGI" is an API for connecting programs to web servers.  The programs
can be written in C, C++, Java, FORTRAN, Pascal, Bourne-shell or just
about any other language you care to mention.

"Perl" is a universal programming language that can be used to write
programs to do just about anything.

"CGI/Perl" refers to writing CGI programs in Perl.

"PERL" is what you get if you try to type "Perl" and your caps-lock
key is on.

> I have a CGI problem which I am hoping someone will be kind enough
> to help with.

If you have a CGI problem then ask in a CGI group.

> The CGI script I am using was downloaded from a library so I don't
> really have a good understanding of how or why it works.

This is a newsgroup for people who want to discuss and understand
Perl.  It's not a helpdesk for people who have no interest in
understanding Perl and just want someone else to debug Perl programs
that they've downloaded.

> In short, I am having trouble taking data from an html form and
> getting my CGI script to write that data to another html page.

You should be using the CGI module for Perl.

> --begin--
>   $cl = $ENV{'CONTENT_LENGTH'};
> 
>   if ($cl > 0)
>   {
>    read(STDIN, $_, $cl);
>    $_ .= "&";
> -end--

No, really, seriously, you want to be using the CGI module.  Unless
you have a detailed understanding of CGI you really should not even
consider trying to roll your own Perl implemention the CGI API.  And
of course if you do have a detailed understanding you'd still probably
choose to use the standard module.

> --begin--
>         name = $name<br>
>         name = $c1{'name'}<br>
>         address = $address<br>
>         address = $c1{'address'}<br>
> --end--

Is that inside a double quoted string?  Please when quoting Perl code
always qoute at the very least complete statements.  If you don't know
enough Perl to recognise a statement then you need to address the fact
that you have no Perl knowledge before you try programming in Perl.

> Unfortunately, all my new page displays is:
> 
> --begin--
>         name =
>         name =
>         address =
>         address =
> --end-
> 
> Why won't the values display?

Because the variables are null or undefined.

> I am slowly going mad, because I'm sure that it's quite simple. I
> have spent countless hours searching for the answer - but it has all
> been in vain.

Probably because you are trying to run without walking first.  You are
trying to work out why when you get to a particular line in your
script certain variables are not set but there's no evicence that you
have any understanding of the mechanism by which you were hoping
they'd become set.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 4630
**************************************


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