[9947] in Perl-Users-Digest
Perl-Users Digest, Issue: 3540 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 25 17:07:33 1998
Date: Tue, 25 Aug 98 14:00:25 -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, 25 Aug 1998 Volume: 8 Number: 3540
Today's topics:
Re: (Simplest) way to convert string to array of chars? <zenin@bawdycaste.org>
Re: A real newbie question (Steve Linberg)
Decoding URL's <erics@wwwebcat.com>
Re: Exporting Methods <JKRY3025@comenius.ms.mff.cuni.cz>
Re: Exporting Methods (Mark-Jason Dominus)
Re: Help: How can I use full path of a *.pm file?? <erik@zeno.com>
Re: Locking files on Window 95 server (Charles DeRykus)
Re: Looking for Programmer/Job Opp. (Norman UNsoliciteds)
Re: Pattern match for filename extensions (Tad McClellan)
Re: Perl compiler (Norman UNsoliciteds)
Re: Perl compiler (Stefaan A Eeckels)
Re: Perl compiler (John Stanley)
Re: Perl compiler <tchrist@mox.perl.com>
Re: Perl documentation <tchrist@mox.perl.com>
Re: Regex question - removing HTML tags.... <sroy@cabletron.com>
require statement broken <erik@zeno.com>
signal handlers <nall@pa.dec.com>
Re: Taint checking in NT (Larry Rosler)
Re: Taint checking in NT <johnc@interactive.ibm.com>
Web Electroacoustic Studio <aacwn100@york.ac.uk>
Re: Win32 Command Line Pass? <murrayb@vansel.alcatel.com>
Re: Yet another invocation line mystery (does seem to b <hansmu@xs4all.nl>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Aug 1998 19:59:49 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: (Simplest) way to convert string to array of chars?
Message-Id: <904075019.316009@thrush.omix.com>
[posted & mailed]
Benjamin Low <b.d.low@unsw.edu.au> wrote:
: where '...messed up string...' was the "encoded" notice. After the
: string was turned into an array it was joined via a slice with the
: appropriate indices to "decode" the string. ('X' did not occur in the
: string)
Personally, I think for something like this I would probably
have done something like:
s{.}{ decodeByte($1) }eg;
This allows you to walk each byte quickly, and apply an arbitrary
expression to it, without ever needing to do the intermediate work
of pulling it apart and putting it back together.
TMTOWTDI :-)
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Tue, 25 Aug 1998 16:27:10 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: A real newbie question
Message-Id: <linberg-2508981627100001@projdirc.literacy.upenn.edu>
In article <6rp2ml$tkt$1@news.loxinfo.co.th>, "Rob" <rob3@loxinfo.co.th> wrote:
> I have a form that I want to post to two different CGI scripts
> simultaneously is this possible...
> Thanks Rob
No.
You can call a single script that calls a second.
BTW, this is not a Perl question. Please use
comp.infosystems.www.authoring.cgi for CGI questions.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Tue, 25 Aug 1998 14:09:22 -0600
From: Eric Shipek <erics@wwwebcat.com>
Subject: Decoding URL's
Message-Id: <35E319F2.5728FAE1@wwwebcat.com>
To all,
I have a question about decoding form data into script variables. I'm
used to using JavaScript and LiveWire and when I read about how to
manipulate sting data in PERL, it looks like greek to me. In LiveWire
each request object is stored into a seperate variable that can be
accessed with the request object. As far as string manipulation is
concerned, I simply put the string through a loop based on its length
property and search for whatever characters I want with the charAt()
function like this:
thestring="";
for (i=0;i<request.variable.length;i++) {
//string manipulation statements such as:
if (request.variable.charAt(i)=="<" || request.variable.charAt(i)==">")
{
alert('No HTML allowed!');return false}
//Or if I'm building a string:
if (conditions) {
thestring=thestring+request.variable.charAt(i);}
}//end loop
I was wondering if there is a similar loop that I could use to go
through form data to access the variables variables and value pairs
submitted. I've read about how to do it, but for some reason it just
doesn't click with me. I have the mouse book by the way.
I appreciate your help as this is my first introduction to the PERL
language and I thank you in advance for your help and advice.
-Eric
ets3@email.byu.edu
------------------------------
Date: Tue, 25 Aug 1998 22:40:09 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Exporting Methods
Message-Id: <35E39FB9.110@comenius.ms.mff.cuni.cz>
Peter A Fein wrote:
>
> Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz> writes:
>
> > BTW: NEVER EVER export the new() function !!!
> > I did this mistake when I was young (actualy about 1.25 years ago ;-)
> > in my Mail::Sender and it made for a lot of problems.
>
> Umm, why? I 've done it with no problems. Not only that, I can't
> think of why you wouldn't export it. But that's me. As the Camel
> says, new() is a convention to make C++ programmers (including myself)
> thing they know what's going on. What difference does it make if it's
> called new() or looky_that_its_an_object()?
>
> --
> Peter A Fein Summering in SF!
I didn't say it shouldn't be called new() !
I only said that you should NOT export it into main
(or whatever) namespace. THAT is a Bad Thing(tm).
Imagine that you want to use two different OO modules.
They both define a new() constructor and both try to export it into
the ::main namespace. Now which new() will be called?
Example :
===FOO.pl===
package FOO;
require Exporter;
@ISA=qw(Exporter);
@EXPORT = qw(new ...);
sub new {
some code
}
...
===FOO.pl===
===BAR.pl===
package FOO;
require Exporter;
@ISA=qw(Exporter);
@EXPORT = qw(new ...);
sub new {
some other code
}
...
===BAR.pl===
===main.pl===
use FOO;
use BAR;
$foo = new(FOO,$x,$y,$z);
=============
So again, you should not EXPORT new(). And you should never
call it as an ordinary function, but always as a ststic method
(I think C++ books use this name).
$foo = new FOO ($x,$y,$z);
or
$foo = FOO->new($x,$y,$z);
instead of
$foo = new(FOO,$x,$y,$z);
The rule of the thumb for exporting is:
Export only what is strictly necessary and under a name that is
unlikely
to be used by any other module.
Which is not the case of new().
Jenda
------------------------------
Date: 25 Aug 1998 16:58:07 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Exporting Methods
Message-Id: <6rv8gv$i0v$1@monet.op.net>
In article <Pine.OSF.3.96.980825095132.26215B-100000@english.iielr.dmu.ac.uk>,
Mark Simonetti <se96ms@english.iielr.dmu.ac.uk> wrote:
>I'm currently writing a Perl script which uses classes. Reading a book on
>Perl tells me I need to export methods to use them.. yet I don't seem
>to have to ? Am I missunderstanding something ? It says I need to use
>"Exporter" !
You don't need the exporter for methods. Only for conventional
non-method functions.
------------------------------
Date: Tue, 25 Aug 1998 20:37:15 GMT
From: "Erik Knepfler" <erik@zeno.com>
Subject: Re: Help: How can I use full path of a *.pm file??
Message-Id: <%fFE1.389$J3.9233941@nnrp2.ni.net>
These are all interesting solutions, however, I still have a similar nagging
NT problem - I have many scripts that have a use or require statement with
_just the filename_, no path, and fail. These used to work, and now they
don't (changed Perl builds). It appears that many script authors whose
scripts I'm borrowing assume that the current directory of the script being
executed will be in the @INC - in fact, the errors that appear say that it
can't find the file in @INC which contains "."!!!
I can't use the below suggestions because there are too many scripts to
modify. Where can I find and change the contents of @INC globally to the
whole system? Why can't I even push a directory into @INC (this even used
to work!!!) Why isn't there just an environment variable that contains
this? If "." is in @INC, and it can't find the file, then "." must not be
the same directory as the script I'm running - why not? What directory is
it?
Erik
Russ Allbery wrote in message ...
>
> use lib '/usr/local/bin';
> use book_item;
>
------------------------------
Date: Tue, 25 Aug 1998 16:56:33 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Locking files on Window 95 server
Message-Id: <Ey98E9.C83@news.boeing.com>
In article <6rhb9q$34s$1@news2.xs4all.nl>,
Hugo Benne <h.benne@library.uu.nl> wrote:
>Hello !
>
>I tried to use the command "flock (FILE,2);" to lock a file on our Win95
>webserver. But instead of locking the file, the script stopped/crashed after
>this line of Perl code.
>
>Is this a known problem and does anybody know the solution ?
>
Worth noting that flock'll block which may explain why
the script stopped. But, crash... I'd be suprised if
flock's the culprit - even on Win95.
If you have 5.004 or later, you might try something
like this from T. Christiansen's just released gem,
"The Perl Cookbook" from O'Reilly:
sub LOCK_EX() { 2 } # exclusive lock (for writing)
sub LOCK_NB() { 4 } # Non-blocking request (don't stall)
unless (flock(FILE, LOCK_EX | LOCK_NB)) {
warn "can't immediately write-lock the file ($!), blocking...";
unless (flock(FILE, LOCK_EX)) {
die "can't get write-lock on numfile: $!";
}
}
HTH,
--
Charles DeRykus
------------------------------
Date: Wed, 26 Aug 1998 05:06:51 +0900
From: No.unsoiliciteds@dead.end (Norman UNsoliciteds)
Subject: Re: Looking for Programmer/Job Opp.
Message-Id: <No.unsoiliciteds-2608980506510001@cs11i11.ppp.infoweb.or.jp>
In article <6rv0vd$7cp$1@xmission.xmission.com>,
snowhare@xmission.xmission.com (Snowhare) wrote:
> $50/hour is *seriously* low if your custom Perl programmer knows what they
> are doing.
The only people I give $50/hour to is a
> 20 year personal friend and a sister who also works in the field.
That's awfully nice of you - you pay everybody more except for your sister
and your friend, I guess you don't have to worry about unions with them
--
The Dinosaurs were so stupid, they couldn't
even devise the means of thier own extinction,
they had to wait for Nature to do it for them.
------------------------------
Date: Tue, 25 Aug 1998 14:54:39 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Pattern match for filename extensions
Message-Id: <vp4vr6.g0k.ln@metronet.com>
Tad McClellan (tadmc@metronet.com) wrote:
: $extensions = join '|', reverse @ftypes;
Uhhh. Make that simply:
$extensions = join '|', @ftypes;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 26 Aug 1998 05:00:59 +0900
From: No.unsoiliciteds@dead.end (Norman UNsoliciteds)
Subject: Re: Perl compiler
Message-Id: <No.unsoiliciteds-2608980500590001@cs11i11.ppp.infoweb.or.jp>
In article <6rukm9$5tk$1@nnrp1.dejanews.com>, huntersean@hotmail.com wrote:
> contribute massively to the development of a language, and free software in
> general, write excellent and helpful reference documentation, and spend all
> your time and effort helping people
I think you missed out the bit where he suffers for the sins of humanity
and cures the blind. However I will conceed he probably was so busy doing
all that he never really got past the preface of the New Age guide to
eastern philosophies. Can't win em all can you?
--
The Dinosaurs were so stupid, they couldn't
even devise the means of thier own extinction,
they had to wait for Nature to do it for them.
------------------------------
Date: 25 Aug 1998 20:18:51 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
To: "Lily Y. Fu" <lily@tigr.org>, sae
Subject: Re: Perl compiler
Message-Id: <6rv67b$phm$1@justus.ecc.lu>
[ posted and mailed ]
In article <35E2D81F.4702@tigr.org>,
"Lily Y. Fu" <lily@tigr.org> writes:
> I'd like to thank everyone replied my seeking for help email!
>
> But, I still need furthur help. Here is my situation:
>
> <configuration description snipped>
>
> Here is the requirement:
>
> 1. I want user A, B, C be able to run the program themselves,
> so, they need read and execute permission
> I tried to make it only readable, but perl complains
> "Permission defined", I guess perl is an
> interpreted language,
> it needs the read permission to read it
> 2. But I don't want user A, B, C to know the webuser/passwd
> information on the OUT host, because there are other
> important staff on the machine, people may login
> to the host and so something harmful,
> so, I can't encrypt the passwd and ask user to type in
> the passwd for webuser
> 3. so, I am thinking, if I can convert the perl
> program into binary,
> it's safer so that users can't see the
> passwd in clear text
> 4. The program users are not highly sophisticated,
> and this password is not the top secret,
> but, I do not want every user just look at the
> program to know the password.
>
> Some people suggested to use a wrapper with 755 permission
> calling the program with password set 700 permission,
> but I got permission denied (the 700 doesn't give read
> permission)
>
> userpush.pl owner lily, permission 755, wrapper, call pushweb
> pushweb owner lily, permission 700 <== has the passwd info
>
> How can I make pushweb executable by everyone
> but can't be read by everyone?
> Use the setuid? but I don't know how to implement it.
In this case, I'd make a .pushwebrc (so it follows the
UNIX config file naming convention), and make sure it's
only readable by the owner:
chmod 400 .pushwebrc
or
chmod 600 .pushwebrc
.pushwebrc contains the plain-text password for the user
(you could make it something like:
system user password
system user password
...
so you can support several systems, and use a different
username on the outside system.
Before reading the .pushwebrc file, check that the permissions
are OK:
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = stat(".pushwebrc");
$mode will contain the file type and the permissions. To access
the permissions (you want to make sure that the two lower octal
digits are 0):
printf "$mode is 0%o\n", $mode;
if ($mode & 077) {
print ".pushwebrc is not safe\n";
exit;
}
print ".pushwebrc is safe, processing...\n";
# Read the password from the .pushwebrc file
...
You now have a reasonable assurance that the passwords are
safe. Another option is to encrypt the passwords in the
.pushwebrc file, but then you'd have to provide a program
to manage the file.
With the scenario described above, each user has to call
pushweb to upload his pages to the Web server, which what
I understand you want to happen. This approach has the
advantage that each user is responsible for the management
of her passwords on the server - much to be preferred over
a central password storage.
Hope this helps,
--
Stefaan
--
PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
Perfection is reached, not when there is no longer anything to add,
but when there is no longer anything to take away. -- Saint-Exupiry
------------------------------
Date: 25 Aug 1998 20:38:20 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Perl compiler
Message-Id: <6rv7bs$auo$1@news.NERO.NET>
In article <6rurm4$6h5$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>Surely you're espousing neither security through obscurity, nor
>the writing down of passwords?
All security is via obscurity, as I have been told by someone who claims
to know such things. And you may be able to remember passwords that you
use once every three months or so, but most of the rest of us need to
write such things down or they are lost.
------------------------------
Date: 25 Aug 1998 20:38:18 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl compiler
Message-Id: <6rv7bq$eu8$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, cberry@cinenet.net (Craig Berry) writes:
:No, not even as strong as hypocrisy. Rather, inconsistency. I'm betting
:that Tom C hasn't thought through the full implications of his position,
:and that perhaps he will wish to reevaluate it. Or not. I'm eagerly
:awaiting his commentary.
I absolutely never require that those I've taught restrict themselves
from then teaching others based on the knowledge they've gleaned from me.
And I also refuse any jobs that expect me to sign away related rights.
For example, if I extemporaneously develop an example program while
teaching on site, I expect to be able to use that code in courses
presented to other companies, and I expect those whom I teach to be able
to show that code to whomever they please. Anything less than that is
unacceptable. And yes, I have on occasion turned down jobs for moral
reasons associated with these positions.
And for the record, I resent the way you have represented me.
--tom
--
echo $package has manual pages available in source form.
echo "However, you don't have nroff, so they're probably useless to you."
--Larry Wall in Configure from the perl distribution
------------------------------
Date: 25 Aug 1998 20:25:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl documentation
Message-Id: <6rv6is$eu8$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, bhilton@tsg.adc.com (Brand Hilton) writes:
:You should probably mention that your filters are pretty aggressive,
:and result in a high percentage of false positives.
I don't think so. I do reject a lot of mail, but seldom
is it something I wanted to read anyway. :-)
--tom
--
echo "I can't find the O_* constant definitions! You got problems."
--The Configure script from the v5.0 perl distribution
------------------------------
Date: Tue, 25 Aug 1998 16:28:23 -0400
From: Sean Roy <sroy@cabletron.com>
Subject: Re: Regex question - removing HTML tags....
Message-Id: <35E31E67.2286@cabletron.com>
Ok,
The stuff in the parentheses says this:
match NOT right angle bracket OR \n (newline). When you see
[^chars...] that carat tells the pattern matcher to not match the
following characters. I'm assuming this is to avoid substituting <> for
<, where someone might have wanted <> since it isn't a markup, (I
guess..). The pipe, | is so that you can list alternatives for a
match. Match this OR (|) that, (don't forget, that's OR, not XOR).
The asterisk is just a wildcard meaning, I don't care what is
between the two angle brackets, just match it.
Of course, the //g part means replace everything that matches the
preceeding criteria with nothing.
Pages 57-76 in the Camel book ("Programming Perl") give an
incredibly painful if not thorough crash course in Regexes. O'reilly
and Associates put out a pretty decent treatise on the subject, aptly
named "Mastering Regular Expressions." They publish "Programming Perl"
also. Check them out, but drink plenty of coffee before you delve into
anything regarding regular expressions.
iada@hplb.hpl.hp.com wrote:
>
> Hi,
> I'm very new to perl and haven't got my head around the joys of regular
> expressions -> I came across this example for removing the HTML tags from a
> string and can't work out how it works:
>
> $value=~s/<([^>]|\n)*>//g
>
> from what I understand it strips the < > pair and anything inbetween, the []
> being a character class, the parenthesis being a group and the * being one or
> more tokens to match (the g being global replace?)
>
> However....I'm confused by the caret - not the beginning of a string in this
> context? and the | in the character class...
>
> I've tried consulting the man pages as well as all the tutorials I could find,
> and am still stuck :-(
>
> Can anyone tell me how this works and/or point me in the direction of an
> idiots guide to Regular expressions?
>
> Thanks
>
> Ian
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
--
-------------------------------------------------
Sean N. Roy <sroy@ctron.com> <snr@hopper.unh.edu>
Configuration Management
Cabletron Systems, Inc.
------------------------------
Date: Tue, 25 Aug 1998 20:27:09 GMT
From: "Erik Knepfler" <erik@zeno.com>
Subject: require statement broken
Message-Id: <x6FE1.387$J3.9229953@nnrp2.ni.net>
Running on NT Server, latest ActivePerl build. My statement of:
require 'someotherfile.pl';
..used to work fine before installing ActivePerl. Now it says that it can't
find it in @INC, yet @INC contains the "." directory, so it should work. I
even tried:
push (@INC, "d:\\mydir\\wherethe\\fileis");
require 'someotherfile.pl';
..but even after that, the resulting error doesn't seem to have caught that
push command (this used to work too). Unforunately I have a million scripts
with these sorts of requires, and I don't want to move them into a valid
@INC dir - how can I fix this?
Erik
------------------------------
Date: Tue, 25 Aug 1998 12:55:16 -0700
From: nall <nall@pa.dec.com>
Subject: signal handlers
Message-Id: <35E316A4.59AC831E@pa.dec.com>
hello.
i want to use perl to create a wrapper around a program that the
user should not be able to ctrl-c out of. here's an example.
------------------------------
#!/usr/local/bin/perl
$SIG{INT} = \&handler;
$|=1;
`cvs commit file1 file2`;
sub handler {
print("Handled the interrupt\n");
$SIG{INT} = \&handler;
}
------------------------------
if i press ctrl-c in the middle of execution, i want the program
to just ignore the SIGINT, but instead it passes it to the cvs
command. is there a way to avoid this? (once committing starts, i
don't want the user to be able to intervene). also, i can't run
it in the background, since cvs needs a terminal to execute the
editor program in...
thanks.
jonathan.
--
jonathan n. nall
nall@pa.dec.com
650-853-6508
DTN: 543-6508
------------------------------
Date: Tue, 25 Aug 1998 13:02:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Taint checking in NT
Message-Id: <MPG.104cb80eec4ad29a9897ec@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <6rv3ad$22j$4@nz12.rz.uni-karlsruhe.de> on Tue, 25 Aug 1998
19:28:13 GMT, Marc Haber <Marc.Haber-usenet@gmx.de> says...
& "John Call" <johnc@interactive.ibm.com> wrote:
& >I like to develop on Unix but have been asked to develop my current
project
& >on NT. I want to enable taint checking. I left in the the shebang line
as
& >follows:
& >
& >#!/usr/bin/perl -w -T
& >
& >Perl seems to be performing as asked. My question, is this the proper
way to
& >turn on warnings and taint checking on NT systems or is there a more
proper
& >way that is preferred by Perl?
&
& The Shebang line is a comment for perl [1] and ignored by NT. You are
& presumably calling your script by calling "perl scriptname". Make that
& "perl -wT scriptname" instead.
& [1] unless there is some magic happening that I am not aware of
You are not aware that this line *is* processed for switches on Win32
systems, though the path is ignored.
--
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 25 Aug 1998 16:05:07 -0400
From: "John Call" <johnc@interactive.ibm.com>
Subject: Re: Taint checking in NT
Message-Id: <6rv5f2$1oia$1@ausnews.austin.ibm.com>
>>#!/usr/bin/perl -w -T
>>
>>Perl seems to be performing as asked. My question, is this the proper way
to
>>turn on warnings and taint checking on NT systems or is there a more
proper
>>way that is preferred by Perl?
>
>The Shebang line is a comment for perl [1] and ignored by NT. You are
>presumably calling your script by calling "perl scriptname". Make that
>"perl -wT scriptname" instead.
>
>Greetings
>Marc
>
>[1] unless there is some magic happening that I am not aware of
I actually assumed it would be a comment myself but when I put it in on a
whim it gave me warnings. I left in the shebang line and took out the -w and
no warnings, put -w back in and I get warnings. I therefore assume it works.
I was just curious if there is a preferred way? This file is running as a
CGI so I don't have the option of running it as perl -w script.pl. I could
put those command line parameters in the server but that is not an optimal
solution in this case because all the servers the script gets run on may not
be set up this way and I don't have access to all the servers to set them up
that way.
As long as it is working I'm happy but I would like to optimize for the
enviornment if possible so if there is a "right way" on NT to do this then
let me know.
Thanks again,
John Call
IBM Interactive Media
------------------------------
Date: Tue, 25 Aug 1998 21:17:40 +0100
From: Andy Ng <aacwn100@york.ac.uk>
Subject: Web Electroacoustic Studio
Message-Id: <35E31BE4.8DDE806B@york.ac.uk>
Alright!!!
Hope your project's going ok!
I've a favour to ask you. If you're not too busy in the next week or so
(why should you be!....) Can you please take a look at the website which
is a prototype of my project. The URL is:
"http://dee.amp.york.ac.uk:8083/"
I need some feed back so if you could email me with them (if they're
really
hard!), or sign my guestbook. Actually it's be cool to sign my
guestbook,
just so I know it's working!
It's only a prototype so I know there may be things missing-but please
bear
in mind when making your comments, the basic functionality and it's
potential to be good. Like, How can it be a marketable product if that
potential was reached?
Final points:
1.Remember it's an .aiff file needed.
2.If you don't have an .aiff then you can use one of the examples
already on.
3.I will clear all soundfiles at the end of everyday, my account isn't
that
big!
4.On the first page..you don't have to follow the words to read the
text....
you'll see....
BIG THANKS!!!.......if you get the time to do it of course! ;)
--Andy
------------------------------
Date: 25 Aug 1998 12:45:34 -0700
From: Brad Murray <murrayb@vansel.alcatel.com>
To: stepherd@gusun.georgetown.edu
Subject: Re: Win32 Command Line Pass?
Message-Id: <u1zq47sm9.fsf@vansel.alcatel.com>
Dave Stephens <stepherd@gusun.georgetown.edu> writes:
> First, which is the preferred method? Any differences? My perl
> education has
> consisted primarily of browsing through other people's code and an
> occasional
> scan of the camel book, thus I sometimes end up with quirky
> methodologies.
If you want the output, backticks are good. If you wanted to run it
continuously (ping -t), you'd want to open the process as a file
handle and loop over lines (perldoc -f open).
> Second, let's say I wanted to check the output of such a command. For
> example,
> if I call print `ping 141.161.1.2\n`; how can I check if the response
> is "Reply from
> 141.161.1.2: bytes=blah blah blah" or "Request timed out." ???
while (<DATA>) {
$ping = `ping -n 1 $_`;
if ($ping =~ /Reply from/) {
# process success condition
print "$_ is okay...\n";
} else {
# process failure condition
print "$_ is broken...\n";
}
}
__END__
141.161.1.2
141.161.1.3
141.161.2.1
--
GAT$ d+(---) s: a C(++++) U++++$ P+++$ L++ E+ W+ N+ !o !K w--- O++$ M+
V PS++ PE Y+ PGP t-- 5 X-- !R tv- b+++ DI++ !D G+ e* h- r+++ y+++
------------------------------
Date: 25 Aug 1998 20:34:26 GMT
From: Hans Mulder <hansmu@xs4all.nl>
Subject: Re: Yet another invocation line mystery (does seem to be perl related)
Message-Id: <6rv74i$leu@news.euro.net>
Martin Gregory <mgregory@asc.sps.mot.com> wrote:
>> >In a previous post I observed that
>> > #!/bin/sh
>> > eval 'exec perl -w -S $0 ${1+"$@"}' # Use the -*- perl -*- on our
path.
>> > if 0;
>> > print "yay\n";
>> >does not work.
>> >How come it does work if you remove the #! line!?
>Sorry to be dense, but I don't understand this because I'm not feeding
>the original script to perl, I'm feeding it to sh.
>
>sh igonores the #! (right? or at worst invokes another sh)
Right.
>sh evals the exec and call perl -w blah.
>Then what? Why does something (sh?) end up complaining about -w?
Then perl finds the #!/bin/sh and execs "/bin/sh -w blah".
(Perlrun doesn't really say what arguments perl passes to the
program named on the #! line. It turns out perl simply passes
on whatever it got from whoever called perl.)
Then /bin/sh complains about -w not being a legal sh option.
P.S. For what it's worth, this is an endless loop:
#!/bin/sh
echo "yay"
exec perl $0
When perl reads that script, it finds the #! and execs /bin/sh.
When /bin/sh reads it, it gets as far as line 3 and execs perl.
Your script doesn't loop like this, because you're adding a -w
option to the arguments.
Hope this helps,
-- HansM
------------------------------
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 3540
**************************************