[13661] in Perl-Users-Digest
Perl-Users Digest, Issue: 1071 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 15 15:22:25 1999
Date: Fri, 15 Oct 1999 12:22:01 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <940015320-v9-i1071@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 15 Oct 1999 Volume: 9 Number: 1071
Today's topics:
Paranoid ISPs (was: Re: taint-safe way of getting cwd?) <rootbeer@redcat.com>
Re: Paranoid ISPs (was: Re: taint-safe way of getting c <darkon@one.net>
parsing and Array manipulation question <chakri@nortelnetworks.com>
Parsing file is skipping lines!!! jhagerty@my-deja.com
Re: Parsing file is skipping lines!!! <newsposter@cthulhu.demon.nl>
Re: Parsing file is skipping lines!!! <msalter@bestweb.net>
Re: Parsing file is skipping lines!!! (Craig Berry)
Re: Parsing file is skipping lines!!! <sariq@texas.net>
Re: Parsing file is skipping lines!!! <David.Gwilt@arm.com>
Re: Parsing file is skipping lines!!! jhagerty@my-deja.com
Re: parsing words <crt@kiski.net>
Passing referring URL thru LWP::UserAgent <webmaster@webdream.com>
Re: PDFlib size settings (Arved Sandstrom)
Re: PDFlib size settings (Henry Penninkilampi)
Perl and CGI redirect question ? <Edouard.Ouin@eircom.net>
Re: Perl and CGI redirect question ? <amonotod@netscape.net>
Perl and Excel <gala@sonic.net>
perl and multithread helmibenamara@my-deja.com
Re: perl and multithread <dan@tuatha.sidhe.org>
perl and word files? <helleskov@vip.cybercity.dk>
Re: perl and word files? (Scott McMahan)
Perl in cron <sterickson@carlson.com>
Re: Perl in cron (Abigail)
Re: Perl in cron <rootbeer@redcat.com>
Re: Perl Interview Question: <gellyfish@gellyfish.com>
Re: Perl Interview Question: (Martien Verbruggen)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 12 Oct 1999 16:20:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Paranoid ISPs (was: Re: taint-safe way of getting cwd?)
Message-Id: <Pine.GSO.4.10.9910121600110.19155-100000@user2.teleport.com>
On Tue, 12 Oct 1999, David Wall wrote:
> PS BTW, my ISP is idiotically paranoid about browsers for some reason
> -- something about "keeping spammers from harvesting email addresses
> from web pages" -- so they have things set to reject "unusual"
> browsers, like, say, emacs. I've complained about it before, to no
> avail. I guess I'll have to write a short script, have it pretend
> it's Netscape, and send it to them to prove a point.....
That's too much work:
$ perl -MLWP::Simple -e 'getprint "http://w3.one.net/"'
<!doctype html public "-//w3c//dtd html 3.2 final//en">
<html>
<head>
<title>OneNet Communications Inc: W3 Personal Web Server</title>
</head>
...
If you really want to use emacs as your browser, changing what it calls
itself is probably Just Another Configuration Variable deep in the bowels
of W3mode. But you could probably write a proxy in Perl that'll take care
of things for you.
But of course, if they're excluding "unusual" browsers, your ISP is
probably also inadvertently excluding the most important clients in the
world - those are the indexing robots from WebCrawler, HotBot, Lycos, and
the like. On the other hand, they don't seem to have a robots.txt file, so
maybe they're just terminally clueless. Why did you say you were paying
money to them? :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 12 Oct 1999 20:30:13 -0400
From: "David K. Wall" <darkon@one.net>
To: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Paranoid ISPs (was: Re: taint-safe way of getting cwd?)
Message-Id: <Pine.LNX.4.10.9910122011060.819-100000@shell.one.net>
On Tue, 12 Oct 1999, Tom Phoenix wrote:
> On Tue, 12 Oct 1999, David Wall wrote:
>
> > browsers, like, say, emacs. I've complained about it before, to no
> > avail. I guess I'll have to write a short script, have it pretend
> > it's Netscape, and send it to them to prove a point.....
>
> That's too much work:
>
> $ perl -MLWP::Simple -e 'getprint "http://w3.one.net/"'
Hmm, much easier than what I did. I made a copy of the
lwp-request program that came with Perl, and added a line to change the
user agent name. Then I deliberately tried to access things I knew would
be rejected, with names like "Denying access based on browser names is
silly", and several others. I made some of the names really long, so they
would show up easily to anyone who looked at the server logs. (Assuming
they look at the server logs)
Still, I suppose I learned a bit just by trying to read the source code
for lwp-request and the modules it uses....
> If you really want to use emacs as your browser, changing what it calls
> itself is probably Just Another Configuration Variable deep in the bowels
> of W3mode. But you could probably write a proxy in Perl that'll take care
> of things for you.
I normally just use Netscape to browse. I haven't regularly used emacs
for anything since grad school.
> But of course, if they're excluding "unusual" browsers, your ISP is
> probably also inadvertently excluding the most important clients in the
> world - those are the indexing robots from WebCrawler, HotBot, Lycos, and
> the like. On the other hand, they don't seem to have a robots.txt file, so
> maybe they're just terminally clueless. Why did you say you were paying
> money to them? :-)
Because they're local, I like having 100MB of space on their server, shell
access, but probably mainly because I'm too lazy to change. They're
pretty good in most ways, other than this misguided attitude toward
browsers.
--
David Wall
darkon@one.net
------------------------------
Date: Wed, 13 Oct 1999 00:01:01 -0500
From: Chakri Paila <chakri@nortelnetworks.com>
Subject: parsing and Array manipulation question
Message-Id: <3804120D.8BFB9CB5@nortelnetworks.com>
Hi,
I have searched for two strings and when I find them I want to store
some of the fields in the $_ and use at a later stage. I search for
"called" and would like to capture the time stamp information in the
first field and the Identifier. Similarly, I would search for the "hung
up" and capture the time stamp information. After looking for the common
indentifier, I would want to do some simple calculations with the
earlier stored information related to the Identifier.
I am not clear where I am wrong.
TIA
++++++++++++++++++ This is the code
$[ = 1; # changing the index origination at 1
foreach $file (@ARGV) {
open(FILE,$file) || warn "Can't open $file $!\n";
$calls_made = 0;
$call_ID = 0;
$call_start = 0.0;
$call_stop = 0.0;
$call_duration = 0.0;
while (<FILE>) {
chop;
@Fld = split(' ', $_);
if (($Fld[8] =~ /called\b/) || ($Fld[9] =~ /hung up\b/)) ### This is
redundant
{
if($Fld[8] =~ /called\b/) { #setup lines are selected
$call_start{$Fld[1]}++; ### how should store the value in Fld[1] of
$_
### this is a timestamp
information
$call_ID_orig{$Fld[2]}++;
}
if($Fld[9] =~ /hung up\b/) { #released lines are selected
$call_stop{$Fld[1]}++; #### I want to use the Fld[1] value for
later use.
### My approach does'nt work
$call_ID_term{$Fld[2]}++; ### similarly Fld[2] is to be used for later
use.
}
}
}
} # end of the look
printf ("\t\t_______________\n\n\n");
$calls_made = 0;
$time_start = 0.0;
$time_stop = 0.0;
foreach $callo (keys %call_ID_orig) { ## call_ID is unique.
foreach $callt (keys %call_ID_term) {
### this is where I would want to have the stored information used. To
do simple calc.
# $time_diff = ($callt($call_stop)-$time_start);
# printf ("\n%s\t",$time_diff);
### if the call ID is the same, the timing information for these should
be used.
if ($callt == $callo)
{
#printf ("\n\n%s\t",$callt);
$calls_made++;
}
}
}
------------------------------
Date: Thu, 14 Oct 1999 21:02:48 GMT
From: jhagerty@my-deja.com
Subject: Parsing file is skipping lines!!!
Message-Id: <7u5gde$8be$1@nnrp1.deja.com>
I am trying to parse a file and I am getting weird results. Hoping
someone can help. It appears that my problem is that all the even
numbered lines are being skipped. Here is my code:
$file = 'config.txt';
open (IN, "$file") or die "can't open $file: $! \n";
while (<IN>) {
$lines = <IN>;
if ($lines =~ m/type/i) {
($label, $value) = split /=/, $lines;
print $label;
print $value;
}
}
close IN;
From this I am only getting results from the odd unnumbered lines.
Also If i print all lines from within the While statement, I only get
the odd lines printed. Do I have an extra line feed in there that is
causing this?
Thanx.
Joe Hagerty
Perl Newbie
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 14 Oct 1999 21:41:37 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Parsing file is skipping lines!!!
Message-Id: <7u5imh$dr0$1@internal-news.uu.net>
jhagerty@my-deja.com wrote:
> I am trying to parse a file and I am getting weird results. Hoping
> someone can help. It appears that my problem is that all the even
> numbered lines are being skipped. Here is my code:
> $file = 'config.txt';
> open (IN, "$file") or die "can't open $file: $! \n";
> while (<IN>) {
here you read a line, which you throw away because:
> $lines = <IN>;
you read the next one here
Erik
------------------------------
Date: Thu, 14 Oct 1999 21:48:27 GMT
From: Mike Salter <msalter@bestweb.net>
Subject: Re: Parsing file is skipping lines!!!
Message-Id: <Pine.BSF.4.05.9910142142380.3196-100000@monet.bestweb.net>
On Thu, 14 Oct 1999 jhagerty@my-deja.com wrote:
>Date: Thu, 14 Oct 1999 21:02:48 GMT
>From: jhagerty@my-deja.com
>Newsgroups: comp.lang.perl.misc
>Subject: Parsing file is skipping lines!!!
>
>I am trying to parse a file and I am getting weird results. Hoping
>someone can help. It appears that my problem is that all the even
>numbered lines are being skipped. Here is my code:
>
>$file = 'config.txt';
>open (IN, "$file") or die "can't open $file: $! \n";
>
>while (<IN>) {
This while loop is reading a line into $_
The line below is reading a line into $line, thus the loss of lines.
Either use 'while ($lines = <IN>) {'
or use $_ below.
I would suggest you buy the Camel book.
> $lines = <IN>;
> if ($lines =~ m/type/i) {
> ($label, $value) = split /=/, $lines;
> print $label;
> print $value;
> }
> }
>close IN;
>
>From this I am only getting results from the odd unnumbered lines.
>Also If i print all lines from within the While statement, I only get
>the odd lines printed. Do I have an extra line feed in there that is
>causing this?
>
>Thanx.
>
>
>Joe Hagerty
>Perl Newbie
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
>
>
------------------------------
Date: Thu, 14 Oct 1999 21:50:42 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Parsing file is skipping lines!!!
Message-Id: <s0ck1ik8hu262@corp.supernews.com>
jhagerty@my-deja.com wrote:
: I am trying to parse a file and I am getting weird results. Hoping
: someone can help. It appears that my problem is that all the even
: numbered lines are being skipped. Here is my code:
:
: $file = 'config.txt';
: open (IN, "$file") or die "can't open $file: $! \n";
:
: while (<IN>) {
This reads the next line of input into $_
: $lines = <IN>;
This reads the next line after that into $lines (and doesn't check for
EOF, by the way).
: if ($lines =~ m/type/i) {
: ($label, $value) = split /=/, $lines;
: print $label;
: print $value;
: }
: }
: close IN;
:
: From this I am only getting results from the odd unnumbered lines.
If you're using zero-based line numbering, that makes sense. Line 0 is
read into $_ and never used again, line 1 goes into $lines and is
processed, line 2 is read into $_ and disappears, etc.
What you want (making a few other small improvements while I'm at it, and
covering just the while loop) looks something like this:
while (<IN>) {
if (m/type/i) {
my ($label, $value) = split /=/;
print $label, $value;
}
}
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: Thu, 14 Oct 1999 17:07:13 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Parsing file is skipping lines!!!
Message-Id: <38065411.F002F3BA@texas.net>
jhagerty@my-deja.com wrote:
>
> I am trying to parse a file and I am getting weird results. Hoping
> someone can help. It appears that my problem is that all the even
> numbered lines are being skipped. Here is my code:
>
> $file = 'config.txt';
> open (IN, "$file") or die "can't open $file: $! \n";
Good. Checking for success of open.
> while (<IN>) {
The first time through the loop, line one of the file is in $_.
> $lines = <IN>;
Uh-oh! You already got the first line, now you've assigned the second
line to $lines. If you want the line from the file, assign it in your
'while' statement.
> if ($lines =~ m/type/i) {
> ($label, $value) = split /=/, $lines;
> print $label;
> print $value;
> }
> }
> close IN;
It's also a good practice to check the success of close.
> From this I am only getting results from the odd unnumbered lines.
I don't know what 'odd unnumbered lines' means.
- Tom
------------------------------
Date: Fri, 15 Oct 1999 09:17:50 +0100
From: David Gwilt <David.Gwilt@arm.com>
Subject: Re: Parsing file is skipping lines!!!
Message-Id: <3806E32E.7E224316@arm.com>
Joe,
The first line assigns the next line of config.txt to $_, the second
line assigns the next line of config.txt to $lines. If you're only
working with $lines, then you will see every other line. To solve, try:
while ($lines = <IN>) {
if ($lines =~ .......
Cheers
Dave G.
> while (<IN>) {
> $lines = <IN>;
> if ($lines =~ m/type/i) {
> ($label, $value) = split /=/, $lines;
> print $label;
> print $value;
> }
> }
> close IN;
> From this I am only getting results from the odd unnumbered lines.
> Also If i print all lines from within the While statement, I only get
> the odd lines printed. Do I have an extra line feed in there that is
> causing this?
------------------------------
Date: Fri, 15 Oct 1999 17:21:58 GMT
From: jhagerty@my-deja.com
Subject: Re: Parsing file is skipping lines!!!
Message-Id: <7u7nr6$rnt$1@nnrp1.deja.com>
In article <3806E32E.7E224316@arm.com>,
David.Gwilt@arm.com wrote:
> Joe,
>
> The first line assigns the next line of config.txt to $_, the second
> line assigns the next line of config.txt to $lines. If you're only
> working with $lines, then you will see every other line. To solve,
try:
>
> while ($lines = <IN>) {
> if ($lines =~ .......
>
> Cheers
>
> Dave G.
>
> > while (<IN>) {
> > $lines = <IN>;
> > if ($lines =~ m/type/i) {
> > ($label, $value) = split /=/, $lines;
> > print $label;
> > print $value;
> > }
> > }
> > close IN;
>
> > From this I am only getting results from the odd unnumbered lines.
> > Also If i print all lines from within the While statement, I only
get
> > the odd lines printed. Do I have an extra line feed in there that is
> > causing this?
>
Works great now -- thanks all
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Oct 1999 07:54:29 -0400
From: "Casey R. Tweten" <crt@kiski.net>
Subject: Re: parsing words
Message-Id: <Pine.OSF.4.10.9910130720450.31818-100000@home.kiski.net>
:or example assume DUCK is a bad word. Normally, the guest book will
:replace it with blank spaces but if the user types in D U C K or D*U*C*K
:or D-U-C-K or D__U__C__K, the program will not catch it. Is there anyway
:I can prevent this from happening.
It has been said before that true filtering is next to impossible.
However, one implementation of a regex might be the following. Using
negated character classes for what _is_ allowed to be between characters.
This, of course, is far from full proof.
#!/usr/local/bin/perl
use strict;
$|++;
while ( <DATA> ) {
s/D[^a-z]*U[^a-z]*C[^a-z]*K/ /ig;
print;
}
__DATA__
hi,
I have createdD a guest book using perl. I would like to know of a way of
detecting bad words. I currently have the program search for bad words
but some clever users started Uusing spaces, symbols to prevent the
program from Ccatching the bad words. For example assume DUCK is a bad
word. Normally, the guest book will replace it with blank spaces but if
the user types in
D U C K or D*U*C*K or D-U-C-K or D__U__C__K, the program will not catch
it. Is there anyway I can prevent this from happening.
Thanks a lot.K
This is a DRUNCK too.
Hello, this DUC'K.
--
Casey R. Tweten Y2K solution
Web Developer (free)
HighVision Associates s/y/k/i;
crt@highvision.com }:o)~
------------------------------
Date: Wed, 13 Oct 1999 16:45:29 GMT
From: "Craig Vincent" <webmaster@webdream.com>
Subject: Passing referring URL thru LWP::UserAgent
Message-Id: <JG2N3.239$Rc.653@198.235.216.4>
Is there a way to modify the header sent to a remote server thru
LWP::UserAgent to pass
a referring URL?
Quick summary of what I'm working on:
- user access a page with a series of links
- each link opens a new window
- The sites those links are accessing does a referring URL check
(ie...checks to see what domain/page the GET request is from...request is
rejected if the Referring URL does not match a predefined set of URLS)
Unfortunately for some browsers (AOL 3, older netscape versions etc...) the
referring URL is not passed to a new window when
it is opened up. As such a percentage of my users receive authorization
decline messages (my client specifically wants all links opening
a new browser window so I can't alter that to fix this).
What I'm looking at doing is having the request for this information be
passed through a cgi script first...this script would grab the HTML
from the server in question and then display to these users. Unfortunately
I need LWP to send a referring URL to these sites in order for the
authentication on the server to accept the request. The administrator for
that server is unavailable for the next few weeks so I can get him to simple
add the script's location to his htaccess file. Since referring URL
variables are client side I figure there must be a way to modify LWP to
accomidate my needs.
Any suggestions or advice would be greatly appreciated.
Sincerely,
Craig Vincent
------------------------------
Date: Fri, 15 Oct 1999 06:41:47 -0300
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: PDFlib size settings
Message-Id: <Arved_37-1510990641470001@dyip-13.chebucto.ns.ca>
In article <37FDFA26.51DFD78D@inx.de>, Daniel Krajzewicz
<krajzewicz@inx.de> wrote:
> Has someone already worked with the PDF-library ??
> If yes : in which pysical units is the size specified ?
> Is it centimer, inch or what ?
> Do someone know how to encode the german DIN A4-norm ?
>
I know PDFLib has a Perl interface, but questions about it will probably
get a better response on comp.text.pdf.
HTH, Arved
------------------------------
Date: Sat, 16 Oct 1999 00:22:35 +0930
From: spamfree@metropolis.net.au (Henry Penninkilampi)
Subject: Re: PDFlib size settings
Message-Id: <spamfree-1610990022360001@d6.metropolis.net.au>
In article <37FDFA26.51DFD78D@inx.de>, Daniel Krajzewicz
<krajzewicz@inx.de> wrote:
> Has someone already worked with the PDF-library ??
Yes.
> If yes : in which pysical units is the size specified ?
> Is it centimer, inch or what ?
Points. 72 points = 1 inch.
> Do someone know how to encode the german DIN A4-norm ?
I don't know what DIN stands for, but the dimensions for A4 are 595x842
points, if that helps.
If you are going to be using PDFlib then you should make sure you have a
complete installation. The complete installation contains an *excellent*
manual which contains a *lot* of really good stuff. You might also want
to check out the moderated PDFlib developers mailing list hosted on
eGroups:
<http://www.egroups.com/list/pdflib>
Henry.
------------------------------
Date: Thu, 14 Oct 1999 14:10:30 +0100
From: Edouard Ouin <Edouard.Ouin@eircom.net>
Subject: Perl and CGI redirect question ?
Message-Id: <3805D646.87707B2C@eircom.net>
This is a multi-part message in MIME format.
--------------0A63F1316B93B474D048E8D8
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
Here is my problem.
On my HTML page I've got tree frames, in a frame I've got a link to quit
the page.
In this link I need to call another HTML page but I need to load this
page in the _top level frame and It's not working !!!
Any idea ?
I'm using :
my $togo = "http://www.where_to_go.com";
my $target = "_top";
print $cgi->redirect(-url => $togo,
-target => $target);
Thank's
--
---------------------------------------------------------
Edouard Ouin
Eircom net Tel: (353) 1 701 0182
Unit B, East Point Business Park Fax: (353) 1 701 1086
Fairview http://www.eircom.net
Dublin 3 Edouard.Ouin@eircom.net
Ireland Mobile : 087 289 0934
--------------0A63F1316B93B474D048E8D8
Content-Type: text/x-vcard; charset=us-ascii;
name="Edouard.Ouin.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Edouard Ouin
Content-Disposition: attachment;
filename="Edouard.Ouin.vcf"
begin:vcard
n:Ouin;Edouard
tel;cell:+353 87 289 0934
tel;home:+353 1 853 0135
tel;work:+353 1 701 0182
x-mozilla-html:FALSE
url:http://www.woonet.com/ted
org:Eircom net;System
adr:;;;Dublin;;Dublin 3;Ireland
version:2.1
email;internet:Edouard.Ouin@eircom.net
title:Software Engineer
x-mozilla-cpt:;0
fn:Edouard Ouin
end:vcard
--------------0A63F1316B93B474D048E8D8--
------------------------------
Date: Thu, 14 Oct 1999 14:46:22 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: Perl and CGI redirect question ?
Message-Id: <7u4qbp$mj5$1@nnrp1.deja.com>
Edouard.Ouin@eircom.net wrote:
> In this link I need to call another HTML page but I need to load this
> page in the _top level frame and It's not working !!!
> Any idea ?
> I'm using :
> my $togo = "http://www.where_to_go.com";
> my $target = "_top";
> print $cgi->redirect(-url => $togo,
> -target => $target);
Not really a Perl question, you should have taken this to
comp.infosystems.www.authoring.html, but I'll take a crack at it
anyway...
I don't use cgi.pm, I use direct print statements, so..
print '<a href="http://www.where_to_go.com/" target="top">I'm
Done!</a>';
That should work, although you may need to modify if you want to use
variables...
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 15 Oct 1999 10:23:32 -0700
From: "Gala Grant" <gala@sonic.net>
Subject: Perl and Excel
Message-Id: <7u7nuk$39n$1@ultra.sonic.net>
I need to use Perl to open an Excel Spreadsheet and pull out info, and then
dynamically create a web page based on the pulled info. Does anyone have
any info on using Perl to manipulate Excel? Is there a module or any text
about it somewhere?
Gala Grant
------------------------------
Date: Wed, 13 Oct 1999 08:51:16 GMT
From: helmibenamara@my-deja.com
Subject: perl and multithread
Message-Id: <7u1h61$aja$1@nnrp1.deja.com>
Hi All,
I've tried to understand how I can use embedded perl in a multithread
application and I'm a bit confused.
We have a process in a multithread mode. This process is linked with an
embedded perl library. Each thread starts its own perl interpreter. Is
it safe to run several threads at the same time, where each thread is
executing separate interpreters ?
Thanks,
Helmi
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 13 Oct 1999 14:30:20 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: perl and multithread
Message-Id: <0I0N3.606$IZ5.15157@news.rdc1.ct.home.com>
helmibenamara@my-deja.com wrote:
> Hi All,
> I've tried to understand how I can use embedded perl in a multithread
> application and I'm a bit confused.
> We have a process in a multithread mode. This process is linked with an
> embedded perl library. Each thread starts its own perl interpreter. Is
> it safe to run several threads at the same time, where each thread is
> executing separate interpreters ?
This isn't safe. You must protect perl with a global mutex and make sure
that only one thread is in any perl interpreter at any one time. This
may be safe in 5.6 (and only if you build with threads) but it isn't now.
And embedding a threaded perl isn't enough either, as perl takes a
mnumber of shortcuts if it thinks there's only one thread running.
Dan
------------------------------
Date: Wed, 13 Oct 1999 15:12:54 +0200
From: "Helleskov" <helleskov@vip.cybercity.dk>
Subject: perl and word files?
Message-Id: <7u20jm$1eac$1@news.cybercity.dk>
hi all,
I have about 1100 word documents that needs to be
available on a web server. My problem is that
these files are constantly being edited and the
person incharge of that - do not want to convert back
and forth between html and doc format.
Does anybody have a solution as to how to show
word documents on a web server ? Or does perl
already have a module for this ?
thanks,
Bo Helleskov/Denmark.
------------------------------
Date: Wed, 13 Oct 1999 16:45:04 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: perl and word files?
Message-Id: <kG2N3.3467$QI5.189083@monger.newsread.com>
Helleskov (helleskov@vip.cybercity.dk) wrote:
> I have about 1100 word documents that needs to be
> available on a web server. My problem is that
> these files are constantly being edited and the
> person incharge of that - do not want to convert back
> and forth between html and doc format.
You might want to read the chapter in my book, Automating Windows With
Perl, which discusses programmatically using Office apps. My example is
printing documents programmatically, but the same logic could be used
for doing Save As automatically.
Scott
http://autoperl.skwc.com Automating Windows With Perl
------------------------------
Date: Wed, 13 Oct 1999 01:57:55 GMT
From: Steve <sterickson@carlson.com>
Subject: Perl in cron
Message-Id: <s07pp3ggbhk30@corp.supernews.com>
Help,
I am trying to email a file in a perl script in cron.. ie run a perl
script in cron that emails a file, I try this line `/usr/bin/mailx
address@domain.com < filename` but get the error in the mail saying that
there needs to be a \ in front of @. I try this, but it still doesnt
work, please advise.
Thanks,
Steve
------------------ Posted via CNET Help.com ------------------
http://www.help.com/
------------------------------
Date: 12 Oct 1999 23:28:51 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl in cron
Message-Id: <slrn8082fs.nk2.abigail@alexandra.delanet.com>
Steve (sterickson@carlson.com) wrote on MMCCXXXIV September MCMXCIII in
<URL:news:s07pp3ggbhk30@corp.supernews.com>:
\\
\\ I am trying to email a file in a perl script in cron.. ie run a perl
\\ script in cron that emails a file, I try this line `/usr/bin/mailx
\\ address@domain.com < filename` but get the error in the mail saying that
\\ there needs to be a \ in front of @. I try this, but it still doesnt
\\ work, please advise.
Ah, the famous "it doesn't work".
Perhaps it's bored. Try repainting the room.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 13 Oct 1999 13:44:17 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl in cron
Message-Id: <Pine.GSO.4.10.9910131343370.25558-100000@user2.teleport.com>
On Wed, 13 Oct 1999, Steve wrote:
> I am trying to email a file in a perl script in cron.. ie run a perl
> script in cron that emails a file, I try this line `/usr/bin/mailx
> address@domain.com < filename` but get the error in the mail saying
> that there needs to be a \ in front of @. I try this, but it still
> doesnt work, please advise.
First, fix it so that it works when you're not using cron. If you get an
error message that you don't understand, check perldiag. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Oct 1999 19:53:08 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Interview Question:
Message-Id: <7u03j4$1jm$1@gellyfish.btinternet.com>
On Tue, 12 Oct 1999 18:18:07 GMT The Glauber wrote:
> In article <MPG.126c274d80e79f2798a07a@nntp.hpl.hp.com>,
> lr@hpl.hp.com (Larry Rosler) wrote:
>> In article <8E5BCFB11dkhenderson@207.14.236.70> on Tue, 12 Oct 1999
>> 00:22:38 GMT, d.k. henderson <dalekh@hotmail.com> says...
>> >
>> > 10
>>
>> My, my. That couldn't be right, for two reasons.
>>
>> 1. If it were right, the question wouldn't have been asked. :-)
>
> That's the correct answer. There's something too smug about that $x=2;
>
What are you talking about ? Did you actually run the code ?
gellyfish@gellyfish:/home/gellyfish > perl
$x=2;
foreach $x (1..10){
print $x;
}
print $x;
123456789102gellyfish@gellyfish:/home/gellyfish >
^
If 10 is the correct answer then there must be something
wrong with my 'putey ....
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 12 Oct 1999 23:33:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Interview Question:
Message-Id: <VyPM3.98$jg4.2574@nsw.nnrp.telstra.net>
[please, make sure your newsreader wraps lines correctly]
On Tue, 12 Oct 1999 18:18:07 GMT,
The Glauber <theglauber@my-deja.com> wrote:
> In article <MPG.126c274d80e79f2798a07a@nntp.hpl.hp.com>,
> lr@hpl.hp.com (Larry Rosler) wrote:
> > The foreach loop iterates over a normal list value and sets the
> > variable VAR to be each element of the list in turn. If the
> > variable is preceded with the keyword my, then it is lexically
> > scoped, and is therefore visible only within the loop. Otherwise,
> > the variable is implicitly local to the loop and regains its
> > former value upon exiting the loop.
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Except that there wasn't any "my" in that code!
Look at the last two sentences again, and think:
if (scoped(my))
{
# sentence 1
}
else # equivalent to 'Otherwise' :)
{
# sentence 2
}
Martien
--
Martien Verbruggen |
Interactive Media Division | Useful Statistic: 75% of the people make up
Commercial Dynamics Pty. Ltd. | 3/4 of the population.
NSW, Australia |
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 1071
**************************************