[7084] in Perl-Users-Digest
Perl-Users Digest, Issue: 709 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 8 15:17:23 1997
Date: Tue, 8 Jul 97 12:00:41 -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 Tue, 8 Jul 1997 Volume: 8 Number: 709
Today's topics:
5.003 Install Problem (Ling Hua)
Re: 5.003 Install Problem <rootbeer@teleport.com>
Re: 500 Server Error - Perl & Win 95 PWS (Abigail)
Re: alternative for 'eval' (M.J.T. Guy)
Re: Can an array have two subscripts (i.e., @array (i,j (Iap SinGuan)
Re: concantenated HTML file printing (Michael Schuerig)
concurrent dbm access? ( Martin Walsh)
delete line in file directly(fixed length record) (Pui Ming WONG)
Re: delete line in file directly(fixed length record) (Nathan V. Patwardhan)
Re: FOR QUESTION (Tung-chiang Yang)
Re: FOR QUESTION (Iap SinGuan)
Gen. a random no. (within range) (P.M.Wong )
GIF Control Blocks / Types in perl - unsigned, etc. <kortbein@dwx.com>
help!? small and easy perl script accessing a music dat <carola@music.gla.ac.uk>
High bit char in input (Honza Pazdziora)
Re: How to make the same changes to many files. (Patrick Baldwin)
Re: IF Problem (Honza Pazdziora)
Looking for a script that will build HTML from a window <guy@forte.com>
Re: multiplatform perl... <rootbeer@teleport.com>
Re: NDBM on Win32 in Perl (Parillo)
newbee Q can i use a exec comand in a web page to redi <mike@novahome.com>
Perl compilation error- Help please <manjari@bit-net.com>
Re: Perl compilation error- Help please (Nathan V. Patwardhan)
Re: Perl is 20 times slower on Cray J90 than SGI! <jheck@merck.com>
Q: Streamlining scripts for Memory performance (Tony Moran)
Re: Question: Output redirection (Even Holen)
Secure data transfers LWP? SSL? PGP? EMAIL? <chris@ixlabs.com>
Re: Shellscript -> perl (Melody Polakow)
Re: Shellscript -> perl <bat@unifi.com>
SSI's in CGI output <cliff@shawfamily.com>
Success running Calenadr on NT4.0! (Melody Polakow)
Re: system call <ajohnson@gpu.srv.ualberta.ca>
Re: Use of Win32::File and official perl5.004_01 on NT buckinm@nfric.nesusa.com
Re: Using ODBC & Ms Access with Perl for NT <jim.michael@gecm.com>
Re: Validating E-Mail addresses and URL's (Bob)
Re: Variable help please (Even Holen)
Re: Variables Question <bat@unifi.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 8 Jul 1997 15:40:25 GMT
From: hua@mary.cs.fsu.edu (Ling Hua)
Subject: 5.003 Install Problem
Message-Id: <5ptn19$o24$1@news.fsu.edu>
I tried to install perl5.003 on a UNISYS svr4, got fatal error during
make. The message is that "Can't find libperl.so.3". I saw that this file
is in the package's source directory.
This first time I used "sh Configure", the second time (after make
realclean) I added the option -des, and got the same fatal error.
Can anybody give me a clue what is going on? I did read INSTALL and
follow the instructions.
Thank you in advance.
Jun
------------------------------
Date: Tue, 8 Jul 1997 09:51:29 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ling Hua <hua@mary.cs.fsu.edu>
Subject: Re: 5.003 Install Problem
Message-Id: <Pine.GSO.3.96.970708095037.10418H-100000@kelly.teleport.com>
On 8 Jul 1997, Ling Hua wrote:
> I tried to install perl5.003 on a UNISYS svr4, got fatal error during
> make.
As long as you're installing, why not install the newest? Get 5.004 from
CPAN, and if you still have troubles installing it, then please let us
know. 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/
------------------------------
Date: Tue, 8 Jul 1997 17:56:42 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: 500 Server Error - Perl & Win 95 PWS
Message-Id: <ED0HuI.AFt@nonexistent.com>
Michael Adams (msadams@netcom.com) wrote on 1406 September 1993 in
<URL: news:msadamsECysKy.8E@netcom.com>:
++ Abigail (abigail@fnx.com) wrote:
++ : Michael Adams (msadams@netcom.com) wrote on 1404 September 1993 in
++ : <URL: news:msadamsECv9zp.FDw@netcom.com>:
++ : ++
++ : ++ It would appear that it is not loading the Perl script.
++
++ : So, it's not a Perl question. Try a more appropriate group, like
++ : rec.pets.penguins, sci.trainspotting, comp.infosystems.www.authoring.cgi,
++ : misc.test, comp.infosystems.www.servers.ms-windows or alt.tla.
++
++ I am sorry to bother you and everyone else on this Usenet with my
++ "inappropriate" questions, but I have reached a deadend. I figured if
++ anyone would know the answer it would be people on this Usenet.
"This Usenet"? How many other Usenets are there? Sure, there will be
people on Usenet knowing the answer, just as there are people on this
planet knowing the answer. But that doesn't mean your question is
appropriate in a Zairian bar. There might be more than a million people
having access to Usenet. A couple of hundreds, maybe a thousand post
in this group. Since this groups is not about servers, it's unreasonable
to assume there are relatively many people here that can answer your
question.
If you want to get out of your deadend, you need to know what the right
sources of information are. I'll give you a second hint, out of the
6 groups I mentioned, 2 might actually be useful.
++ I bought S. Sol's book over the weekend, and he mentions that the 500
++ error is a catchall, meaning that I could do a number of things and get
++ the same 500 Server Error. It is obvious that the ActiveWare Perl for
++ Win32
++ is incomplete in its installation. I would just like to get some help
++ from someone who has already gone through this.
If S. Sol's book gives the impression '500 Server Error' is a Perl
error, burn the book. Perhaps you need a camel, and you really, really
need the manuals of your server.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=$]*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 7 Jul 1997 10:36:03 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: alternative for 'eval'
Message-Id: <5pqgqj$du7@lyra.csx.cam.ac.uk>
Ted Braun <R22601@email.sps.mot.com> wrote:
>I am currently passing as arguments strings which make up part of scaler
>variable names into a subroutine and based on these arguments setting
>values of scalar variables. In order to get the actual value of these
>scalar variables I have used eval, but I see where using eval is not
>recommended for time efficiency. Is there a more efficient way to
>evaluate the results of my concated string then eval for my example
>below?
> eval "\$".$val1."p3=\$".$val2."p3;";
You want symbolic references (aka soft references). See the perlref man
page. Your eval can be replaced by
${$val1.'p3'} = ${$val2.'p3'};
And incidentally, you're getting the worst of all worlds in your use of
quotes. If you don't want variable substitution, use single quotes
so you don't need to escape characters (and Perl supplies the ";" at the
end of an eval):
eval '$'.$val1.'p3=$'.$val2.'p3';
Alternatively, use the substitution of "" strings to do the concatenation
for you, avoiding all those extra dots and quotes (but you do need the {}
to stop the "p3" being stuck onto the "val1" name):
eval "\$${val1}p3=\$${val2}p3";
And finally, you probably shouldn't be using variables like this at all.
By putting your names in a public hash (the symbol table), you are
sharing the name space with arbitrary things in the rest of the program
and run the risk of clashes. Far better is to put your names in your
own private hash. Let's call it %p3; then the above example becomes
$p3{$val1} = $p3{$val2};
It'll be more efficient like that as well as cleaner.. Also, you have
available extra functions available. For example, to get a list of all
current variables, just go keys %p3 .
Mike Guy
------------------------------
Date: 7 Jul 1997 10:40:36 GMT
From: iap@iis.sinica.edu.tw (Iap SinGuan)
Subject: Re: Can an array have two subscripts (i.e., @array (i,j))?
Message-Id: <5pqh34$p2f$1@gate.sinica.edu.tw>
In article <33C05907.9D8D343@cc.memphis.edu>, fdeng@cc.memphis.edu says...
>
>Sorry for asking a question that may be too elementary. Can an array
>have two subscripts, such as @array(i,j)? I have looked my Teach
>Yourself Perl 5 in 21 days and found no answer.
>
>Thanks for helping.
>
>Johnny
Try:
@array=([0,1],[a,b]);
print $array[1][0];
it will print 'a' for you.
I am sure that "Teach Yourself Perl 5 in 21 days" has materials about this.
But I don't know in which pages, because I don't have it in hand.
Hope it helps.
Iap SinGuan
------------------------------
Date: Tue, 8 Jul 1997 09:31:31 +0200
From: uzs90z@uni-bonn.de (Michael Schuerig)
Subject: Re: concantenated HTML file printing
Message-Id: <1997070809313116345@rhrz-ts2-p8.rhrz.uni-bonn.de>
Jesse Markham <foug@msg.ti.com> wrote:
> Was curious if anyone knew of Perl script that can grab several HTML
> files and throw them into one long file, then print them as one
> document. I have been picking up the pieces after I have inherited a
> mess of a perl script by a former colleague.
As you're using Netscape anyway (judging from the header) you might just
concatenate the files (on WinNT something like copy\b file1+file2+file3
newfile). At least on the Mac Mozilla happily chews almost any
disfigured bit of HTML you throw at it.
I suspect that in general it can always be troublesome to concatenate
HTML files regardless of how you do it. If you parse the files and only
concatenate the bodies you'll use the HEADs; if you concatenate the
complete files this might lead to strange interactions of HEADs or
JavaScripts or whatever. So I guess you'll have to try what works best
for your particular files.
Michael
--
Michael Schuerig P'rhaps he's hungry. Six volts make him smile.
mailto:uzs90z@uni-bonn.de And twelve volts would probably kill.
http://www.uni-bonn.de/~uzs90z/ -Jethro Tull, "Batteries Not Included"
------------------------------
Date: 7 Jul 1997 10:36:53 GMT
From: walsh-s@univ-rennes1.fr ( Martin Walsh)
Subject: concurrent dbm access?
Message-Id: <5pqgs5$k27$1@news.univ-rennes1.fr>
(perl novice)
Is there anyway of allowing concurrent access to a dbm or ndbm file?
------------------------------
Date: 7 Jul 1997 09:28:44 GMT
From: s11976@net2.hkbu.edu.hk (Pui Ming WONG)
Subject: delete line in file directly(fixed length record)
Message-Id: <5pqcsc$a3o$1@power42t.hkbu.edu.hk>
It's explained in the FAQ that there's no direct way of deleting
a line in a file unless a new file is used for output and then
renaming it to the old file afterwards.
BUT, it's also said something like it is POSSIBLE to do it directly
IF the file has all the lines of the same length.
Now my file consists of all 8-bytes (9 if the \n is also counted)
length records.
What exactly should my statements be if i have to say, delete the
5th record from my file directly.
--
__
/ \_/ ) __ Pui Ming WONG (E-mail: pm@hkbu.edu.hk)
/ ( ------------- } System Support Programmer
( =l=ll===============__} Computing & Telecomm. Services Centre
\ _ ( Hong Kong Baptist University
\_/ \__) 224 Warerloo Road, Hong Kong
------------------------------
Date: 7 Jul 1997 12:25:52 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: delete line in file directly(fixed length record)
Message-Id: <5pqn8g$q7p@fridge-nf0.shore.net>
Pui Ming WONG (s11976@net2.hkbu.edu.hk) wrote:
: It's explained in the FAQ that there's no direct way of deleting
: a line in a file unless a new file is used for output and then
: renaming it to the old file afterwards.
Well, you can open the file r/w (+<), then seek() to the beginning of
the file, but it's suggested that you open a backup file to work on.
I prefer skipping the line to be deleted using next.
open IN, "infile" or die("infile error: $!");
@lines = <IN>;
close(IN);
open OUT, ">outfile" or die("outfile error: $!");
for(@lines) { chop; next if $_ eq 'whatever'; print OUT $_."\n"; }
close(OUT);
You could always increment a variable and skip the line if $i == 5:
$i = 0;
for(@lines) { $i++; next if $i == 5; print OUT $_; }
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Mon, 7 Jul 1997 09:39:30 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: FOR QUESTION
Message-Id: <tcyangECy05u.2u2@netcom.com>
You need to read a Perl book to know what the three expressions are
doing in the FOR loop separated by the semicolons. This will answer
all of your questions.
=================================
Fan Ng wrote after zapping the scum of the universe:
: hi there:
: Is someone know that for ( ; <STDIN> ; )
: {print;}
: why stdin can't in the first or last???? and what kind the still to put in that
: three EXPR in FOR.
--
========= Try the low-crossposting robomoderated 'alt.culture.taiwan' ===
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: 7 Jul 1997 10:48:31 GMT
From: iap@iis.sinica.edu.tw (Iap SinGuan)
Subject: Re: FOR QUESTION
Message-Id: <5pqhhv$p2f$2@gate.sinica.edu.tw>
In article <33c15d56.18863371@news.prodigy.net>, FANNGMAIL@prodigy.net says...
>
>hi there:
> Is someone know that for ( ; <STDIN> ; )
> {print;}
>why stdin can't in the first or last???? and what kind the still to put in that
>three EXPR in FOR.
It can be in the last if of the following form:
for(;;$a=<STDIN>){
print $a;
}
Iap SinGuan
------------------------------
Date: 8 Jul 1997 02:16:51 GMT
From: s11976@ctsc.hkbc.hk (P.M.Wong )
Subject: Gen. a random no. (within range)
Message-Id: <5ps7uj$ahk$1@power42t.hkbu.edu.hk>
I would like to generate a random number (whole number)
But it has to fall within a certain range that i specify
like, 10< n < 20
Are there any statement in perl to do it ?
--
__
/ \_/ ) __ Pui Ming WONG (E-mail: pm@hkbu.edu.hk)
/ ( ------------- } System Support Programmer,
( =l=ll===============__} Computing & Telecomm. Services Centre
\ _ ( Hong Kong Baptist University
\_/ \__) 224 Waterloo Road, Hong Kong
------------------------------
Date: Tue, 08 Jul 1997 12:23:30 -0600
From: Josh Kortbein <kortbein@dwx.com>
Subject: GIF Control Blocks / Types in perl - unsigned, etc.
Message-Id: <868381804.12038@dejanews.com>
This is related to a question I posted earlier, regarding pack()
templates.
I am calling pack() to create a GIF Control Block for use in me-created
animated GIFs. Everything is working well except the delay time - the GIF
specs call for an unsigned value, which represents the number of
hundredths of a second to wait before displaying the next image.
I pass an "S" to pack(), i.e.:
$controlblock = pack("CCCCSCC",0x21,0xF9,0x04,0x00,255,0x00,0x00)
The "255" is the value I'm packing into the "S".
These values don't come across accurately in the final product, though -
when I view my GIF with Netscape or open it in a Windows GIF-building
program, the delay values vary seemingly irregularly.
For instance, the 255 above is translated into 100/100 sec.
The spec says "unsigned", which I take to be "unsigned int"; however,
passing an unsigned int "I" to pack doesn't work, so I've been using an
unsigned short "S". What might the right choice be, in perl, to agree with
the spec?
Email replies welcome - TIA.
Josh
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 08 Jul 1997 13:47:34 +0100
From: Carola Boehm <carola@music.gla.ac.uk>
Subject: help!? small and easy perl script accessing a music database
Message-Id: <33C236E6.2781@music.gla.ac.uk>
Hi,
I may need some help from quick help from perl experts. I will have to
write a small script in perl without having ever done so before. Before
I get into reading all about perl, maybe you can give me some quick
solutions.
I have to
- Write a script or program that accepts 2 command line arguments,
a temp file name and query term.
- In the script, I call and get results of a database query (I know
this bit)
- and then I write
the results of your operation into the temp file I received on the
command line in a acertain format.
This really seems like a small excercise, but having never done anything
with Perl, I started of having problems even using a script able to call
arguments. I'd be thankful for any info, pointers or prgramming
examples.
Thanks guys
carola
More info:
The result of the object quey looks something like this with sometimes
just some of the attributes, depending on the query:
ObjectID=0x00000043
Type=Document
DocumentType=text
Author=hgsystem
TimeCreated=97/05/27 12:36:13
TimeModified=97/05/30 11:19:24
Title=en:TW Discography
Keyword=scottish music composers
Name=thomasWilsonDiscography_html
MimeType=text/html
Path=DC0x00000010 0x0000099a
Parent=thomasWilson_Collection
GOid=0x82d160c9 0x00000043
ObjectID=0x00000108
Type=Document
DocumentType=collection
Author=hgsystem
TimeCreated=97/06/02 09:22:21
TimeModified=97/06/25 10:06:01
Title=en:Users
Keyword=users hg hyperg pads
Name=users_collection
Description=all users have writing/reading rights to their own
collections
Sequence=7
Subdocs=10
Parent=rootcollection
GOid=0x82d160c9 0x00000108
ObjectID=0x00000045
Type=Document
DocumentType=Remote
Author=hgsystem
TimeCreated=97/05/27 10:37:25
TimeModified=97/05/27 10:42:39
Title=en:Welcome to the Department of Music Home Pages (2)
Keyword=Staff music glsagow
Name=musicDepartmentWelcomePage_WWW2
Protocol=http
Host=www.music.gla.ac.uk
Path=/MainIndex.html
MimeType=text/html
PresentationHints=CollectionHead
Parent=MusicDepartmentFolder
GOid=0x82d160c9 0x00000045
This has to be transfromed by the script into a file looking like this:
[Default]
HitCount=3
Diagnostic=0
Separator=## sep ##
[Data]
Key-for-record1
Record data for record number 1
## sep ##
Key-for-record2
Record data for record number 2
## sep ###
Key-for-record3
Record data for record number 3
------------------------------------------------------------------
"Is this just a clockwork of fabulous design,
or does it acutally tell time"
(Virgil Thompson)
------------------------------------------------------------------
MusicWeb http://sun1.rrzn.uni-hannover.de/musicweb
SMaTBaM
http://www.music.gla.ac.uk/HTMLFolder/Research/SMaTBaMWelcome.html
------------------------------------------------------------------
Carola Boehm
Department of Music Tel: +44 (0) 141 330 6065
University of Glasgow Fax: +44 (0) 141 330 3518
14 University Gardens email: carola@music.gla.ac.uk
Glasgow G128QH
------------------------------
Date: Mon, 7 Jul 1997 13:03:27 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: High bit char in input
Message-Id: <adelton.868280607@aisa.fi.muni.cz>
Hallo,
the pod2man says
=item high bit char in input stream
(W) You can't use high-bit characters in the input stream,
because the translator uses them for its own nefarious purposes.
Use an HTML entity in angle brackets instead.
What shall I do when I need to use Czech characters in the manual
page? They are specified in the ISO-8859-2 encoding but the parser
will cut the top bit out. I cannot use an HTML entity for my letters
because they make about 20 per cent of all the text.
Does the parser really use _all_ of the \200-\377 chars?
Is there some hope for me?
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: 8 Jul 1997 18:54:47 GMT
From: pbaldwin@mrst.com (Patrick Baldwin)
Subject: Re: How to make the same changes to many files.
Message-Id: <slrn5s539r.rdd.pbaldwin@spectre.mrst.com>
Chris Hostetter wrote:
>> I've looked through the CPAN archives and the majority of Web sites
>> a MetaCrawler search turned up on the subject, but I may have missed
>> someplace.
>
>look for a program called "rdist"
>
> (sometimes you don't need perl)
>
Unfortunately, it doesn't look like rdist will quite work, as the various
auto.direct files are not always identical; some mount filesystems that
others don't. I received several e-mails suggesting rdist, so I checked
into it fairly heavily, but it just doesn't seem like it will work.
Which leaves me with Perl or a shell script. I'm leaning towards Perl
right now, but any comments or suggestions welcome.
-P. Baldwin
------------------------------
Date: Mon, 7 Jul 1997 11:52:04 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: IF Problem
Message-Id: <adelton.868276324@aisa.fi.muni.cz>
"James Steven" <jsteven@sirris.com> writes:
> What's wrong with this IF Statement? Every time it executes it runs the
> first IF case, I've tried everything!
>
> if ($subdname=="my.yagoo.com") {
^^
eq because you try to compare strings. You should
really check perlop man page.
Hope this helps.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Tue, 08 Jul 1997 11:00:33 -0700
From: Guy Platt <guy@forte.com>
Subject: Looking for a script that will build HTML from a windows directory
Message-Id: <33C28041.2F08A0D7@forte.com>
Anyone know of a script that will turn a browser into a directory
browser? I'd like to be able to give it a starting directory, and have
a page built that shows all sub-directories and files found in that
directory.
Ideally it would operate like the windows explorer, allowing me to
browse directories.
I've been trying to write one, but being new to Perl, have not got very
far.
Thanks
Guy
------------------------------
Date: Tue, 8 Jul 1997 09:53:51 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Jon A. Tankersley" <zjat02@trc.amoco.com>
Subject: Re: multiplatform perl...
Message-Id: <Pine.GSO.3.96.970708095153.10418I-100000@kelly.teleport.com>
On Tue, 8 Jul 1997, Jon A. Tankersley wrote:
> Newsgroups: comp.lang.perl.misc, comp.lang.perl
If your news administrator still carries comp.lang.perl, please encourage
him or her to check out the frequent posting about bogus newsgroup names
in news.announce.newgroups. You'll be doing yourself and many others a
favor to use only comp.lang.perl.misc (and other valid Perl newsgroups)
instead.
news:news.announce.newgroups
> I've got to build perl for multiple architecture in a location other
> than /usr/local/bin....
Usually, the best thing to do is to install Perl wherever you can on each
machine, but put in a pair of symbolic links (from /usr/bin/perl and
/usr/local/bin/perl) to the real executables.
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/
------------------------------
Date: 8 Jul 1997 15:03:25 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: Re: NDBM on Win32 in Perl
Message-Id: <5ptkrt$91n@linet06.li.net>
I found this:
Can't locate package %s for @%s::ISA
(W) The @ISA array contained the name of another package that
doesn't seem to exist.
in perldiag.html
However, I guess I am no more enlightened than before.
BTW, my reply to e-mail address seems wrong.
If a TIN expert is out there, please e-mail me at
lparillo@suffolk.lib.ny.us
I cannot do a man tin, since there is a menu shell I cannot break out
of, but there may be another way to change my reply-to address.
Parillo (lparillo@newshost.li.net) wrote:
: And so I did.
: And it worked.
: Is the warning message (copied into the comments) important?
: I would hate to have to turn off strict or the -w
: #!c:\perl\bin\perl -w
: # This is the error message I get....
: # C:\Perl\bin>perl -w \temp\tietest.pl2
: # Can't locate package AutoLoader for @DynaLoader::ISA at
: # \temp\tietest.pl2 line 5.
: #
: # But the output comes out fine
: # (key is from previous run, key1 and key2 are from this run)
: # key: value
: # key1: value1
: # key2: value2
: #
: require 5.001;
: use strict;
: use SDBM_File;
: MAIN:
: {
: my %db_write;
: my %db_read;
: sub O_CREAT { 0x0100 }
: sub O_BINARY { 0x8000 }
: sub O_RDWR { 0x0002 }
: tie (%db_write, 'SDBM_File', 'c:/temp/my_db', O_RDWR | O_CREAT |
: O_BINARY, 0666)
: or die "write tie died;-)";
: $db_write{"key1"} = "value1";
: $db_write{"key2"} = "value2";
: untie %db_write;
: tie (%db_read, 'SDBM_File', 'c:/temp/my_db', O_RDWR | O_CREAT |
: O_BINARY, 0666)
: or die "read tie died;-)";
: foreach (keys %db_read) {print "$_: $db_read{$_}\n"}
: untie %db_read;
: }
: Neil Kohl (neilkohl@netaxs.com) wrote:
: : Nope. SDBM_File is supported.
: : Try something like:
: : use SDBM_File;
: : #flags for SDBM
: : sub O_CREAT { 0x0100 }
: : sub O_BINARY { 0x8000 }
: : sub O_RDWR { 0x0002 }
: :
: : my %db;
: : tie (%db, "SDBM_File", "$dbm_file_name", O_RDWR | O_CREAT | O_BINARY,
: : 0666) or die "tie die!";
: : # fiddle with data here...
: : untie %db;
: : SDBM files aren't as compact as other formats, but they work...
: : --
: : neil kohl
: : =====================================================================
: : neilkohl@netaxs.com | "A long quiet like a purge and then
: : philadelphia, pa | a contemplation and decision of future roads,
: : usa | that is what to look forward to."
: : | - T.E. Lawrence, 15.vi.18
: : =====================================================================
------------------------------
Date: Tue, 8 Jul 1997 14:19:10 -0300
From: "NOVAHOME" <mike@novahome.com>
Subject: newbee Q can i use a exec comand in a web page to redir the browser?
Message-Id: <5ptsnn$buj3@sapphire.mtt.net>
--
Support@novahome.com
HTTP://www.novahome.com
Ok this is what i am trying to do.
the perl script looks for cookie. if the cookie is present it will update
the cookie.
if the cookie is not present it will redirect the browser to teh index page
for sign in.
I am trying to use it with a exec command in the page.
<!--#exec cgi="location_to_your_cgi-bin_dir/forcehome.cgi" -->
the code looks like this
#!/usr/local/bin/perl
require ('cgi-utils.pl','cgi-lib.pl','cookie.lib');
&SetCookies('count','1');
open($check_file,"test.shtml");
if (&GetCookies('count')) {
# do something.. if not it will crash.. update to check counter or update a
stats file #
print "\n";
}
# Otherwise, force user to index page! #
else {
print ("Location: http://www.novahome.com/test/test.shtml\n\n");
print "\n";
}
So far is comes up with the text page has moves click here to the new
location. bla bla bla.
can i have it auto redirect the browser to the new page?
thaks
Mike
------------------------------
Date: Tue, 08 Jul 1997 11:04:34 -0400
From: Manjari <manjari@bit-net.com>
Subject: Perl compilation error- Help please
Message-Id: <33C25702.1AEC@bit-net.com>
Hi,
We have downloaded the CGI.pm module. I am following the instructions on how to
install a perl module.
When I run the command below I get the following error
perl Makefile.PL
syntax error in file Makefile.PL at line 1, next 2 tokens "use ExtUtils"
Execution of Makefile.PL aborted due to compilation errors.
I am unable to use the 'use xxx' statement in any other perl programs either
not just modules.
We have perl5.003 installed on a machine running FreeBSD 2.2.1-RELEASE.
Can anyone tell me what is wrong? If this information is already available somewhere
please direct me to it.
Thanks for your time
Manjari
------------------------------
Date: 8 Jul 1997 16:07:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Perl compilation error- Help please
Message-Id: <5ptojr$29q@fridge-nf0.shore.net>
Manjari (manjari@bit-net.com) wrote:
: We have downloaded the CGI.pm module. I am following the instructions on how to
: install a perl module.
: When I run the command below I get the following error
:
: perl Makefile.PL
You're probably using the perl (version 4.036) that's installed in
/usr/bin, but you should be using the Perl installed in
/usr/local/bin.
So, run: /usr/local/bin/perl Makefile.PL
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Tue, 08 Jul 1997 14:16:24 -0400
From: "James J. Heck" <jheck@merck.com>
Subject: Re: Perl is 20 times slower on Cray J90 than SGI!
Message-Id: <33C283F8.167E@merck.com>
Brett,
A few of us tested the same thing on our Cray J90 however it only took
1.28 seconds to execute. Then we ran it on a SGI R10k machine here and
it took 1.01 seconds.
After talking to a few ppl we believe that it has to do with the fact
that the Cray is word addressable whereas the SGI is byte addressable.
Thus the parsing of each line on the Cray takes more memory overhead.
James
--------------------
James J. Heck
jheck@acm.org
http://www.bucknell.edu/~jheck
The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, Merck & Co., Inc. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
------------------------------
Date: 8 Jul 1997 16:17:16 GMT
From: tmoran@iol.ie (Tony Moran)
Subject: Q: Streamlining scripts for Memory performance
Message-Id: <5ptp6c$v3n$1@nuacht.iol.ie>
Hiya. I have 3 CGI-Perl scripts. The problem is that as new features
are requested and added, they become more bloated, particularly with
banks of Data Validation code. I'm starting to think about how I'm
gonna streamline and optimise things, but I'm not sure how far, if
I even should, to go. The scripts are 5, 14 and 10k respectively.
The 3 scripts use CGI-LIB.PL for decoding of variables passed from
Forms.
2 of the scripts create the forms themselves. I use the CGI-LIB.PL
function CgiDie() a lot, in my validation, and to send back the form
data to preceding scripts when necessary.
Memory wise, the scripts are used quite regularly, but not intensively,
except when a company first installs them; then, there is about a week
or two's worth of intensive use by users. In most cases,
2 questions, aside from any other recommendations offered.
1: Should I split the largest script, that basically has 2 main
sections, into 2 different scripts. This means that I'd also have to
create a new script to interpret Form Data to decide *which* of those
2 scripts to use. The more scripts, the more decoding, the more work
cgi-lib.pl has to do. Is this an unwise trade-off ?
2: Would I be better off (I can't use JavaScript in this situation)
taking the Data validation code out of the scripts, put it into 2
or 3 separate smaller scripts to validate the code there, and then
Post it to the main scripts, if it is Valid.
Any other suggestions and advice much appreciated.
Cheers, Tony.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| He who will not reason, is a bigot; he who cannot is a fool; |
| and he who dares not is a slave. |
| -= TonY =- |
| <tmoran@iol.ie> Dublin, Ireland |
++*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-+*%$%*+-++
------------------------------
Date: 8 Jul 1997 14:33:46 GMT
From: evenh@ra.pvv.ntnu.no (Even Holen)
Subject: Re: Question: Output redirection
Message-Id: <slrn5s4jss.emd.evenh@ra.pvv.ntnu.no>
(This posting is a reposting of an article which erroneous said
that to redirect and merge stderr in sh you must write 2&>1. This
new version is the correct version. I've cancelled the previous
posting! )
In article <33B7D8D1.E48@ptc.com>, Sudhakar Sannakkayala wrote:
> I'm trying to redirect the some stuff from the STDERR to a
>file.
>Eg. example.pl >& filename
>
>This works ...
This works as long as you're using (t)csh...
> ... But if I call "system("example.pl >& filename");" from
>another perl script it gives me an error
>"sh: filename: Generated or received a file descriptor number that is
>not valid."
... but it doesn't work when using sh. The corresponding entry in sh
is 2>&1. So that your line reads:
system("example.pl >filename 2>&1")
>Please enligthen me
If you want to read more on the subject then start reading the man pages
of sh ( "man sh" ) under the sections of file redirections.
Hope this helps!
Regards,
Even Holen
PS! I've set the Followup-To to comp.lang.perl.misc, since clp.modules
and clp.tk wasn't very much related to this issue
--
<>< Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/ :-)
------------------------------
Date: Tue, 08 Jul 1997 11:07:13 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Secure data transfers LWP? SSL? PGP? EMAIL?
Message-Id: <33C281D1.6EB6@ixlabs.com>
I am looking into ways of doing secure data transfers across firewalls.
I have used one system, which uses pgp email, which works well but is a
pain to set up when I need new feeds.
What I would like to do is an LWP post to CGI with SSL, so that the
encryption is automatic and I get an immediate response. I can use the
HTTP proxy to jump the firewall.
I know very little about SSL, but I assume the client (in this case,
LWP), would need to support it, which I don't think it does.
If anyone has an idea on how to implement this, or has any other bright
ideas about accomplishing automated secure data transfers, I'd love to
hear them.
Chris
------------------------------
Date: Tue, 08 Jul 1997 18:17:55 GMT
From: melody@imp.net (Melody Polakow)
Subject: Re: Shellscript -> perl
Message-Id: <33c2840e.6272627@news.lisco.com>
Im admittedly a novice here, but I am running my Perl scripts as shell
scripts on my Win NT/Netscape server.
>On 7 Jul 1997, Christopher Shane Adams wrote:
>
>> Is there a utility that will convert shellscripts to perl?
>
>It sounds as if you want this entry from the FAQ entitled, "How can I
>convert my shell script to perl?". Hope this helps!
>
> http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq8/
> How_can_I_convert_my_shel_scrip.html
>
>--
>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/
>
_______________________________
------------------------------
Date: Tue, 08 Jul 1997 13:51:59 -0400
From: Boris Tabenkin <bat@unifi.com>
To: Boris Tabenkin <bat@unifi.com>
Subject: Re: Shellscript -> perl
Message-Id: <33C27E3E.44C774D5@unifi.com>
This is a multi-part message in MIME format.
--------------11EEB82092CA8F9AC7CC5696
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit
Ok,
kind of cheezu though, don't you think?
Boris Tabenkin wrote:
> No,
>
> The nature of shell scripts (bourne and the like) to use external
> programs such as SED, AWK, etc., makes it very hard to translate to
> PERL. You can , however translate SED, AWK, and FIND to PERL. I found
> that simply re-writting things in PERL on per-needed basis works
> fairly
> well.
>
> Christopher Shane Adams wrote:
>
> > Is there a utility that will convert shellscripts to perl?
> >
> > --
> > God is Real unless declared as an Integer.
> > Someone famous once said:
> > I don't believe in God, but I'm scared of him.
>
>
> -------------------------------------------------------------------------------------------------------------
>
> Boris Tabenkin <bat@unifi.com>
>
> Boris Tabenkin
> <bat@unifi.com>
> Netscape Conference Address
> Netscape Conference DLS Server
> Additional Information:
> Last Name
> First NameBoris Tabenkin
--------------11EEB82092CA8F9AC7CC5696
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Boris Tabenkin
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Boris Tabenkin
n: ;Boris Tabenkin
email;internet: bat@unifi.com
x-mozilla-cpt: ;0
x-mozilla-html: FALSE
end: vcard
--------------11EEB82092CA8F9AC7CC5696--
------------------------------
Date: 8 Jul 1997 16:56:51 GMT
From: "Cliff Shaw" <cliff@shawfamily.com>
Subject: SSI's in CGI output
Message-Id: <01bc8bbf$e55ca640$f540f6cd@cbshaw.superlink.net>
How can I have SSI's work in the output produced by my CGI scripts.
Thanks
Cliff
cliff@shawfamily.com
------------------------------
Date: Tue, 08 Jul 1997 18:12:28 GMT
From: melody@imp.net (Melody Polakow)
Subject: Success running Calenadr on NT4.0!
Message-Id: <33c28186.5624787@news.lisco.com>
Just thought I'd let any of you novices (like myself) out there that
I have successfully implemented Selena Sol's GroupWare Calendar 4.0
(http://selena.mcp.com/Scripts/) on my Windows NT4.0/Netscape Server.
I would be happy to help guide anyone else through the process.
P.S. - looking for a good ToDo List program...
_______________________________
------------------------------
Date: Tue, 08 Jul 1997 10:22:43 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: system call
Message-Id: <33C25B43.2FAB8383@gpu.srv.ualberta.ca>
Patrick J Lim wrote:
>
> We are trying to do a system call from a Perl script.
> However, we are getting a return status of 1, when
> we expect 0. For example, "system(date)" returns 1,
> and we are not getting the output from the date command.
> Any hints, suggestions, comments?
read the documentation? ie; look up 'system' in the
perlfunc documentation (perldoc perlfunc, man perlfunc)
and you'll be told explicitly that:
...The return value is the exitstatus of the
program as returned by the wait() call. To
get the actual exit value divide by 256. See
also the exec entry elsewhere in this
document . This is NOT what you want to use
to capture the output from a command, for
that you should use merely backticks or qx//,
as described in the section on `STRING` in
the perlop manpage...
regards
andrew
------------------------------
Date: Tue, 08 Jul 1997 12:52:00 -0600
From: buckinm@nfric.nesusa.com
Subject: Re: Use of Win32::File and official perl5.004_01 on NT and other problems on NT
Message-Id: <868383968.13917@dejanews.com>
In article <33c2fb67.1028417437@newshost.us.oracle.com>,
joshaugh@uk.oracle.com wrote:
>
> if just gives me:
>
> Can't locate auto/Win32/File/READONLY.al in @INC (@INC contains:
> t:\tools\perl5.004\lib t:\tools\perl5.004\lib t:\tools\perl5.004\lib\site
> t:\tools\perl5.004\lib\site .) at fptest.pl line 8
>
I got this same error trying to use the ODBC module with perl 5.004_01.
Maybe there are changes to be made before recompiling the modules to go
from Activeware to 5.004 ?
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 08 Jul 1997 13:29:36 -0400
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: Using ODBC & Ms Access with Perl for NT
Message-Id: <33C27900.441C@gecm.com>
Miran Sepic wrote:
> How can I use MS Acess Database (.mdb) in Perl script?
Win32ODBC would be a start.
> I found some information and a source code, but it was a code for a single
> table. Now i am trying to solve the following problem:
>
> Database consists of 3 tables:
> Customer, Download, Products
> CGI script should do the following:
> 1. Open the database
> 2. Open the Customer table
> 3. Search for a customer (User ID), returns to form if it doesn't exists
> 4. If exists, opens the Download table, check the license
> 5. If OK, opens the Products table, search for products available for this
> customer
> 6. Output the list with available products
> 7. Close the database
>
> I saw some solutions for a single table, but the problem is how to switch
> from table to table.
>
> Any ideas?
Yes, I think your question is about SQL, not about Perl. See
comp.databases, or comp.databases.ms-access, which are good places to
post questions regarding SQL and MS-Access. Also read the fine
documentation supplied with Access on joining tables.
Why not use a single query that joins the tables:
SELECT DISTINCTROW Customer.CustomerID, License.LicenseNo,
Product.ProductID FROM (Customer INNER JOIN License ON
Customer.CustomerID = License.CustomerID) INNER JOIN Product ON
License.LicenseNo = Product.LicenseNo;
I assume you have a one to many relationship of Customers to Licenses
and of Licenses to Products. If you get an empty set back the Customer
has no licensed products.
Cheers,
Jim
------------------------------
Date: Tue, 08 Jul 1997 18:43:53 GMT
From: xxbbell@voicenet.com (Bob)
Subject: Re: Validating E-Mail addresses and URL's
Message-Id: <5pu1no$hia$1@news1.voicenet.com>
>> /http:\/\//
>s|http://|
Not to be picky, but the above code is actually a match, not a
substitution, so it would be:
m|http://|
or m!http://!
or whatever
--
- Bob
http://www.voicenet.com/~bbell
xxbbell@voicenet.com
remove x's to reply
------------------------------
Date: 5 Jul 1997 14:17:26 GMT
From: evenh@ra.pvv.ntnu.no (Even Holen)
Subject: Re: Variable help please
Message-Id: <slrn5rslrf.s57.evenh@ra.pvv.ntnu.no>
In article <19970629050601.BAA19488@ladder02.news.aol.com>, CitiCentr wrote:
>I was hoping someone could help me with a quick problem- is there anyway
>in Perl to have one variable become part of another variable name? For
>instance, if I wanted to test ($cat1 eq 1) but I wanted the 1 to be
>dependent on a variable $calendar (ie, if $calendar was 2 then the
>expression would be ($cat2 eq 1)...is that possible?
The answer here is that there are many ways to do it... Most of the
solutions includes derefencing of some sort (and someone ought to
suggest the use of arrays instead... ).
But here is one possible way of doing it (not explicitly written as
in your example, but you'll get the idea):
#!/usr/bin/perl
$cal = 2;
$something2 = "It works!!!";
$new = ${"something$cal"};
print "Does it work? $new\n";
Hope this helps. Do also catch up on reading the documantation on
references...
Regards,
Even Holen
--
<>< Even Holen, evenh@pvv.ntnu.no, http://www.pvv.ntnu.no/~evenh/ :-)
------------------------------
Date: Mon, 07 Jul 1997 12:59:29 -0400
From: Boris Tabenkin <bat@unifi.com>
To: Dave Rapchun <rapchun@barnard.yerkes.uchicago.edu>
Subject: Re: Variables Question
Message-Id: <33C12071.13616FFC@unifi.com>
Using the external FTP program is a not a great idea since you can not
do any sort of error checking. A better alternative is to use the FTP
library available on CPAN. It lets you bury FTP calls into your program
Regards,
Boris Tabenkin
bat@ziplink.com
Dave Rapchun wrote:
> Hello,
>
> I'm trying to call the 'ftp' function from within my perl script, but
> I want to pass it a variable containing the file name I wish to
> transfer. I am stumped. Please help.
>
> Thanx.
>
> Dave.
------------------------------
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 709
*************************************