[12357] in Perl-Users-Digest
Perl-Users Digest, Issue: 5957 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 11 05:07:13 1999
Date: Fri, 11 Jun 99 02:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 11 Jun 1999 Volume: 8 Number: 5957
Today's topics:
Access to mail content paul@bagend.wurley.net
adding and updating! (howto) <office@asc.nl>
Re: Afraid to ask about Y2K! <gellyfish@gellyfish.com>
Re: ANSWER: Re: uninitialized value? what am i doing wr <office@asc.nl>
Re: ANSWER: Re: uninitialized value? what am i doing wr (Lee)
Calculating weekday given year, month and day perl_beginner@my-deja.com
Call OS/2 system functions from Perl? <ibelgaufts@gfc-net.de>
Can you "croak" in mod_perl? jay@powerdog.com
Re: CGI and Access Database <chongsun@krdl.org.sg>
delete line ending with ) jimbob4334@my-deja.com
Re: Documentation Writing was [Re: Perldoc and Perlfaq] birgitt@my-deja.com
Re: Documentation Writing was [Re: Perldoc and Perlfaq] birgitt@my-deja.com
Does anyone know of a Perl port for CE decives? <f.geiger@vol.at>
Re: help using large memory from perl (Rodger Donaldson)
Re: holding shell output in perl (Hasanuddin Tamir)
Re: How do I sort files in a dir by last modified time? <aef@pangea.ca>
Re: How do I split this string into an array of words: <rpsavage@ozemail.com.au>
Re: How to display background picture in cgi? (Abigail)
Re: Interpolation Question <ahumphr@c-s-k.de>
Obtaining ActiveState Perl? <michiel.verhoef@wkap.nl>
Re: OLE reference <gellyfish@gellyfish.com>
Opening a returned web page in a new window... <streaking_pyro@my-deja.com>
Re: Opening a returned web page in a new window... <outlaw_torn@mailexcite.com>
Opening many new windows... <streaking_pyro@my-deja.com>
Re: Requesting help in optimizing (Larry Rosler)
Re: Search and replace (Larry Rosler)
Re: shortest self printing perl program <vesa.kivisto@helsinki.fi>
Re: shortest self printing perl program zenin@bawdycaste.org
Silly old me <chongsun@krdl.org.sg>
Re: Telnet monitor <nlucent@my-deja.com>
Re: waiting... (Hasanuddin Tamir)
Re: why short of 1 month ?? <chongsun@krdl.org.sg>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Jun 1999 01:47:13 GMT
From: paul@bagend.wurley.net
Subject: Access to mail content
Message-Id: <7jppqv$2sk$1@nnrp1.deja.com>
Hi,
I am new to perl programming and was hoping to get some assistance with
the following project. I would like to estabalish an email account that
accepts share prices. The data would be submitted in a standard format.
When a new message arrives I would like to have a perl program that
takes the content of the message and writes this to a text file. Could
someone please give me a pointer to how I would access the mail
message. THe box I am using is running linux and sendmail...
Thanks in advance,
Paul
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 09:46:02 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: adding and updating! (howto)
Message-Id: <7jqeuq$7qk$1@zonnetje.NL.net>
hi
i need to create a form that has several checkmarks you can click
once you click them , a frame or a value in a box should be updated to show
the new total
i want to do this with perl
- is there a way to run perl programs on 'changes' in forms?
- is there a way to let perl change values in forms?
- is there a way to let perl change frames and / or frame contents?
tnx
buZz
------------------------------
Date: 11 Jun 1999 09:25:48 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Afraid to ask about Y2K!
Message-Id: <3760c80c@newsread3.dircon.co.uk>
Steve Bean <sbean@iex.net> wrote:
> In article <375b7df9@newsread3.dircon.co.uk>, gellyfish@gellyfish.com
> says...
>>
>>Steve Bean <sbean@iex.net> wrote:
>>> But i WILL anyway. I can't believe someof the flameout answers to good
>>> questions about Y2K in this section.
>>>
>>
>>I cant believe that we have got to this stage in the game and
>>people are still asking this question - what precisely is it that
>>prevents from going to <http://www.deja.com> and searching for 'Y2K'
>>in this group ? It found 6500 hits just now.
>>
>>
> This is exactly what I am talking about.
Precisely what is exactly what you are talking about. I know what I am
talking about do you ? Questions of a similar nature to yours are asked
frequently - in fact so frequently that the question has earned a special
place in the documentation that comes with Perl that answers many of these
frequently asked questions - this documentation is known as the FAQ. If you
had taken the time to read this documentation you would have answered the
question for yourself.
> What the hell is deja.com?
Where the hell have you been and why the hell didnt you find out for yourself
> And
> who are you to flame out at anybody.
Aw, you think you've been flamed, what a shame, I'd stay out of situations
where grownups have discussions about strongly held views then. Actually
my comments were a general observation on the strange fact that people
still feel the need to ask these questions, so very late in the day, when
this has been discussed over and over and over and over again, If you
had checked the resource I referred to then you would have discovered this
fact. Anyhow who are *you* to suggest that I *shouldnt* flame anyone
(supposing I had which I hadnt but there you go .. ).
> It 's obvious that you are not
> responsible for Y2K.
No actually its all my fault: I personally have been going round for the
last thirty years forcing people to write code that treated year value as
two characters and other such things as well. In my spare time I have
also been involved with an attempt to force avionics software engineers
to use windows NT to control the Airbus and Visual Basic for the flight
control software for the Ariane rocket...
> I dismiss you and do not worry about you.
>
Oh well you wont care if I ignore you as well ...
*plonk*
/J\
--
"Malcolm, what have I told you about putting chocolate near your
crotch?" - Mrs Merton
------------------------------
Date: Fri, 11 Jun 1999 09:42:25 +0200
From: "Bastiaan S van den Berg" <office@asc.nl>
Subject: Re: ANSWER: Re: uninitialized value? what am i doing wrong?
Message-Id: <7jqeo8$7kj$1@zonnetje.NL.net>
>$car = 0;
>print "Car exists!\n" if ($car);
>$car2 = "";
>print "The other car exists!\n" if ($car2);
>$car3 = "0";
>print "The third car exists!\n" if ($car3);
>Hmmm, that didn't print anything. Guess you're wrong. Thrice.
well , i can't help it if it works for me , and not for you ..
btw. i use :
print "this works" if defined $working;
not:
print "this doesn't" if ($itdoesnt)
------------------------------
Date: Fri, 11 Jun 1999 04:05:46 -0500
From: rlb@intrinsix.ca (Lee)
Subject: Re: ANSWER: Re: uninitialized value? what am i doing wrong?
Message-Id: <B3863B9A966885527@0.0.0.0>
In article <7jqeo8$7kj$1@zonnetje.NL.net>,
"Bastiaan S van den Berg" <office@asc.nl> wrote:
>>$car = 0;
>>print "Car exists!\n" if ($car);
>>$car2 = "";
>>print "The other car exists!\n" if ($car2);
>>$car3 = "0";
>>print "The third car exists!\n" if ($car3);
>
>>Hmmm, that didn't print anything. Guess you're wrong. Thrice.
>
>well , i can't help it if it works for me , and not for you ..
>
>btw. i use :
>print "this works" if defined $working;
>not:
>print "this doesn't" if ($itdoesnt)
Silly boy!
She was responding to the suggestion that if(defined $var) could be
replaced by if($var), so changing them back is hardly a counter-example.
Lee
------------------------------
Date: Fri, 11 Jun 1999 06:10:18 GMT
From: perl_beginner@my-deja.com
Subject: Calculating weekday given year, month and day
Message-Id: <7jq986$7g1$1@nnrp1.deja.com>
what is the most efficient way to calculate the weekday (sunday=0,
monday=1 ...) given the year, month, and day without using the module
provided by perl (i.e using arithmatics and algorithm)? Any suggestion?
Thanks.....
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 09:28:24 +0100
From: Juergen Ibelgaufts <ibelgaufts@gfc-net.de>
Subject: Call OS/2 system functions from Perl?
Message-Id: <3760C8A8.D961F7EE@gfc-net.de>
Hi everyone,
I am currently working with Perl under OS/2. In the docs, I found how to
call REXX functions and how to build workplace shell objects like
folders and icons.
Is there a way to access the other REXX functions or OS/2 APIs as well?
I have tried to use the REXX beep command which results in an error
message that the entry "beep" cannot be found in REXXUTIL. It seems that
one can only access the functions that reside in the REXXUTIL DLL but
not the built-in functions.
Any suggestions are welcome.
Thanks in advance
Juergen Ibelgaufts
------------------------------
Date: Fri, 11 Jun 1999 02:02:28 GMT
From: jay@powerdog.com
Subject: Can you "croak" in mod_perl?
Message-Id: <7jpqnf$36f$1@nnrp1.deja.com>
Hello there,
I am running on the following:
Linux Red Hat: 5.2 (x86)
Perl: 5.004_05
Apache: 1.3.6
mod_perl: 1.19
CGI::Carp: 1.13
Is "CGI::Carp::croak" safe to use with mod_perl?
Ever time I call "croak" in my CGIs the error get passed back to the
browser, which is what I want. But when I hit the back button and
fix on the form whatever caused the error and resubmit the CGI just
sits there and does nothing. I check the processes and the apache
server takes up no CPU time. Eventually the browser will time out
with a "Document Contains No Data". If you can't use Croak are there
any other modules I can use that does basically the same thing that
will work with mod_perl?
Also on a side note:
In the main of my CGI's I declare some 'my' variables (ie, my $foo;).
Is this mod_perl safe? Will the $foo be reinitialized ever time
the CGI is called? Or will it inherit the value from the last
time it was called?
Thank you for your time.
Jay Jungalwala
--
Jay Jungalwala
Vice-President
Powerdog Industries, Inc.
jay@powerdog.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 13:03:34 +0800
From: "CacheBoy" <chongsun@krdl.org.sg>
Subject: Re: CGI and Access Database
Message-Id: <7jq60h$p3p$2@godzilla.krdl.org.sg>
It is very simple. I have done it before and wrote a documentation as well
as tutorial too. Problem is my website is make inaccessible by outside IP
address by my system administrator.
There are 2 ways. 1 Use Win32::ODBC and 2 Use DBI as well as DBD::ODBC.
Both of them works. Although I preferred Win32::ODBC.
Email me if you need more info.
But I won' be around on 12/6 to 16/6.
------------------------------
Date: Fri, 11 Jun 1999 04:01:04 GMT
From: jimbob4334@my-deja.com
Subject: delete line ending with )
Message-Id: <7jq1lr$5ba$1@nnrp1.deja.com>
How do I delect every line ending with ).
This is what I have - trying to escape out the )
perl -pi -e '/$\)//q' temp.file
get: /)/: unmatched () in line 1
TIA,
Jim
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 04:58:55 GMT
From: birgitt@my-deja.com
Subject: Re: Documentation Writing was [Re: Perldoc and Perlfaq]
Message-Id: <7jq52c$69q$1@nnrp1.deja.com>
In article <ebohlmanFD55zx.3uH@netcom.com>,
ebohlman@netcom.com (Eric Bohlman) wrote:
> birgitt@my-deja.com wrote:
Why is it that documentation is very often neglected ? Is
it
> : lack of money, lack of the detailed insider knowledge of a software
> : package by people other than the developers themselves or is it "on
> : purpose" ? -
> I think the problem is that many, if not most, software development
> projects spend much of their development stages in crisis mode,
> where most of the human effort is devoted to "putting out fires."
> Documentation, especially programmer documentation rather than
> end-user documentation, seldom has crises associated with it during
> the development cycle, so it gets relatively little attention.
>
> This is a special case of short-term thinking. The benefits of good
> maintenance documentation don't show up until well after the code has
> been written, tested and installed, so there's a tendency to neglect
> it in favor of activities whose benefits are more immediately visible.
> Performance evaluation practices can make this worse--programmers'
> performance is usually judged according to measures like lines of code
> written in a given time (ugh!), on-time delivery of executables, and
> the like. People being evaluated tend to focus their efforts on
> things that the boss considers important, and good maintenance
> documentation is seldom one of them. In many cases, the programmer >
> who wants to do a thorough job of maintenance documentation has to do
> it on his own time, which is not an attractive prospect in an industry
> where working 80-hour weeks is considered a badge of honor.
>
> Poor documentation arises from many of the same causes as Y2K problems
> (but not Y2K problems in Perl!): "we don't have time to do it right
> the first time, but we have time to fix it later."
>
>
I understand and think the conditions you are describing are often
found, but in this case (and being a German company), this package
was developed with weekly contact/review/design session with one
the company's owners and managers, the package was comfortably written
in four years, well designed (aY2K problem was foreseen from the outset
and avoided), well tested, successfully used, the developers are having
lifelong positions for over 18 years and noone gets fired here, nor
works an 80 hours schedule very often. But technology is changing,
mainframes die out and networks need to be redesigned and software
packages completely adapted and hauled over. That was just meant as
an example.
But I am still interested in how documentation writing is best organized
especially in OPEN SOURCE PROJECTS where the developers are even doing
the code writing "out of their own pockets - and minds - and drive".
I hope that question is appropriate to post to the authors of one of the
best documented projects I have seen. I would not want to touch the
issue for whom documentation is written, as the "documentation for the
end-user" is not always a priority and therefore the "style" of the
documentation can be "highly technical". But what if even professionals
can't be found anymore, who can dig through "highly technical"
documenation and what if noone can evaluate, if behind the "highly
technical" hides a lot of "a holy mess" ? (Well, I guess as a non-
technical person I still know why I am for "open sources"). 8-)
birgitt
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 05:01:30 GMT
From: birgitt@my-deja.com
Subject: Re: Documentation Writing was [Re: Perldoc and Perlfaq]
Message-Id: <7jq577$6bo$1@nnrp1.deja.com>
In article <ebohlmanFD55zx.3uH@netcom.com>,
ebohlman@netcom.com (Eric Bohlman) wrote:
> birgitt@my-deja.com wrote:
Why is it that documentation is very often neglected ? Is
it
> : lack of money, lack of the detailed insider knowledge of a software
> : package by people other than the developers themselves or is it "on
> : purpose" ? -
> I think the problem is that many, if not most, software development
> projects spend much of their development stages in crisis mode,
> where most of the human effort is devoted to "putting out fires."
> Documentation, especially programmer documentation rather than
> end-user documentation, seldom has crises associated with it during
> the development cycle, so it gets relatively little attention.
>
> This is a special case of short-term thinking. The benefits of good
> maintenance documentation don't show up until well after the code has
> been written, tested and installed, so there's a tendency to neglect
> it in favor of activities whose benefits are more immediately visible.
> Performance evaluation practices can make this worse--programmers'
> performance is usually judged according to measures like lines of code
> written in a given time (ugh!), on-time delivery of executables, and
> the like. People being evaluated tend to focus their efforts on
> things that the boss considers important, and good maintenance
> documentation is seldom one of them. In many cases, the programmer >
> who wants to do a thorough job of maintenance documentation has to do
> it on his own time, which is not an attractive prospect in an industry
> where working 80-hour weeks is considered a badge of honor.
>
> Poor documentation arises from many of the same causes as Y2K problems
> (but not Y2K problems in Perl!): "we don't have time to do it right
> the first time, but we have time to fix it later."
>
>
I understand and think the conditions you are describing are often
found, but in this case (and being a German company), this package
was developed with weekly contact/review/design session with one
the company's owners and managers, the package was comfortably written
in four years, well designed (aY2K problem was foreseen from the outset
and avoided), well tested, successfully used, the developers are having
lifelong positions for over 18 years and noone gets fired here, nor
works an 80 hours schedule very often. But technology is changing,
mainframes die out and networks need to be redesigned and software
packages completely adapted and hauled over. That was just meant as
an example.
But I am still interested in how documentation writing is best organized
especially in OPEN SOURCE PROJECTS where the developers are even doing
the code writing "out of their own pockets - and minds - and drive".
I hope that question is appropriate to post to the authors of one of the
best documented projects I have seen. I would not want to touch the
issue for whom documentation is written, as the "documentation for the
end-user" is not always a priority and therefore the "style" of the
documentation can be "highly technical". But what if even professionals
can't be found anymore, who can dig through "highly technical"
documentation and what if noone can evaluate, if behind the "highly
technical" hides a lot of "a holy mess" ? (Well, I guess as a non-
technical person I still know why I am for "open sources"). 8-)
birgitt
--
B.Funk
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 08:51:43 +0200
From: "Franz GEIGER" <f.geiger@vol.at>
Subject: Does anyone know of a Perl port for CE decives?
Message-Id: <7jqbkq$chf$1@pollux.ip-plus.net>
I wonder if there is already a port for HPC/Pro devices or if anybody is
working on such a thing.
Regards
Franz GEIGER
--
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.
------------------------------
Date: Fri, 11 Jun 1999 19:46:57 +1200
From: rodgerd@wnl121.wnl.co.nz (Rodger Donaldson)
Subject: Re: help using large memory from perl
Message-Id: <slrn7m1fnh.fpt.rodgerd@wnl121.wnl.co.nz>
On Wed, 09 Jun 1999 13:14:35 -0400, Bill Jones <bill@fccj.org> wrote:
>Linux doesn't access more than 128MB swap space; defining
>more is a waste...
Do *try* to keep up. You're only 5 or so years out of date.
--
Rodger Donaldson rodger.donaldson@wnl.co.nz
Systems Support Direct line : 04 474 0560
Wellington Newspapers Limited Fax : 04 474 0309
You are in a maze of twisty little companies, all working against each other.
------------------------------
Date: 11 Jun 1999 22:48:06 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: holding shell output in perl
Message-Id: <slrn7m0t9q.ctd.hasant@borg.intern.trabas.co.id>
On Thu, 10 Jun 1999 18:49:18 GMT,
Steve . <syarbrou@nospam.enteract.com> wrote:
> I have a perl script that calls rdist to do a system copy. RDIST
> outputs things as it goes along to the screen. I want that output to
> be caught by the perl script before it hits the screen and modified
> per my instructions. How do you catch the output being displayed by a
> system call? Thanks.
perldoc -f system
perldoc perlop
perldoc -f open
At least, one of them could satisfy you.
HTH,
--
-hasan-
uhm, no more sig(h)
------------------------------
Date: Fri, 11 Jun 1999 00:21:39 -0500
From: "AEF" <aef@pangea.ca>
Subject: Re: How do I sort files in a dir by last modified time?
Message-Id: <7jq6c1$d63$1@pumpkin.pangea.ca>
Problems:
Keep returning a month before the Epoch of Nov 31, 1969 on the filedates for
all the files? Whazzup?
Dean Hudson <deanh@nwnet.net> wrote in message
news:7jnl3k$4bh@cypress.nwnet.net...
> In article <7jnc3j$o1d$1@pumpkin.pangea.ca>, AEF <aef@pangea.ca> wrote:
> >How do I sort files in a directory, on the last modified time, and print
> >that time out in a formated month, day , year?
> >
> >Thanks.
> >
> >
>
> Here's an ugly little beast; it's using the orcish maneuver on $stat[9]
> for the files in the directory. $a and $b are switched, since the larger
> return values for modtime are the more recent files. Using the orcish
> thingy gives access to the values returned by stat so it can feed
> them into localtime() via the cache hash.
>
> # ----- code ----- #
> #!/usr/bin/perl -w
>
> use strict;
>
> my ( %m );
>
> for ( sort { ( $m{$b} ||= (stat($b))[9] ) <=>
> ( $m{$a} ||= (stat($a))[9] ) } <*> )
>
> my ( $day, $mon, $yr );
> ( $day, $mon, $yr ) = ( localtime $m{$_} )[3..5];
> print "$_ => d:$day m:", $mon + 1, " y:", 1900 + $yr, "\n";
> }
> # ----- code ----- #
>
> Hope that helps...
>
> dean.
> --
> --
> dean hudson, <deanh@verio.net> Verio Systems Engineering
------------------------------
Date: Fri, 11 Jun 1999 18:11:19 +1000
From: "Pen and Ron Savage" <rpsavage@ozemail.com.au>
Subject: Re: How do I split this string into an array of words: CAR, DOG, "PIG,4", 5 split into ('CAR', 'DOG', 'PIG,4', '5') ?
Message-Id: <Bz383.895$td3.5998@ozemail.com.au>
The reply below by Clayton/tex is sort-of useless.
A generic solution is to use the Text::CSV or Text::CSV_XS modules, when you
think about it :-)
--
Cheers
Pen and Ron Savage
rpsavage@ozemail.com.au
http://www.ozemail.com.au/~rpsavage
Clayton L. Scott wrote in message <7jq4hu$ib4$3@bertrand.ccs.carleton.ca>...
>You, yes you, Snehanshu. Stop writing crap like this:
>: How do I split this string into array words using :
>
>: CAR, DOG, "PIG,4", 5 => ('CAR', 'DOG', 'PIG,4', '5')
>
>: I tried using split(',' , CAR, DOG, "PIG,4", 5 ) but that separate the
word
>: "PIG,4" into 2 words '"PIG' and '4"'
>
>$string = q/CAR, DOG, "PIG,4", 5/;
>
>@array = split(', ', $string);
>
>It should have been a pretty obvious pattern.
>
>/tex
>--
>Warning: Dates on Calendar are closer than they appear.
------------------------------
Date: 10 Jun 1999 21:35:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to display background picture in cgi?
Message-Id: <slrn7m0tvt.2fo.abigail@alexandra.delanet.com>
CacheBoy (chongsun@krdl.org.sg) wrote on MMCIX September MCMXCIII in
<URL:news:7jnc4v$p6u$1@godzilla.krdl.org.sg>:
[] I tried to generate a web page from my perl program but the background which
[] is a gif file did not show.
And your Perl question is?
Abigail
--
perl -wlne '}print$.;{' file # Count the number of lines.
-----------== 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: Fri, 11 Jun 1999 09:28:25 +0200
From: "Aidan Humphreys" <ahumphr@c-s-k.de>
Subject: Re: Interpolation Question
Message-Id: <7jqdpg$dri$1@newsread.f.de.uu.net>
> AH> $foo = <<'__ETX';
>
>remove the '' from the here token. where did you see that being used and
>why did you do that? ... ...
Sorry, I explained the problem very badly. The purpose of the program is to
retrieve a string from a source -external- to the program (database file
etc) and to expand the string with information know only at runtime.
I could do this by substitution operations, but a more elegant solution
occured to me. If the string contains substrings of the form $xyz
then is it not possible to trigger interpolation on the string after it is
read in?
The little example program skipped over reading the string from an external
source by single quoting it (precisly so it didn't interpolate).
Its maybe clearer to say:
#!/bin/perl
#
@param("My", "Title");
#
# Read a string of the form:
# <HTML><HEAD><TITLE> $param[0] $param[1]</TITLE></HEAD></HTML>
$foo = <>;
#
# Interpolate $param[0] within the string using eval.
# ??? ??? ???
# Print the expanded string
print $foo;
#End
Obviously if the string was known prior to running the program then you
could use standard Perl interpolation.
@param("Mytitle");
$foo = "<HTML><HEAD><TITLE>$param[0]</TITLE></HEAD></HTML>";
print $foo;
But since it is read from an external source the standard interpolation
mechanism will not occur.
Can the interpolation be achieved with eval?
Aidan.
------------------------------
Date: Fri, 11 Jun 1999 08:38:14 +0200
From: Michiel Verhoef <michiel.verhoef@wkap.nl>
Subject: Obtaining ActiveState Perl?
Message-Id: <3760AED6.22243153@wkap.nl>
Hi all,
For the last couple of days I have tried to download ActiveState Perl
but there seems to be an error in the connection somewhere (tracert
showed that :-). However, as I am in
need of this distribution I wondered if someone knew of a mirror where I
could get
it from as well?
Any help will be appreciated,
Cheers :-)
Michiel
------------------------------
Date: 11 Jun 1999 09:39:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: OLE reference
Message-Id: <3760cb3c@newsread3.dircon.co.uk>
David Cassell <cassell@mail.cor.epa.gov> wrote:
> Jonathan Stowe wrote:
>>
>> On Thu, 10 Jun 1999 10:55:03 -0700 David Cassell wrote:
>> > Jonathan Stowe wrote:
>> >> [snip]
>> >><http://msdn.microsoft.com/officedev/preview/technical/articles/word.asp
>> >
>> > Oops. M$ has re-organized its site, and this page is kaput.
>>
>> Are you sure - I cut and paste right there and then and I dont use a
>> cache or a proxy ...
>
> I even tried it in Nyetscape, so I wouldn't have to risk a typo
> or cut&paste error. Every time I get re-directed to an error page
> which tells me that the page has been deleted or moved.
>
> Boy, the nerve of some people, trying to fix up their websites...
Absolutely shocking I'd say - OK lets try :
<http://www.microsoft.com/officedev/articles/opg/007/007.htm> and see
if that stays where its supposed to be ...
/J\
--
"I want to be like Oprah" - Sarah, Duchess of York
------------------------------
Date: Fri, 11 Jun 1999 04:02:21 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Opening a returned web page in a new window...
Message-Id: <7jq1o7$5bh$1@nnrp1.deja.com>
I would like to write a script that, when "submit" is clicked, the
returned HTML page is opened in a new window (like TARGET=_new) and the
user stays at the origanal page that he was at when he
clicked "submit". Thanks for any help!
--
R.Joseph
http://www.24-7design.com
http://bowdown.to
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 04:12:08 GMT
From: outlaw_torn <outlaw_torn@mailexcite.com>
Subject: Re: Opening a returned web page in a new window...
Message-Id: <7jq2ai$5gh$1@nnrp1.deja.com>
In your form tag try putting the target parameter:
<form .... target = _new>
In article <7jq1o7$5bh$1@nnrp1.deja.com>,
R.Joseph <streaking_pyro@my-deja.com> wrote:
> I would like to write a script that, when "submit" is clicked, the
> returned HTML page is opened in a new window (like TARGET=_new) and
the
> user stays at the origanal page that he was at when he
> clicked "submit". Thanks for any help!
>
> --
> R.Joseph
> http://www.24-7design.com
> http://bowdown.to
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 04:28:22 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Opening many new windows...
Message-Id: <7jq38t$5p2$1@nnrp1.deja.com>
Ok, lets say I have a script that takes in user data, and then uses
this data to search many different engines (like say, 8 search engines
with the field the enter). If I want each search engines results to
come up in a new window, how would I accomplish this?? Thanks alot!
--
R.Joseph
http://www.24-7design.com
http://bowdown.to
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 11 Jun 1999 00:06:35 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Requesting help in optimizing
Message-Id: <MPG.11ca554930929152989bbe@nntp.hpl.hp.com>
In article <ebohlmanFD4yyx.EKI@netcom.com> on Fri, 11 Jun 1999 00:06:33
GMT, Eric Bohlman <ebohlman@netcom.com> says...
> Larry Rosler (lr@hpl.hp.com) wrote:
> : { local $/ = "\n[";
>
> : while (<DATA>) {
> : chomp; # Strip section-beginning marker
> : s/^\s*(#.*)?\n//gm; # Strip blank lines and comment lines
> : s/^\s+//gm; # Trim leading space on each line
> : s/\s+$//gm; # Trim trailing space on each line
> : next unless length; # Just getting started
>
> : s/(.+)]\n// or die "$_: No section name after '['.\n";
>
> Boundary bug. That regex should be "[?(.+)]\n" so that the leading '['
> on the very first record (which won't have been chomp()'d off) isn't
> taken as part of the section name.
There were blank lines and comment lines ahead of the first record in
the test data set. So the chomp did work. Oh, well. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 10 Jun 1999 23:48:55 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Search and replace
Message-Id: <MPG.11ca511b922506f1989bbd@nntp.hpl.hp.com>
[Posted and a courtesy copy sent. Rearranged to put question before
answer, unlike Jeopardy.]
In article <7jpi5c$fu$1@nnrp1.deja.com> on Thu, 10 Jun 1999 23:36:13
GMT, outlaw_torn <outlaw_torn@mailexcite.com> says...
> In article <7jot06$o1u$1@nnrp1.deja.com>,
> jhagerty@my-deja.com wrote:
> > Sorry for the newbie but I can't get something figured out. I want to
> > do a search and replace on a text file. More accurately I want to
> > trim out a bunch if lines. Here's a sample
> >
> > First Joe
> > Last Hagerty
> > Server Temp_FS
> >
> > I want to make both of those lines go away. I'd like to find First
> > and delete until Server to end up with:
> >
> > Server Temp_FS
> >
> I'd try some code that goes something like this:
>
> open (IN, "infile");
I'd check *every* open for success, even in demo code.
> @file = <IN>;
I'd read input one line at a time if possible, so it doesn't all have to
be in memory at once.
> close (IN);
>
> open (OUT, "outfile");
I'd open an output file for output, not input.
I'd check *every* open for success, even in demo code.
> foreach $line (@file) {
> if ($line !~ /First/ && $line !~ /Last/) {
I'd look at the conditions of the request, which was to delete these
lines and any inbetween. I'd use the 'scalar range operator' to deal
with that.
> print OUT $line;
> }
> }
> close (OUT);
>
> That should do...although if the Server line happens to contain First or
> Last then there could be some hassles.
I'd deal with that by properly anchoring the patterns.
/^First/ .. /^Last/ or print OUT while <IN>;
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 11 Jun 1999 10:22:43 +0300
From: "Vesa Kivistv" <vesa.kivisto@helsinki.fi>
Subject: Re: shortest self printing perl program
Message-Id: <7jqdgl$fn2$2@oravannahka.Helsinki.FI>
I have noticed it also, reason still unknown, but if you just *remember*
it's so, you can compensate that in your code.
> OK, since I am in quiz mode today, can someone come up
> with a shorter program that prints itself without opening
> any files, spawning processes etc. than this one-liner:
>
>
> printf($x,39,$x='printf($x,39,$x=%c%s%c,39);',39);
>
>
>
> --
> Kiriakos Georgiou
------------------------------
Date: 11 Jun 1999 08:25:47 GMT
From: zenin@bawdycaste.org
Subject: Re: shortest self printing perl program
Message-Id: <929089730.811567@thrush.omix.com>
Kiriakos Georgiou <kgnews@olympiakos.com> wrote:
: OK, since I am in quiz mode today, can someone come up with a shorter
: program that prints itself without opening any files, spawning processes
: etc. than this one-liner:
:
: printf($x,39,$x='printf($x,39,$x=%c%s%c,39);',39);
@ARGV=$0;print<>;
But of course this must open a file. :-(
--
-Zenin (zenin@archive.rhps.org) Caffeine...for the mind.
Pizza......for the body.
Sushi......for the soul.
-- User Friendly
------------------------------
Date: Fri, 11 Jun 1999 13:07:01 +0800
From: "CacheBoy" <chongsun@krdl.org.sg>
Subject: Silly old me
Message-Id: <7jq60i$p3p$3@godzilla.krdl.org.sg>
Hi, from the quality of the replies here, some of you really know your
stuff.
I would like to inquire abt who is the father/fathers of perl.
Thanks. Pls understand that I am very new to perl and my knowledge is not as
much as most of you here so please refrain from giving me the
you-mean-dont-know kind of answers.
Once again thanks.
------------------------------
Date: Fri, 11 Jun 1999 07:38:28 GMT
From: nlucent <nlucent@my-deja.com>
Subject: Re: Telnet monitor
Message-Id: <7jqedk$9pl$1@nnrp1.deja.com>
In article <375E7CD2.8CE7A782@vii.com>,
"Kerry J. Cox" <kjcox@vii.com> wrote:
> Quick question. I'm looking for some sort of script (I'm sure it
> would be easy enough to write but I'm not a programmer) that would
> monitor who is telnetting into my server and from what domain that are
> coming from. Maybe by doing a "who" and checking either their IP
> address or domain name. If it falls outside an acceptable range, as
> determined by a flat file or something similiar, then I could either
be
> notified immediately by a write to my terminal. This can either be a
> cron job that runs every 5 minutes or so or a daemon that runs in the
> background.
> Also, perhaps this script could be modified to also monitor ftp
> processes. If anyone knows of a script that might do this or
something
> similiar that I could then modify, I would be much appreciative.
> Thanks.
> KJ
>
> --
> .-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
> | Kerry J. Cox Vyzynz International Inc. |
> | kjcox@vii.com Systems Administrator |
> | (801) 596-7795 http://www.vii.com |
> | ICQ# 37681165 http://quasi.vii.com/linux/ |
> `-------------------------------------------------------'
>
>
You would probably be able to do something like this pretty easily with
tcp wrappers, the format for wrappers is daemon : host : action, in
action you can spawn processes or whatever you want to do (play "here
comes the judge" mp3 if your boss telnets in ). So you could basically
find a script that does what you want, then every time someone connects
that script will be run, and if its someone that you know will telnet in
often, or matches the good guys category just have it exit cleanly, if
its someone from the bad file, or a domain in the bad file then have it
mail you, page you, send a message to the console, or whatever you want.
just use
in.telnetd : .goodguys.com : spawn "/usr/local/bin/letusin.sh"
try man hosts_access (I think), or apropos hosts.allow, or apropos tcpd.
You can also do the same thing w/ ftp using in.ftpd as the daemon
(btw the mp3 suggestion gets pretty annoying hering a 3+ min mp3
whenever someone connects)
Hope it helps
Nick
--
The opinions expressed are my own, and are not
endorsed or shared by my employer.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 11 Jun 1999 22:48:12 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: waiting...
Message-Id: <slrn7m0u6n.eco.hasant@borg.intern.trabas.co.id>
On Thu, 10 Jun 1999 04:33:26 GMT,
outlaw_torn <outlaw_torn@mailexcite.com> wrote:
> In article <slrn7lt203.qks.hasant@borg.intern.trabas.co.id>,
> hasant@trabas.co.id (Hasanuddin Tamir) wrote:
>
> > fork(), get the child's pid, exec(), send the pid some signal.
> > That's basically...
> >
>
> Thanks to both for the reply, but what then if I fork...I still have to
> wait. The only way I can see to do that is with wait (which from my doco
> says that the parent waits...and waits...and waits) or parse the ps
> stuff until the child finishes, or kill it when the time is up. What I
> basically need is a wait, which gives up waiting when necessary.
did you go to perlipc manpage?
how about perlfaq8?
HTH,
--
-hasan-
uhm, no more sig(h)
------------------------------
Date: Fri, 11 Jun 1999 13:00:05 +0800
From: "CacheBoy" <chongsun@krdl.org.sg>
Subject: Re: why short of 1 month ??
Message-Id: <7jq60h$p3p$1@godzilla.krdl.org.sg>
Becuz the base is 0 like in an array, the base starts at 0.
Only programmers need to know that. They will write a simple program to
display it as it is so that people would not notice it.
------------------------------
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 5957
**************************************