[9699] in Perl-Users-Digest
Perl-Users Digest, Issue: 3293 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 30 08:17:27 1998
Date: Thu, 30 Jul 98 05:01:04 -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, 30 Jul 1998 Volume: 8 Number: 3293
Today's topics:
Re: # in a print statement (Larry Rosler)
Re: # in a print statement <Tony.Curtis+usenet@vcpc.univie.ac.at>
Compiling Perl 5.005 with Watcom C/C++ v11 greenej@my-dejanews.com
Re: cperl-mode vs vi <grossjohann@ls6.cs.uni-dortmund.de>
Re: deadlocking sockets <mc@whoever.com>
Re: Dereferencing Hashes and Arrays (Larry Rosler)
Re: file system operations on open files (Ilya Zakharevich)
Re: file system operations on open files (Larry Rosler)
Re: file system operations on open files (Larry Rosler)
Re: file system operations on open files <andrew@erlenstar.demon.co.uk>
flock and/or fcntl on solaris <jimbo@soundimages.co.uk>
Re: How to delete files inside perl script? <qdtcall@esb.ericsson.se>
Re: How to extrat characters from string (I.J. Garlick)
Re: Is it possible <thomas@daimi.aau.dk>
Re: Loop Problem dave@mag-sol.com
Making my own modules (Antti-Jussi Korjonen)
Re: Perl + FP Web Server + Microsoft Web Server <thomas@daimi.aau.dk>
Re: Perl 5.004/5.005 difference? (Bug?) (M.J.T. Guy)
Re: problem with script creating files under Perl 5 "-T (M.J.T. Guy)
running an exe from a perl script <malleck@dsi.cnrs.fr>
Re: Script trouble <quednauf@nortel.co.uk>
Sending e-mail using cgi jthimont@my-dejanews.com
Re: sendmail on NT server? <gandalf@fth.net>
Setting up a Members Only Section on Unix server <stanz@en.com>
Re: Setting up a Members Only Section on Unix server <perlguy@inlink.com>
Re: Submit only Once <thomas@daimi.aau.dk>
Re: sytem( ) calls in CGI scripts <qdtcall@esb.ericsson.se>
tresgd <robert.yung@swissbank.com>
Using PUSH <se96ms@english.iielr.dmu.ac.uk>
Re: Using PUSH <se96ms@english.iielr.dmu.ac.uk>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 30 Jul 1998 01:45:49 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: # in a print statement
Message-Id: <MPG.1029d29520ddf7629897a1@nntp.hpl.hp.com>
In article <1dcy04p.1kh7u371ia3kwmN@bay1-90.quincy.ziplink.net> on Wed,
29 Jul 1998 20:34:10 -0400, Ronald J Kimball <rjk@coos.dartmouth.edu>
says...
> <nikkim@my-dejanews.com> wrote:
...
> > print GUEST "<IMG id=\"Picture2\" HEIGHT=88 WIDTH=562 SRC=\"./bbstop8.jpg\"
> > BORDER=0 USEMAP="#map5" > etc, etc ...
> ^ ^
>
> Backslash the quotes so the # is within the string, instead of outside
> it.
Better yet, use the qq quoting method and get rid of all those
backslashes.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 30 Jul 1998 11:06:57 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: # in a print statement
Message-Id: <7x1zr3pv0u.fsf@fidelio.vcpc.univie.ac.at>
Re: # in a print statement, Larry <lr@hpl.hp.com> said:
Larry> In article
Larry> <1dcy04p.1kh7u371ia3kwmN@bay1-90.quincy.ziplink.net>
Larry> on Wed, 29 Jul 1998 20:34:10 -0400, Ronald J Kimball
Larry> <rjk@coos.dartmouth.edu> says...
>> <nikkim@my-dejanews.com> wrote:
Larry> ...
>> > print GUEST "<IMG id=\"Picture2\" HEIGHT=88 WIDTH=562
>> SRC=\"./bbstop8.jpg\" > BORDER=0 USEMAP="#map5" > etc,
>> etc ... ^ ^
>>
>> Backslash the quotes so the # is within the string,
>> instead of outside it.
Larry> Better yet, use the qq quoting method and get rid of
Larry> all those backslashes.
Or maybe *even* better, use the HTML shortcuts in CGI.pm;
after all, an IMG is a structure with meaning, not just a
string of characters to be print'ed.
print GUEST img({src => '.....',
height => 562,
...
}
);
Or you could use HTML elephant^H^H^H^H^Hments, viz.
use HTML::Element;
my $image = new HTML::Element 'img';
$image->attr('src', '....');
$image->attr('height', 562);
$image->attr('usemap', qq/#map5/);
...
print GUEST $image->as_HTML;
And, of course, don't forget the ALT attribute!!
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | personal email:
Stupid! Stupid!" ~ Eros, Plan9 fOS. | tony_curtis32@hotmail.com
------------------------------
Date: Thu, 30 Jul 1998 07:14:00 GMT
From: greenej@my-dejanews.com
Subject: Compiling Perl 5.005 with Watcom C/C++ v11
Message-Id: <6pp6fo$122$1@nnrp1.dejanews.com>
Now that I've been using various binary distributions of Perl (Win32) since
the days of Perl v4, I thought that I should try to build my own.
Has anyone successfully built Perl for Win32 using the Watcom C/C++ v11
compiler? When I use the Watcom NMAKE program, it dies on the makefile. When I
use DMAKE, it begins compiling, but then dies on the first file with several
errors (not to mention the embedded comments warnings!).
Any suggestions???
JAGreene
--
# James Greene - Informatics Consulting - D-79539 Loerrach, Germany
# Internet: www.gucc.org/greene/consult - greene@gucc.org
# PGP Fingerprint: 8930 41E7 351B 56D8 801C D4D9 4C76 AF0F E24E F307
perl -we "$_=join'<',qw{d2by' f5e;f4z($iu w0@86yo=&ae b!097)l(&aa8vme
b$*};$_=unpack'u*',uc;print"
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 30 Jul 1998 12:27:05 +0200
From: Kai Grossjohann <grossjohann@ls6.cs.uni-dortmund.de>
Subject: Re: cperl-mode vs vi
Message-Id: <vafhfzzk51i.fsf@ramses.cs.uni-dortmund.de>
>>>>> Brian Moseley <ix@maz.org> writes:
> i use emacs (just started using cperl-mode), the rest of my team
> uses emacs. they check in code with tabs, i check in code with
> spaces. heartache ensues.
I don't understand where the problem is. Do they have a problem
reading your files, or vice versa? (A possible problem could occur
when they have set their tab-width to be something different than 8,
and you have written a file using tabs assuming a width of 8. Or have
*you* changed tab-width?)
There is a variable indent-tabs-mode which controls whether
indentation inserts spaces only or tabs/spaces combinations.
kai
--
Abort this operation? [Abort] [Cancel]
------------------------------
Date: Thu, 30 Jul 1998 08:25:48 +0100
From: Martin C Brown <mc@whoever.com>
Subject: Re: deadlocking sockets
Message-Id: <35C01FFC.F66E9405@whoever.com>
faganb@my-dejanews.com wrote:
> This should clarify. These examples were taken from one (many?) sources
> including Robin Chatterjee, Perl docs, "camel", etc.
No autoflush on the client socket, try including:
use FileHandle;
autoflush S 1;
That certainly won't help... hang on whilst I try the code.
Yep - that works.
If you are still having problems with deadlocking - it's difficult to escape from
sometimes - you might want to think about ceating two sockets, one for reading and
one for writing. You can then use select to flip between them on reads and writes.
It requires some careful consideration on the part of service ports but otherwsie
it should work OK.
However, careful application level protocols can usually get round it.
------------------------------
Date: Thu, 30 Jul 1998 01:32:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Dereferencing Hashes and Arrays
Message-Id: <MPG.1029cf804e3c0b5f9897a0@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6pno7q$h0a$1@monet.op.net> on 29 Jul 1998 14:04:42 -0400,
Mark-Jason Dominus <mjd@op.net> says...
...
> You seem to be confused abut basic syntax. You might want to take a
> look at my article `Understand References Today'. It is at
>
> <URL:http://www.plover.com/~mjd/FAQs/>
<URL:http://www.plover.com/~mjd/perl/FAQs/>
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 30 Jul 1998 07:30:40 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: file system operations on open files
Message-Id: <6pp7f0$nnq$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Mark-Jason Dominus
<mjd@op.net>],
who wrote in article <6poc5q$o5p$1@monet.op.net>:
> Maybe someone else explain to me why we need to worry about DOS
> filesystem compatibility in a program for modifying the Unix password
> file.
"A" says that a particular implementation is portable. "B" objects to
this statement.
Enough said,
Ilya
------------------------------
Date: Thu, 30 Jul 1998 01:07:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: file system operations on open files
Message-Id: <MPG.1029c986f0f22ff798979e@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6pnnim$gra$1@monet.op.net> on 29 Jul 1998 13:53:26 -0400,
Mark-Jason Dominus <mjd@op.net> says...
> In article <35BF558B.2BAE83D5@waii.ERASETHIS.com>,
> Marcelo L. Meira <marcelo.meira@waii.ERASETHIS.com> wrote:
> >Sorry, my fault for not reading the cross-post info. I read the article
> >from comp.unix.programmer, and also I saw the mention to /etc/passwd, so
> >I assumed Unix was the (only) OS in question here.
>
> It is. Ilya was making a joke. Larry is just confused.
Each of those three statements is wrong.
A false statement was made here, that it is 'portable' to unlink or
rename a file while it is open. Both Ilya and I attempted to correct it.
The fact that the example happened to refer to /etc/passwd is irrelevant
to the misstatement on portability.
Larry Rosler wrote:
> That's right. That's the point. 'Portable' includes other OSs than Unix
> variants. There are a few such, you know.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 30 Jul 1998 01:14:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: file system operations on open files
Message-Id: <MPG.1029cb47f42504a298979f@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6pnilb$g45$1@monet.op.net> on 29 Jul 1998 12:29:31 -0400,
Mark-Jason Dominus <mjd@op.net> says...
> In article <MPG.1028e43bc4f8028298979d@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
> >That's right. That's the point. 'Portable' includes other OSs than Unix
> >variants. There are a few such, you know.
>
> Yeah, but how many of them have an /etc/passwd?
>
> >In Windows/DOS systems, the OS does not permit this.
>
> What's the point of coding for Windows/DOS portability for a program
> whose function is to perform some operation on the Unix password file?
>
> That's why I crossposted to comp.unix.programmer.
This is a Perl group, not a Unix group. Generalizations made here about
portability have impact on the readers of the group, which goes well
beyond Unix. Crossposting is irrelevant to the Perl content (which is
why I never look to see).
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 30 Jul 1998 11:57:55 +0100
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
Subject: Re: file system operations on open files
Message-Id: <87ogu7r4gc.fsf@erlenstar.demon.co.uk>
>>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:
Larry> [Posted to comp.lang.perl.misc and copy mailed.]
You mean "Posted to comp.lang.perl.misc and comp.unix.programmer and copy
mailed". This likewise, but note followups.
>> That's why I crossposted to comp.unix.programmer.
Larry> This is a Perl group, not a Unix group. Generalizations made
Larry> here about portability have impact on the readers of the
Larry> group, which goes well beyond Unix. Crossposting is
Larry> irrelevant to the Perl content (which is why I never look to
Larry> see).
You'd think a Perl programmer would appreciate the importance of context.
If you're going to make statements like "this is a Perl group, not a
Unix group" then you should learn to either use Followup-To or trim
your newsgroups line. Pointless crossposted flamewars caused by
deliberate disregard for the context of statements has an impact on
the readers of *this* group (c.u.p); I for one have no particular desire
to killfile on crossposts to comp.lang.* because quite a few legitimate
questions (including the one that started this thread) are crossposted in
that way.
If your newsreader has an option to prompt for a Followup-To for all
crossposted messages, then I suggest you use it. Otherwise learn to do
it yourself.
--
Andrew.
comp.unix.programmer FAQ: see <URL: http://www.erlenstar.demon.co.uk/unix/>
or <URL: http://www.whitefang.com/unix/>
------------------------------
Date: 30 Jul 1998 11:56:03 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: flock and/or fcntl on solaris
Message-Id: <u3ebjip4s.fsf@jimbosntserver.soundimages.co.uk>
This is a problem I'm having as well the poster referenced below. I
have searched Dejanews and have run the script as provided by Tom
Phoenix and the results follow below. I am no Unix expert. I am not
even a *real* unix user. But my problem is similar to that described
below as well as my capacity to access the system or it's
administrators. All suggestions greatfully accepted. Thanks In
Advance.
Jim Brewer
On 29 Dec 1997, John Bokma wrote:
> > Did your perl binary pass all of the 'make test' tests when it was
> > compiled?
>
> I run this code on a system to which I don't have root access and
> I didn't (can't) compile perl on it.
You may need to ask a system administrator to help you to run the tests or
to recompile perl.
> > did you try installing Randal's original code to see
> > whether the same problem occurs?
>
> No, but the important part, i.e. the file locking is the same.
I trust that you were careful, but it would be easy to do something wrong.
For example, if you used the wrong constants, that would be a problem.
> The flock isn't working, the rest of the code is not the problem.
Well, let's test flock and find out for sure. I'm appending a test script;
what does it do for you? 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!
#!/usr/bin/perl -w
use strict;
use Fcntl qw(:flock);
my $filename = $0;
$| = 1;
my $fork_count = 3; # Make three children
# (Total number of processes is one larger.)
my @children;
for (1..$fork_count) {
my $pid = fork;
unless (defined $pid) {
print "Harmless fork error: $!\n";
sleep 1;
redo;
}
last if $pid == 0;
push @children, $pid;
}
open T, "+<$filename" or die "Can't open '$filename': $!";
print "\n($$): About to lock $filename!\n";
flock T, LOCK_EX or die "Can't lock: $!";
sleep 1; # just to let the IO catch up
print "($$): Lock acquired...";
for (reverse ('Boom!', 1..3) ) {
sleep 1;
print " $_ ";
}
print "\n($$): Unlocking $filename!\n";
close T;
# Wait for the kids
for (@children) {
waitpid $_, 0;
}
exit;
__END__
The results of the test programme are as follows:
$ perl -w TP_fcntl.plx
(409): About to lock TP_fcntl.plx!
Can't lock: 269241252 at TP_fcntl.plx line 28.
(410): About to lock TP_fcntl.plx!
Can't lock: 269241252 at TP_fcntl.plx line 28.
(411): About to lock TP_fcntl.plx!
(408): About to lock TP_fcntl.plx!
Can't lock: 269241252 at TP_fcntl.plx line 28.
Can't lock: 269241252 at TP_fcntl.plx line 28.
Perl info is :
$ perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 1) configuration:
Platform:
osname=solaris, osvers=2.5.1, archname=sun4-solaris
uname='sunos starburst 5.5.1 generic_103640-08 sun4u sparc sunw,ultra-2 '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio= d_sfio=
Compiler:
cc='gcc', optimize='-O', gccversion=2.7.2.1
cppflags=''
ccflags =''
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=8, usemymalloc=y, randbits=15
Linker and Libraries:
ld='gcc', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
libc=/lib/libc.so, so=so
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
cccdlflags='-fpic', lddlflags='-G'
Characteristics of this binary (from libperl):
Built under solaris
Compiled at Dec 19 1997 15:38:50
@INC:
/opt/LWperl/lib/sun4-solaris/5.00401
/opt/LWperl/lib
/opt/LWperl/lib/site_perl/sun4-solaris
/opt/LWperl/lib/site_perl
.
$
------------------------------
Date: 30 Jul 1998 12:53:20 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: How to delete files inside perl script?
Message-Id: <isyatbbof3.fsf@godzilla.kiere.ericsson.se>
Meena Chockalingam <cmeena@hotmail.com> writes:
> I used unlink and it does not work either.
Have you tried turning the computer on?
(Free clue: "doesn't work" is somewhat vague)
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Thu, 30 Jul 1998 08:01:48 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
To: Juan Guevara <chapin@ecst.csuchico.edu>
Subject: Re: How to extrat characters from string
Message-Id: <EwwEB0.Cyz@csc.liv.ac.uk>
[Posted and mailed]
In article <Pine.HPP.3.95.980729152433.6466B-100000@cancer.ecst.csuchico.edu>,
Juan Guevara <chapin@ecst.csuchico.edu> writes:
> Hello,
>
> How do you get a character from a string, specifying
> the index where it is located. For example, if I say:
>
> $index=index $string,$findthis;
>
> Is there a function that does the following:
> $char = get_me_character_at_$index($string);
This is probably not the most efficient way but surely substr like this
will work
my $sub = substr($string, $index, 1);
man perlfunc gives a comprehensive list of all built in perl functions
if you haven't got the camel.
Hold on.....(tap,tap, tap)
Yes this is a faq.
"How can I access/change the first N letters of a string?" in perlfaq4 to be
precise.
--
Ian J. Garlick
ijg@csc.liv.ac.uk
In Tennessee, it is illegal to shoot any game other than whales from a
moving automobile.
------------------------------
Date: Thu, 30 Jul 1998 12:53:13 +0200
From: Thomas Jespersen <thomas@daimi.aau.dk>
Subject: Re: Is it possible
Message-Id: <35C05099.6A5E719E@daimi.aau.dk>
Patrick L. McGillan wrote:
>
> Hi,
>
> I can't seem to figure out how to control a serial port. Is it possible with
> perl? I would like to do some low level i/o to a serial port.
Sure,
but we need to know your OS first.
Look at perlfaq8
------------------------------
Date: Thu, 30 Jul 1998 07:44:05 GMT
From: dave@mag-sol.com
Subject: Re: Loop Problem
Message-Id: <6pp885$3e6$1@nnrp1.dejanews.com>
In article <MPG.1028dca48ca257d798979c@nntp.hpl.hp.com>,
lr@hpl.hp.com (Larry Rosler) wrote:
[My embarassing mistakes, Larry's helpful correction and my even more
embarassing failure to accept the truth snipped!]
> It is hard to know whether to laugh or to cry in the face of such
> obtuseness. // matches the previous match, period. In your 'simpler
> script' there isn't any; evidently it then matches anything. Precede
> your snippet with this:
>
> 'x' =~ /x/;
>
> and see what happens. Then change both the 'x's to 'r's and try again.
Larry,
You are, of course, absolutely right. I must apologise for my intransigence.
I'd like everyone to ignore all of my posts on this subject!
That'll teach me to post first thing in the morning, before a caffine fix.
Dave...
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 30 Jul 1998 09:37:03 GMT
From: aajii@aajii.ton.tut.fi (Antti-Jussi Korjonen)
Subject: Making my own modules
Message-Id: <6pperv$glv$1@baker.cc.tut.fi>
Are there any HOWTO's or FAQ's on that subject?
I've made a module and it works just fine, except it doesn't
return anything. It reads the values needed ok and stores
them in a string.
What do I need to do to return the string or the contents of
the string to the function, which is calling it?
--
__/ __/ __/ __/ Antti-Jussi Korjonen
__/ __/ __/ __/ __/__/ Vaajakatu 5 D 85
__/ __/ __/ __/ __/__/ 33720 TAMPERE, FINLAND
__/ __/ __/__/__/ __/ __/ tel. +358-(0)40-577 83 23
Antti-Jussi.Korjonen@sonera.fi
--------->> http://www.students.tut.fi/~k150556 <<---------
------------------------------
Date: Thu, 30 Jul 1998 13:21:42 +0200
From: Thomas Jespersen <thomas@daimi.aau.dk>
Subject: Re: Perl + FP Web Server + Microsoft Web Server
Message-Id: <35C05746.C76DB388@daimi.aau.dk>
grumo@passosnet.net wrote:
>
> Sorry,
>
> It is possible to make Perl to work with above home servers, period.
>
> But, only the Content-Type: text/html seems to produce results in the
> browser. For instance:
>
> $file = 'myfile.gif';
> print "Content-Type: image/gif\n\n";
> open(PIC,"$file");
> print <PIC>;
> close(PIC);
>
> produces no image! Strange?!
>
> Anyone, can give some input? I guess this is not a easy one.
perldoc -f binmode
------------------------------
Date: 30 Jul 1998 09:32:20 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Perl 5.004/5.005 difference? (Bug?)
Message-Id: <6ppej4$h6$1@pegasus.csx.cam.ac.uk>
Martien Verbruggen <mgjv@comdyn.com.au> wrote:
>Looks like pos isn't being reset.
>
>Might be worth a perlbug report.
You seem to have missed this part of my posting:
> This change looks like a bug to me - pos($i) should be reset each time
> round the loop, since $i is updated. Reported to perlbug.
^^^^^^^^^^^^^^^^^^^
And in fact, two patches have been issued already.
Mike Guy
------------------------------
Date: 30 Jul 1998 09:26:16 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: problem with script creating files under Perl 5 "-T"
Message-Id: <6ppe7o$9v$1@pegasus.csx.cam.ac.uk>
Geo <geo@stopspam316csi.com> wrote:
>I have a block of code that let's my scripts create a new file with a unique
>name, however, I tried to use it in a script that is running with the -T
>option and it won't work...
>
>Here's what I usually do...
>
>----------------
>open (ORDERLOG, "+>$path/$timestamp.log");
> print ORDERLOG "$timestamp\n\n";
> print ORDERLOG $content\n\n;n";
> close (ORDERLOG);
>---------------
>
>Evidently Perl 5 feels it is "tainted" and prevents the script from writing
>new files.
>
>How do you accomplish this under Perl5 "-T"?
Before doing anything with tainted data, make sure you have read and
understood all of perldoc perlsec. The tainting mechanism harasses
you for good reasons.
Then the section "Laundering and Detecting Tainted Data" should give
you the answer.
Mike Guy
------------------------------
Date: Thu, 30 Jul 1998 07:20:45 +0000
From: Khadidja Malleck <malleck@dsi.cnrs.fr>
Subject: running an exe from a perl script
Message-Id: <35C01ECD.4C03087C@dsi.cnrs.fr>
Hello!
I would like to know how to call a program from within a perl script?
I have a file called Launch.sh and the permissions are set in 755 and I
want to call it from a perl script.
Can anyone help me please???
Thanks a lot.
Khadidja Malleck
malleck@dsi.cnrs.fr
------------------------------
Date: Thu, 30 Jul 1998 10:32:02 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Script trouble
Message-Id: <35C03D92.EB3F4354@nortel.co.uk>
Eric Umehara wrote:
>
> Hi
>
Where to begin ??
>
> Below is the script and a sample line.
> #!/perl/usr/bin
>
> "Willow ";"c = 2 to 4 meters (7 to 13 ft.) ";"U = upright
> tree ";"yes ";"yes ";" ";"yes";"SH =
> partial shade";"S = Spring ";;;111;
>
> open (plantlist, "<<plant.txt");
> open (final, "|final.txt")
Semicolon missing on second line. You don't check the return values of
the open, so you don't know if the open was a success. Also, if you want
to read from a file, use open PLANTLIST, "< plant.txt" or die "File not
there: $!"; The second open opens a pipe to final.txt . I don't think
that that is what you want: open FINAL, "> final.txt" or die "File not
there: $!";
> while (<plantlist>) {
> $_=@sfline;
You're assigning to $_, a scalar, an array that doesn't even exist yet.
Hmmm, let's not think further about that. Apart from that, if the array
would exist, the scalar would get the size of the array. Also I've got
the feeling that you wanted to assign $_ to the array. Assignment works
TO the left.
> @sfline= m!tr/l/ /!;
> ($name , $height , $grow , $1 , $2 , $3 , $4 , $light , $season ,
> $page)=$sfline;
This is stuff, and to quote ... Can't find the quote anymore. Anyway,
just doesn't make sense. Also, $1, $2 .... are special variables, used
to hold pattern matches contained in brackets in a regexp.
> foreach $whites ($name , $height , $light , $season , $page) {
> $whites=/{2,}$/;
What is that regexp supposed to match ? 2 of ***(?!?) at the end of a
line...I think Perl, encountering such code, should say something like:
What are you talkiing to me, maaaan ? I don't understand a frikkin' word
:)
> print final "$whites\n";
> }
> }
> close plantlist;
> close final;
Well, try the following:
undef $/;
#undefines record line separator, to slurp in the whole crap into one
string
while (<DATA>) { #read the DATA build into the script
print "before:$_"; #print what you've got
s/[\s\"]//g; # replace whitespace '\s' and '"' with nothing,
globally
@elements = split /;/;#split the line on ';'
for (@elements) { print "--$_\n"; } #print all array elements
}
__DATA__
"Willow ";"c = 2 to 4 meters (7 to 13 ft.) ";"U = upright
tree ";"yes ";"yes ";" ";"yes";"SH =
partial shade";"S = Spring ";;;111;
This, together with the other stuff should enable you to suss it out.
Another thing:
LEARN, GET THE BASICS.
You can't throw stuff at Perl and expect it to know what it is supposed
to do. Get the syntax, and if you want to do a certain thing, read up on
it, so you know which operator does it. Because nothing happens
magically in this world (Apart from Abigail's sig, which is beyond my
apprehension :)
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Thu, 30 Jul 1998 10:30:24 GMT
From: jthimont@my-dejanews.com
Subject: Sending e-mail using cgi
Message-Id: <6ppi00$do0$1@nnrp1.dejanews.com>
I have a standard dial-up account which allow me to execute cgi scripts. I
wondered if there is a technique to send e-mail using cgi: From (my site) to
an address acquired from an HTML form. I understand that there are security
risks using addresses entered in forms. James
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 30 Jul 1998 10:26:07 +0200
From: Jean-Philippe FAUVELLE <gandalf@fth.net>
To: John <blackd1@hotmail.com>
Subject: Re: sendmail on NT server?
Message-Id: <35C02E1F.64E0F390@hotmail.net>
# This should work both on NT and Unix (MAC ?) !
# WARNING ABOUT WINDOWS :
# NET::* is only available with Gurusamy distribution, but not yet with
ActiveState perl.
use NET::SMTP;
$smtp = Net::SMTP->new('mail.hostname.com', Timeout=>20);
$smtp->mail('from@domain.com', Bits => 8 );
$smtp->recipient('to@domain.com');
$smtp->data();
$smtp->datasend("To: to@domain.com\n");
$smtp->datasend("From: from@domain.com\n");
$smtp->datasend("Subject: MAIL_SUBJECT\n\n");
$smtp->datasend("this is the\nmessage\n...");
$smtp->dataend();
$smtp->quit;
____________________________________________
Jean-Philippe Fauvelle
fauvelle@hotmail.com
------------------------------
Date: Thu, 30 Jul 1998 10:25:14 GMT
From: stan zylowski <stanz@en.com>
Subject: Setting up a Members Only Section on Unix server
Message-Id: <35BF8378.52C9@en.com>
This seems to be a typical question.
i am having trouble setting up a Members Only section
on the Unix Server. Scripts are executed only in
the CGI-BIN. When i set up a MEMBERS subdirectory of
the CGI-BIN, and password protect it, users
are not allowed to access the index.html or any
other web page because it's the cgi-bin.
If I protect a regular directory, my bulletin board
script which is executed in the cgi-bin is not
protected.
any advice?
------------------------------
Date: Thu, 30 Jul 1998 11:18:40 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Setting up a Members Only Section on Unix server
Message-Id: <35C05690.74C56260@inlink.com>
Why not just create a "protected" subdirectory under your cgi-bin
directory. That is really the only way that you are going to have both
protected and unprotected scripts.
HTH
Brent
------------------------------
Date: Thu, 30 Jul 1998 13:45:52 +0200
From: Thomas Jespersen <thomas@daimi.aau.dk>
Subject: Re: Submit only Once
Message-Id: <35C05CF0.D1241E71@daimi.aau.dk>
William Wueppelmann wrote:
> When the script is processed, do the following:
> 1. check a data file that contains a list of all submitted acession
> numbers. If the "uid" field matches any of those fields, do not process
> the rest of the data, and instead return a blank form (with a new
> accession number) and possibly an explanitory message.
no, no, no
punish them!
Say "Thank for your submission" again! Then they can spend the rest of
the day submitting forms to no use :)
------------------------------
Date: 30 Jul 1998 13:06:18 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: sytem( ) calls in CGI scripts
Message-Id: <isvhofbnth.fsf@godzilla.kiere.ericsson.se>
bday@cbr.eng.sun.com (Brian Day) writes:
> I was wondering if anybody could explain why system() calls are not working
They're probably working just fine, but they're not doing what you
think they're doing.
> system("cd /home/brandond/expl_db");
> system("ls -1 explorer* > temp");
system() spawns a subprocess. Since you seem to be doing programming
for Sun, I think you ought to know what that means for the changing of
directories.
One might also note that what you're doing there can be accomplished
more easily and *much* faster without calling external programs (look
for readdir() and grep() in the perlfunc manpage).
> Nowhere in my CGI w/Perl books does it explain process management.
They must be *very* bad Perl books! Get better ones.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Wed, 29 Jul 1998 14:59:00 GMT
From: Robert Yung <robert.yung@swissbank.com>
Subject: tresgd
Message-Id: <35BF38B4.6531EB1@swissbank.com>
gfdfd
------------------------------
Date: Thu, 30 Jul 1998 11:17:42 +0100
From: Mark Simonetti <se96ms@english.iielr.dmu.ac.uk>
Subject: Using PUSH
Message-Id: <Pine.OSF.3.96.980730111449.32421E-100000@english.iielr.dmu.ac.uk>
Okay, I know how to use push:
push(@array, $elem);
Obviously adds "$elem" to "@array"..
but why doesn't this work:
#START
$$hash{'thingy'} = [];
push($$hash{'thingy'}, 'hmm');
#END
$$hash{'thingy'} evaluates to an array ? Ok, it evaluates to an array
reference, which push doesn't seem to like. Infact when I compile it, it
tells me its a hash element (which obviously it is) but I would of thought
it'd compile it and evaluate it...... please how to I make it work :)
Mark.
--
=================================
Mark Simonetti
se96ms@dmu.ac.uk
marks@webleicester.co.uk
http://www.cms.dmu.ac.uk/~se96ms/
=================================
"I used to be indecisive, but now I'm not so sure."
------------------------------
Date: Thu, 30 Jul 1998 12:02:16 +0100
From: Mark Simonetti <se96ms@english.iielr.dmu.ac.uk>
Subject: Re: Using PUSH
Message-Id: <Pine.OSF.3.96.980730120125.32672C-100000@english.iielr.dmu.ac.uk>
S'ok, solved it like this:
push(@{$$hash{'thingy'}}, 'hmm');
which seems to work fine !!!
Mark.
--
=================================
Mark Simonetti
se96ms@dmu.ac.uk
marks@webleicester.co.uk
http://www.cms.dmu.ac.uk/~se96ms/
=================================
"I used to be indecisive, but now I'm not so sure."
On Thu, 30 Jul 1998, Mark Simonetti wrote:
> Okay, I know how to use push:
>
> push(@array, $elem);
>
> Obviously adds "$elem" to "@array"..
>
> but why doesn't this work:
>
>
> #START
>
> $$hash{'thingy'} = [];
> push($$hash{'thingy'}, 'hmm');
>
> #END
>
> $$hash{'thingy'} evaluates to an array ? Ok, it evaluates to an array
> reference, which push doesn't seem to like. Infact when I compile it, it
> tells me its a hash element (which obviously it is) but I would of thought
> it'd compile it and evaluate it...... please how to I make it work :)
>
> Mark.
> --
> =================================
> Mark Simonetti
> se96ms@dmu.ac.uk
> marks@webleicester.co.uk
> http://www.cms.dmu.ac.uk/~se96ms/
> =================================
>
> "I used to be indecisive, but now I'm not so sure."
>
>
>
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3293
**************************************