[9692] in Perl-Users-Digest
Perl-Users Digest, Issue: 3286 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 29 14:07:19 1998
Date: Wed, 29 Jul 98 11:01:17 -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 Wed, 29 Jul 1998 Volume: 8 Number: 3286
Today's topics:
re: aids created by man <simon@new-mediacom.com>
Re: anyone know of a syslogd replacement? <rootbeer@teleport.com>
RE: bug in lexical array reference? <jpowers@cs.oberlin.edu>
Changing foreign characters <aidan@crux.blackstar.co.uk>
Re: Changing foreign characters <minich@globalnet.co.uk>
Re: Changing foreign characters (Abigail)
Dereferencing Hashes and Arrays <rogersmith@mail.arc.nasa.gov>
Re: Dereferencing Hashes and Arrays <jdporter@min.net>
File associations for Perl on NT box <bcarter@biztrack.com>
Re: file system operations on open files (Mark-Jason Dominus)
Re: file system operations on open files <Adriaan.van.Kessel@NotThere.rivm.nl>
Re: file system operations on open files <marcelo.meira@waii.ERASETHIS.com>
Re: file system operations on open files <jdporter@min.net>
Re: file system operations on open files (Mark-Jason Dominus)
Re: fork() problem mickghazey@my-dejanews.com
Re: Glob problem <rootbeer@teleport.com>
Re: Help on my very short script using hash dave@mag-sol.com
Re: Help on my very short script using hash <rootbeer@teleport.com>
Re: Help on my very short script using hash <simonf@conduit.co.uk>
Re: Help on my very short script using hash (Aaron B. Dossett)
hiding user input (Scott Stark)
How to delete files inside perl script? <cmeena@hotmail.com>
Re: How to delete files inside perl script? <rootbeer@teleport.com>
Re: How to delete files inside perl script? <nguyend7@egr.msu.edu>
I want to separate my Perl from my HTML pjgeer@my-dejanews.com
Re: Interesting Question needs Quick Answer <simonf@conduit.co.uk>
Re: launching programs in perl scripts <rootbeer@teleport.com>
Re: Link Updating <rootbeer@teleport.com>
method GET and windows NT <nuriaf@santandersupernet.com>
Re: Net::Telnet -like module without telnet (Michael J Gebis)
Re: Newbie: extracting fields <simonf@conduit.co.uk>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 29 Jul 1998 17:03:16 +0100
From: Simon Wistow <simon@new-mediacom.com>
Subject: re: aids created by man
Message-Id: <645CAC0140CED111AF1500805FEDDB8A6D6F@ns.new-mediacom.co.uk>
> On the one hand there is the sheer 'convenience' of aids ie (gets rid
> of homosexuals, drug users, promiscuous people and large chunks of
> third world populations ... all considered undesirable by
> governments), the fact that there are cases of people with AIDs but
> who never got HIV and vice versa and also the fact that with all this
> research nobody has yet found a cure.
>
> On the other hand it could just be a really evil little shit.
>
> Now here's another topic to toss into the melting pot :
> Did you know that there's considerable evidence that RSI is
> caused by a virus and not typing?
>
> Discuss ...
>
>
>
> -----Original Message-----
> From: adamj@netspace.net.au (Adam Jenkins)
> [SMTP:adamj@netspace.net.au]
> Posted At: Tuesday, July 28, 1998 12:23 PM
> Posted To: misc
> Conversation: Recent Secret Government Experiments Killing
> People!!!
> Subject: Re: AIDS created by man (was :Re: Recent Secret
> Government Experiments Killing People!!!
>
> "general.shalikashvilli@pentagon (.com)" <president@aol.com>
> writes:
>
> >check out :
> >http://www.peg.apc.org/~newdawn/
> >to see some interesting files about the AIDS conspiracy.
>
> Or do a search for "Peter Duesburg". From memory the deal is
> basically
> that there's no real link between HIV and AIDS. The science
> industry
> are getting lots of valuable funding for AIDS research, and it
> would
> ruin their reputation to turn around now and go "er.. we were
> wrong".
> Oh and AIDS is a wonderful way to encourage safe sex; go around
> telling
> people that they can have unsafe sex and not get AIDS and die
> (hep B
> etc aren't so scary) and they'll get all promiscuous and bad.
>
> I've also heard that it's reasonably curable by blood
> tranzfusion or
> something (research done in France), but this is being kept
> quiet while
> they keep looking for a more marketable cure. Whoever invents
> an actual
> drug that can cure it is going to be a very rich person.
>
> My brother did a subject at the University of Melbourne where
> the
> HIV/AIDS connection was taught; many people have tried to stop
> the
> lecturer from teaching what he does. There was a guy too who
> had publicly
> stated he would inject himself with AIDS to prove his theories
> were right.
>
> WHAT this has to do with hacking is totally beyond me :) Part
> of
> the "subculture" of hackers being all smart and in-the-know?
> But then
> all this stuff is common knowledge to most biology/medicine
> students etc.
------------------------------
Date: Wed, 29 Jul 1998 16:51:53 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: anyone know of a syslogd replacement?
Message-Id: <Pine.GSO.4.02.9807290951150.19378-100000@user2.teleport.com>
On Wed, 29 Jul 1998, stephen farrell wrote:
> Subject: anyone know of a syslogd replacement?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 29 Jul 1998 12:30:23 -0400
From: Joshua Powers <jpowers@cs.oberlin.edu>
To: ts <decoux@moulon.inra.fr>
Subject: RE: bug in lexical array reference?
Message-Id: <Pine.ULT.3.96.980729121911.2623Z-100000@occs.cs.oberlin.edu>
Ah - according to man perlsub:
Just because the lexical variable is lexically (also called
statically) scoped doesn't mean that within a function it
works like a C static. It normally works more like a C
auto. But here's a mechanism for giving a function private
variables with both lexical scoping and a static lifetime.
If you do want to create something like C's static
variables, just enclose the whole function in an extra
block, and put the static variable outside the function but
in the block.
{
my $secret_val = 0;
sub gimme_another {
return ++$secret_val;
}
}
# $secret_val now becomes unreachable by the outside
# world, but retains its value between calls to gimme_another
So essentially, even after the block is exited, perl retains a list of
values for that block somewhere (i.e. - they aren't really deleted), so if
the block is entered again, and the variable values aren't declared that
will use the last good values of the variables. Is this true? I think I
was unclear on the definition of lexical scoping. I thought it meant the
variable names were actually _deleted_ upon exiting the enclosing block,
but apparently, they are stored away in case the block is ever entered
again. Am I correct, now? If this is true, than this is not a bug after
all. Thank you for all your help.
-Josh Powers
On Wed, 29 Jul 1998, ts wrote:
> >>>>> "J" == Joshua Powers <jpowers@cs.oberlin.edu> writes:
>
> J> Oh, I see what you're saying now. But a my() variable must be deleted
> J> upon exiting its enclosing block. So this has to be a bug, right? This
>
> No, I don't think the doc say :
>
> This doesn't mean that a my() variable declared in a
> statically enclosing lexical scope would be invisible. Only
> the dynamic scopes are cut off. For example, the bumpx()
> function below has access to the lexical $x variable because
> both the my and the sub occurred at the same scope,
> presumably the file scope.
>
> The variable $n is always in its scope, and must be visible.
>
> J> variable name clearly isn't being deleted from the namespace.
>
> but I can't explain the output when you associate the ref() and the
> value.
>
> moulon% cat a.pl
> #!/usr/bin/perl -w
> use strict;
> sub toto {
> my $m = shift;
> my $n = 2 if !($m % 5);
> $n += 2;
> print \$n, " -- $n\n";
> }
> for (0 .. 11) {
> toto($_);
> }
> moulon% a.pl
> SCALAR(0xc4910) -- 4
> SCALAR(0xc6188) -- 2
> SCALAR(0xc6188) -- 4
> SCALAR(0xc6188) -- 6
> SCALAR(0xc6188) -- 8
> SCALAR(0xc6188) -- 4
> SCALAR(0xc617c) -- 2
> SCALAR(0xc617c) -- 4
> SCALAR(0xc617c) -- 6
> SCALAR(0xc617c) -- 8
> SCALAR(0xc617c) -- 4
> SCALAR(0xc4910) -- 2
> moulon%
>
> Why it retrieve the value 4 after 8 (for SCALAR(0xc6188)) ?
>
> Then why it begin with SCALAR(0xc617c) -- 2 ?
>
> Perhaps there is a problem here, I don't know
>
>
> Guy Decoux
>
>
>
-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-^-_-
Josh Powers - jpowers@cs.oberlin.edu
http://www.cs.oberlin.edu/~jpowers
------------------------------
Date: Wed, 29 Jul 1998 15:55:26 GMT
From: Aidan Rogers <aidan@crux.blackstar.co.uk>
Subject: Changing foreign characters
Message-Id: <901731311.712595@sparc.tibus.net>
I'm currently writing a program in Perl which generates TeX dynamically, and
the output of the TeX gets printed. However, TeX barfs any time I try to send
it a foreign character, like a-umlaut, or n-tilde and so forth. Does anyone
know of a Perl module that will change a-umlauts in to a's, as I have not
been able to find one on CPAN. (This could however be down to my lack of
experience and general short-sightedness when it comes to finding things that
are right in front of me).
Any help (including alternative solutions) would be greatly appreciated.
Thank,
Aidan
------------------------------
Date: Wed, 29 Jul 1998 17:25:25 +0100
From: "Martin" <minich@globalnet.co.uk>
Subject: Re: Changing foreign characters
Message-Id: <6pniea$9op$1@heliodor.xara.net>
You can use standard regular expressions.
$text =~ tr/DdVv\|Qq/AaOoUuNn/;
Although, for the umlauts, you may prefer to following:
$text =~ s/D/AE/g;
$text =~ s/v/oe/g;
since an umlaut (in German at least) can be written as the letter followed
by an e instead.
Martin
------------------------------
Date: 29 Jul 1998 17:21:21 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Changing foreign characters
Message-Id: <6pnlmh$aal$5@client3.news.psi.net>
Martin (minich@globalnet.co.uk) wrote on MDCCXCIII September MCMXCIII in
<URL: news:6pniea$9op$1@heliodor.xara.net>:
++ You can use standard regular expressions.
++
++ $text =~ tr/DdVv\|Qq/AaOoUuNn/;
++
++ Although, for the umlauts, you may prefer to following:
++
++ $text =~ s/D/AE/g;
++ $text =~ s/v/oe/g;
Well, since it's TeX, you'd be silly if you lose the accents.
s/D/\\"A/g;
s/v/\\"o/g;
etc...
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
------------------------------
Date: Wed, 29 Jul 1998 09:56:27 -0700
From: Roger Smith <rogersmith@mail.arc.nasa.gov>
Subject: Dereferencing Hashes and Arrays
Message-Id: <35BF5439.647F1207@mail.arc.nasa.gov>
This is a multi-part message in MIME format.
--------------DB3F23C82F73BE2C08B3E61E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
HI
I have a hash of arrays, created by the Ldapp package. After retrieving
a record it is stored in an entry array that is an hash of arrays:
DB<13> X entry
$entry = HASH(0x43b7a4)
'cn' => ARRAY(0x4d3b68)
0 'Judith K. Stevens'
'createtimestamp' => ARRAY(0x4d38a4)
0 '19980531194950Z'
'creatorsname' => ARRAY(0x4d3850)
0 'uid=admin,o=arc.nasa.gov'
'dn' => 'uid=jkstevens,o=arc.nasa.gov'
'givenname' => ARRAY(0x4d6014)
0 'Judith K.'
... remainder omitted.
I try to fetch a value from this hash with:
$givenname = @$entry{'givenname'}; # first name
Now $givenname looks like:
DB<14> X givenname
$givenname = ARRAY(0x4d6014)
0 'Judith K.'
but whenever I try to access the CONTENTS of $givenname or @givenname,
perl returns the scaler of "1"; which I assume is perl's way of trying
to tell me that the array contains one entry????
What I really want is to obtain a STRING variable that contains the
string "Judith K." so I can run regular expressions over it.
Any suggestions would be most gratefully appreciated.
Thanks,
--------------DB3F23C82F73BE2C08B3E61E
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Roger Smith
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Roger Smith
n: Smith;Roger
org: NASA-Ames Research Center
adr: MS/233-10;;Building 233, Room 235;Moffett Field;Ca;94035;US
email;internet: rogersmith@mail.arc.nasa.gov
title: Senior WebMaster, LDAP Evangelist
tel;work: 650-604-3583
tel;fax: 650-604-1560
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------DB3F23C82F73BE2C08B3E61E--
------------------------------
Date: Wed, 29 Jul 1998 17:56:52 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Dereferencing Hashes and Arrays
Message-Id: <35BF62CD.6EBB@min.net>
Roger Smith wrote:
>
> $givenname = @$entry{'givenname'}; # first name
Assigning an array to a scalar?
That gives the array length!
Do this:
$givenname = $entry{'givenname'}[0];
which gets the 0'th element, which you already know
is the only one there.
--
John Porter
------------------------------
Date: Wed, 29 Jul 1998 10:04:17 -0700
From: "RL Carter" <bcarter@biztrack.com>
Subject: File associations for Perl on NT box
Message-Id: <6pnd8g$jub$1@paperboy.owt.com>
Okay, okay, I have read just about every conceivable piece of data on Perl
for NT and have a problem. I am attempting to put up Perl from
Activeware-Activestate on an NT4.0 box running MSIS. I had trouble, but got
it to work after reading a lot of stuff posted on the web. However, one
problem I am not sure I fixed correctly. When my test scripts were not
being executed properly, I followed the instructions in MSKB186801 and
corrected to problem. That article has you associate .pl files with
PerlIS.dll. Other information posted on the Web tells me to make sure I
have my .pl (and .cgi) extensions associated with Perl.exe and NOT
PerlIS.dll and that this must be done BOTH in the registry AND from
explorer. Well, can anyone tell me the correct answer(s)?
1) What should be associated with what?
2) From where?
3) How?
4) Why?
I sure a lot of people would like to know the definitive answer to these
questions. If you know, please post back to bcarter@biztrack.com
------------------------------
Date: 29 Jul 1998 12:29:31 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: file system operations on open files
Message-Id: <6pnilb$g45$1@monet.op.net>
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.
Geez louise.
------------------------------
Date: 29 Jul 1998 16:29:57 GMT
From: "A.van.Kessel" <Adriaan.van.Kessel@NotThere.rivm.nl>
Subject: Re: file system operations on open files
Message-Id: <6pnim5$dsq$1@mississippi.rivm.nl>
lr@hpl.hp.com (Larry Rosler) wrote:
>
>It may be common for Unix systems, but it is not portable. 'Inode' is
>not a portable concept.
>
Most of the confusion was caused by crossposting to comp.unix.programmer.
The semantics for open files/inodes are pretty clear. In c.u.p "portable"
may mean: portable between Unixes.
I don't know about perl's assumptions. I guess it just sits on the OS
and inherits anything under the hood.
So let's say: unlinking/moving an open file *is* portable as long as you
stick with unix.
:-)
--
Happy hacking,
Adriaan van Kessel.
Ingres DBA, C/Unix hacker
Email: Adriaan.van.Kessel@rivm.nl
(remove NotThere. from the address in the header)
*** Nederlandstalige zachtwaar is een pijn in de aars ***
------------------------------
Date: Wed, 29 Jul 1998 12:02:03 -0500
From: "Marcelo L. Meira" <marcelo.meira@waii.ERASETHIS.com>
Subject: Re: file system operations on open files
Message-Id: <35BF558B.2BAE83D5@waii.ERASETHIS.com>
Ilya Zakharevich wrote:
>
> [A complimentary Cc of this posting was sent to Marcelo L. Meira
> <marcelo.meira@waii.ERASETHIS.com>],
> > Not according to Bach's "The Design of the Unix OpSys" (chap. 5). The
> > abstraction Unix uses between User's fd table <-> file table <-> inode
> > table allows for the syscalls in question, no matter if the file is
> > opened or not. If a OS doesn't support this, it's not Unix.
>
> Exactly. And probably visa versa. Which makes it absolutely unportable.
>
> Ilya
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.
Larry Rosler wrote:
>
> That's right. That's the point. 'Portable' includes other OSs than Unix
> variants. There are a few such, you know.
>
Yes, I know. I even know about ANSI C!
--
----------------
Marcelo L. Meira, Programmer
spam bait: postmaster@localhost
e-mail: marcelo.meira at waii dot com
Western Geophysical - (713) 689-2679
"UNIX _IS_ user friendly; it's just picky about who its friends are."
------------------------------
Date: Wed, 29 Jul 1998 17:50:22 GMT
From: John Porter <jdporter@min.net>
Subject: Re: file system operations on open files
Message-Id: <35BF6147.2BB6@min.net>
A.van.Kessel wrote:
>
> In c.u.p "portable" may mean: portable between Unixes.
>
> So let's say: unlinking/moving an open file *is* portable as long as you
> stick with unix. :-)
Heh, this reminds me of ads you sometimes see, which proclaim
*RUNS ON ALL MAJOR PLATFORMS!*
which then turn out to be: Win3.1, Win95, WinNT3.51 Client, WinNT3.51
Server, WinNT4.0 Client, WinNT4.0 Server, Novell NetWare...
--
John Porter
------------------------------
Date: 29 Jul 1998 13:53:26 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: file system operations on open files
Message-Id: <6pnnim$gra$1@monet.op.net>
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.
------------------------------
Date: Wed, 29 Jul 1998 17:04:56 GMT
From: mickghazey@my-dejanews.com
Subject: Re: fork() problem
Message-Id: <6pnknp$1ha$1@nnrp1.dejanews.com>
It worked on my 12 processor Solaris box. I'll test it on a uniprocessor when
I get a chance.
In article <6phf0q$m2e$1@nnrp1.dejanews.com>,
dwiesel@my-dejanews.com wrote:
> Hi,
>
> I have a fork() problem. I can't figure out what is wrong. Look at this
> code...
>
> #! /usr/local/bin/perl
> $number_of_forks = 0;
>
> $SIG{CHLD} = sub { $number_of_forks--; wait;};
>
> for ($i = 0; $i < 3; $i = $i + 1)
> {
> $number_of_forks++;
> $pid = fork;
>
> # If child
> if ($pid eq 0)
> {
> &do_something_that_takes_a_while($i);
> exit;
> }
> }
>
> while($number_of_forks > 0)
> {
> print "Number of forks: $number_of_forks\n";
> sleep 1;
> }
>
> When I run this small program I get the following output:
>
> my_computer:~$ test.pl
> Number of forks: 3
> Number of forks: 1
> Number of forks: 1
> Number of forks: 1
> etc. etc. (looping forever)
>
> I can't figure out what I have done wrong... can you help me?
>
> // Daniel
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 29 Jul 1998 16:40:36 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Glob problem
Message-Id: <Pine.GSO.4.02.9807290932490.19378-100000@user2.teleport.com>
On Wed, 29 Jul 1998, Daniel wrote:
> open(MYNEWFIL,"/dbase.txt");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> local (*GLOB) = $name;
> $GLOB = $value;
You probably want to use a hash instead of this.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 29 Jul 1998 15:51:40 GMT
From: dave@mag-sol.com
Subject: Re: Help on my very short script using hash
Message-Id: <6pngec$rif$1@nnrp1.dejanews.com>
In article <lloyd007-2907980715550001@lloyd007.vip.best.com>,
lloyd007@best.com (lloyd) wrote:
> I have been trying to make a very simple script about hash work but so far
> am frustrated. Now it seems that I have the has correct, but now I am
> getting other troubel with the script. It is a simple program to ask your
> name and then for a password. I stored the password in the hash and now I
> am trying torecall the password and match it to the users output here is
> the script
>
> #!/usr/bin/perl -w
>
> %pass = (
> "lloyd => lloyd
> leanne => henigman
> udel => wilson"
> );
You've initialised your hash wrongly. I think you mean
%pass = (
lloyd => 'lloyd',
leanne => 'henigman',
udel => 'wilson'
);
hth,
Dave...
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 29 Jul 1998 16:50:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Help on my very short script using hash
Message-Id: <Pine.GSO.4.02.9807290949010.19378-100000@user2.teleport.com>
On 29 Jul 1998, lloyd wrote:
> #!/usr/bin/perl -w
>
> %pass = (
> "lloyd => lloyd
> leanne => henigman
> udel => wilson"
> );
How is it that you're running this with warnings turned on and you aren't
getting a warning for this? Are you using some very old version of perl?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 29 Jul 1998 17:17:14 +0100
From: "Simon Fairey" <simonf@conduit.co.uk>
Subject: Re: Help on my very short script using hash
Message-Id: <35bf4a27.0@nnrp1.news.uk.psi.net>
lloyd wrote in message ...
>I have been trying to make a very simple script about hash work but so far
>am frustrated. Now it seems that I have the has correct, but now I am
>getting other troubel with the script. It is a simple program to ask your
>name and then for a password. I stored the password in the hash and now I
>am trying torecall the password and match it to the users output here is
>the script
>
>#!/usr/bin/perl -w
The -w should have pointed out the odd number of elements in your hash
>
>%pass = (
> "lloyd => lloyd
> leanne => henigman
> udel => wilson"
> );
This should read ('my' is optional but recommended)
my %pass = (
'lloyd' => 'lloyd',
'leanne' => 'henigman',
'udel' => 'wilson'
);
Then everything will work fine, look at the perldata, perldsc and eventually
perllol man pages for more info on correctly initialising hashes.
Simon
------------------------------
Date: 29 Jul 1998 17:41:35 GMT
From: aarond@alpha.ewl.uky.edu (Aaron B. Dossett)
Subject: Re: Help on my very short script using hash
Message-Id: <6pnmsf$bqh$1@service3.uky.edu>
Tom Phoenix (rootbeer@teleport.com) wrote:
> On 29 Jul 1998, lloyd wrote:
>
> > #!/usr/bin/perl -w
> >
> > %pass = (
> > "lloyd => lloyd
> > leanne => henigman
> > udel => wilson"
> > );
>
> How is it that you're running this with warnings turned on and you aren't
> getting a warning for this? Are you using some very old version of perl?
It doesn't have to be all that old, my copy of 5.003 doesn't issue a
warning.
--
Aaron B. Dossett | Finger aarond@london.cslab.uky.edu for PGP key
dossett@bigfoot.com|
Comp. Sci. Senior | http://www.ewl.uky.edu/~aarond
University of Kentucky 1996 & 1998 NCAA Basketball Champions
------------------------------
Date: 29 Jul 1998 17:29:26 GMT
From: sstark@informix.com (Scott Stark)
Subject: hiding user input
Message-Id: <6pnm5m$3gh1@webint.na.informix.com>
Is there any way to make user input in a perl script invisible, or showing a
series of **** characters instead of what's typed? My script prompts the user
for a password and currently anyone watching can see the input.
thanks
Scott Stark
sstark@informix.com
------------------------------
Date: Wed, 29 Jul 1998 11:19:04 -0500
From: Meena Chockalingam <cmeena@hotmail.com>
Subject: How to delete files inside perl script?
Message-Id: <35BF4B78.751D7C39@hotmail.com>
Hi All,
I am running SunOS 4.1.3. Inside my perl script, I want to delete bunch
of files.
I used backquotes as well as system commands. Nothing seems to work.
Any help would be appreciated.
Thanks,
Meena Chockalingam
------------------------------
Date: Wed, 29 Jul 1998 16:58:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How to delete files inside perl script?
Message-Id: <Pine.GSO.4.02.9807290956530.19378-100000@user2.teleport.com>
On Wed, 29 Jul 1998, Meena Chockalingam wrote:
> Subject: How to delete files inside perl script?
The perlfunc manpage should be helpful to you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Jul 1998 17:33:32 GMT
From: Dan Nguyen <nguyend7@egr.msu.edu>
Subject: Re: How to delete files inside perl script?
Message-Id: <6pnmdc$itm$1@msunews.cl.msu.edu>
Meena Chockalingam <cmeena@hotmail.com> wrote:
: I used backquotes as well as system commands. Nothing seems to work.
I'm in a giving mood. Try using the 'unlink' function.
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Wed, 29 Jul 1998 17:37:07 GMT
From: pjgeer@my-dejanews.com
Subject: I want to separate my Perl from my HTML
Message-Id: <6pnmk3$48c$1@nnrp1.dejanews.com>
I write CGIs that output HTML. I want to separate the HTML from the Perl so I
can edit (or have someone else edit) just the HTML by itself, without worrying
about busting the script. I had been using here docs to handle blocks of HTML
but I get mad about things like the code below. How can I separate the HTML
from the Perl?:
print <<"EOF";
...
<SELECT Name="languages">
EOF
foreach $record ( @records ) {
print "<OPTION Value=\"$record.txt\">$record</OPTION>\n";
}
print <<"EOF";
</SELECT>
EOF
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Wed, 29 Jul 1998 16:21:18 +0100
From: "Simon Fairey" <simonf@conduit.co.uk>
Subject: Re: Interesting Question needs Quick Answer
Message-Id: <35bf3d09.0@nnrp1.news.uk.psi.net>
I'm curious are we talking a script to emulate 'cat' or 'type' or are we
talking about a script which does nothing but print itself, without I assume
using open() or the obvious system() call?
Simon
I.J. Garlick wrote in message ...
>[Posted and mailed]
>
>In article <Ewuutr.Ip3@csc.liv.ac.uk>,
>sm8plh@csc.liv.ac.uk (P.L. Hegarty) writes:
>> Firstly I will apologise if this question is answered anywhere else, but
>> I'm in a bit of a rush and have not been able to get the FAQ for this
>> group yet.
>>
>> I want to write a perl script which produces as its output an exact copy
of
>> itself. So when you run the script you get exactly the same output to
>> screen as if you used 'cat' or 'type'. You can not read anything into the
>> script or use any system calls. That last bit is the heart of the
problem.
>>
>> I have been told that it can be done but as yet all I have done is
>> eliminate the simple solutions that do not work.
>>
>> If any one knows a answer or can point me in the direction of one I would
be
>> greatful.
>>
>
>DON'T give him the answer this is homework.
>
>Nice try Parrick. Now work it out for yourself, afterall you told me
>yesterday it was a 'piece of cake'.
>
>What is even more staggering is that you could imagine we don't read this
>news group!!!
>
>--
>Ian J. Garlick
>ijg@csc.liv.ac.uk
>
>Who watches the Watchmen.
------------------------------
Date: Wed, 29 Jul 1998 16:26:44 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: launching programs in perl scripts
Message-Id: <Pine.GSO.4.02.9807290921230.19378-100000@user2.teleport.com>
On Wed, 29 Jul 1998, Yaroslav Buga wrote:
> Somebody, tell me please how to launch program (for example ping) in
> perl script.
The methods described in perlfunc and perlipc should be useful. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 29 Jul 1998 16:17:55 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Link Updating
Message-Id: <Pine.GSO.4.02.9807290915550.19378-100000@user2.teleport.com>
On Wed, 29 Jul 1998 spankboy18@my-dejanews.com wrote:
> Does anyone know of a perl script that allows you to automatically update
> your website links using server side includes?
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 28 Jul 1998 09:55:44 +0200
From: "EsteMar" <nuriaf@santandersupernet.com>
Subject: method GET and windows NT
Message-Id: <6pk3dc$anl$1@pumba.class.udg.mx>
My CGI program run whit the GET method when I call from windows 95.
Wowever from windows NT not run.
If I change the POST method then It run. Why?
is It for the CONTENT_LENGTH variable?
How I could modify the CONTENT_LENGTH variable?
------------------------------
Date: 29 Jul 1998 16:27:33 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Net::Telnet -like module without telnet
Message-Id: <6pnihl$ho5@mozo.cc.purdue.edu>
aajii@aajii.ton.tut.fi (Antti-Jussi Korjonen) writes:
}I'm using Net::Telnet module now to execute commands on another computer.
}I don't need to log onto another computer any more, I can use the same
}computer where the script is located.
}I'd like to use similar method in executing programs, that is used in
}Net::Telnet module.
}Can anybody help me with this?
}Expect?
If your question can be rephrased as "How can I run an interactive
program with perl?" the answer might be, "Use the Expect module from
CPAN." It might also be, "Read the article by Lincoln Stein in this
month's Perl Journal," which uses the slightly out of date chat2.pl,
but still is a good article.
However, I am confused by the last line of your post, "Expect?" which
might mean you've looked at the expect module and it doesn't meet your
needs. Or maybe not.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Wed, 29 Jul 1998 14:36:35 +0100
From: "Simon Fairey" <simonf@conduit.co.uk>
Subject: Re: Newbie: extracting fields
Message-Id: <35bf2480.0@nnrp1.news.uk.psi.net>
OK your regexp was almost ok but not quite, a few points:
1. You are escaping more than you need to escape
2. You are not looking for the '.' before fdata
3. You are only looking for one space between '.fdata.s' and the next f when
there are two spaces
So how about:
/^\s*\.fdata\.s\s+f'([\d.-]+),\s+f'([\d.-]+),\s+f'([\d.-]+)/;
which should do the job, if you are not worried about matching to '.f.data'
then you can lose everything upto the first f'.
Hope that helps
Simon
greggman@my-dejanews.com wrote in message
<6pmodc$tev$1@nnrp1.dejanews.com>...
>I'm sorry this is such a basic question but I've been looking for over 2
>hours for the answer. I must be an idiot. That includes looking in the
>current perl docs/faq etc. Maybe I just don't know what to search for. I
>could have had this finished in C in about 2 mintues. I need to learn perl
>better.
>
>I'm reading a file one line at a time. A typical line looks like this
>
> .fdata.s f'33.011974, f'50.352013, f'-30.042702 ; max
>
>How do I get $1, $2 and $3 to be 33.011974, 50.352013, -30.042702
>respectively?
>
> I tried this
>
> /\s*fdata\.s\sf\'([\d\.\-]+),\sf\'([\d\.\-]+),\sf\'([\d\.\-]+).*/;
>
>which clearly (well, not so clearly to me) doesn't work.
>
>In C I think I would do this
>
> (assuming I don't care about precision)
>
> float v1,v2,v3
>
> scanf (" fdata.s f!%f, f'%f, f'%f", &v1, &v2, &v3);
>
> note: in perl, I'm not conserned about using the data as floats, strings
>would be better, in fact in this particular case all I'm trying to do is
this
>
> print "$1, $2, $3,\n";
>
>Please help.
>
>Thank you.
>
>-gregg tavares
>
>
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
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 3286
**************************************