[10586] in Perl-Users-Digest
Perl-Users Digest, Issue: 4178 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 9 08:07:59 1998
Date: Mon, 9 Nov 98 05:00:38 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 9 Nov 1998 Volume: 8 Number: 4178
Today's topics:
Re: $a = $a <merlyn@stonehenge.com>
Re: Array problems for a newbie (Bradley K. Farrell)
Re: Array problems for newbie (Bradley K. Farrell)
Can anyone help with my globs?? dccobb@yahoo.com
Configuration PERL <s.gontier@dl.ac.uk>
Re: Cool programming project? (Paul Winkler)
dont echo passwords !!! <michaelr@lndn.tensor.pgs.com>
Re: Effectively replacing browser's history entries (Sam Holden)
Hard coding a variable into a perl script - help gachious@my-dejanews.com
Re: How to run perl scripts written in C++ on windows? (Troy Denkinger)
how2 talk to ssh(1) from within perl(1), it wants a con <jun@mew.gol.com>
I want my perl program to return a specific number luong@my-dejanews.com
I'm making a counter. And need some help reading the da (VYTiS)
Network Search Script iacovm@rpi.edu
Re: OOP or not? (for a Perl module) <zenin@bawdycaste.org>
Opening files webmaster@man.amis.com
Re: Perl at Webjump - lonely perler! (Tad McClellan)
Re: Perl script on Unix??? <J.D.Gilbey@qmw.ac.uk>
Re: Perl Warning Message? (Larry Rosler)
Re: Perl Warning Message? (Ronald J Kimball)
Re: Perl2exe <ibelgaufts@gfc-net.de>
Poor performance processing a file <torquil@protest.demon.co.uk>
Re: Problem with Counter+Statistic (Tore Aursand)
Re: Problem with Counter+Statistic (Larry Rosler)
Re: SEEK function on NT <zenin@bawdycaste.org>
Split with Multiple <mcculley@jersey.net>
Re: STANDARD PERL for WIN 95/NT EXECUTABLE (Larry Rosler)
Re: trouble with grep.... (Ronald J Kimball)
Re: Why is perl better than shell scripting language? (David Combs)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 08 Nov 1998 12:58:34 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: $a = $a
Message-Id: <8cr9vec5xx.fsf@gadget.cscaper.com>
>>>>> "Gareth" == Gareth Rees <garethr@cre.canon.co.uk> writes:
Gareth> Todd Smith <tbsmith@viper.net> wrote:
>> If Perl saw this line, would it do some assignment or ignore it like
>> it would a comment?
>>
>> $a = $a;
Gareth> If Perl always optimised away this line, then the resulting code would
Gareth> be incorrect. When $a is a tied scalar I expect the code $a = $a; to
Gareth> call the FETCH and STORE methods of the class $a is tied to.
This could also be the last expression evaluated in a value-ful block,
and thus have an impact on the return value (like from a subroutine,
eval-block, or do-block).
So, no, we can't completely toss this.
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Mon, 09 Nov 1998 07:36:32 GMT
From: bradley@iinet.net.au (Bradley K. Farrell)
Subject: Re: Array problems for a newbie
Message-Id: <36469858.96183091@news.m.iinet.net.au>
"Tim Hicks" <tim.hicks@lineone.net> wrote:
>The problem is, it doesn't print
>the last word that has been entered. Here is the code.
Tim, I had the same problem. And I think I found the solution - for
Win95. The last word _is_ being entered, and it _is_ being printed.
However, when it is printed, it actually _overtypes_ the last line of
input. Very silly.
To get around this, print a newline immediately before you print out
the (reversed) array. Voila!
This problem does not arise when you run the identical script on a
unix box. I'm not sure where this Perl-on-Win95 "bug" comes from (if
it's a bug at all).
Good luck, and keep going with The Llama Book. It's great.
--
Bradley K. Farrell
bradley@iinet.net.au
------------------------------
Date: Mon, 09 Nov 1998 07:50:25 GMT
From: bradley@iinet.net.au (Bradley K. Farrell)
Subject: Re: Array problems for newbie
Message-Id: <36479cad.97291941@news.m.iinet.net.au>
I have already posted a response to this, but in an earlier thread of
the same name. Please look further up the message tree.
--
Bradley K. Farrell
bradley@iinet.net.au
------------------------------
Date: Mon, 09 Nov 1998 10:01:47 GMT
From: dccobb@yahoo.com
Subject: Can anyone help with my globs??
Message-Id: <726eib$qv0$1@nnrp1.dejanews.com>
I am having a few problems with the glob routine in Perl, here is my script:
@x = glob('*.htm');
print "Content-type: text/html\n\n";
print "test";
print $x;
(I just want to list all .htm files)
When ran from the command prompt on a Win 98 based PC with an Omnicron Web
server on 127.0.01 the following is displayed:
Bad command or file name
test
The same applies when ran on Hypermarts site under a Unix OS.
Both Operating Systems have Perl 5, so why doesn't glob work??
Any help would be appreciated, Cheers
--
"Everything should be as simple as possible, but no simpler",
Albert Einstein.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 09 Nov 1998 11:57:50 +0000
From: Sebastien Gontier <s.gontier@dl.ac.uk>
Subject: Configuration PERL
Message-Id: <3646D8BE.D5524F34@dl.ac.uk>
Hi,
Does anyone had this problem configuring Perl??
"Use of uninitialized value at configpm line 403, <GLOS> chunk 530.
configpm: tmp not valid at configpm line 403
*** Error code 2 (bu21)!
What can I do? Thank you for your help.
Seb.
------------------------------
Date: Mon, 09 Nov 1998 10:35:49 GMT
From: zarmzarmNO@SPAMhotmail.com (Paul Winkler)
Subject: Re: Cool programming project?
Message-Id: <3646c52d.23481250@news.erols.com>
How 'bout a really spiffy graphical front-end to GNU fontutils?
Probably would be quite do-able in Perl/TK....
I can guarantee you that I would use it at least once. :-)
Regards,
PW
>On Wed, 7 Oct 1998, Bnar Baban wrote:
>
>> I'm wondering if anyone has any idea of a nice programming/computing
>> project that might be fun! It should be large enough to cover 3 - 4
>> weeks of work for two persons.
==============================================================
Paul Winkler --- music & sound --- zarmzarm@hotmail.com
http://members.tripod.com/~slinkP/
a member of
ARMS --- an ongoing pop music experiment
http://members.tripod.com/~slinkP/mini-arms.html
==============================================================
------------------------------
Date: Mon, 09 Nov 1998 09:56:05 +0000
From: Michael Renshaw <michaelr@lndn.tensor.pgs.com>
Subject: dont echo passwords !!!
Message-Id: <3646BC35.7389@lndn.tensor.pgs.com>
I came across the Expect module last week. While going through the
examples I found the following code to prevent echoing
a password....
$stdin->exp_stty('-echo');
Does anyone know a way to do this outside of the Expect module
as I would like to use it in non-Expect scripts ?
thanx
Mike
------------------------------
Date: 9 Nov 1998 09:08:36 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Effectively replacing browser's history entries
Message-Id: <slrn74dc8k.ps7.sholden@pgrad.cs.usyd.edu.au>
On Mon, 09 Nov 1998 10:32:54 +1000, Paul Buchanan
<buchanpj@hatespam.citec.qld.gov.au> wrote:
>I know how to do this with JavaScript 1.1 [it's
>location.replace(newlocation)] but I'd prefer a server-based solution...
>
>I would sincerely appreciate any assistance,
This has absolutely nothing to do with perl.
The answer is obviously that you just use the normal meta tag for the job :
<META NAME="HISTORY" VALUE="SKIP THIS PAGE DAMN IT YOU DUMB BROWSER">
If you want an answer from someone who might actually know something about
web stuff, why don't you ask in a newsgroup about web stuff...
--
Sam
It has been discovered that C++ provides a remarkable facility for
concealing the trival details of a program--such as where its bugs are.
--David Keppel
------------------------------
Date: Mon, 09 Nov 1998 09:39:58 GMT
From: gachious@my-dejanews.com
Subject: Hard coding a variable into a perl script - help
Message-Id: <726d9e$q0p$1@nnrp1.dejanews.com>
Hello,
I am using a "Form to Email" script (FormMail.pl from Matt's Script Archive)
and am wanting to know if it is possible to "hard code" the recipient e-mail
address (my address) into the script.
The reason I want to do this is to prevent the e-mail address from being
visible in the html code on the web page form.
Can someone help me or point me in the direction where I can find information
on hard coding form fields into the script itself?
Thanks,
Zee
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 08 Nov 1998 18:13:04 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: How to run perl scripts written in C++ on windows?
Message-Id: <724ms2$7qr$1@hirame.wwa.com>
original author cc'ed.
In article <36451F23.A6A1E31D@enhanced-performance.com>, Dale Sutcliffe
<dales@enhanced-performance.com> wrote:
>How to run perl scripts written in C++ on windows 98?
>
>perl scripts work fine, but now I want to create scripts in C++. how do
>I do this?
You are seriously confused. If your question is how to program in C++, I
suggest you go to comp.lang.c++. Otherwise, please clarify your question
because it is currently nonsense.
Regards,
Troy Denkinger
------------------------------
Date: Mon, 09 Nov 1998 07:27:31 GMT
From: Junichi Kurokawa <jun@mew.gol.com>
Subject: how2 talk to ssh(1) from within perl(1), it wants a controlling tty!
Message-Id: <ovhkpjpog.fsf@mew.gol.com>
TSSA, but let me elaborate:
% perl -de 0
DB<1> open(SSH,'| ssh -f host whatever_command')
DB<2>logname's password: <type the password> Syntax error at (...)
^^^^^^^^^^^^^^^^^^^
Apparently the ssh(1) wants to read its passphrase from '/dev/tty'
instead of STDIN as far as I could read from the `readpass.c' source
file of SSH, while the perl(1) interpreter doesn't seem to talk to
that.
You will typically have to have a passphraseless key to automate jobs
like this, and it works. But I don't really want a passphraseless
key.
Aside from the issue as to how you save the passphrase (yeah, I know)
I somehow have to figure out how to pass a passphrase to the ssh(1).
RTFM, online searches after searches didn't help.
Mandatory Environment:
This is perl, version 5.004_03
FreeBSD mew.gol.com 2.2.6-RELEASE FreeBSD 2.2.6-RELEASE #0:
If you know how you can pass a text to a command such as this, please
help. Any comments will be appreciated, thanks in advance.
BTW please *do* email me a copy, I don't too often read c.l.p.m.
Thanks.
--
Junichi Kurokawa <jun@mew.gol.com>
Global Online Japan Corporation, Tokyo
------------------------------
Date: Mon, 09 Nov 1998 09:43:37 GMT
From: luong@my-dejanews.com
Subject: I want my perl program to return a specific number
Message-Id: <726dga$q3k$1@nnrp1.dejanews.com>
Hi all,
I'm sorry in advance if my question sounds stupid. Just wonder if I can set
the numeric return code of my perl program to a specific value.
For example: ... $return = system ("foo.pl"); if ($return > 12) { ## do
something } .... in which $return is a number calculated by the foo.pl, not
the status of running it. I think I can do it by reset some predefined
variable in foo.pl but I don't know how to. Any glue? Thanks, Luong
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 08 Nov 1998 18:19:33 GMT
From: vip@takas.lt (VYTiS)
Subject: I'm making a counter. And need some help reading the data file...
Message-Id: <3645e0dc.0@news.takas.lt>
Keywords: cgi, perl, counter
Hello,
I'm almost done with the image counter...
Still need some help:
I have a file data.txt which contains these lines:
12::http://www.hoo.com/main.html
34::http://www.hoo.com/frame.html
6::http://www.hoo.com/links.html
Now I need perl code that would check what is the name of the page it's called
from (I use SSI tag) and then set $hits = [number before ::]
(If it's called from main.html, perl would set $hits = "12";
Please help me!!!
THANKS
Vytis.
------------------------------
Date: Mon, 09 Nov 1998 05:55:25 GMT
From: iacovm@rpi.edu
Subject: Network Search Script
Message-Id: <726089$bk7$1@strato.ultra.net>
Need a cgi/perl script that can be run on a web page to search windows network
neighborhood.
------------------------------
Date: 09 Nov 1998 12:09:11 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: OOP or not? (for a Perl module)
Message-Id: <910613190.518078@thrush.omix.com>
Paul Winkler <zarmzarmNO@SPAMhotmail.com> wrote:
>snip<
: --Just for the heck of it, it would probably be pretty easy to add a
: graphical front-end in Perl/TK.
"pretty easy" and "add a graphical front-end" don't normally
belong in the same sentance. :-)
>snip<
: As I said, the big question is whether to take an OOP approach or not.
: Reasons Why OOP:
: --might make usage syntax easier? We're dealing with a pretty unwieldy
: data structure (see below).
: --might make extension of the module easier?
Both, as well as other indirect features.
: Reasons Why NOT OOP:
: --I don't really understand OOP.
For what you want to do I don't think it would be too hard
to get upto speed easily.
: --I think I know how to do what I want in traditional programming.
Which should make moving it to OO that much easier. :-)
: --Don't have to worry about mucking around outside of established
: class methods.
Er, huh?
: The main issue is whether or not an OOP approach would make the system
: easier to use?
Maybe, maybe not.
: Remember, the scripts we're writing with this Perl
: module are compositions, not applications!
Never say never. I could easily picture a GUI CMusic composer
being built from a good set of libraries, even ones that spit
out Perl code to be later run as a composition.
: So it's important that
: they be quick & easy to write, and easy to read.
Then you've come to the right place! :-)
: Probably at this point it would be helpful if I gave an example of
: what I want to be able to do.
>snip<
: pattern_from_file(Verse1, "some-score-file.sco", [ 4 .. 10 ]);
: # We keep stuff in a big data
: # structure: a hash of list refs. of list refs. The hash keys
: # are pattern names; the first-level list is of line numbers; the
: # second-level list contains each line's pfields.
You might want to check out the Data::Dumper and/or Storable
modules to make saving/reading such structures very easy.
: play(Verse1, 2); # Plays Verse1 twice.
: rewind(); # Set time to whatever it was when the last function was
: # called.
: play(Verse2); # Plays Verse2 at same start time as the first
: # Verse1. If rewind() hadn't been there, it would
: # come after the Verse1's...
: # and there's lots of ways to do things like that.
Moving to OO wouldn't mean much more then moving some of this
around:
my $verse1 = CMusic->new ("some-score-file.sco", [ 4 .. 10 ]);
my $verse2 = CMusic->new ("some-other-score-file.sco", [ 0 .. 20 ]);
$verse1->play (2);
$verse1->rewind();
$verse2->play (2);
$verse2->shuffle_pfield ($verse2->pfield(5, beats(4 to 9), *= 2));
$verse2->play();
>snip<
: Am I nuts for doing things this way? Would OOP make life easier or
: harder?
In this case, I think it would be easier.
: If I followed an OOP strategy, what might the above code look
: like?
Well, look. :-)
: Are there some existing Perl modules that might be useful? (I
: haven't found any yet...)
I think I remember some MIDI stuff once upon a time. Check
CPAN for "MIDI" and "sound": www.cpan.org
--
-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: Mon, 09 Nov 1998 15:51:20 +0800
From: webmaster@man.amis.com
Subject: Opening files
Message-Id: <36469EF8.7468@man.amis.com>
What file formats can Perl open and read?
------------------------------
Date: Sun, 8 Nov 1998 02:58:06 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl at Webjump - lonely perler!
Message-Id: <uem327.iq1.ln@flash.net>
The Tinman (an000229@anon.fun.junk.ee) wrote:
: PLEASE could all html programmers
^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^ huh?
HTML is not a programming language.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 08 Nov 1998 11:37:10 +0000
From: Julian Gilbey <J.D.Gilbey@qmw.ac.uk>
Subject: Re: Perl script on Unix???
Message-Id: <36458266.53E914A8@qmw.ac.uk>
ssery@my-dejanews.com wrote:
>
> Hi Everyone...
>
> I'm trying to make a perl script to display all machine's condition in the
> lab. For example, if I run the script on Unix, it should display...
> yyoon:root> perl ypcat.pl <- ypcat is a file name 112,223,112,0 camp alive
> 112,223,112,1 udhg alive 112,223,112,2 rudead dead <- if rudead machine is
> dead or not responding ..... ..... 112,223,112,250 lory alive
>
> I started it out like this.
> #!/usr/bin/perl
> for($i=1;$i<=250;$i++)
> {
> ypcat hosts | grep 112,223,112,$i;
> ping 112,223,112,$i;
> }
You could try:
#!/bin/sh
i=1
while test i -le 250 do
ypcat hosts | grep 112,223,112,$i
ping 112,223,112,$i
i=`expr $i + 1`
done
Probably easier than using Perl for this task.
HTH,
Julian
P.S. If you want to use prel, check out the system()
command in perlfunc(1). The | operator in perl means
logical or, not pipe.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Julian Gilbey Email: J.D.Gilbey@qmw.ac.uk
Dept of Mathematical Sciences, Queen Mary & Westfield College,
Mile End Road, London E1 4NS, ENGLAND
-*- Finger jdg@goedel.maths.qmw.ac.uk for my PGP public key. -*-
------------------------------
Date: Sun, 8 Nov 1998 06:49:52 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl Warning Message?
Message-Id: <MPG.10af4f68bf4f78e0989900@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <7245vh$nmv$3@news.pop-stuttgart.de> on Sun, 08 Nov 1998
14:16:49 +0100, Ronald Gvggel <rgoeggel@atos-group.com> says...
...
> > I'm getting the following Perl warning message: "Use of initialized
> > value at fix_it line xx". The "xx" line is:
> > $curr = join(/["]/, @FIELDS);.
>
> You have to quote a ".
>
> $curr = join(/[\"]/, @FIELDS);
Just for the record (because this question has already been answered
correctly several times), NO. You don't have to quote a " in a
character class. And that has nothing to do with the problem here.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 8 Nov 1998 14:01:31 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl Warning Message?
Message-Id: <1di6h1j.h1bda1pf1xruN@bay2-145.quincy.ziplink.net>
Ronald Gvggel <rgoeggel@atos-group.com> wrote:
> > $curr = join(/["]/, @FIELDS);.
>
> You have to quote a ".
>
> $curr = join(/[\"]/, @FIELDS);
No, you don't.
You don't even have to use the character class.
These all do exactly the same thing:
/[\"]/
/["]/
/\"/
/"/
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 09 Nov 1998 09:30:29 +0100
From: "J|rgen Ibelgaufts" <ibelgaufts@gfc-net.de>
Subject: Re: Perl2exe
Message-Id: <3646A825.6023891D@gfc-net.de>
Hi,
as far as i know perl2exe is not (yet?) compatible with perl 5.005 because this
version of perl uses system-dependent path names while perl 5.004 does not. i
currently see 3 possible ways out of this: 1. wait for a new version of perl2exe
:-( , 2. use the win32 binary distribution of perl 5.004 (not so good if you need
to use tk version 8) or copy all the perl files into a 5.004-compatible directory
tree (but this would probably be a lot of work and surely is far away from a
standard distribution).
somewhere i read that perl2exe works with active state perl 5.005, but i have not
tried it.
hope this helps
juergen ibelgaufts
-------------------------------------------------------------------
Chris Liley schrieb:
>
> Trying to use Perl2exe I keep getting the error message:
>
> Warning: module Carp not found
> Make sure that the perl\bin directory is in your path
>
> My path is as follows:
> PATH=C:\PERL\5.005\BIN\MSWIN32-X86-OBJECT;C:\PERL\5.005\BIN;C:\WINDOWS;C:\WI
> NDOWS\COMMAND
>
> Which I think includes the relevant perl\bin !
>
> Further the script runs fine prior to compiling so Perl knows where to find
> the modules. The modules are included via the "USE" statement.
>
> Is the directory your are in when calling perl2exe relevant ? I am calling
> it from the directory I keep the script in, should I be in the BIN directory
> ?
>
> Any help appreciated,
>
> Chris Liley
------------------------------
Date: Sun, 8 Nov 1998 22:26:32 -0000
From: "Torquil Chapman" <torquil@protest.demon.co.uk>
Subject: Poor performance processing a file
Message-Id: <910564314.20884.0.nnrp-06.c1ed1892@news.demon.co.uk>
Hello all,
I've written a script that sequentially processes two text input files and
produces seven text output files. Both input files have more that 2 million
lines in them and I'm processing line by line.
Initially, performance is exceptionally good and I'm able to process the
first 10,000 lines in 1 minute. The next 10,000 lines take about two
minutes and so on. It took 35 minutes to process the first 100,000 lines
and more than double that to process the next 100,000 lines! What is
decaying the performance? I assume that the slowest part of the operation
is the IO, particularly the writes but what can I do to speed them up?
I use the following syntax to open my files for output;
$my_file_name = "e:\\my_path\\my_file.txt";
open MY_FILE_HANDLE ">$my_file_name";
...and I print to them ...
print MY_FILE_HANDLE "$out_field1 $out_field2 $out_field3\n";
The input files are sequentially processed in a loop...
while (!(eof $my_input_file)) {
$line_of_file = chop <$my_input_file>
....
....
I'm using ActiveStates Perl 5.004 on an NT4 workstation with a decent CPU
and 128MB of memory.
I'd be gratefull for any thoughts people might have for speeding up this
processing.
Many thanks.
Torquil Chapman
torquil@protest.demon.co.uk
------------------------------
Date: Mon, 09 Nov 1998 08:00:52 GMT
From: tore@forumnett.no (Tore Aursand)
Subject: Re: Problem with Counter+Statistic
Message-Id: <3646a116.401453028@news.online.no>
On Sun, 08 Nov 1998 07:23:54 GMT, burningboy@hotmail.com (James
Bond 098) wrote:
> EMERGENCY Case:
Well - I don't think it's really an emergency. :-)
> i'm writing a counter+statistic, i don't know how to check what
> web-site do the people came from to my page, Suggest me please.
$referer = $ENV{'REFERER'};
--
Tore Aursand
ForumNett Online AS
http://www.forumnett.no/
------------------------------
Date: Mon, 9 Nov 1998 00:55:44 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Problem with Counter+Statistic
Message-Id: <MPG.10b04de6d8237da8989903@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <3646a116.401453028@news.online.no> on Mon, 09 Nov 1998
08:00:52 GMT, Tore Aursand <tore@forumnett.no> says...
...
> $referer = $ENV{'REFERER'};
$referer = $ENV{'HTTP_REFERER'};
and the quotes are unnecessary.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 09 Nov 1998 07:13:08 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: SEEK function on NT
Message-Id: <910595451.968784@thrush.omix.com>
[posted & mailed]
Spider <mjd@sgi.net> wrote:
: Here is the complete script. The indent I get is 2 spaces indented like a
: tab before the array data so the text file looks like this.
: NewData1
: Array data here
>snip<
: It is being read by an applet that left justifies each line so it still
: "looks" ok thereI'd like to know what or where the 2 spaces are coming
: from
BTW, please don't use the character "", whatever it is. It's not
ASCII.
>snip<
: print TEXT <<NEW_TEXT;
: ^^pause(1500) $TheDate
: $in{'S1'}\r\n
: @textfile
: NEW_TEXT
>snip<
Bingo. In this context, @textfile is being interpolated as if
it was inside a double quoted string like "@textfile". When
you interpolate an array like that it is equilivent(sp?) to
this:
print TEXT
"^^pause(1500) $TheDate\n",
"$in{'S1'}\r\n\n",
join $", @textfile,
"\n";
Notice that 'join $", @textfile'. $" is the list separator, by
default a single space. So, every time you print @textfile out
you're adding one more space to the beginning of every (save for
one) line.
Answer, don't use a here-doc for this, or otherwise quote the
@textfile array. It really isn't needed here anyway:
print TEXT "pause(1500) $TheDate", "$in{'S1'}\r\n\n", @textfile;
--
-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: Sun, 08 Nov 1998 17:54:24 -0500
From: "Frank McCulley" <mcculley@jersey.net>
Subject: Split with Multiple
Message-Id: <7257bj$eh5$1@news.jersey.net>
I have just begun to work with Perl and I have come across a problem and I
have not been able to find a solution. I am sending form data to a perl
program. I am using a pop up menu and I am allowing multiple selections.
The data is then being sent with the post method. A & is placed between the
two selections and this kills my split command in Perl. Is there an easy
solution to this problem?
------------------------------
Date: Sun, 8 Nov 1998 15:14:13 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: STANDARD PERL for WIN 95/NT EXECUTABLE
Message-Id: <MPG.10afc5a38bf82d4e989902@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <74S2oLPZUkB@link-n-j.poehlmann.link-n.cl.sub.de> on 08 Nov
1998 00:00:00 +0000, Johannes Poehlmann <j.poehlmann@link-n.cl.sub.de>
says...
> (Weekly posting to comp.lang.perl.misc and de.lang.perl)
>
> _Where to find the *STANDARD* windows 95/NT port of perl (binary) ?_
>
> (The "standard" has a number of advantages over Microsoft's "Activeware"
> port. E.g. you can install perl modules not contained in the binary
> distribution. As long as these Modules do not use C-code you do not need a C-
> compiler )
> Worldwide (Redirecting you to a "near" site )
> ftp://ftp.perl.com/pub/CPAN/ports/win32/Standard/x86/
>
> Look for a File like
> perl5.00402-bindist04-bc.zip
> there is a new Version (perl 5.005 ) released
...SNIP of a couple of hundred lines
> Gurusamy Sarathy (Just Another Perl Porter)
> gsar@umich.edu
> 08-AUG-1997
This material is 15 months old. I have found the ActivePerl port of
5.005_02 (available for free at <URL:http://www.activestate.com>) to be
quite robust. Is there any reason why that should not be the perl of
choice today for Win32?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 8 Nov 1998 14:01:32 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: trouble with grep....
Message-Id: <1di6hb8.1cp0m4qbkczrlN@bay2-145.quincy.ziplink.net>
I'm glad you found a way to solve the problem. You should still read
the relevant entry in the FAQ, because there's a better way to do it.
As to why your original code did not work...
@array = qw(abc abc def ghi def);
foreach $item(@array)
{
push @new, $item unless grep /$item/, @new;
}
print "@new\n";
__END__
abc def ghi
Works for me.
What were the elements in @array when you tried it?
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 8 Nov 1998 23:20:42 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: Why is perl better than shell scripting language?
Message-Id: <dkcombsF24M6I.6y3@netcom.com>
Please, an example or two of what neat thing you are talking about.
THANKS!
In article <op1zpa5szgh.fsf@ca.newbridge.com>,
Brad Warkentin <bradw@ca.newbridge.com> wrote:
>yong <yong@shell.com> writes:
>
>> There's one situation I can think of I have to use the shell language,
>> that is when I want to change the environment variables of the parent
>> process.
>
>Nope.... :-)
>
>If you want to add/change/delete a single variable then sure, but if
>you want to build environments, based on complex conditionals tis way
>easier to do in perl. For instance we have a tool that builds tool
>suite environments for CAE tools, which have all sorts of stupid
>environmental variable requirements, many of which overlap.
>
>Just have to have a shell wrapper that runs your perl program to build
>a shell appropriate file and then sources that file. Source the
>wrapper or better yet hide the Korn versus Csh versus Bash versus ?
>syntactical differences behind an alias an you are done
>
>Do it right and you have user independance across multiple os' and
>shells, and only have to maintain 1 perl source, plus 1 trivial
>wrapper script per shell you support.
>
>bj
------------------------------
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 4178
**************************************