[7524] in Perl-Users-Digest
Perl-Users Digest, Issue: 1151 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 9 13:17:19 1997
Date: Thu, 9 Oct 97 10:00:58 -0700
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, 9 Oct 1997 Volume: 8 Number: 1151
Today's topics:
associative array (Robert)
Re: associative array <seay@absyss.fr>
Re: Bug in split? <eike.grote@theo.phy.uni-bayreuth.de>
Re: Bug in split? <dehon_olivier@jpmorgan.com>
Re: Date::Manip Minutes return??? <rootbeer@teleport.com>
Re: Does Perl compile to bytecode internally?? <rootbeer@teleport.com>
Re: Help! I need to delete multiple lines from an HTML <rwhahn@idirect.com>
Re: Help: Form Input wo/submit or image src <rootbeer@teleport.com>
Re: HELP: perlxs C++ color example <karo@artcom.net>
Re: manifest.pm (I R A Aggie)
Re: mkdir problems <rootbeer@teleport.com>
Re: Need To Clear Screen With Perl 5...? <rootbeer@teleport.com>
OraPerl and PL/SQL Stored Procedure <skrishna@cisco.com>
Re: Perl Installation Question <seay@absyss.fr>
Perl integers bigger than I thought? But why 49? (Matija Grabnar)
Re: Please help me with this?! <chris@starkimages.com>
Re: Please help me with this?! <chris@starkimages.com>
Re: Please help! <rootbeer@teleport.com>
Re: Problem with script in LLama book <usenet-tag@qz.little-neck.ny.us>
Re: Q: hash key confusion <rootbeer@teleport.com>
Re: Q: how to specify how many decimals a calcultaion s (Mick Farmer)
Re: Question: File locking (Tad McClellan)
Saving "on-the-fly" built form (Pavel V. Mizenin)
SGI XSUB and C++ <karo@artcom.net>
Re: Sprintf leak in HP-UX Perl 5.004!?! (M.J.T. Guy)
Re: Syntax <barnett@houston.Geco-Prakla.slb.com>
Re: Text formatting question <barnett@houston.Geco-Prakla.slb.com>
writing a simple proxy <smajer@advance-bank.de>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 09 Oct 1997 16:05:58 GMT
From: colte@hem.passagen.se (Robert)
Subject: associative array
Message-Id: <343cfee1.21652982@news.hogia.net>
I have all the variables from a form in %input
I want to replace all occurances of the scandinavian
characters edv with the appropriate html-code.
I've been trying something like this but no success so far.
@input = join("|", %input);
foreach $varde (%input) {
$varde =~ s/e/å/g;
$varde =~ s/E/Å/g;
$varde =~ s/d/ä/g;
$varde =~ s/D/Ä/g;
$varde =~ s/v/ö/g;
$varde =~ s/V/Ö/g;
%input = split(/\|/, @input);
And then I write the following code to get the variables
from %input.
($rubrik = $input{'rubrik'}) =~ s/\n/\n<BR>/g;
($info = $input{'info'}) =~ s/\n/<BR>/g;
But It doesn't work. Could anyone give me any advice ?
Is there a better way to do this ? (dumb question!)
Thanks
Robert
------------------------------
Date: Thu, 09 Oct 1997 18:22:41 +0200
From: Doug Seay <seay@absyss.fr>
To: Robert <colte@hem.passagen.se>
Subject: Re: associative array
Message-Id: <343D04D1.2A26D597@absyss.fr>
[posted and mailed]
Robert wrote:
>
> I have all the variables from a form in %input
> I want to replace all occurances of the scandinavian
> characters edv with the appropriate html-code.
> I've been trying something like this but no success so far.
>
> @input = join("|", %input);
> foreach $varde (%input) {
^^^ should be @ for a @list, not a %hash
Try "-w" and "use strict" to let perl find your syntax errors for you.
> $varde =~ s/e/å/g;
> $varde =~ s/E/Å/g;
> $varde =~ s/d/ä/g;
> $varde =~ s/D/Ä/g;
> $varde =~ s/v/ö/g;
> $varde =~ s/V/Ö/g;
> %input = split(/\|/, @input);
I don't think that this line does what you want it to do. But first you
should tell us what you think it does.
> And then I write the following code to get the variables
> from %input.
>
> ($rubrik = $input{'rubrik'}) =~ s/\n/\n<BR>/g;
> ($info = $input{'info'}) =~ s/\n/<BR>/g;
>
> But It doesn't work. Could anyone give me any advice ?
> Is there a better way to do this ? (dumb question!)
What do you mean "it doesn't work"? What do you expect? Not that the
transformation of $rubrik adds a <BR> after \n and $info replaces a \n
with a <BR>. Not at all the same thing for the two variables.
- doug
------------------------------
Date: Thu, 09 Oct 1997 16:43:00 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Bug in split?
Message-Id: <343CED74.ABD@theo.phy.uni-bayreuth.de>
Hi,
Gary Howland wrote:
>
> I want to split a string, containing a pair of numbers, seperated by a
> non-digit. I thought this would work:
>
> split("\D", "123-456");
^ ^
use slashes ('/') here
Bye, Eike
--
=======================================================================
>>--->> Eike Grote <eike.grote@theo.phy.uni-bayreuth.de> <<---<<
-----------------------------------------------------------------------
Home Page, Address, PGP,...: http://www.phy.uni-bayreuth.de/~btpa25/
-----------------------------------------------------------------------
PGP fingerprint: 1F F4 AB CF 1B 5F 4B 1D 75 A1 F9 C5 7B 3F 37 06
=======================================================================
------------------------------
Date: 09 Oct 1997 17:36:18 +0200
From: Olivier Dehon <dehon_olivier@jpmorgan.com>
Subject: Re: Bug in split?
Message-Id: <njz4t6rc5jh.fsf@jpmorgan.com>
Gary Howland <ghowland@hotlava.com> writes:
> I want to split a string, containing a pair of numbers, seperated by a
> non-digit. I thought this would work:
>
> split("\D", "123-456");
>
> but it doesn't - it gives ("123-456"), not ("123", "456).
>
> Am I correct in thinking that \D should let me do this?
>
> Gary
>From the perlfunc manpage, split takes a /PATTERN/ as an argument, that
is, you should rewrite your code as :
@array = split /\D/, '123-456';
You can make sure that split produces a 2-element list by using :
@array = split /\D/, '123-456', 2;
And if you want doublequotes around the \D :
@array = split m"\D", '123-456', 2;
works too.
Hope this helps.
Olivier Dehon
------------------------------
Date: Thu, 9 Oct 1997 07:56:26 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: rlindner@lse.fullfeed.com
Subject: Re: Date::Manip Minutes return???
Message-Id: <Pine.GSO.3.96.971009075543.23840J-100000@usertest.teleport.com>
On Wed, 8 Oct 1997 rlindner@lse.fullfeed.com wrote:
> What I'm wondering is how can I display that value in hours alone? As
> in 1,232,234 hours.
Can you convert the value to seconds and then divide by 3600? Hope this
helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 9 Oct 1997 08:10:43 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Eric <pojo@gte.net>
Subject: Re: Does Perl compile to bytecode internally??
Message-Id: <Pine.GSO.3.96.971009080836.23840L-100000@usertest.teleport.com>
On 8 Oct 1997, Eric wrote:
> Does PERL compile a program to bytecode internally before executing?
Yup.
> Does it compile all included modules (PMs) that are specified? --
Every module is compiled as it is 'use'd or 'require'd. (That is, use
normally happens at compile time, and require normally happens at runtime.
But either way, a module is compiled just once.)
> Can this bytecode be exported?
>
> Can it be run by a "barebones" perl interpreter? (no PM files)
That's one of the modes of the (not-quite-yet-ready) compiler, more or
less. :-) Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 09 Oct 1997 11:24:54 -0400
From: Robert Hahn <rwhahn@idirect.com>
Subject: Re: Help! I need to delete multiple lines from an HTML page
Message-Id: <343CF740.3964CAFE@idirect.com>
I solved the problem. This posting contains the code for it, and should be
useful for anyone who is also in this situation. I'm sure TMTOWTDI, but my
approach is influenced by a background in JavaScript and (if I really reach
back) 8-bit BASIC.
To sum up:
The problem:
Say you want to create a "classified ad" page that you can maintain the easy
way. Putting up an ad is very easy - just write something up (or use) Matt
Wright's Guestbook script.
Now, as ads become old, you'd want an easy way to delete the ad. Now, further
suppose the ad was several lines long.
The solution:
"Tag" the ad in your HTML file so that it is preceeded by, and followed by, an
identifying comment (say, the date the ad was posted) so:
...
<!--adDate-->
ad goes here
ad goes here
ad goes here
<!--adDate-->
...
now, create a form that allows you to pick which ad you want to delete, and
submit adDate (I chose a value of "<!--adDate-->" instead - same difference)
Send it to this (mostly complete) program:
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
# Begin the Editing of the Resale File
open (FILE,"$resalereal") || die "Can't Open $resalereal: $!\n";
@LINES=<FILE>;
close(FILE);
$SIZE=@LINES;
$PVAL = "$FORM{address}";
#set a flag variable
$TAG = 0;
# Open File for deleting a listing
open (RESALE,">$resalereal") || die "Can't Open $resalereal: $!\n";
for ($i=0;$i<=$SIZE;$i++) {
$_=$LINES[$i];
if (/$PVAL/){
# flip the value of the flag and print nothing
$TAG = abs ($TAG-1);
print RESALE " ";
}
elsif ($TAG==1) {
print RESALE " ";
}
else {
print RESALE $_;
}
}
close (RESALE);
I hope this code is useful for you.
If anyone can come up with a better way to do it (my previous example tried to
match multiple lines of code like this: m/$PVAL .*? $PVAL/s, I would like to
see it.
Regards,
Rob
------------------------------
Date: Thu, 9 Oct 1997 07:55:14 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Chuck <cstewart@flash.net>
Subject: Re: Help: Form Input wo/submit or image src
Message-Id: <Pine.GSO.3.96.971009075334.23840I-100000@usertest.teleport.com>
On Wed, 8 Oct 1997, Chuck wrote:
> Is there a way to initiate submit at form posting without using submit
> or image src?
If there's a way to do this, it should be documented in the docs and FAQs
for HTML or a browser, or maybe in the CGI spec. If you can't find the
answer you need in any of those docs and FAQs, check with a newsgroup
about HTML or browsers, or maybe about the CGI. They'll be able to give
you a better and more complete than we can here. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 09 Oct 1997 17:27:12 +0200
From: Benjamin Pannier <karo@artcom.net>
Subject: Re: HELP: perlxs C++ color example
Message-Id: <343CF7D0.103A9D2F@artcom.net>
reece@dasher.wustl.edu wrote:
>
> I'd appreciate any useful tips and C++/perlxs examples. Thanks!
> Reece
Well, i`ve done it 10 minutes ago. I had have the same heavy problems.
The perlxs documentations is very rarly on that problem.
Ok I give you my working example:
Makefile.PL:
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Objects',
'VERSION_FROM' => 'Objects.pm', # finds $VERSION
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
'INC' => '', # e.g., '-I/usr/include/other'
'CC' => 'CC -n32',
'LD' => 'CC',
);
myObject.h:
class myObject {
private:
int _value;
public:
myObject() {
printf("myObject: Constructor\n");
}
~myObject() {
printf("myObject: Destructor\n");
}
void setValue(int value) {
printf("myObject: setValue(%d)\n", value);
_value = value;
}
int getValue(void) {
printf("myObject: getValue() = %d\n", _value);
return(_value);
}
};
Object.xs:
// -*- mode: c++ -*-
extern "C" {
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
}
#include "myObject.h"
MODULE = Objects PACKAGE = myObject
myObject *
myObject::new()
void
myObject::DESTROY()
void
myObject::setValue(value)
int value
int
myObject::getValue()
typemap:
TYPEMAP
myObject * O_OBJECT
OUTPUT
# The Perl object is blessed into 'CLASS', which should be a
# char* having the name of the package for the blessing.
O_OBJECT
sv_setref_pv( $arg, CLASS, (void*)$var );
INPUT
O_OBJECT
if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) )
$var = ($type)SvIV((SV*)SvRV( $arg ));
else{
warn( \"${Package}::$func_name() -- $var is not a
blessed SV reference\" );
XSRETURN_UNDEF;
}
test.pl:
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
######################### We start with some black magic to print on
failure.
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
BEGIN { $| = 1; print "1..4\n"; }
END {print "not ok 1\n" unless $loaded;}
use Objects;
$loaded = 1;
print "ok 1\n";
######################### End of black magic.
# Insert your test code below (better if it prints "ok 13"
# (correspondingly "not ok 13") depending on the success of chunk 13
# of the test code):
$object = new myObject;
print "ok 2\n";
$object->setValue(23);
print "ok 3\n";
$ret = $object->getValue();
print "ok if value eq 23: $ret\n";
hope that helps,
-karo
--
__/__/__/\ Benjamin Pannier,ART+COM GmbH,BudapesterStr44,D-10787Berlin
__/__/__/\/ Tel:(+49-30)25417-3 Fax:(+49-30)25417-555
__/__/__/\/ Email:karo@artcom.net WWW:http://www.artcom.net/~karo/
__\__\__\/ Email:karo@artcom.org me@karo.org i.am@ka.ro karo@artcom.de
------------------------------
Date: Thu, 09 Oct 1997 11:24:46 -0400
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: manifest.pm
Message-Id: <-0910971124470001@aggie.coaps.fsu.edu>
In article <01bcd451$82f735d0$491dd8ce@sea-ws0093>, "Aaron Couch"
<acouch@activevoice.com> wrote:
+ does anyone know specifically where to find this file???
+ i can't find it anywhere.
Try: "perldoc manifest", which sent me back:
NAME
ExtUtils::Manifest - utilities to write and check a MANIFEST
file
James
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Thu, 9 Oct 1997 08:11:27 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Barry Neville <Barry@exclaim.demon.co.uk>
Subject: Re: mkdir problems
Message-Id: <Pine.GSO.3.96.971009081059.23840M-100000@usertest.teleport.com>
On Wed, 8 Oct 1997, Barry Neville wrote:
> I'm getting some crazy results from the Perl mkdir function running on a
> Solaris 2.5 machine. The resulting permissions I'm getting seem almost
> random. Can anyone shed some light?
Got octal? :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 9 Oct 1997 08:05:32 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Todd Carlton <todd@pca.net>
Subject: Re: Need To Clear Screen With Perl 5...?
Message-Id: <Pine.GSO.3.96.971009075638.23840K-100000@usertest.teleport.com>
On 8 Oct 1997, Todd Carlton wrote:
> Any idea what the perl clear screen command is?!?!?
You might find something useful in the Curses module.
> (2) I wrote a script that outputs to a browser. I need it to auto-update
> every two seconds without having to click the reload button.
If there's a way to get the browser to keep calling your script, it should
be documented in the specs for HTTP, HTML, CGI, or your browser. If you
can't find that information in those docs and FAQs, try asking in one of
the newsgroups on those topics. Those methods should give you a better and
more complete answer than we can give you here. Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 9 Oct 1997 08:53:06 -0700
From: SRIDHAR KRISHNAN <skrishna@cisco.com>
Subject: OraPerl and PL/SQL Stored Procedure
Message-Id: <Pine.HPP.3.95.971009085059.17162H-100000@lint.cisco.com>
>From skrishna@cisco_deletethis.com Thu Oct 9 08:50:41 1997
Date: Wed, 8 Oct 1997 12:22:59 -0700
From: sk <skrishna@cisco_deletethis.com>
Newsgroups: comp.databases.oracle.tools, comp.databases.oracle.misc,
comp.lang.perl.misc
Subject: Oraperl - PL/SQL Question
I am running into a problem returning OUT parameters from a PL/SQL stored
procedure. Although the procedure is exec'ing (I verified it by logging
into a table), the output argument is not getting set in perl.
I am pre-assigning values to the output variable. Here is a mock up code.
#!/usr/local/bin/perl5
use Oraperl;
$ENV{ORACLE_HOME} = ...
.
.
.
$in_var = 'A';
$out_var = 'X';
$csr = &ora_open ($lda, <<EOQ) ;
BEGIN
PROC1 (:1, :2);
END;
EOQ
&ora_bind($csr, $in_var, $out_var);
print $out_var, "\n";
&ora_close($csr);
-----------------------------------------------------------
PROCEDURE PROC1( in_var IN varchar2, out_var OUT varchar2)
IS
BEGIN
out_var := in_var;
END ;
----------------------------------------------------------
Any suggestions ?
Sridhar
------------------------------
Date: Thu, 09 Oct 1997 17:00:34 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: Perl Installation Question
Message-Id: <343CF192.232CBF77@absyss.fr>
Tom Phoenix wrote:
>
> On Wed, 8 Oct 1997, delazzer wrote:
>
> > A friend gave me a tar file that has Perl 5.004_03. The Perl web page
> > says 5.004_01 is the latest version. Is 5.004_03 the latest or is
> > 5.004_01?
>
> _01 is the latest released version; _03 has not been officially released
> (as I understand things). For most people, there's no real difference
> between the two; just a few bug fixes for things you're not likely to
> notice. :-)
Uhh, what happened to _02? Is there an even/odd convention I'm not
aware of, or was it quickly obsoleted by bug fixes in _03?
- doug
------------------------------
Date: 9 Oct 1997 15:21:16 GMT
From: matija@arnes.si (Matija Grabnar)
Subject: Perl integers bigger than I thought? But why 49?
Message-Id: <61ispc$53n$1@kanja.arnes.si>
I have an applications which has to operate with realy big numbers.
(Usenet traffic - 'nuff said).
Anyway: I expected that the integers would roll over at 2**31 or at
2**32. However, I was surprised when I saw this:
perl -e 'foreach (32..50) { print "$_ ".2**$_."\n";}'
32 4294967296
33 8589934592
34 17179869184
35 34359738368
36 68719476736
37 137438953472
38 274877906944
39 549755813888
40 1099511627776
41 2199023255552
42 4398046511104
43 8796093022208
44 17592186044416
45 35184372088832
46 70368744177664
47 140737488355328
48 281474976710656
49 562949953421312
50 1.12589990684262e+15
I am happy that the integers don't roll over (or convert to float) when
they reach 32 bits, but why does it convert to float after 49 bits?
Why not at 2**32+1 or at 2*64+1?
FWIW this is perl5.004_03 on SunOS nanos 5.5.1
--
"My name is Not Important. Not to friends.
But you can call me mr. Important" - Not J. Important
Matija.Grabnar@arnes.si
------------------------------
Date: Thu, 09 Oct 1997 11:12:15 -0500
From: Chris Schmidt <chris@starkimages.com>
Subject: Re: Please help me with this?!
Message-Id: <343D025E.4C6A744@starkimages.com>
Andrew Collington wrote:
> Hi.
>
> I have just bought the book "Using Perl 5 for Web Programming" and I'm
> having a little trouble with some of the code, although I have copied it
> straight out of the book.
>
> The bits of code I'm having porblems with go along the lines of:
>
> $words=[td]s/[^\w-' ]//g;
> if (!($dirs[$list]=[td]/temp/)) { do something... }
>
> Now, I understand what these do, but what is the [td] bit meant to do? I
> have tried running the code but it just gives me errors (it doesn't if I
> remove the [td] though!)
>
> Can anyone help with this?
> I'm using perl 5.0001 (or is that .001? I cannot remember of the top of
> my head, but it's version 5 anyways ;)
>
> Thanks for any help!
>
> Andy
[td] means ~
------------------------------
Date: Thu, 09 Oct 1997 11:12:32 -0500
From: Chris Schmidt <chris@starkimages.com>
Subject: Re: Please help me with this?!
Message-Id: <343D0270.92354759@starkimages.com>
Andrew Collington wrote:
> Hi.
>
> I have just bought the book "Using Perl 5 for Web Programming" and I'm
> having a little trouble with some of the code, although I have copied it
> straight out of the book.
>
> The bits of code I'm having porblems with go along the lines of:
>
> $words=[td]s/[^\w-' ]//g;
> if (!($dirs[$list]=[td]/temp/)) { do something... }
>
> Now, I understand what these do, but what is the [td] bit meant to do? I
> have tried running the code but it just gives me errors (it doesn't if I
> remove the [td] though!)
>
> Can anyone help with this?
> I'm using perl 5.0001 (or is that .001? I cannot remember of the top of
> my head, but it's version 5 anyways ;)
>
> Thanks for any help!
>
> Andy
[td] means ~
------------------------------
Date: Thu, 9 Oct 1997 08:17:28 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: P Chappell <user@elektra.u-net.com>
Subject: Re: Please help!
Message-Id: <Pine.GSO.3.96.971009081513.23840O-100000@usertest.teleport.com>
On Wed, 8 Oct 1997, P Chappell wrote:
> Subject: Please help!
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> Please - does anybody have any experience with Microsoft Personal Web
> Server?
If you can't find what you need in its docs and FAQs, maybe you should get
a better server - there are several good free ones out there. But if you
want to get this one (or any other browser) working, check in the docs and
FAQs for a newsgroup about browsers. That will give you a better and more
complete answer than we can give you here. Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 9 Oct 1997 16:44:32 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Problem with script in LLama book
Message-Id: <eli$9710091231@qz.little-neck.ny.us>
Tad McClellan <tadmc@flash.net> wrote:
> brian d foy (comdog@computerdog.com) wrote:
> : >I don't have a Llama Book in front of me,
> : you don't have a copy with you at all times? ;) i know of at least
I certainly don't. I don't think I even own one. Both editions of the
Camel, yes I own, but I still don't carry them around. Course, I only
use perl recreationally and can usually wait to look up things.
> : one person that walks around with a complete set of perl man pages -
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> : didn't think to ask if he had a copy of any Perl books with him
I'd bet not. He didn't pull out one to look at the list of O'Reilly
perl titles when the question of "How many texts?" came up.
> Does he use a wheelbarrow?
No, he didn't. (Say brian, about that collective noun question:
does "a caravan of perl programmers" sound good?)
> That's what I use...
You're in Texas. Texas is a big place. You have room for such bulky
things. In New York, I've heard people say things like "It's not
crowded -- you can take a step back and not hit anyone."
Elijah
------
brian: maybe you should get the microfiche attachment for your PAA
------------------------------
Date: Thu, 9 Oct 1997 08:14:42 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Raymond Yee <yee@socrates.berkeley.edu>
Subject: Re: Q: hash key confusion
Message-Id: <Pine.GSO.3.96.971009081147.23840N-100000@usertest.teleport.com>
On 8 Oct 1997, Raymond Yee wrote:
> Please help me to understand the following construct in perl:
>
> $Test{$string1,$string2}
>
> which I found in some code that I'm studying.
That's a technique which was used in the bad old days, before we had
references in Perl. Perl joins the strings with the $; variable. These
days, we'd probably write that like this:
$Test{$string1}{$string2}
See the manpages perlref(1), perllol(1), and perldsc(1) for more info.
Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Thu, 9 Oct 1997 15:02:48 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: Q: how to specify how many decimals a calcultaion shall have?
Message-Id: <EHsHso.Js@mail2.ccs.bbk.ac.uk>
Dear Calle,
It's just the same in Perl.
$r = int($r*1000+0.5)/1000;
Regards,
Mick
------------------------------
Date: Thu, 9 Oct 1997 07:55:59 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Question: File locking
Message-Id: <v8ki16.7l2.ln@localhost>
George J. Lee (gjlee@uclink4.berkeley.edu) wrote:
: I need help with file locking. I am designing a web site for investing
So then you have, of course, already had a look at the Perl Frequently
Asked Questions list before posting, right?
Not only is that good Usenet manners, it will get you your answer
FASTER!
You could probably have had this fixed in about five minutes by
checking the FAQ.
How long did it take you to get a answer from Usenet?
A few hours?
My impatience demands that I go the five minute route ;-)
Anyway, questions concerning locking in Perl FAQ, part 5:
"How can I lock a file?"
"What can't I just open(FH, ">file.lock")?"
"I still don't get locking. I just want to increment
the number in the file. How can I do this?"
Boy! That last one sounds just like what you described...
It gives code for doing that. One of the comments in there says:
# DO NOT UNLOCK THIS UNTIL YOU CLOSE
: as a portion of the relevant code:
: open(PURCHASE, ">>$LOCK_FILE") or die "open $LOCK_FILE: $!\n";
Excellent!
You wanted to know if the open() was successful, so you checked the
return value.
A sign of good programming.
: flock(PURCHASE, 2);
Don't you want to know if the flock() succeeded though?
: &add_to_the_cart;
: flock(PURCHASE, 8);
So right here you are giving up the lock.
If your time slice expires right here, some other process can get the
file.
: exit;
Then perl flushes buffers and *closes* the file as part of its cleanup.
Note that there is some time there when you no longer have the lock,
but you still have data to write...
So, close before you give up the lock, like the FAQ comment said too...
[ close() also releases the lock, no need for an explicit flock()
call to unlock it
]
: Please reply via e-mail. Thanks.
Please read the newsgroup where you asked the question.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 9 Oct 1997 15:00:48 GMT
From: mizenin@bgnet.bgsu.edu (Pavel V. Mizenin)
Subject: Saving "on-the-fly" built form
Message-Id: <mizenin-091097105252@m251-85.bgsu.edu>
Hi,
I'm writing a form builder for quiz/survey creation. The user has a whole
host of options. Therefore, the "building" process will involve a lot of
going back and forth between the options form and the preview form. At some
point the user is content with the questionnaire and wants to save it (on
the server). Is there any way to save the entire form (html code) in a file
on the server machine without presaving it every time the user previews the
form?
thank you
Pavel Mizenin
CS/OR Dept. at BGSU
mizenin@bgnet.bgsu.edu
------------------------------
Date: Thu, 09 Oct 1997 17:19:11 +0200
From: Benjamin Pannier <karo@artcom.net>
Subject: SGI XSUB and C++
Message-Id: <343CF5EF.6C417923@artcom.net>
Just for them who want to know:
If you want to make a XS in C++ on a SGI you have to change the default
linker. The standard linker is the 'ld' but this one do not include the
C++ definitions. So change the linker to: 'CC'.
My Makefile.PL:
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Objects',
'VERSION_FROM' => 'Objects.pm', # finds $VERSION
'LIBS' => [''], # e.g., '-lm'
'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
'INC' => '', # e.g., '-I/usr/include/other'
'CC' => 'CC -n32',
'LD' => 'CC',
);
-karo
--
__/__/__/\ Benjamin Pannier,ART+COM GmbH,BudapesterStr44,D-10787Berlin
__/__/__/\/ Tel:(+49-30)25417-3 Fax:(+49-30)25417-555
__/__/__/\/ Email:karo@artcom.net WWW:http://www.artcom.net/~karo/
__\__\__\/ Email:karo@artcom.org me@karo.org i.am@ka.ro karo@artcom.de
------------------------------
Date: 9 Oct 1997 15:04:32 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Sprintf leak in HP-UX Perl 5.004!?!
Message-Id: <61irq0$ktt$1@lyra.csx.cam.ac.uk>
Brian Atkins <atkins@PROBLEM_WITH_INEWS_GATEWAY_FILE> wrote:
>I'm seeing a nasty memory growth problem using sprintf.
>Any information, fixes, whatever, would be greatly appreciated!
This bug is fixed in the as-yet unreleased perl5.004_04.
Mike Guy
------------------------------
Date: Thu, 09 Oct 1997 11:25:30 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Syntax
Message-Id: <343D057A.1954@houston.Geco-Prakla.slb.com>
Josh:
The following should work correctly:
#!/usr/local/bin/perl -w
$test = "4";
if ($test =~ /^[012xX]$/) {
print "Found it.\n";
} else {
print "Not here.\n";
}
The above code snippet results in:
"Not here."
/^[012xX]$/ searches for a line that contains one of "0, 1, 2, x, or X",
and nothing else. Make sure the variable doesn't have an imbdedded
return character (\n), or this will not work.
Hope it helps. :)
Josh wrote:
>
> How would I test to see if $test is equal to either 0 or 1 or 2 or x or
> X. Nothing else and not a combination of 2 or more.
> Thanks :)
> Josh
> josh@jersey.net
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
* Schlumberger Geco-Prakla (281) 596-1434 (Office Number) *
* 1325 S. Dairy Ashford (281) 596-1807 (Fax) *
* Houston, TX 77077 *
------------------------------------------------------------------------
------------------------------
Date: Thu, 09 Oct 1997 10:40:10 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Text formatting question
Message-Id: <343CFADA.3DD1@houston.Geco-Prakla.slb.com>
It should be as easy as setting up the FORMAT so it is something like:
@<<<<< @<<<<< ...
$Name1 $Name2 ...
@<<<<< @<<<<< ...
$Addr1 $Addr2 ...
.
.
.
Of course, you will need to have read all 5 lines before using write,
otherwise, you will get:
Name1
Address1
.
.
.
This what you wanted? :)
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
------------------------------------------------------------------------
* Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com *
* Schlumberger Geco-Prakla (281) 596-1434 (Office Number) *
* 1325 S. Dairy Ashford (281) 596-1807 (Fax) *
* Houston, TX 77077 *
------------------------------------------------------------------------
------------------------------
Date: Thu, 09 Oct 1997 18:43:02 +0100
From: Stefan Majer <smajer@advance-bank.de>
Subject: writing a simple proxy
Message-Id: <343D17A6.CBF134A7@advance-bank.de>
Hi
I just want to write a proxy for the following job:
it should act as a daemon listening to a specified port, taking incoming
connections and transport them to a other network address on the same
port,
maybe someone already did this simple job ???
suggestions welcome
mfg stefan majer
------------------------------
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 1151
**************************************