[16909] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4321 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 14 06:06:32 2000

Date: Thu, 14 Sep 2000 03:05:10 -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: <968925910-v9-i4321@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 14 Sep 2000     Volume: 9 Number: 4321

Today's topics:
        ANNOUNCE: AI::NeuralNet::Mesh v0.43 <jdb@wcoil.com>
    Re: Character Class in Regex - Despecify What? <e.roselli@volusoft.com>
        Compiling SSLeay on RedHat ? <info@thomas-fahle.de>
        Cyrillic in Perl? <e.roselli@volusoft.com>
    Re: File name with space in Net::FTP put scarlzong@my-deja.com
    Re: File name with space in Net::FTP put <stig@palmquist.org>
    Re: I really need help !!!! <peterp100@hotmail.com>
    Re: I really need help !!!! <news@NOSPAMjstrom.cjb.net>
    Re: killfiles?  scores?  I wish I had these luxuries (Gwyn Judd)
    Re: main process should not wait for externally started but86@my-deja.com
        PB with perl <poizot@intechmer.cnam.fr>
    Re: print and CGI scripts <david.obrien@ssmb.com.au>
    Re: print and CGI scripts <bill.kemp@wire2.com>
    Re: print and CGI scripts (Tim Hammerquist)
    Re: print and CGI scripts <nickco3@yahoo.co.uk>
        Problem with refresh <tom@hughesmedia.co.uk>
    Re: Qualifications for new Perl programmer????? <bart.lateur@skynet.be>
    Re: Qualifications for new Perl programmer????? <bart.lateur@skynet.be>
    Re: Qualifications for new Perl programmer????? (Gwyn Judd)
    Re: Qualifications for new Perl programmer????? <bcaligari@my-deja.com>
    Re: Req.: The perfect Perl Editor? (Abigail)
    Re: Req.: The perfect Perl Editor? (Tim Hammerquist)
    Re: select and sysread <alex.turner@enformatica.com>
    Re: slick way to look at array? (Gwyn Judd)
    Re: slick way to look at array? atthestudio@my-deja.com
    Re: slick way to look at array? <iltzu@sci.invalid>
        sprintf() rounding problem <news@dash2.uklinux.net>
    Re: sprintf() rounding problem <e.roselli@volusoft.com>
        storing HASH in HASH in DB_File ?? (janeways dream)
    Re: transliterating file names in a dir <iltzu@sci.invalid>
    Re: XML parser in perl <bart.lateur@skynet.be>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 14 Sep 2000 09:01:07 GMT
From: "Josiah Bryan" <jdb@wcoil.com>
Subject: ANNOUNCE: AI::NeuralNet::Mesh v0.43
Message-Id: <8pq44j$e8j$0@206.230.71.44>

Greetings Perlfolk,

Announcing the release of

    AI-NeuralNet-Mesh-0.43.zip

Recomended download URL:
 http://www.josiah.countystart.com/modules/get.pl?mesh:clp.misc


It has entered CPAN as
  file: $CPAN/authors/id/J/JB/JBRYAN/AI-NeuralNet-Mesh-0.43.zip
  size: 99820 bytes
   md5: 91bba01fb5e3417694cfd554f9b3a1f3


** What is this?

AI::NeuralNet::Mesh is an optimized, accurate
neural network Mesh. It was designed with
accruacy and speed in mind.

This network model is very flexable. It will allow
for clasic binary operation or any range of integer
or floating-point inputs you care to provide. With
this you can change activation types on a per node or
per layer basis (you can even include your own anonymous
subs as activation types). You can add sigmoid transfer
functions and control the threshold. You can learn data
sets in batch, and load CSV data set files. You can do
almost anything you need to with this module. This code
is deigned to be flexable. Any new ideas for this module?
Contact Josiah Bryan at <jdb@wcoil.com>

As always, included is a cleaned, CSS-ed, HTML-format of the POD docs.

** What's new?

>From the POD:
This is version B<0.43>, the second release of this module.

With this version I have gone through and tuned up many area
of this module, including the descent algorithim in learn(),
as well as four custom activation functions, and several export
tag sets. With this release, I have also included a few
new and more practical example scripts. (See ex_wine.pl) This release
also includes a simple example of an ALN (Adaptive Logic Network) made
with this module. See ex_aln.pl. Also in this release is support for
loading data sets from simple CSV-like files. See the load_set() method
for details. This version also fixes a big bug that I never knew about
until writing some demos for this version - that is, when trying to use
more than one output node, the mesh would freeze in learning. But, that
is fixed now, and you can have as many outputs as you want (how does 3
inputs and 50 outputs sound? :-) Also in this release is output range
limiting via the range() activation function.

** What do you think?

Now I know you people are out there that are using the module...
I can hear the fists hitting the keyboards in frustration. :-) Relieve
some of that frustration by e-mailing me and letting me know what
you think of the module and any suggestions you got.

Use it, let me know what you all think. This is just a
groud-up write of a neural network, no code stolen or
anything else. Don't expect a classicist view of nerual
networking here. I simply wrote from operating theory,
not math theory. Any die-hard neural networking gurus out
there? Let me know how far off I am with
this code! :-)

Regards,

        ~ Josiah Bryan, <jdb@wcoil.com>

--
Josiah Bryan
jdb@wcoil.com
Tel: 937.316.6256





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

Date: Thu, 14 Sep 2000 09:14:35 +0300
From: "Elisa Roselli" <e.roselli@volusoft.com>
Subject: Re: Character Class in Regex - Despecify What?
Message-Id: <8ppu4q$cgg$1@wanadoo.fr>


Andrew J. Perrin a écrit dans le message ...
>From memory, the only characters that require escaping in classes are
>^, - (sometimes), and ]. So I think you should be able to do:
>
>[A-Za-z \n.,;:!?'()-]


Good to know - so the only things to escape in a character class are the
characters that might otherwise be ambiguous within it, but not within the
whole of Perl. What about character classes _within_ character classes - I
mean things like \s or \W?

>However, you might find it much easier to define what characters are
>*not* allowed, given the rather large selection above. Can you do
>something along the lines of:
>
>[^[\]{}*&]
>
>etc., which looks like almost everything you're looking for?

Oh I disagree! The characters not used far outnumber those used, at least on
my keyboard: what about digits, maths symbols, pipes, tildes, hashmarks... -
all of which are unlikely to pop up in Lysander's love declarations, even if
some avant-guarde production casts him as a bot!   ;°)

>
>Also, though, note that you can't specify "single" newlines and tabs
>versus multiple of them using a character class, since you have to
>allow multiples of your other characters.


I don't think I'm trying to specify single newlines. This is only a part of
the regular expression - see my answer to Sean farther down.

>To make your life much, much easier, you might consider setting $/
>(input_record_separator) to "\n\n" or something along those lines to
>break up the file into the chunks on its way in.
>
>In general, Freidl's _Mastering Regular Expressions_ is a very good
>reference for the regex stuff, although I confess I didn't find the
>answer to what has to be escaped in character classes there.



I agree, an outstanding book. And your own work on sed and awk, although not
relevant to my current problem, has been very useful to me as well.

Thanks for the support,
Elisa Francesca Roselli




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

Date: Thu, 14 Sep 2000 10:29:12 +0200
From: Thomas Fahle <info@thomas-fahle.de>
Subject: Compiling SSLeay on RedHat ?
Message-Id: <39C08C58.D87137F8@thomas-fahle.de>

Hello all,


SSLeay compiles well but
/usr/local/src/SSLeay 0.9b/perl/ not.

make returns the following error messages
bio.xs: In function `p5_bio_callback':
bio.xs:36: `sv_undef' undeclared (first use in this function)
bio.xs: In function `XS_SSLeay__BIO_new':
bio.xs:140: `na' undeclared (first use in this function)
 ...
make: *** [bio.o] Error 1



Any hints or suggestions are welcome.




Thomas



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

Date: Thu, 14 Sep 2000 09:59:13 +0300
From: "Elisa Roselli" <e.roselli@volusoft.com>
Subject: Cyrillic in Perl?
Message-Id: <8pq0oh$hck$1@wanadoo.fr>

This is a question that has been with me for a while, and that I have raised
in awk and Java forums before. I'm curious on the Perl take.

Would it be possible to use Perl to design a tool that would transliterate
between Cyrillic and Western character sets, according to a predefined table
of transliteration rules? I mean that one would previously establish that
simple letters like a and b map directly onto their Cyrillic equivalents,
but juicier mouthfuls like the shcha or the ya would be represented by
combinations of characters on the Latin side. These would be consistent
within a given Western language, but would change depending on which Western
language was chosen (Russian shcha mapping to shcha in English, schtscha in
German, chtcha in French etc..). My vision is that one could type one's
Russian text on a familiar Western keyboard, select it and send to the Perl
program, and have it come out in proper Russian on the other side.

I have done some research on this already and know about such things as
transliteration fonts and keyboards, which I have installed. I have
internationalized my Web tools to access the emerging Russian Web, and I
notice that many Russian sites can display in Cyrillic or translit versions.
And of course, there is plenty of Russian shareware that does precisely
this, so my question is technical rather than functional.

Is Perl ASCII-based (like awk)  or Unicode-based (like Java)? How do
codepages and locale come into all this? Can screens display Latin and
Cyrillic simultaneously? What kind of IO? Can computers bi-locate like
medieval saints? When do I get to dance with Prince Andrey?

You can tell I'm bored with my work...


Elisa Francesca Roselli




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

Date: Thu, 14 Sep 2000 08:22:54 GMT
From: scarlzong@my-deja.com
Subject: Re: File name with space in Net::FTP put
Message-Id: <8pq1sg$vj$1@nnrp1.deja.com>

In article <G0uLoH.8J3@news.boeing.com>,
  ced@bcstec.ca.boeing.com (Charles DeRykus) wrote:
> In article <8podbk$33j$1@nnrp1.deja.com>,  <scarlzong@my-deja.com>
wrote:
> >Hi,
> >
> >a quick question concerning Nert::FTP.
> >
> >I have a script using ftp to transfer files but put("$file") does not
> >work if the file name contains space. The remote computer is a RH6.2
so
> >it does  support for example touch "qa dd", but $ftp->put("qa dd")
does
> >not work. Any ideas anyone ?
> >
>
> Did you add debug, i.e. Net::FTP->new("somehost...", Debug=>1)
>
> hth,
> --
> Charles DeRykus
>


Yes, certainly. Sorry I forgot to put it the original message.
I get "Bad remote filename 'qa dd'" as response. So I am pretty
comfortable it is the Net:FTP package that has this limitation.
´
I have tried put("/"qa dd/"") which doesn't work of course, but it is a
trick like that I'm looking for. Or if anyone has any idea how to
change Net:FTP.


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


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

Date: 14 Sep 2000 11:30:25 +0200
From: Stig Palmquist <stig@palmquist.org>
Subject: Re: File name with space in Net::FTP put
Message-Id: <m3zolbcocu.fsf@stig.a.sol.no>

ced@bcstec.ca.boeing.com (Charles DeRykus) writes:

> In article <8podbk$33j$1@nnrp1.deja.com>,  <scarlzong@my-deja.com> wrote:
> | Hi,
> 
> | a quick question concerning Nert::FTP.
> 
> | I have a script using ftp to transfer files but put("$file") does not
> | work if the file name contains space. The remote computer is a RH6.2 so
> | it does  support for example touch "qa dd", but $ftp->put("qa dd") does
> | not work. Any ideas anyone ?

You sould probably try to escape "\" the space character.

Like:

$filenametoupload=~ s/ /\ /g;

-- 
Stig Palmquist <stig@palmquist.org>


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

Date: Thu, 14 Sep 2000 04:00:16 -0400
From: peter <peterp100@hotmail.com>
Subject: Re: I really need help !!!!
Message-Id: <j1t1sscggu9pappj4ocv3sfe67p3ttetr6@4ax.com>

I have another problem, the cgi is now running (I copied all the perl
files into the /html dir, BUT

the data that gets enter into the form is not being displayed...I
believe the problem must be in the geturl.cgi (same as geturl.pl, I
renamed it) Scroll down and I'll show you where I think the problem
is,

>> THIS IS THE PERL [file name: geturl.pl]:
>>
>> #!/usr/bin/perl
>>
>> require "/pub/scripts/perl-cgi/html.pl";
>> [first, what is this?, the book doesn't say, and no such file or dir
>> exists on my system]
>>
>> $Title = "Get Information From A URL";
>>
>> $QueryString = $ENV{ 'QUERY_STRINGS'} ;
>>
>> @NameValuePairs = split (/&/, $QueryString);
>>
>> &HTML_Header ($Title);
>> print "\n";
>> print "<H1>$Title</H1>\n";
>> print "<HR>\n";

RIGHT HERE:

>> foreach $NameValue (@NameValuePairs)
>> {
>> ($Name, $Value) = split (/=/, $NameValue);
>> print "Name = $Name, value = $Value<BR>\n";
>> }
>>
>> $HTML_Ender;
>>
The $title goes to the new page after I submit the filled form, but
none of the data shows up. If you have the book, pg. 393 is what it
show look like.  I just get the title "Get Information From a URL"

What does (@NameValuePairs) do in this case ?

Thanks again,

Peter
>> AND HERE IS THE HTML:
>>
>> <html>
>> <head>
>> <title>Visitor Information Form</title>
>> </head>
>> <body>
>> <h1 align="left">Visitor Information Form</h1>
>> <hr>
>> <form action="geturl.pl" METHOD="GET">
>>
>> [I'm not sure which dir the form action should point to, in my config
>> files, apache says: protected-cgi-bin/ /home/httpd/protected-cgi-bin/]
>>
>> <b>
>> Last name: <INPUT TYPE="text" NAME="LastName" SIZE=16>
>>
>> First name: <INPUT TYPE="text" NAME="FirstName" SIZE=16>
>> <br><br>
>>
>> Address: <INPUT TYPE="text" Name="Address" SIZE=32>
>>
>> City: <INPUT TYPE="text" NAME="City" SIZE=32>
>> <br><br>
>>
>> State: <INPUT TYPE="text" NAME="State" SIZE=2>
>> <br><br>
>> </b><center><b>
>> <INPUT TYPE="submit" VALUE="Send Information">
>> <INPUT TYPE="reset" VALUE="Clear Form Fields">
>> </b>
>>
>> </center></form>
>> </body>
>> </html>
>>
>> [Unfortunately this book does a poor job, I'll probably return it, can
>> anyone tell me a good book about cgi (perl-cgi) that's worth the paper
>> it's printed on ?]



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

Date: Thu, 14 Sep 2000 09:22:22 GMT
From: <news@NOSPAMjstrom.cjb.net>
Subject: Re: I really need help !!!!
Message-Id: <iN0w5.257$n4.17026@newsc.telia.net>

Try this:

print "Name = $Name\, value = $Value\<BR>\n";

"peter" <peterp100@hotmail.com> skrev i meddelandet
news:j1t1sscggu9pappj4ocv3sfe67p3ttetr6@4ax.com...
> I have another problem, the cgi is now running (I copied all the perl
> files into the /html dir, BUT
>
> the data that gets enter into the form is not being displayed...I
> believe the problem must be in the geturl.cgi (same as geturl.pl, I
> renamed it) Scroll down and I'll show you where I think the problem
> is,
>
> >> THIS IS THE PERL [file name: geturl.pl]:
> >>
> >> #!/usr/bin/perl
> >>
> >> require "/pub/scripts/perl-cgi/html.pl";
> >> [first, what is this?, the book doesn't say, and no such file or dir
> >> exists on my system]
> >>
> >> $Title = "Get Information From A URL";
> >>
> >> $QueryString = $ENV{ 'QUERY_STRINGS'} ;
> >>
> >> @NameValuePairs = split (/&/, $QueryString);
> >>
> >> &HTML_Header ($Title);
> >> print "\n";
> >> print "<H1>$Title</H1>\n";
> >> print "<HR>\n";
>
> RIGHT HERE:
>
> >> foreach $NameValue (@NameValuePairs)
> >> {
> >> ($Name, $Value) = split (/=/, $NameValue);
> >> print "Name = $Name, value = $Value<BR>\n";
> >> }
> >>
> >> $HTML_Ender;
> >>
> The $title goes to the new page after I submit the filled form, but
> none of the data shows up. If you have the book, pg. 393 is what it
> show look like.  I just get the title "Get Information From a URL"
>
> What does (@NameValuePairs) do in this case ?
>
> Thanks again,
>
> Peter
> >> AND HERE IS THE HTML:
> >>
> >> <html>
> >> <head>
> >> <title>Visitor Information Form</title>
> >> </head>
> >> <body>
> >> <h1 align="left">Visitor Information Form</h1>
> >> <hr>
> >> <form action="geturl.pl" METHOD="GET">
> >>
> >> [I'm not sure which dir the form action should point to, in my config
> >> files, apache says: protected-cgi-bin/ /home/httpd/protected-cgi-bin/]
> >>
> >> <b>
> >> Last name: <INPUT TYPE="text" NAME="LastName" SIZE=16>
> >>
> >> First name: <INPUT TYPE="text" NAME="FirstName" SIZE=16>
> >> <br><br>
> >>
> >> Address: <INPUT TYPE="text" Name="Address" SIZE=32>
> >>
> >> City: <INPUT TYPE="text" NAME="City" SIZE=32>
> >> <br><br>
> >>
> >> State: <INPUT TYPE="text" NAME="State" SIZE=2>
> >> <br><br>
> >> </b><center><b>
> >> <INPUT TYPE="submit" VALUE="Send Information">
> >> <INPUT TYPE="reset" VALUE="Clear Form Fields">
> >> </b>
> >>
> >> </center></form>
> >> </body>
> >> </html>
> >>
> >> [Unfortunately this book does a poor job, I'll probably return it, can
> >> anyone tell me a good book about cgi (perl-cgi) that's worth the paper
> >> it's printed on ?]
>




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

Date: Thu, 14 Sep 2000 08:47:00 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: killfiles?  scores?  I wish I had these luxuries
Message-Id: <8g0w5.441$WSlb.3866844@news.xtra.co.nz>

I was shocked! How could jason <elephant@squirrelgroup.com>
say such a terrible thing:

>hear that Gwyn .. you're not a (and I just want you to know that this 
>word has been frollicking in my vocabulary all day) poopyhead afterall

Tell that to my girlfriend :)

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Time is that quality of nature which keeps events from happening all at
once. Lately it doesn't seem to be working.


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

Date: Thu, 14 Sep 2000 09:08:59 GMT
From: but86@my-deja.com
Subject: Re: main process should not wait for externally started executable
Message-Id: <8pq4j3$3us$1@nnrp1.deja.com>

I love to shock people sometimes
;-)
thanks for your help

> I was shocked! How could but86@my-deja.com <but86@my-deja.com>
> say such a terrible thing:
> >Hello programmers!
>
> perldoc -q "How do I start a process in the background?"
>


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


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

Date: Thu, 14 Sep 2000 11:54:03 +0200
From: Emmanuel POIZOT <poizot@intechmer.cnam.fr>
Subject: PB with perl
Message-Id: <39C0A03B.C240F96E@intechmer.cnam.fr>

Hi,
I just install PERL on my Tru64 Unix os.
I got the next message when I want to use it :

22945:/usr/bin/perl: /sbin/loader: Fatal Error: cannot map libperl.so

Any idear ?
--
Cordialement
_________________________________________________
Emmanuel POIZOT
CNAM/INTECHMER
B.P. 324
50103 CHERBOURG
Tél (direct) (33) 233 887 342
Fax  (33) 233 887 339
URL  http://www.intechmer.cnam.fr




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

Date: Thu, 14 Sep 2000 18:10:15 +1000
From: Dave O'Brien <david.obrien@ssmb.com.au>
Subject: Re: print and CGI scripts
Message-Id: <39C087E7.C0785100@ssmb.com.au>



"Godzilla!" wrote:
> 
> Dave O'Brien wrote:
> 
> > "Godzilla!" wrote:
> > > Dave O'Brien wrote:
> 
> > The script is a CGI script.
> > It won't be run at the terminal.
> 
> This is untrue. Your script will output to
> a browser, to a command screen or a telnet
> terminal. First case you, a browser, you
> are hot for html. Last two cases, you
> receive plain text prints.
> 
> A form action and similar won't work for
> plaintext output, still gonna print
> regardless, still gonna run, regardless.
> 
> Take out html content type, your script
> is still going to print just as soon
> as it hits "print" on a line.
> 
> *laughs*
> 
> How will you prevent a print, regardless
> of type, html, plaintext or other, if
> you include a print command in your
> script? Well?
> 
> After reading over the rest of your
> article, reading your self-contradictory
> statements, changing parameters, your
> argumentive nature, exceptional illogic,
> believe you to be full of mule manure
> and trolling.
> 
> Godzilla!
> --
> Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
> UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
> BumScrew, South of Egypt ¦ HTML Programming Class

I'm not trolling. honestly.  I have read back on my first post, and it
*is* very unclear.  The point is, when you generate the html, from the
CGI module (or whatever), you are using print statements.  The problem
is, later in the script I want to use print statements, so that they
print to a file and not to the browser.  There seems to be no documented
way to undo the the print "Content-type" command.

I know that the print command prints to a terminal as well.  I'm just
trying to prevent it from printing to the browser.  I'm not trying to be
argumentative.  That is the problem with text, it is easy to get the
wrong impression.  The fact the I was imprecise, doesn't mean I am
spoiling for a fight.  I don't wish to argue about something that I
genuinely need help with.  Thanks for your time though.

Dave


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

Date: Thu, 14 Sep 2000 08:59:40 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: print and CGI scripts
Message-Id: <968918605.21730.0.nnrp-13.c3ad6973@news.demon.co.uk>


Dave O'Brien wrote in message <39C0629D.10478C67@ssmb.com.au>...
>This seems like a simple proble, but I can't find any doco on it.
>
>I am writing a CGI script that takes some user settings, and then then
>processes, and creates some new files.
>
>My problem is that all print commands are directed to the browser. using
>CGI.pm, which uses the print "Content-type:text/html\n\n"; statement.
>How do I revoke this?


<SNIP>
Isn't the main thing here that CGI is about redirecting STDOUT to the
browser.
So you can't have STDOUT going to a terminal (?).

My hacky solution would be to put 'warn' statements in and look at the
error_log with a "tail -f"
(assuming its apache on unix/linux).

What about writing data to a logfile of your own and doing a tail -f on
that?
(I suppose if your filenames are predictable you could just look at them)

[Answer is more off topic than I thought it would be]




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

Date: Thu, 14 Sep 2000 07:59:20 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: print and CGI scripts
Message-Id: <slrn8s122m.5sc.tim@degree.ath.cx>

Dave O'Brien <david.obrien@ssmb.com.au> wrote:
> "Godzilla!" wrote:
  [ snip ]
> 
> I'm not trolling. honestly.

No, that's her job, Dave.

Actually, I'm not aware of any simple way to print to the terminal in a
CGI script.  That's how CGI works: data going to STDOUT filehandle
(which is often the terminal screen) is redirected to the browser.

The line 'Content-type: text/...\n' isn't a directive to anything but
the client's browser.  You don't "turn it off" or any such thing.  To
write to a filehandle other than STDOUT, you need to specify the
filehandle in the print command:

	print MY_FILE $data;

It appears you did this, and I can't find where your error is in the
code you posted.  If you'd like to post (or just send via email) the
entire script, I can take a look at it.

HTH,
-- 
-Tim Hammerquist <timmy@cpan.org>

Big egos are big shields for lots of empty space.
	-- Diana Black


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

Date: Thu, 14 Sep 2000 09:26:56 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: print and CGI scripts
Message-Id: <39C08BD0.D35B6BAA@yahoo.co.uk>

Dave O'Brien wrote:

> This seems like a simple proble, but I can't find any doco on it.
>
> I am writing a CGI script that takes some user settings, and then then
> processes, and creates some new files.

<snipped>

> All I want to do, is temporarily redirect
> print statements back to the terminal, and not the browser.

But which terminal? Your CGI-processing webserver is presumely running as a
daemon, and by definition daemons have no associated terminal.

Give us an example (and ignore Godzilla)
---
Nick



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

Date: Thu, 14 Sep 2000 10:42:19 +0100
From: Tom Fotheringham <tom@hughesmedia.co.uk>
Subject: Problem with refresh
Message-Id: <39C09D7B.E195BE6B@hughesmedia.co.uk>

If I make a from, the user enters the data, then if they keep refreshing
the page created by the script that accepts the form, it keeps
re-entering the form.

How can I redirect the user to a different page after the data has been
accepted?

Any help or pointers would be gratefully recieved.
Thanks ,
TOM



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

Date: Thu, 14 Sep 2000 08:11:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <cs11ssgp4bi3ndrs1738tahejoch7c3ci0@4ax.com>

Ilmari Karonen wrote:

>The knowledge that interpolated arrays
>are joined by $" while the arguments to print() are joined by $, isn't
>really doing anything for me except taking up space in my mind.

It's in the front of my mind. I use these all the time. And, of course,
the mnemonics help.

Although, I think that if you'd say that they use a different special
variable to stick between the items, that could be considered correct,
even if you forgot their names.

-- 
	Bart.


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

Date: Thu, 14 Sep 2000 08:18:49 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <7d21sskkio0e69qcodsq01bbrh6a60klkl@4ax.com>

Godzilla! wrote:

>Write an imaginative and creative Perl script with a minimum
>of five-hundred lines

I have rarely ever written a Perl script of over 500 lines. I can do
some pretty amazing stuff in under 200 lines.

-- 
	Bart.


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

Date: Thu, 14 Sep 2000 08:49:28 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <si0w5.442$WSlb.6750332@news.xtra.co.nz>

I was shocked! How could Bart Lateur <bart.lateur@skynet.be>
say such a terrible thing:
>Godzilla! wrote:
>
>>Write an imaginative and creative Perl script with a minimum
>>of five-hundred lines
>
>I have rarely ever written a Perl script of over 500 lines. I can do
>some pretty amazing stuff in under 200 lines.

My longest perl script is all of 523 lines and that has taken me over a
year of loving craft to get it to that state. Lines of code is not
something you want to get into a <body-part> size war over though.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
One of the most adventurous things left us is to go to bed. For no one
can lay a hand on our dreams.
-E. V. Lucas, "365 Days and One More"


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

Date: Thu, 14 Sep 2000 09:48:01 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <8pq6sd$6e1$1@nnrp1.deja.com>

In article <m3em2nu9n3.fsf@solo.david-steuber.com>,
  David Steuber <nospam@david-steuber.com> wrote:
> Brendon Caligari <bcaligari@my-deja.com> writes:
>
> ' Doh....I think any self-respecting programmer does end up with a
> ' portfolio of programs/modules/whatever which he could very well
present
> ' at an interview....just like designers/etc.  It's stupid asking
some 27
> ' year old programmer, with a couple of degrees, and years of
experience
> ' to sit for an exam....but then again..what do you expect from a
> ' headmistress.
>
> A code portfolio is a nice idea.  Of course, it only works when you
> are allowed to take the code home with you and keep it.  That has not
> been an option for me in the past when working for others.  I can only
> show off the code I wrote for fun.
>
> I did my own base64 decoder in C myself.  I don't have it on hand
> because I did it for a company that wouldn't let me take code home
> with me.

I've learnt..maybe the hard way...that employers give you some money
and you give them a piece of mind.  however, the master copy...the idea
behind a solution would still be in your mind...and that nobody can
take a way :)

Whenever I worked on something I'm proud of whose source code I
couldn't keep, I tend to write it down in my 'projects' resume...even
just to keep track of what I'm done....especially when trying to sell
myself.  Many problems I cracked on a job I ended up re-coding more
generically for myself too.  Case in point was years ago..wrote a
terminal emulator (ansi) for integration into a program that dialled an
online service.  The program was coded in turbo pascal.  Re-wrote the
emulator in C, and it got me a small contract for some similar work :)

>
> There are times when you may well want to do somthing that n other
> people have done already.  Just for fun.  Maybe to learn how the
> language makes you think about a problem.  There is nothing wrong with
> that at all.
>
> There are other times when you need to get some task done in the
> shortest possible time frame.  Then you have to weigh the time it
> takes to build your own wheel or learn to use an existing wheel.  I
> will generally follow the path of least resistance.  At least, the
> path that I think will have the least resistance.

Agree 100%  I'd use grep piped into awk if i can get something done in
a second.  One of these days I want to write a few scripts to access a
web server without using modules etc.  However, when I needed to get an
share price table, and send the prices to a few mail addresses, i used
lwp.  :)

>
> When it comes to programming, there is more than just the language.
> If you pick up a dictionary, you can pretty quickly learn to speak
> gibberish in the language for which that dictionary was written.
> Learning to write poetry in that language takes longer.  However, many
> forms of poetry have similar constructs like rime and meter.  In
> programming you have algorithms and data.  It's Wirth's famous
> equation.  If you don't understand the fundamentals of algorithms and
> data, then it really doesn't matter if you have memorized the special
> variables in Perl or all the key words and libraries.  None of it will
> do you any good because you will only be able to speak gibberish, not
> poetry.

upsetting was a book review i saw when hunting for perl books a few
months ago.  the review said that the book teaches perl even if you
don';t have any programming experience.

I'll shoot the next guy I meet who'll say that he wants to learn
programming and is therefore going to learn perl, vb, c..whatever.
Come across too many so called programmers, who have no idea what
something as basic as recursion is.

>
> A good programmer can get a job done in just about any language.  A
> bad programmer can't get anything done in any language.

A good programmer will give you a solution that will work for all the
problem space.  A bad programmer will give you a vb program for which
there exists scenarios for whcih the expected results are returned.

Brendon
++++


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


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

Date: 14 Sep 2000 07:38:06 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <slrn8s100t.ku0.abigail@alexandra.foad.org>

Tim Hammerquist (tim@degree.ath.cx) wrote on MMDLXXI September MCMXCIII
in <URL:news:slrn8s0tfu.4t8.tim@degree.ath.cx>:
][ 
][ Because I like occasional vacations into a delusional world where my
][ opinion or preference means more than the next persons, I'll tell you
][ what I use in order of preference:
][ 
][ Unix/Linux:
][ 	vim		( http://www.vim.org )
][ 	nvi, vile, or vanilla vi
][ 	pico
][ 	emacs
][ On Win32:
][ 	Win32 port of vim	( http://www.vim.org )
][ 	UltraEdit-32		( http://www.ultraedit.com ; ~US$30 )
][ 	Homesite 4.x		( http://www.allaire.com ; ~US$90 )
][ 	Notepad


That's quite a range of editors! My use is far more limited:

Unix:   vile
        vi
        ed

Wind32: I don't do Windows. ;-)



Abigail
-- 
BEGIN {my $x = "Knuth heals rare project\n";
       $^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
       $y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;


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

Date: Thu, 14 Sep 2000 07:50:14 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: Req.: The perfect Perl Editor?
Message-Id: <slrn8s11hk.5sc.tim@degree.ath.cx>

Abigail <abigail@foad.org> wrote:
> Tim Hammerquist (tim@degree.ath.cx) wrote
> ][ I'll tell you what I use in order of preference:
> ][ 
> ][ Unix/Linux:
> ][ 	vim		( http://www.vim.org )
> ][ 	nvi, vile, or vanilla vi
> ][ 	pico
> ][ 	emacs
> ][ On Win32:
> ][ 	Win32 port of vim	( http://www.vim.org )
> ][ 	UltraEdit-32		( http://www.ultraedit.com ; ~US$30 )
> ][ 	Homesite 4.x		( http://www.allaire.com ; ~US$90 )
> ][ 	Notepad
> 
> That's quite a range of editors! My use is far more limited:
> 
> Unix:   vile
>         vi
>         ed
> 
> Wind32: I don't do Windows. ;-)

Well, I had to use something before my life was greatly improved by
linux.  And when I do get stuck on Windows (clients' putas, usually), I
like to use something.

Plus, I like to try everything at least once.  Those are just the
editors in which I program effectively, not necessarily that I use on a
regular basis.

-- 
-Tim Hammerquist <timmy@cpan.org>
The great tragedy of Science -- the slaying
of a beautiful hypothesis by an ugly fact.
	-- Thomas Henry Huxley


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

Date: Thu, 14 Sep 2000 09:26:38 +0100
From: Alex Turner <alex.turner@enformatica.com>
Subject: Re: select and sysread
Message-Id: <39C08BBE.96C2CA83@enformatica.com>

sysread should not be mixed with standard IO.  sysread and syswrite bypass
a lot of what <> read and write (etc.) do.

Anyhow - the Perl Cookbook is very very good for explaining this sort of
thing (O'Rielly).

AJ

Alexander J Turner

CTO Enformedia.com www.enformedia.com

kj0 wrote:

> I find the documentation for select and sysread in the camel book very
> unclear.  Where can I find an example that uses both (select to find a
> file descriptor from which to read and sysread to read from it)?
>
> (I should add that my code works OK if I ignore the camel book's
> unequivocal warning against mixing select and < >.  But if I heed the
> warning and use sysread instead of < > my code hangs.)
>
> Thanks,
>
> KJ



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

Date: Thu, 14 Sep 2000 08:52:08 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: slick way to look at array?
Message-Id: <Yk0w5.443$WSlb.6684826@news.xtra.co.nz>

I was shocked! How could Larry Rosler <lr@hpl.hp.com>
say such a terrible thing:
>In article <8ppbrh$ic$1@brokaw.wa.com>, lauren_smith13@hotmail.com 
>says...
>> 
>> Damian Conway <damian@cs.monash.edu.au> wrote in message
>> news:8pp9im$d6u$1@towncrier.cc.monash.edu.au...
>> > use Quantum::Superpositions;
>> > $answer = any("tt Admin", "Admin", "tt Assign") eq any(@groups);
>> 
>> Wow!  O(1)!  You can't beat that!
>
>But what is the multiplier?

That depends on the computer

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
"Do you cheat on your wife?" asked the psychiatrist.

"Who else?" answered the patient.


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

Date: Thu, 14 Sep 2000 09:00:05 GMT
From: atthestudio@my-deja.com
Subject: Re: slick way to look at array?
Message-Id: <8pq42f$3bq$1@nnrp1.deja.com>

Hows this...
$answer = ( join(":",@groups) =~ m/(tt Admin|Admin|tt Assign) );

>
> What is a slick way to do the following (one liner perferred):
>
> $answer = Is ("tt Admin" or "Admin" or "tt Assign") in @groups ?
>


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


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

Date: 14 Sep 2000 09:47:51 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: slick way to look at array?
Message-Id: <968923820.24801@itz.pp.sci.fi>

In article <39BF877C.EAEA3368@atgi.net>, Cynthia Rossbach wrote:
>What is a slick way to do the following (one liner perferred):
>$answer = Is ("tt Admin" or "Admin" or "tt Assign") in @groups ?

$answer=grep$_,@{{map+($_,1),@groups}}{'tt Admin','Admin','tt Assign'};

This solution should be O(n+m).  Of course, if you want to do this
more than once, you should consider a permanent hash.

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla  | "By promoting postconditions to
and its pseudonyms -    |  preconditions, algorithms become
do not feed the troll.  |  remarkably simple."  -- Abigail



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

Date: Thu, 14 Sep 2000 09:04:40 +0100
From: "David Hugh-Jones" <news@dash2.uklinux.net>
Subject: sprintf() rounding problem
Message-Id: <39c08734$1@news.telinco.net>

Hi,

I am developing a program which has to add Value Added Tax to an order at
17.5%. I do this roughly as follows:

$tax=17.5;
$value=57;                                 # (for example )
$value+=$value*$tax*0.01;       # tax is a percentage
$value = sprintf(%.2f,$value);     # to convert $value to the nearest penny

My problem is that sprintf doesn't round the numbers correctly. E.g. for
this instance, $value is 66.975 after line 3. This should round to 66.98,
but in fact the fourth line outputs 66.97.

Could anyone tell me what I am doing wrong and how to put it right? I have
looked at the sprintf() entry in the perlfunc man page, and also the sprintf
man(3) page, but with no success.

Thanks very much. Replies to davidhj@mail.com will be gratefully accepted!

Dave





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

Date: Thu, 14 Sep 2000 10:34:35 +0300
From: "Elisa Roselli" <e.roselli@volusoft.com>
Subject: Re: sprintf() rounding problem
Message-Id: <8pq2qr$il8$1@wanadoo.fr>


David Hugh-Jones a écrit dans le message <39c08734$1@news.telinco.net>...

>Could anyone tell me what I am doing wrong and how to put it right? I have
>looked at the sprintf() entry in the perlfunc man page, and also the
sprintf
>man(3) page, but with no success.


I'm pretty shaky and willing to be corrected, but isn't your sprintf
function just a means of formatting text, rather than of doing maths
calculations? So perhaps it just lops your digit string after the given
number of decimal places? In which case you might have to write yourself a
short rounding routine?

I guess this would read down to the third digit after the decimal place in
your VAT result, test whether this was greater than five, increment the
second digit after the decimal if the test proved true, and lop off the
rest. Hard to believe it doesn't already exist, though.

On the other hand, see Tim Conrow's reply to "Perl substraction weird
result", posted on the 12th.

Elisa Francesca Roselli




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

Date: Tue, 12 Sep 2000 23:53:59 GMT
From: JanewaysDream@StarTrekmail.com (janeways dream)
Subject: storing HASH in HASH in DB_File ??
Message-Id: <39bec051.30063458@news.connect.ab.ca>

on PERSONAL WEB SERVER, running ACTIVE STATE PERL

neither "tie" or "dbmopen" methods are SUCCESSFUL at storing/
and then RETRIEVING HASHES WITHIN HASHES again....

my scripts WORK during the intitialization of the dbm's ie.
	dbmopen(%d2, "$thebase", 0666);
	$d2{'flinstones'}{'lead'} = 'fred';
	$d2{'flinstones'}{'wife'} = 'wilma';
	$d2{'flinstones'}{'son'} = 'bambam';
etc.,,

and they print BACK okay in the SAME SCRIPT ie.
	print "the flinstones wife is named
$d4{'flinstones'}{'wife'}<br>\n";
	print "the flinstones kid is named
$d4{'flinstones'}{'son'}<br>\n";
etc.,,,

HOWEVER when a different script tries to
READ FROM THE db which ACTUALLY
does get created,... IT CANNOT EXTRACT
any DATA!!!

I've tried those fancy =>, ],}, and all syntaxes
they dont work either !  

any resources/references to Multidimensional Associative Array DBM
storge?

Thanks,
Wayne,
Edmonton, Canada.



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

Date: 14 Sep 2000 07:21:01 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: transliterating file names in a dir
Message-Id: <968915309.21254@itz.pp.sci.fi>

In article <m3wvgfdbrw.fsf@dhcp11-177.support.tivoli.com>, Ren Maddox wrote:
>pault4282@my-deja.com writes:
>> I have been using opendir and glob and foreach tr =~ A-Z/a-z/-/c but
>> nothing seems to work.  I recieve an error: transliteration pattern not
>> terminated.  Any suggestions?

The original problem, of course, is that the transliteration pattern
is, as the error message says, not terminated.  In fact, it's fucked
up in just about every other way I can think of too.  The tokens are
more or less there, but they appear to have been shuffled randomly.


>The original camel book had a script called "rename" that would apply
>arbitrary perl code to filenames.  You would use it like:
>
>$ rename 'tr/A-Z /a-z-/' *

Well, here's a quick rewrite:

  #!/usr/bin/perl -w
  use strict;
  die "Usage: rename <code> [<file> ...]\n" unless @ARGV;

  eval 'for (@ARGV) {my $orig = $_; '.shift().
       '; rename $orig, $_ if $orig ne $_;}';

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla  | "By promoting postconditions to
and its pseudonyms -    |  preconditions, algorithms become
do not feed the troll.  |  remarkably simple."  -- Abigail



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

Date: Thu, 14 Sep 2000 07:46:51 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: XML parser in perl
Message-Id: <8f01sscffg74m46v5mfc0knskrrf9idshi@4ax.com>

poojakumari@hotmail.com wrote:

>However, as far as I can tell,
>XML::Parser uses expat, which is C code and needs to be compiled.  I
>really need a cross-platform solution

XML::Parser *is* a cross-platform solution, since it has been ported and
precompiled to most platforms that do not include a C compiler by
default. So, yes, there is a precompiled XML::Parser available for
Windows and Mac.

On a Win32 machine, XML::Parser is even a standard module because the
module installer package uses it.

-- 
	Bart.


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

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


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