[8861] in Perl-Users-Digest
Perl-Users Digest, Issue: 2478 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 2 15:05:51 1998
Date: Sat, 2 May 98 12: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 Sat, 2 May 1998 Volume: 8 Number: 2478
Today's topics:
Re: 1701 days hath September (was: Re: rename funciton) <ljz@asfast.com>
Re: 1701 days hath September (was: Re: rename funciton) <ljz@asfast.com>
Re: 1701 days hath September (was: Re: rename funciton) <flavell@mail.cern.ch>
Re: A bug in localtime() (John Moreno)
Re: Confusion with new warning concerning split operato dennis_marti@yahoo.com
Re: email attachments <jkry3025@comenius.ms.mff.cuni.cz>
Encryption of perl scripts <hophuels@koan.de>
Re: Encryption of perl scripts <tchrist@mox.perl.com>
extracting a sub-string (Paul Farber)
help wanted (trivial) <fantha@berlin1.netsurf.de>
Re: help wanted (trivial) <alastair@calliope.demon.co.uk>
Re: help wanted (trivial) <alpaca@iname.com>
Interpolation.pm/Date::Manip.pm: strange bug <jkry3025@comenius.ms.mff.cuni.cz>
Re: java applet embedded in script (Jonathan Stowe)
looking for a little bit of help here. (Shawn )
Re: matching problem (Belg4mit)
Re: matching problem (Belg4mit)
Re: Perl/Wall lingo question <p-fein@uchicago.edu>
Re: QRe: == vs. eq <dformosa@st.nepean.uws.edu.au>
Re: QRe: == vs. eq (Sitaram Chamarty)
Re: Randomly sorting an array (Mark-Jason Dominus)
Re: Redirection <jkry3025@comenius.ms.mff.cuni.cz>
Re: Sys::syslog not working? (Martin Moellenbeck)
Re: Using the -- notation? (Jonathan Stowe)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 02 May 1998 10:59:20 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: 1701 days hath September (was: Re: rename funciton)
Message-Id: <ltpvhwlnw7.fsf@asfast.com>
smcdow@arlut.utexas.edu (Stuart McDow) writes:
> stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
> > Stuart McDow <smcdow@arlut.utexas.edu> wrote:
> > >I'm not intending to be
> > >incendiary here; I'm just trying to point out that it's a matter of
> > >individual priorities.
> >
> > No, it is a matter of understanding how USENET groups work. All this
> > touchy-feely stuff about people living in gated communitities and stuff
> > is very nice, but it doesn't change how a moderated newsgroup works.
>
> I disagree. IMO, the real point is that no one is ever forced to
> participate in moderated newsgroups. If someone doesn't like moderated
> newsgruops, then they don't have to subscribe. Finis. Done. It is
> about individual priorities.
Yep. And furthermore, the non-moderated group will remain.
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: 02 May 1998 10:58:50 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: 1701 days hath September (was: Re: rename funciton)
Message-Id: <ltsomslnx1.fsf@asfast.com>
stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
> In article <lt4sz9qqyp.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com> wrote:
> >However, since c.l.p.misc will still exist, I don't see how these
> >potentially non-utopian aspects of the proposed c.l.p.moderated would
> >have any major effects on anyone who doesn't chose to participate in
> >that new group ... assuming that this non-utopianness will come to
> >pass at all.
>
> Saying that those who are not able to participate will suffer no major
> effects is a very damning admission about the value of the proposed
> group. I suspect that, were you one of the excluded, your tune would be
> different.
Based on what I read in the RFD, I believe that I would indeed be
excluded from c.l.p.moderated if I were to try to submit posts that
are similar to many of the ones I have submitted here. One of the
rules that was put forth concerned the non-acceptance of posts that
repeat information that is found in the FAQ, and a significant
percentage of my posts do just that.
But as long as c.l.p.misc exists alongside of c.l.p.moderated, I have
no problem with these rules or the potential exclusion of many of my
posts.
Even if I were to be labeled a permanent "persona non grata" with
regard to the proposed moderated newsgroup, my exclusion would not
bother me all that much as long as there was still a c.l.p.misc to
post in.
Remember, a moderated group can still be *read* by anyone. It's only
*posting* that is restricted.
> When you consider that some of the less-than-utopian aspects are not
> necessary and will not serve to accomplish anything but exclude
> otherwise acceptable members, there is no reason to include those
> aspects.
Are you opposed to the existence of private schools in addition to
public schools, then? A moderated Perl newsgroup would fill a similar
niche in the net community to the niche filled by private schools in
the educational community. Some private schools have admissions
standards that might be considered quite arbitrary, and there are
indeed "acceptable" children who might be excluded from any given
private school on the basis of these standards. However, since we
also have public schools, we can still be confident that our children
can get an education.
To continue this analogy, there are also competing private schools for
those of us who want to find places with differing standards, and it's
also possible to set up a moderated forum that competes with
c.l.p.moderated if anyone desires to do so (mailing lists and
web-based forums are easy to set up).
I don't mind the existence of private schools in addition to public
schools, and I don't mind the existence of c.l.p.moderated in addition
to c.l.p.misc.
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: Sat, 2 May 1998 18:06:51 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: 1701 days hath September (was: Re: rename funciton)
Message-Id: <Pine.A41.3.95a.980502175857.99974E-100000@rsplus14.cern.ch>
On 2 May 1998, Lloyd Zusman wrote:
..
> rules that was put forth concerned the non-acceptance of posts that
> repeat information that is found in the FAQ, and a significant
> percentage of my posts do just that.
May I ask why you'd do that?
It's a dangerous precedent to set to usenauts (IMHO) to lead them to
believe that if they post an FAQ, someone will dutifully come along and
read the answer out verbatim to them. I'd suggest that at most a
"taster" could be posted from the answer, to demonstrate to them that
they failed to use due diligence, but still requiring them to actually
look inside the FAQ document to find a complete enough answer for making
further progress.
(They also need to learn that asking an FAQ is very likely to get them a
string of bogus answers from others who are almost as clueless as they
are.)
> Remember, a moderated group can still be *read* by anyone.
Quite. Glory be to intelligent lurkers.
------------------------------
Date: Sat, 02 May 1998 16:32:18 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: A bug in localtime()
Message-Id: <1d8eiiv.1i5gy76i2s7h4N@roxboro0-061.dyn.interpath.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> lidong@globalserve.net (Alex Dong Li) writes:
> :Has anyone noticed a bug in function localtime()?
>
> No, but we've noticed millions of people thinking they did.
>
> :My system clock is right, but localtime() returns a wrong month value.
>
> You have a peculiar idea of right and wrong. Please consult
> your documentation for an explanation. Hint: think array
> offset addressing.
Be charitable - maybe he REALLY is getting a bad result instead of being
illiterate.
It could be that his version is having some problem and is returning 5
for may or even 6, or maybe 3 - it's not beyond the real of
possibilities that he knows that the correct answer for may would be 4
and when he doesn't see that, he is (quite properly) complaining about
it.
Of course how would we know - he doesn't say what results he is getting
nor what he was expecting (maybe he was expecting 'May'?).
--
John Moreno
------------------------------
Date: Sat, 02 May 1998 13:42:17 -0600
From: dennis_marti@yahoo.com
Subject: Re: Confusion with new warning concerning split operator in perl5.004
Message-Id: <6ifpe9$m49$1@nnrp1.dejanews.com>
In article <3548f7eb.10426307@news.metropolis.com>#1/1,
ablume@80s.com (Alex Blume) wrote:
[... what is a]
> better method to count the number of regular expression matches (in
> this case, just dashes) found in a string.
There's a FAQ (section 4) entry titled, "How can I count the number
of occurrences of a substring within a string?"
When it's a single character, use transliteration.
Otherwise, try incrementing while something matches.
Dennis
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Sat, 02 May 1998 18:10:13 -0700
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
Subject: Re: email attachments
Message-Id: <354BC3F0.2CE@comenius.ms.mff.cuni.cz>
Zenin wrote:
>
> Brian Mathis <brianm@kodak.com> wrote:
> : You really should be using Net::SMTP to send your messages. It's much
> : safer.
>
> You assume (danger!) that an SMTP server is available. Some
> systems do not have incoming mail and therefor have no sendmail or
> other mail daemon running ever except to send out qued mail.
> Calling sendmail on such systems is your only "safe" method. -Yes,
> you could try to decode the address and talk SMTP directly to the
> remote machine but what if it's not available? Are you ready to
> start your own mail que system?
>
> SMTP is not portable. Don't use it if you want to be portable.
>
> --
> -Zenin
> zenin@archive.rhps.org
You assume (danger!) that the system is some sort of unix and
that some command line sendmail is available.
Most Windows systems do not have any command line driven
mail sending program installed.
I don't think it's very likely that there is no machine with an SMTP
daemon available
around. But experiences vary.
SMTP is the most portable way we have.
Jenda
------------------------------
Date: Sat, 02 May 1998 18:35:30 +0200
From: Hans Ophuels <hophuels@koan.de>
Subject: Encryption of perl scripts
Message-Id: <354B4B52.5E547E9E@koan.de>
I have to write a perl/CGI script. It will be distributed on several
computers. How can I achive that nobody changes the script.
You know, this is very simple with a texteditor and some basic knoweldege.
Is there a posibity that the Script is encrypted and decrypted
at execution time.
I think a very simple encryption would done it well.
Thanks a lot
Hans
hophuels@koan.de
------------------------------
Date: 2 May 1998 17:07:22 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Encryption of perl scripts
Message-Id: <6ifjsa$r1u$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, hophuels@koan.de writes:
:I have to write a perl/CGI script. It will be distributed on several
:computers. How can I achieve that nobody changes the script?
Ask them not to.
Or put that condition in the licence.
Or don't give them the script.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"I think the pod should be the master...."
--Larry Wall in <9410072305.AA03994@scalpel.netlabs.com>
------------------------------
Date: Sat, 02 May 1998 18:49:22 GMT
From: farber@f-tech.net (Paul Farber)
Subject: extracting a sub-string
Message-Id: <354b697d.4262021@news.f-tech.net>
Hello all,
Perl is good, regular (m/// s/// tr///) epressions are killing me.
How the heck do you pull a string from sentence???
The info I need is between < and >, split won't work as the placement
of the < > will vary, so I need an expression to rip out this string
and put it into a scalar.
Should I put the sentence into @sentence and POP off each word?
Thanks
Paul
------------------------------
Date: Sat, 2 May 1998 19:16:52 +0200
From: fantha <fantha@berlin1.netsurf.de>
Subject: help wanted (trivial)
Message-Id: <98050219174901.00865@FPC>
Hi there !
First of all :
I'm new with perl, so this is a very trivial question I have.
Today I bought a book so that I can start my career as a perlmaster :)
While reading it I tried to code a program that handles hashes.
But it doesn't work in that way I thought it should do.
In my opinion it should return "schwarz" if you type "black". But it
returns nothing. What's wrong here ?
Please answer to my question by posting here or by email
fantha@berlin1.netsurf.de
Thanks, Jens
Here's my tiny prog
#!/usr/bin/perl
%COLORS =
(
"black" => "schwarz",
"white" => "wei_",
"blue" => "blau",
"yellow" => "gelb",
"red" => "rot",
"green" => "gr|n"
);
print "Bitte geben Sie eine Farbe ein :";
$farbe = <STDIN>;
# print $farbe;
#
# This only was a test, to see if $farbe contains data
# It does !
print $COLORS{$farbe};
------------------------------
Date: Sat, 02 May 1998 16:31:42 +0000
From: Alastair <alastair@calliope.demon.co.uk>
Subject: Re: help wanted (trivial)
Message-Id: <354B4A6E.DC662B8A@calliope.demon.co.uk>
fantha wrote:
> =
> =
> Today I bought a book so that I can start my career as a perlmaster :)
> While reading it I tried to code a program that handles hashes.
> But it doesn't work in that way I thought it should do.
> In my opinion it should return "schwarz" if you type "black". But it
> returns nothing. What's wrong here ?
> =
> =
> #!/usr/bin/perl
> %COLORS =3D
> (
> "black" =3D> "schwarz",
> "white" =3D> "wei=DF",
> "blue" =3D> "blau",
> "yellow" =3D> "gelb",
> "red" =3D> "rot",
> "green" =3D> "gr=FCn"
> );
> print "Bitte geben Sie eine Farbe ein :";
> $farbe =3D <STDIN>;
> =
> # print $farbe;
> #
> # This only was a test, to see if $farbe contains data
> # It does !
> =
> print $COLORS{$farbe};
Your input also contains a trailing 'newline' character - so
it doesn't match anything in the hash. You should use
'chomp' to remove it e.g.
chomp($farbe =3D <STDIN>);
Bye,
-- =
Alastair
------------------------------
Date: 2 May 1998 15:44:14 GMT
From: "Allan M. Due" <alpaca@iname.com>
Subject: Re: help wanted (trivial)
Message-Id: <6iff0e$hkl$0@206.165.146.154>
>print "Bitte geben Sie eine Farbe ein :";
>$farbe = <STDIN>;
$farbe has a terminating newline at then end ($farbe is equal to black\n) so
you need to remove it with chomp.
chomp($farbe);
and all will be right with the world.
Allan M. Due
Due@discovernet.net
Due@WhiteCrow.net
"There are two major products that come out of Berkeley: LSD and UNIX. We
don't believe this to be a coincidence."
-Jeremy S. Anderson
------------------------------
Date: Sat, 02 May 1998 17:58:49 -0700
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
To: mjd-perl-interpolation@plover.com, sbeck@cise.ufl.edu
Subject: Interpolation.pm/Date::Manip.pm: strange bug
Message-Id: <354BC144.6D1F@comenius.ms.mff.cuni.cz>
I have been playing with Intrapolation.pm (0.53)
( http://www.plover.com/~mjd/perl/Interpolation/ )
together with Date::Manip (5.30) (from CPAN)
and encountered a strange bug.
(WinNT4.0sp3 + AS build 316/GS 5.004_04)
If I define an interpolation for function UnixDate
and the first call to UnixDate is from this interpolation
used in a print statement, nothing gets printed and even the other
arguments to print get lost. Moreover the GSAR's port (5.004_04)
crashes after finishing the script.
As soon as I call UnixDate either directly or even
through the interpolation used in an assignment
everything's OK.
I tried to trace the script, but everything seemed OK.
The FETCH method of Interpolation gets called with propper arguments,
the UnixDate gets called with propper arguments, it returns propper
result, but the print doesn't output anything.
I do not see anything neither in Interpolation.pm nor in Date::Manip
that could cause this, so it seems to me like a bug in perl.
Does this happen under Unix as well? Or do you see some reason
for this in the modules?
Thanks for any insight, Jenda
Here is the code:
#!/usr/bin/perl
use Date::Manip;
use Interpolation 'time' => sub {UnixDate( "now", $_[0])};
#print UnixDate( "now", '%d.%m.%Y'); #<???>1
#$res = "Hi Jenda at $time{'%d.%m.%Y'}.\n"; #<???>2
print $res,"AAAA\n";
print "Hi ","Jenda at $time{'%d.%m.%Y'}.\n";
print "Hi Jenda at $time{'%d.%m.%Y'}.\n";
print "Hi Jenda at $time{'%d.%m.%Y'}.\n";
__END__
And here is the output :
All lines processed:
02.05.1998Hi Jenda at 02.05.1998.
AAAA
Hi Jenda at 02.05.1998.
Hi Jenda at 02.05.1998.
Hi Jenda at 02.05.1998.
<???>1 commented out
Hi Jenda at 02.05.1998.
AAAA
Hi Jenda at 02.05.1998.
Hi Jenda at 02.05.1998.
Hi Jenda at 02.05.1998.
<???>2 commented out
02.05.1998AAAA
Hi Jenda at 02.05.1998.
Hi Jenda at 02.05.1998.
Hi Jenda at 02.05.1998.
Both commented out
AAAA
Hi Jenda at 02.05.1998.
Hi Jenda at 02.05.1998.
as you can see the first print statement didn't output anything.
------------------------------
Date: Fri, 01 May 1998 06:05:42 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: java applet embedded in script
Message-Id: <354963de.17476860@news.btinternet.com>
On Fri, 01 May 1998 19:52:02 -0400, Warren Shaklee wrote :
>Thanks in advance to anyone who can help.
>
>I have a perl script in a cgi-bin directory and generates a web page
>with an image and two java applets. The java class files are in the
>cgi-bin directory. The generated page finds the class files and
>generates the page, but the applets don't initialize. Error message
>Start: applet not initialized.
Doesnt sound like any Perl message I ever heard of.
> If there is anything special abount
>passing applet parm from the perl script, I can't find it.
>
Dunno chief. but what I do know is this almost certainly FA to do
with Perl. I'd check the output of the program to see if it is good.
If you are using CGI.pm as you would be advised to be doing then you
can run this offline to see what is printing or otherwise you might
take it up with some source of information regarding your browser to
discover how to see the output.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 02 May 1998 16:53:50 GMT
From: sweiner@usa.net (Shawn )
Subject: looking for a little bit of help here.
Message-Id: <354c4f10.5461542@news.wwa.com>
Alright I am stuck here and in need of a little help.
I recently DLd the GS version of Perl for win32 (at CPAN) and have run
into an interesting problem.
When it converted the .pod files into html it messed it up by putting
a "y" in the relative URLs instead of ".." for example it put
file:C:\Perl\html\lib\y/lib/site/Alias.html
instead of
file:c:\perl\html\lib\../lib/site/alias.html
Now me being the stupid, stuburn person I am figured I could code a
simple Perl script to fix the problem and solve my headache (and
provide me a learning experience in perl to boot) but I've run into a
problem: I can't get it to substitute the correct ".." for the "y".
(Frustrating ain't it?) and I've gotten to the point of this call for
help. Even when I insert a 'print "match\n"' inside the if (for the
match) it still doesn't work so I think that that is where my problem
lies.
And, yes I have read the FAQ this is why I'm going the Tempfile route
vs others as mentioned in perlfaq5 : p--- to all those who say RTFM
first. (or RTFF).
Here is the script:
#perl -w
use carp;
#This program is to try to convert messed up html files from pod2html
#hopefully it will work
# This is a sample url from one of the files
# file:C:\Perl\html\lib\y/lib/site/Alias.html
sub convert {
$file=$_;
$temp="temp.html";
open (IN, "< $file");
open (OUT, "> $temp");
while ($in=<IN>) {
$_=$in;
if (/\\lib\\y\//) {
$in =~ s/\\y\//\\..//g;
}
print OUT $in;
}
die "CHECK TEMP.HTML";
#this is here for testing purposes else rename($temp,$file);
}
my $dir='c:\perl\html\lib';
opendir (DIR,$dir);
while ($_=readdir(DIR)) {
if (/\.htm/||/\.html/) {
&convert;
}
}
Shawn
shawn@wwa.com
shawns@wwa.com
sweiner@usa.net
slweiner@juno.com
sweiner@yahoo.com
IrunWulf@aol.com
ICQ#1925117 (visit www.mirabilis.com for more info)
------------------------------
Date: 02 May 1998 18:40:56 GMT
From: belg4mit@aol.com (Belg4mit)
Subject: Re: matching problem
Message-Id: <1998050218405600.OAA17026@ladder03.news.aol.com>
well alt="<foo>bar</foo>"> isn't really a problem, because that's just plain
nonsense.
$m += /<foo>/;
does seem to be counting them, it's just that I have to count <foo> & </foo>
which is fine, but then i have to check lines for each case and add them to the
array,
which means you end up with duplicate lines in the array.
say input is:
<b>hi
this is</b><b> a bad way to write html</b>
The resulting array would be:
<b>hi></b>
this is</b><b> a bad way to write html</b>
this is</b><b> a bad way to write html</b>
actually, you're right [] isn't optional... but the way I usually use it
amounts to the same thing. but since I only have one character option here it
won't work. I could use . but that's rather inclusive....
I suppose I could use an html parser, but it's just supposed to be a quick and
dirty check to make sure that all the container tags are matched. since weblint
seems to be poor at doing this.
Thanks for the help!
------------------------------
Date: 02 May 1998 18:43:43 GMT
From: belg4mit@aol.com (Belg4mit)
Subject: Re: matching problem
Message-Id: <1998050218434300.OAA18533@ladder01.news.aol.com>
just clarify I usually use [] for something like [bcfhmprsv]at
which should match: bat, cat...,no?
so that's where I slipped and was under the impression it denoted an optional
clause/expression
------------------------------
Date: Sat, 2 May 1998 16:37:16 GMT
From: Peter A Fein <p-fein@uchicago.edu>
Subject: Re: Perl/Wall lingo question
Message-Id: <87emycsk77.fsf@bj2-64.rh.uchicago.edu>
"Jeroen Muris" <jmuris@igr.nl> writes:
> Let me add to the confusion.
>
> In mathematics I was told:
> * A point is dimensionless.
> * A line is 2-dimensional.
> * A plane is 3-dimensional.
>
> As a land-surveyor and geodesist, I tend to look at it from this angle:
> * A point can only exist if there's a dimension to put it, hence in a space
> with dimension of 1 or more. It can be represented by a number (in 1
> dimension), or an array (in 2 or more dimensions).
> * A line has got a location and a direction, and needs 2 dimensions to
> exist.
> * A plane has got a location and 2 directions (if I remember my classes
> well, it is actually defined by two intersecting lines), thus needing 3
> dimensions.
> I think the difference is in wether you look at what an object is or where
> an object is found.
What you're describing here is the minimum space these objects exist in, not
the objects themselves. An n-dimensional space requires n values to
describe a point in it. For example, you need one x to indicate where
a point lies on a line, a x & y to describe where on a plane, and so
forth. A point is therefore dimensionless, since a point in that
space can only be one place, and thus needs no variables to indentify
it. The problem I see with describing the objects in the minimum
space they need to be in is that it's therefore equally valid to
describe it in larger dimensional spaces. For example, if you want to
define a line in a plane, it's also equally legit to define it in 3+
space. No longer such a useful guide for determining dimension.
> But if you start thinking of variables, things become ugly:
It did. So I killed my response to it.
--
Peter Fein
1005 E. 60th St.
Chicago, IL 60637
773-834-6206
p-fein@uchicago.edu
http://pfein.home.ml.org/
------------------------------
Date: 2 May 1998 17:02:12 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: QRe: == vs. eq
Message-Id: <894128532.54437@cabal>
In <354927f9.3181860@news.btinternet.com> Gellyfish@btinternet.com (Jonathan Stowe) writes:
>On Sat, 02 May 1998 05:02:02 +0200, N i c l a s O l o f s s o n wrote
[...]
>>entertaining. FTM, who needs it!
>>
>You did WHAT to the manual?
After long nights of programming the Cammel on the cover starts looking
mighty attractive.
--
I'm a perl programer if you need perl programing hire me.
Please excuse my spelling as I suffer from agraphia see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: 2 May 1998 11:48:19 -0700
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: QRe: == vs. eq
Message-Id: <slrn6kmj5f.186.sitaram@ltusitaram.unidata.com>
On 27 Apr 1998 18:05:32 GMT, Allan M. Due <due@discovernet.net> wrote:
> Any suggestions for "real newsreaders" for those of us doomed to operate
>in a Windoze environment.? Or, are we only real if we have access to UNIX?
Why are you "doomed" to operate in Windows? You appear to have
posted from an ISP account, the same kind that many others like me
and you use. In other words, it doesn't seem to be an
employer-mandated setup, where I agree you might be "doomed".
Your ISP may not explicitly support Linux, but it should work,
nevertheless.
So install a "real O/S" :-) Start with www.linux.org. See you on
comp.os.linux.misc, or email me if you have specific questions.
I'd be happy to help.
If you *have* to have Windows for some other reasons, dual boot.
------------------------------
Date: 2 May 1998 11:45:43 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Randomly sorting an array
Message-Id: <6iff37$2ir$1@monet.op.net>
Keywords: adieu codebreak staple worthwhile
In article <Pine.GSO.3.96.980501144215.2859R-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> sub shuffle {
> # returns a random shuffle of a given list
> my @list = @_; # private copy
> for my $i (1..$#list) { # Yes, start at 1!
> my $j = rand($i+1); # pick one at or before $i
> @list[$i,$j] = @list[$j,$i]; # swap
> }
> @list;
> }
We found that this runs somewhat faster if you insert
next if $i == $j;
in the obvious place. Perl seems to take a (comparatively) long time
when it tries to do
@x[$i,$i] = @x[$i,$i]
------------------------------
Date: Sat, 02 May 1998 18:51:02 -0700
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
Subject: Re: Redirection
Message-Id: <354BCD81.4AD1@comenius.ms.mff.cuni.cz>
Brian Dwornick wrote:
>
> Hello,
>
> I am having a problem with a script redirect a user to a page depending
> on what they type in.
>
> I have a form (index.cgi) that takes in $username and $password
> it then verifys it to an encrypted file
> then I want to redirect it to admin.cgi with just $username and a new
> variable $session
>
> Both admin.cgi and index.cgi work doing what they are suposed to do but
> I can't get variables from one to the other
>
> print "Location: admin.cgi?username=$username&session=$session";
>
> is how i have been trying to do it
> is there special characters i have to use?
>
> i want it to use "Location: file.name";
>
> Help
>
> Brian
1.You may have to print either
"HTTP/1.0 302 Moved\r\n"
or
"Status: 302 Moved\r\n"
2. I think you have to use full URLs
print "Location:
http://$ENV{SERVER_NAME}/admin.cgi?username=$username&session=$session";
HTH, Jenda
------------------------------
Date: Fri, 1 May 1998 22:11:06 +0200
From: mm@gismo.moellenbeck.cww.de (Martin Moellenbeck)
Subject: Re: Sys::syslog not working?
Message-Id: <q8adi6.pq4.ln@hal.moellenbeck.cww.de>
In article <6i72hf$k2n$2@nz12.rz.uni-karlsruhe.de>,
Marc.Haber-usenet@gmx.de (Marc Haber) writes:
Hello Marc,
I had the same problem. I am running SUSE 5.1 and perl 5.004.
I must setup syslogd, it was not running to hear on network, nut
perl send to this daemon by network.
You must start syslogd like: /usr/sbin/syslogd -r &
Have fun
Martin
> Calle Dybedahl <qdtcall@esb.ericsson.se> wrote:
>>Marc.Haber-usenet@gmx.de (Marc Haber) writes:
>>> I am trying to have a perl script log something on the syslog on a
>>> Linux box. I am using the example from the Camel book. That program
>>> does: nothing. There is nothing being logged to syslog. syslog.ph is
>>> present on the system.
>>
>>You have set up syslog on your machine to log entries of severity
>>info, haven't you? If you haven't, syslogd is just throwing away what
>>you send to it.
>
> Actually, I don't know how syslog is configured as the machine was
> configured by somebody else. The syslogd ist, however, logging almost
> everthing down to every single line sent to the printer.
>
> I will try to log info with higher priority this afternoon.
>
> Thanks for pointing me into that direction.
>
> Greetings
> Marc
>
--
-------------------------------------------------------
| Martin Moellenbeck m.moellenbeck@cww.de
-------------------------------------------------------
------------------------------
Date: Fri, 01 May 1998 06:05:38 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Using the -- notation?
Message-Id: <35495de5.16210234@news.btinternet.com>
On 2 May 1998 13:17:27 GMT, Jonas Bofjall wrote :
>Why doesn't this:
> open(blaj, ">$ARGV[$#ARGV--]");
>work like this:
> open(blaj, ">$ARGV[$#ARGV]");
> $#ARGV--;
>
Think what you are doing here.
Altering $#ARGV will effectively alter the number of elements in the
array.
In the first example you are getting the index of the last element of
@ARGV then reducing the number of elements in the array by one and
then trying to access the previous last element which has effectively
been made undef. Kerpowee no file name, open fails (except of course
if you happen to be on a version 5 DRS/NX which would inexplicably
allow the creation of files with no nameon occassion, but thats all
behind me now.)
On the other hand:
open(blaj,">$ARGV[--$#ARGV]");
will work but obviously doesnt do what you want, accessing the second
to last element as it does.
If you want to process each element of @ARG you are probably better
off using for or foreach.
Anyhow, how come I've got what appears to be pizza all over page 236
of my camel book?
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2478
**************************************