[11597] in Perl-Users-Digest
Perl-Users Digest, Issue: 5197 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 22 10:07:23 1999
Date: Mon, 22 Mar 99 07:00:23 -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, 22 Mar 1999 Volume: 8 Number: 5197
Today's topics:
Re: [HELP] How to restrict other sites to link my docum (Jonathan Stowe)
Change password online script. <lemmen@support.nl>
Re: embeded Perl on Win32 <ibelgaufts@gfc-net.de>
Re: Environment strings (Jonathan Stowe)
Environment variable <hallvard@npk.no>
Re: File test operator for modification/access time. <aqumsieh@matrox.com>
Re: Hello! one cgi question (Bart Lateur)
Re: Help Needed Please!!! (Mark P.)
Re: HTML in email <webmaster@noit.phnet.fi>
Re: HTML in email (Thore Harald Hoye)
Re: Net::FTP (Jonathan Stowe)
Re: Net::FTP (I R A Aggie)
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Re: One liner? <Allan@due.net>
Re: One liner? <Allan@due.net>
Re: Possible values for $^O? (Bart Lateur)
Re: Possible values for $^O? (Jonathan Stowe)
regular expressions <schkey@info.load-otea.hrdc-drhc.gc.ca>
remove HTML from a string on perl5.004_4 (yang shen)
Re: return codes in Win32 Perl <ibelgaufts@gfc-net.de>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 22 Mar 1999 14:02:45 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: [HELP] How to restrict other sites to link my documents?
Message-Id: <36f64d3d.18578776@news.dircon.co.uk>
On 22 Mar 1999 11:57:24 GMT, sbin@cs.nthu.edu.tw (Sbin Lin) wrote:
>Hi,
>
> Could anyone tell me how to restrict other sites to
>link my documents (just like images).
>
It may or may not be possible but it is not a Perl question.
/J\
------------------------------
Date: Mon, 22 Mar 1999 14:40:16 +0100
From: "Marcel Lemmen" <lemmen@support.nl>
Subject: Change password online script.
Message-Id: <7d5h5r$8o9$1@news.news-service.com>
Hello all,
I'm an ISP and I want my users to change their password online.
I want to use a Perl CGI script.
Who can help me with this script?
Thanx in advance,
Marcel Lemmen
Support Net BV.
www.support.nl
------------------------------
Date: Mon, 22 Mar 1999 15:29:46 +0100
From: =?iso-8859-1?Q?J=FCrgen?= Ibelgaufts <ibelgaufts@gfc-net.de>
Subject: Re: embeded Perl on Win32
Message-Id: <36F653DA.C3FF852E@gfc-net.de>
Piotrek,
I got the following running (a C source and a batch file for compiling and
linking). I use the standard distribution (GS-Perl) 5.005 compiled with MS Visual
C 4.00; this program compiles and links at least with Visual C 4 and 5 (I don't
know about version 6).
Note that I don't know very much C; I grabbed pieces of this program from varying
sources including the Perl manpages.
Juergen Ibelgaufts
------- start of C source ------------------------------
#define WIN32
#include <stdio.h>
#include <EXTERN.h>
#include <perl.h>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
// The following has been created by "perl -MExtUtils::Embed -e xsinit -o
perlxsi.c"
// in order to allow the use of dynamically loaded perl extensions
#if defined(__cplusplus) && !defined(PERL_OBJECT)
#define is_cplusplus
#endif
#ifdef is_cplusplus
extern "C" {
#endif
#include <EXTERN.h>
#include <perl.h>
#ifdef PERL_OBJECT
#define NO_XSLOCKS
#include <XSUB.h>
#include "win32iop.h"
#include <fcntl.h>
#include <perlhost.h>
#endif
#ifdef is_cplusplus
}
# ifndef EXTERN_C
# define EXTERN_C extern "C"
# endif
#else
# ifndef EXTERN_C
# define EXTERN_C extern
# endif
#endif
EXTERN_C void xs_init _((void));
EXTERN_C void boot_DynaLoader _((CV* cv));
EXTERN_C void
xs_init(void) {
char *file = __FILE__;
dXSUB_SYS;
/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}
// Perl-Interpreter starts here ---------------------------------------------
static PerlInterpreter *my_perl;
int main(int argc, char **argv, char **env) {
my_perl = perl_alloc();
perl_construct(my_perl);
perl_parse(my_perl, xs_init, argc, argv, (char **)NULL);
perl_eval_pv("print \"pshell running...\n\";", TRUE);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
}
----------- End of C source -------------------------------
-------------Start of Batch file --------------------------
setlocal
if exist c:\devstudio\vc\bin\cl.exe set lw=c:
if exist d:\devstudio\vc\bin\cl.exe set lw=d:
if exist e:\devstudio\vc\bin\cl.exe set lw=e:
if exist f:\devstudio\vc\bin\cl.exe set lw=f:
path=%lw%\devstudio\vc\bin;%path%;
set include=%lw%\devstudio\vc\include;F:\perl\5.005\lib\MSWin32-x86-thread\CORE;
set lib=%lw%\devstudio\vc\lib;F:\perl\5.005\lib\MSWin32-x86-thread\CORE;
cl pshell.c perl.lib
endlocal
------------ End of Batch file ------------------------
------------------------------
Date: Mon, 22 Mar 1999 12:49:59 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Environment strings
Message-Id: <36f63bcd.14113971@news.dircon.co.uk>
On Mon, 22 Mar 1999 06:33:14 -0500, Bret Bordwell <bret@bordwell.com>
wrote:
>Ronald J Kimball wrote:
>>
>> In that case, it must be your code. Environment variables simply don't
>> work that way.
>>
>> Perhaps it's an error on line 17?
>>
>
>Funny, line 17.
>
>Well, maybe some other value is being held, or something, 'cause it's
>weird.
>Now I'm a seasoned programmer with over 12 years doing this stuff for
>DOS and Windows. I'm a bit new
>with Perl... so give me a break.
>
Give *US* a break - there might be some pretty clever people here but
I am absolutely certain that none of them would list amongst their
skills the remote viewing of other peoples code ...
Seeing what happens is one thing but you could have written this in
RPG/III as far as we know. Please post the bit of code you are having
difficulty with.
/J\
------------------------------
Date: Mon, 22 Mar 1999 14:33:23 +0100
From: "Hallvard =?ISO-8859-1?B?2A==?=strem" <hallvard@npk.no>
Subject: Environment variable
Message-Id: <7d5gol$9lv$1@elle.eunet.no>
I'm a Perl newbie trying to get a simple web counter script working on my
Windows NT server, but I'm not able to get the environment variables right.
The script should count pages by the documents URI and list them in a
HTML-table, but the DOCUMENT_URI variable is empty when called from the
script. I can still get the URI if I call it directly from the HTML page.
Can anyone help?
Regards,
Hallvard =D8strem
------------------------------
Date: Sun, 21 Mar 1999 15:58:55 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: File test operator for modification/access time.
Message-Id: <x3y1zii8sq8.fsf@tigre.matrox.com>
latorre69@arrakis.es (miedo) writes:
> I want to know how many days a file was modificated/accessed ago, but
perldoc -f stat
------------------------------
Date: Mon, 22 Mar 1999 12:02:20 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Hello! one cgi question
Message-Id: <36f930c6.12690586@news.skynet.be>
sachin@surya.pune.lucent.com wrote:
>I am newbie, just want to read from a file and write to some other file..I am
>able to read from the file, but whenever i open a new file and write to it,
>everything goes right...but no file is created actually.....Whether cgi-bin
>evironment puts a restriction on creating files....
You don't check the return value for the open (for output), do you? It
probably fails, and $! will tell you why.
Probably it's a file permissions problem. To create a new file in CGI,
you need to enable write and execute permissions for the directory, for
all (that's what the script runs as, usually).
HTH,
Bart.
------------------------------
Date: Mon, 22 Mar 1999 14:05:38 GMT
From: mag@imchat.com (Mark P.)
Subject: Re: Help Needed Please!!!
Message-Id: <36f64db5.303419343@news.ionet.net>
Sorry, I guess you're right. I just always saw single lines
and assumed. Still learning. Doing pretty good with absolutely no
programming experience also.
On Mon, 22 Mar 1999 01:26:16 -0500, rjk@linguist.dartmouth.edu (Ronald
J Kimball) wrote:
>Mark P. <mag@imchat.com> wrote:
>
>> Notice the print qq~ and the ending ~; Everything between will
>> print out with unescaped quotes. What killed your script was that the
>> print command has to be one unbroken line.
>
>
>~> perl
>print qq~
>Bullsh-t.
>~;
>__END__
>Bullsh-t.
>
>
>Please test your assertions before you post them. Especially when
>they're wrong. ;-)
>
>--
> _ / ' _ / - aka -
>( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
> / http://www.tiac.net/users/chipmunk/
> "It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Mon, 22 Mar 1999 15:48:07 +0200
From: "WB" <webmaster@noit.phnet.fi>
Subject: Re: HTML in email
Message-Id: <7d5hdk$eio$1@ankka.csc.fi>
What wrong in the following code....?
open (MAIL,"|$mailprogram");
print MAIL "To: $recip\n";
print MAIL "From: $sender\n";
print MAIL "Subject: Kummiporot\n";
print MAIL "Content-Type: text/html;\n\n";
print MAIL "<HTML>\n";
print MAIL "<HEAD>\n";
print MAIL "</head>\n";
print MAIL "<body>\n";
print MAIL "<IMG src="http://www.kummiporo.net\kuvat\porokuu.jpg">\n";
print MAIL "</body>\n";
print MAIL "</html>\n";
close(MAIL);
------------------------------
Date: Mon, 22 Mar 1999 14:34:59 GMT
From: thoye@online.no (Thore Harald Hoye)
Subject: Re: HTML in email
Message-Id: <36f8548d.1025113078@news.online.no>
On Mon, 22 Mar 1999 15:48:07 +0200, "WB" <webmaster@noit.phnet.fi>
wrote:
>print MAIL "<IMG src="http://www.kummiporo.net\kuvat\porokuu.jpg">\n";
You don't say what the unexpected behaviour is, but you may want to fix
some backslashes and stuff here.
print MAIL "<IMG src=\"http://www.kummiporo.net/kuvat/porokuu.jpg\">\n";
would probably be better.
------------------------------
Date: Mon, 22 Mar 1999 12:56:29 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Net::FTP
Message-Id: <36f63dc4.14616696@news.dircon.co.uk>
On Mon, 22 Mar 1999 12:25:12 +0100, David Van den Brande
<brandeda@se.bel.alcatel.be> wrote:
>Hi,
>
>is there a Net::FTP command that changes the local working directory ?
>Or, is there a way to give a local path within a get command
>$ftp->get(/home/usr/tmp/localfilename,remotefilename) ?
>
Er, yes :
NAME
Net::FTP - FTP Client class
SYNOPSIS
use Net::FTP;
$ftp = Net::FTP->new("some.host.name");
$ftp->login("anonymous","me@here.there");
$ftp->cwd("/pub");
I'd clean your glasses next time you are reading the documentation ;-}
/J\
------------------------------
Date: 22 Mar 1999 13:10:18 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Net::FTP
Message-Id: <slrn7fcgs1.mol.fl_aggie@stat.fsu.edu>
On Mon, 22 Mar 1999 12:56:29 GMT, Jonathan Stowe
<gellyfish@btinternet.com> wrote:
+ On Mon, 22 Mar 1999 12:25:12 +0100, David Van den Brande
+ <brandeda@se.bel.alcatel.be> wrote:
+ >is there a Net::FTP command that changes the local working directory ?
^^^^^^^^^^^^^^^^^^^^^^^
+ $ftp->cwd("/pub");
+ I'd clean your glasses next time you are reading the documentation ;-}
Ummm...no. The key word is *local*. Care for some windex? ;)
+ >Or, is there a way to give a local path within a get command
+ >$ftp->get(/home/usr/tmp/localfilename,remotefilename) ?
Ummm...you mean like:
$ftp->get($there,$here);
??? What Jonathan said about glassess and the documentation...
James
------------------------------
Date: 22 Mar 1999 14:45:51 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <7d5l2v$gru$2@info2.uah.edu>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 15 Mar 1999 14:51:08 GMT and ending at
22 Mar 1999 06:49:29 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1998 Greg Bacon. All Rights Reserved.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 253 (45.9% of all posters)
Articles: 419 (26.3% of all articles)
Volume generated: 734.8 kb (27.5% of total volume)
- headers: 336.0 kb (6,447 lines)
- bodies: 389.9 kb (12,749 lines)
- original: 261.2 kb (9,016 lines)
- signatures: 8.5 kb (200 lines)
Original Content Rating: 0.670
Averages
========
Posts per poster: 1.7
median: 1 post
mode: 1 post - 176 posters
s: 1.5 posts
Message size: 1795.7 bytes
- header: 821.1 bytes (15.4 lines)
- body: 952.8 bytes (30.4 lines)
- original: 638.3 bytes (21.5 lines)
- signature: 20.7 bytes (0.5 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
8 16.9 ( 7.2/ 9.7/ 4.5) scp@mindless.com
7 15.5 ( 10.3/ 5.1/ 2.7) "Quantum Leaper" <leaper@bigfoot.com>
7 12.6 ( 5.7/ 6.9/ 3.0) Kid Kaboom <newsgroups@kidkaboom.frogspace.net>
7 11.6 ( 5.5/ 4.1/ 2.1) Tony Curtis <Tony.Curtis@vcpc.univie.ac.at>
7 10.6 ( 4.1/ 6.0/ 2.6) blade@leela.janton.fi (Sami Rosenblad)
6 7.6 ( 4.1/ 3.5/ 2.0) Andrew Tipson <atipson@wesleyan.edu>
6 10.6 ( 5.0/ 5.2/ 3.4) 'x'campbell-lange@easynet.co.uk (Rory Campbell Lange)
5 10.1 ( 6.7/ 3.4/ 1.5) "Rufus V. Smith" <Rufus_Smith@GuntherIntl.com>
5 7.3 ( 3.9/ 3.3/ 2.6) s.filipowicz@orades.nl
5 6.1 ( 3.2/ 2.9/ 1.9) "Jerry Zhao" <zzhao@execulink.com>
These posters accounted for 4.0% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
19.8 ( 5.1/ 14.8/ 5.3) 4 tng@sosweb.net.nospam
16.9 ( 7.2/ 9.7/ 4.5) 8 scp@mindless.com
15.5 ( 10.3/ 5.1/ 2.7) 7 "Quantum Leaper" <leaper@bigfoot.com>
14.6 ( 5.6/ 9.1/ 2.1) 4 "Michael Barnes" <barnesm@cain-travel.com>
12.6 ( 5.7/ 6.9/ 3.0) 7 Kid Kaboom <newsgroups@kidkaboom.frogspace.net>
11.6 ( 5.5/ 4.1/ 2.1) 7 Tony Curtis <Tony.Curtis@vcpc.univie.ac.at>
11.0 ( 5.7/ 5.3/ 3.0) 4 "Jeffrey S. Kline" <jeff_kline@hopkins.k12.mn.us>
10.7 ( 2.4/ 8.3/ 6.3) 3 Martin Foster <mfoster@spots.ab.ca>
10.6 ( 5.0/ 5.2/ 3.4) 6 'x'campbell-lange@easynet.co.uk (Rory Campbell Lange)
10.6 ( 4.1/ 6.0/ 2.6) 7 blade@leela.janton.fi (Sami Rosenblad)
These posters accounted for 5.0% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 2.2 / 2.2) 4 root@aol.com
1.000 ( 0.4 / 0.4) 4 Simon Ng <simon_ng@pacific.net.sg>
1.000 ( 1.7 / 1.7) 3 fgont@hotpop.com (Fernando Ariel Gont)
0.979 ( 2.0 / 2.0) 3 christianarandaOUT@OUTyahoo.com (Christian M. Aranda)
0.842 ( 2.5 / 2.9) 4 stufuller@usa.net
0.790 ( 2.6 / 3.3) 5 s.filipowicz@orades.nl
0.783 ( 1.2 / 1.5) 3 mkagalen@lynx.dac.neu.edu
0.761 ( 6.3 / 8.3) 3 Martin Foster <mfoster@spots.ab.ca>
0.748 ( 2.4 / 3.3) 4 andre_perl@ONE-CLICK.COM (Andri Bell [aka Andre Bell])
0.704 ( 3.9 / 5.5) 4 "Steven T. Hatton" <hattons@cpkwebser5.ncr.disa.mil>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.464 ( 1.2 / 2.6) 3 britts@pyro.net
0.459 ( 4.5 / 9.7) 8 scp@mindless.com
0.441 ( 1.5 / 3.4) 5 "Rufus V. Smith" <Rufus_Smith@GuntherIntl.com>
0.436 ( 3.0 / 6.9) 7 Kid Kaboom <newsgroups@kidkaboom.frogspace.net>
0.433 ( 2.6 / 6.0) 7 blade@leela.janton.fi (Sami Rosenblad)
0.418 ( 2.9 / 7.0) 3 rob_liberti@my-dejanews.com
0.361 ( 5.3 / 14.8) 4 tng@sosweb.net.nospam
0.282 ( 0.8 / 2.8) 4 steger@bigfoot.com
0.237 ( 2.1 / 9.1) 4 "Michael Barnes" <barnesm@cain-travel.com>
0.220 ( 0.8 / 3.4) 3 Brad Hughes <brad@tgsmc.com>
36 posters (14%) had at least three posts.
Top 10 Crossposters
===================
Articles Address
-------- -------
42 "Quantum Leaper" <leaper@bigfoot.com>
36 James@DX2.home (James Stevenson)
32 Edward Hill <edward_hill@gec.nospam.com>
27 "Rufus V. Smith" <Rufus_Smith@GuntherIntl.com>
24 "Jeffrey S. Kline" <jeff_kline@hopkins.k12.mn.us>
24 steger@bigfoot.com
24 "Michael Barnes" <barnesm@cain-travel.com>
24 tng@sosweb.net.nospam
24 stufuller@usa.net
24 root@aol.com
------------------------------
Date: Mon, 22 Mar 1999 08:08:27 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: One liner?
Message-Id: <7d5ev3$a11$1@camel29.mindspring.com>
Allan M. Due wrote in message ...
:Sara Young <syoung@actcom.co.il> wrote in message
:news:7d52ai$pp$1@lnews.actcom.co.il...
:: Let's say you have an array of @positions and a $delimiter.
:: Your task is to take a $line and insert the delimiter in the correct
:: character locations. For example, if:
:: @positions = (4, 6);
:: $line = 'hello there';
:: $delimiter = ',';
:: Then the output should be:
:: hel,lo, there
:: Is it possible to do this with one line of code?
:Needs the latest version of perl, otherwise move the foreach.
:#!/usr/local/bin/perl -w
:use strict;
:my @positions = (4, 6);
:my $line = 'hello there';
:my $delimiter = ',';
:
:substr($line,$_,0,$delimiter) foreach (@positions);
Well, I would probably be remiss if I didn't point out that although the
code I posted does what you asked for, it probably is not what you want. If
you want the separator to appear in the line at its specified location you
need to adjust on the fly. If your delimiter is only one character then
this will work as a one-liner:
substr($line,$_+$index++,0,$delimiter) foreach @positions;
I can't think how to localize the autoincrement so if your separator is more
than one char I think we have to go to something like.
foreach (@positions) {
substr($line,$_+$index,0,$delimiter);
$index += length($delimiter);
}
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
"And I don't like doing silly things (except on purpose)."
- Larry Wall in <1992Jul3.191825.14435@netlabs.com>
------------------------------
Date: Mon, 22 Mar 1999 08:22:09 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: One liner?
Message-Id: <7d5for$arp$1@camel29.mindspring.com>
Allan M. Due wrote in message <7d5ev3$a11$1@camel29.mindspring.com>...
:Allan M. Due wrote in message ...
::Sara Young <syoung@actcom.co.il> wrote in message
::news:7d52ai$pp$1@lnews.actcom.co.il...
::: Let's say you have an array of @positions and a $delimiter.
::: Your task is to take a $line and insert the delimiter in the correct
::: character locations. For example, if:
::: @positions = (4, 6);
::: $line = 'hello there';
::: $delimiter = ',';
::: Then the output should be:
::: hel,lo, there
::: Is it possible to do this with one line of code?
:
substr($line,$_+(($index+=length($delimiter))-length($delimiter)),0,$delimit
er) foreach @positions;
Ok one line, any length separator. There has to be something cleaner but I
have to get to work.
HTH
AmD
Man I got to get a life.
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
The product of an arithmetical computation is the answer to an equation; it
is not the solution to a problem.
- Ashley-Perry Statistical Axioms[4]
------------------------------
Date: Mon, 22 Mar 1999 11:59:24 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Possible values for $^O?
Message-Id: <36f82f46.12361200@news.skynet.be>
Philip Newton wrote:
>Does $^O differentiate between e.g.
>Win95, Win98, WinNT, and Win2000?
I think that $^O depends entirely on the Perl port, and NOT on the OS
itself.
For example, Ilya's OS/2 port says it's "os2", even when run on DOS. It
looks like the Activestate port says "MSWin32", no matter what platform.
Bart.
------------------------------
Date: Mon, 22 Mar 1999 12:35:11 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Possible values for $^O?
Message-Id: <36f637aa.13054339@news.dircon.co.uk>
On Mon, 22 Mar 1999 11:38:54 +0100, Philip Newton
<Philip.Newton@datenrevision.de> wrote:
>Hi there,
>
>there was a thread about finding out the OS a while back, which
>mentioned $^O. What are the possible (or most common) values for $^O?
There is no list as far as I know.
>After all, this is one variable where you can't find out all the outputs
>by trial and error, unless you have access to a whole lot of systems. On
>my HP-UX box, $^O has the value 'hpux'.
> What others are there (for
>commonly-used operating systems)?
Let see:
tom.dircon.net$ perl5.00502 -e 'print $^O,"\n"'
sco_sv
tom.dircon.net$ uname -a
SCO_SV tom 3.2 2 i386
tom.dircon.net$
fatmog:~/radius$ perl -e 'print $^O,"\n"'
linux
fatmog:~/radius$ uname -a
Linux fatmog 2.0.34 #5 Tue Sep 1 10:12:18 BST 1998 i686 unknown
fatmog:~/radius$
bash$ perl5 -e 'print $^O,"\n"'
bsdos
bash$ uname -a
BSD/OS admin.dircon.net 2.1 BSDI BSD/OS 2.1 Kernel #2: Fri Nov 21
16:47:59 GMT 1
997 philip@admin.dircon.net:/usr/src/sys/compile/ADMIN i386
bash$
P:\>perl -e "print $^O"
MSWin32
P:\>uname -a
MS-DOS DESKTOP8 7 10 pc
???
> Does $^O differentiate between e.g.
>Win95, Win98, WinNT, and Win2000?
>
No I dont think so.
/J\
------------------------------
Date: Mon, 22 Mar 1999 14:37:50 GMT
From: schkey <schkey@info.load-otea.hrdc-drhc.gc.ca>
Subject: regular expressions
Message-Id: <7d5kjt$k8j$1@nnrp1.dejanews.com>
Hi,
I am looking for anyone who can tell me of any regular expressions to search
for special HTML entities inside an HTML document.
Thanks.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 22 Mar 1999 14:55:34 GMT
From: ys74@cornell.edu (yang shen)
Subject: remove HTML from a string on perl5.004_4
Message-Id: <7d5ll6$q8t@newsstand.cit.cornell.edu>
Hi everyone,
I can use:
#!/usr/bin/perl -p0777
s/<(?:[^>'"]*|(['"]).*?\1)*>//gs
to remove HTML tags on perl5.003. After my perl upgraded to perl5.004_4 I got
this error msg.:
/<(?:[^>'"]*|(['"]).*?\1)*>/: regexp *+ operand could be empty at
remove_HTML.pl line 2.
Any ideas?
Thanks a lot!
Yang
ys74@cornell.edu
------------------------------
Date: Mon, 22 Mar 1999 15:15:34 +0100
From: =?iso-8859-1?Q?J=FCrgen?= Ibelgaufts <ibelgaufts@gfc-net.de>
Subject: Re: return codes in Win32 Perl
Message-Id: <36F65085.9A420BBF@gfc-net.de>
Phil,
what do you delete the files with? The Perl lines
system ("del $filename")
or
unlink $filename
should always do what you want.
Juergen Ibelgaufts
----------------------------------------------------------------------
Phil Mak schrieb:
>
> Hi,
>
> I've set up a Perl program to delete certain files from a directory
> running under Windows NT. For some reason, it is not doing it. When I
> check the $? variable to find out the return code, it gives me the value
> '65280'. Does anyone know what this means? Or can somebody direct me
> to a web page that would contain a list of all the return codes and
> their meanings? Just need someone to point me in the right direction.
>
> Thanks,
> Phil
------------------------------
Date: 22 Mar 1999 14:45:48 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <7d5l2s$gru$1@info2.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 15 Mar 1999 14:51:08 GMT and ending at
22 Mar 1999 06:49:29 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 1999 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Excluded Posters
================
perlfaq-suggestions\@(?:.*\.)?perl\.com
Totals
======
Posters: 551
Articles: 1591 (561 with cutlined signatures)
Threads: 481
Volume generated: 2669.9 kb
- headers: 1191.8 kb (24,014 lines)
- bodies: 1391.5 kb (45,511 lines)
- original: 897.1 kb (31,855 lines)
- signatures: 85.1 kb (1,944 lines)
Original Content Rating: 0.645
Averages
========
Posts per poster: 2.9
median: 1 post
mode: 1 post - 320 posters
s: 6.5 posts
Posts per thread: 3.3
median: 2 posts
mode: 1 post - 130 threads
s: 3.4 posts
Message size: 1718.4 bytes
- header: 767.1 bytes (15.1 lines)
- body: 895.6 bytes (28.6 lines)
- original: 577.4 bytes (20.0 lines)
- signature: 54.8 bytes (1.2 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
77 124.1 ( 48.0/ 68.5/ 42.3) lr@hpl.hp.com (Larry Rosler)
70 96.5 ( 39.5/ 56.9/ 34.9) tadmc@metronet.com (Tad McClellan)
42 68.2 ( 29.1/ 30.3/ 18.8) Jonathan Stowe <gellyfish@btinternet.com>
41 74.6 ( 30.9/ 33.8/ 17.2) rjk@linguist.dartmouth.edu (Ronald J Kimball)
40 72.4 ( 32.6/ 35.1/ 18.4) "David L. Cassell" <cassell@mail.cor.epa.gov>
39 53.6 ( 29.7/ 22.5/ 14.1) jglascoe@giss.nasa.gov
34 53.8 ( 30.6/ 19.8/ 8.3) comdog@computerdog.com (brian d foy)
32 46.4 ( 24.1/ 17.3/ 16.5) abigail@fnx.com
28 35.6 ( 15.2/ 20.4/ 11.5) Eric Bohlman <ebohlman@netcom.com>
24 33.8 ( 19.2/ 14.6/ 9.6) bart.lateur@skynet.be (Bart Lateur)
These posters accounted for 26.8% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
124.1 ( 48.0/ 68.5/ 42.3) 77 lr@hpl.hp.com (Larry Rosler)
96.5 ( 39.5/ 56.9/ 34.9) 70 tadmc@metronet.com (Tad McClellan)
74.6 ( 30.9/ 33.8/ 17.2) 41 rjk@linguist.dartmouth.edu (Ronald J Kimball)
72.4 ( 32.6/ 35.1/ 18.4) 40 "David L. Cassell" <cassell@mail.cor.epa.gov>
68.2 ( 29.1/ 30.3/ 18.8) 42 Jonathan Stowe <gellyfish@btinternet.com>
53.8 ( 30.6/ 19.8/ 8.3) 34 comdog@computerdog.com (brian d foy)
53.6 ( 29.7/ 22.5/ 14.1) 39 jglascoe@giss.nasa.gov
46.4 ( 24.1/ 17.3/ 16.5) 32 abigail@fnx.com
35.6 ( 15.2/ 20.4/ 11.5) 28 Eric Bohlman <ebohlman@netcom.com>
33.8 ( 19.2/ 14.6/ 9.6) 24 bart.lateur@skynet.be (Bart Lateur)
These posters accounted for 24.7% of the total volume.
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
1.000 ( 2.9 / 2.9) 5 "Chris Denman" <c-denman@dircon.co.uk>
1.000 ( 8.1 / 8.1) 7 andrew-johnson@home.com
0.955 ( 16.5 / 17.3) 32 abigail@fnx.com
0.896 ( 19.3 / 21.5) 9 Greg Bacon <gbacon@cs.uah.edu>
0.870 ( 4.4 / 5.0) 6 ran@netgate.net
0.836 ( 4.2 / 5.0) 6 "Robert Gwynne" <gwynne@utkux.utk.edu>
0.790 ( 2.6 / 3.3) 5 s.filipowicz@orades.nl
0.787 ( 4.0 / 5.1) 5 "Gavin" <gaving@enter.net>
0.786 ( 5.7 / 7.2) 8 "Brent Cornwell, Pediatrics Computer Administrator" <bcornwell@mail.peds.lsumc.edu>
0.776 ( 4.8 / 6.2) 10 James Tolley <jamesht@idt.net>
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.466 ( 2.3 / 4.9) 5 "Kevin S (xS)" <xs@dmusic.com>
0.459 ( 4.5 / 9.7) 8 scp@mindless.com
0.441 ( 1.5 / 3.4) 5 "Rufus V. Smith" <Rufus_Smith@GuntherIntl.com>
0.436 ( 3.0 / 6.9) 7 Kid Kaboom <newsgroups@kidkaboom.frogspace.net>
0.433 ( 2.6 / 6.0) 7 blade@leela.janton.fi (Sami Rosenblad)
0.422 ( 8.3 / 19.8) 34 comdog@computerdog.com (brian d foy)
0.421 ( 1.5 / 3.6) 5 ilya@math.ohio-state.edu (Ilya Zakharevich)
0.371 ( 3.8 / 10.2) 7 Dan Sugalski <sugalskd@netserve.ous.edu>
0.350 ( 2.4 / 7.0) 5 Steve Wells <wells@cedarnet.org>
0.287 ( 1.1 / 3.7) 5 Christoph Wernli <cw@dwc.ch>
64 posters (11%) had at least five posts.
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
51 The truth about the Pentium III chip and ID --- **boycott info**
17 Variables in QUERY_STRING
16 Need Faster Approach
14 Which OS am I in
13 chdir : how do I pass parameters to this function???
12 Finding end of line
12 Regex limits for regex/function calls within subsitutions?
12 $var$i or what?
11 Need a one liner...
11 Why can't i create a file with >>$file?
These threads accounted for 10.6% of all articles.
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
142.8 ( 71.7/ 70.7/ 34.9) 51 The truth about the Pentium III chip and ID --- **boycott info**
30.0 ( 11.2/ 16.5/ 10.4) 16 Need Faster Approach
25.5 ( 13.9/ 9.7/ 5.0) 17 Variables in QUERY_STRING
22.9 ( 6.7/ 15.3/ 8.1) 8 does perl discourage obfuscated code? (was Re: Perl evangelism)
21.9 ( 8.3/ 12.5/ 7.8) 11 Need a one liner...
21.6 ( 8.6/ 12.7/ 6.0) 10 Where to start with Perl
21.5 ( 10.2/ 10.3/ 5.7) 12 $var$i or what?
21.4 ( 8.5/ 12.4/ 7.1) 11 Why can't i create a file with >>$file?
20.9 ( 10.5/ 9.1/ 5.3) 14 Which OS am I in
20.1 ( 14.5/ 5.1/ 2.6) 10 Please can we stop this PIII thread RIGHT HERE? As it's off-topic for everybody!
These threads accounted for 13.1% of the total volume.
Top 10 Threads by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.838 ( 2.0/ 2.3) 6 About CGI.pm
0.829 ( 3.2/ 3.9) 5 Perl - "Command not found"
0.799 ( 1.5/ 1.9) 5 dir command in perl?
0.778 ( 3.7/ 4.7) 6 Unicode/Base64 ?
0.765 ( 4.7/ 6.1) 5 Perl scripts written for UNIX. Will they work on NT?
0.750 ( 4.4/ 5.8) 5 storing data the best way - question?
0.733 ( 4.7/ 6.4) 7 Regex Question
0.728 ( 2.4/ 3.3) 5 How to let users of website know there are others present
0.728 ( 2.6/ 3.5) 5 Any idea to generate charts under Linux ?
0.724 ( 3.5/ 4.8) 8 Filehandle Q...
Bottom 10 Threads by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Subject
----- -------------- ----- -------
0.477 ( 6.0 / 12.7) 10 Where to start with Perl
0.473 ( 4.3 / 9.0) 9 need better way to print external file withen perl file
0.455 ( 2.7 / 5.9) 8 writing thumnails
0.454 ( 2.0 / 4.5) 5 How to redirect Output?
0.435 ( 2.5 / 5.8) 7 Forwarding to home directory using Net::FTP
0.433 ( 1.5 / 3.5) 8 rmdir fails Why?
0.411 ( 1.6 / 4.0) 5 Here 's a good one !!!
0.410 ( 4.2 / 10.4) 7 any perl4 hackers want to try their hand at this?
0.384 ( 3.6 / 9.3) 10 flock() on Alpha/VMS
0.222 ( 2.3 / 10.6) 5 Win32 Network problems with ActiveState PERL?
101 threads (20%) had at least five posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
69 comp.lang.python
69 comp.lang.tcl
60 comp.mail.sendmail
55 comp.os.linux.networking
55 comp.os.ms-windows.advocacy
54 comp.os.linux.setup
42 comp.lang.perl.modules
17 alt.perl
15 comp.lang.pascal.delphi.misc
15 comp.lang.clarion
Top 10 Crossposters
===================
Articles Address
-------- -------
48 "Brent Cornwell, Pediatrics Computer Administrator" <bcornwell@mail.peds.lsumc.edu>
42 "Quantum Leaper" <leaper@bigfoot.com>
36 ran@netgate.net
36 James@DX2.home (James Stevenson)
32 Edward Hill <edward_hill@gec.nospam.com>
27 timr@probo.com (Tim Roberts)
27 "Rufus V. Smith" <Rufus_Smith@GuntherIntl.com>
24 "Michael Barnes" <barnesm@cain-travel.com>
24 steger@bigfoot.com
24 tng@sosweb.net.nospam
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5197
**************************************