[16015] in Perl-Users-Digest
Perl-Users Digest, Issue: 3429 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 20 11:19:50 2000
Date: Tue, 20 Jun 2000 06:05:11 -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: <961506311-v9-i3429@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 20 Jun 2000 Volume: 9 Number: 3429
Today's topics:
Re: Any Perl experts around? farahas@my-deja.com
Re: Any Perl experts around? <flavell@mail.cern.ch>
Re: Buscamos Programador para EEUU <gellyfish@gellyfish.com>
Re: Checking for open socket before writing to it? <gellyfish@gellyfish.com>
Re: creating and opening a file <gellyfish@gellyfish.com>
Re: Current time minus file's datestamp time <sb@muccpu1.muc.sdm.de>
debugging an already running program <warrenNOwaSPAM@actcom.co.il.invalid>
Re: End delimiter line <gellyfish@gellyfish.com>
extracting data from web pages akerne_orchids@my-deja.com
Re: how do I "redirect" a substitution? <gellyfish@gellyfish.com>
Re: how do I "redirect" a substitution? <gellyfish@gellyfish.com>
Re: https <gellyfish@gellyfish.com>
Re: Internet Programmers Wanted! <gellyfish@gellyfish.com>
Newbie question about subroutines... <vhatz@ccf.auth.gr>
Re: Newbie question about subroutines... (Clinton A. Pierce)
Novell Server and Perl <thoren@southern-division.com>
Re: Perl Builder 2.0 for LINUX - Beta Available <gellyfish@gellyfish.com>
Re: Perl DBI Oracle? <thunderbear@bigfoot.com>
Re: perl generated html response problem <flavell@mail.cern.ch>
Re: PerlCRT 2.05 for Win32 <gellyfish@gellyfish.com>
Re: redirection with cgi metza@my-deja.com
Re: redirection with cgi <gellyfish@gellyfish.com>
Re: Reg Expression Question (Bart Lateur)
Re: running perl daemons from a shell script <gellyfish@gellyfish.com>
Re: subdomain name forwarding scripts ?? <gellyfish@gellyfish.com>
Thanks a lot! <rvanoni@e-estimating.com>
Re: very simple cgi problem <gellyfish@gellyfish.com>
Re: Very Strange Behaviour <gellyfish@gellyfish.com>
RE: Where to get CPAN CD? (H. Merijn Brand)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 20 Jun 2000 12:02:46 GMT
From: farahas@my-deja.com
Subject: Re: Any Perl experts around?
Message-Id: <8inmh2$3cr$1@nnrp1.deja.com>
Obviously the word mannerism doesn't figure in your
dictionary....anyway I needed some perl experts cause I registered on
qsupport.com and they have a exclusive section for experts who can
handle queries from users.
I wanted to pass on the info to those guys.......
farah
In article <8hqfk5$e3i$1@news.mch.sbs.de>,
michel.dalle@usa.net (Michel Dalle) wrote:
> In article <8hpqq3$5gf$1@nnrp1.deja.com>, farahas@my-deja.com wrote:
> [snip]
>
> I'm sorry, there are no Perl experts here. This newsgroup only
discusses
> issues concerning camels and other brown animals.
>
> For example :
>
> %%
> Before we polish that "diamond", we should probably ask ourselves if
> it's brown and stinks.
> -- Larry Wall in <199911061942.LAA29314@kiev.wall.org>
> %%
> And if it's brown and stinks, we should ask ourselves whether we can
> put a saddle on its hump. :-)
> -- Larry Wall in <199911061942.LAA29314@kiev.wall.org>
> %%
> A yacc is an unruly beast.
> -- Larry Wall in <199912012050.MAA06214@kiev.wall.org>
>
> More gems can be found at
> http://www.perl.com/CPAN/misc/lwall-quotes.txt.gz
>
> :)
>
> Michel.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 20 Jun 2000 14:38:16 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Any Perl experts around?
Message-Id: <Pine.GHP.4.21.0006201433560.5388-100000@hpplus03.cern.ch>
On Tue, 20 Jun 2000 farahas@my-deja.com up-ended usenet in
the newfangled way of things, and blurted out:
> Obviously the word mannerism doesn't figure in your
> dictionary....
bizarre
> anyway I needed some perl experts cause I registered on
> qsupport.com and they have a exclusive section for experts who can
> handle queries from users.
Well, I'm sure we're all _so_ much the wiser for that.
Score duly adjusted.
[and another jeopardectomy, quite a messy one by the time
it got to the operation...]
--
"Some popular newsreaders, such as Outlook Express, automatically put the
cursor above the quoted material; you can take advantage of this by
scrolling down through the prior posting, deleting anything superfluous,
until you reach the point where you want to start your reply." -a.u.e FAQ
------------------------------
Date: 19 Jun 2000 21:02:04 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Buscamos Programador para EEUU
Message-Id: <8ilu7s$kuc$1@orpheus.gellyfish.com>
On Thu, 15 Jun 2000 10:43:45 GMT Antonio wrote:
> Buscamos Programador para EEUU Para más información:
I can only suppose that it was because it was not quite the same as the
usual job advert that it didnt cop the opprobrium that is attracted by
the others.
Please search Deja News for David Adler's usual response to job postings
here.
( Hey its a kind of do it yourself flame ) ;-}
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 18 Jun 2000 16:00:08 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Checking for open socket before writing to it?
Message-Id: <8iio5o$9mo$1@orpheus.gellyfish.com>
On Sat, 17 Jun 2000 19:38:35 -0700 Ramesh Vadlapatla wrote:
> Hello!
>
> I am using this command to connect to a server:
> $socket1=IO::Socket::INET->new(PeerAddr=>"$hostname:$new_port",Proto=>"tcp");
>
> The server occasionaly shuts down, thereby closing the socket and my print
> command:
> $socket1->print($message);
> fails and I get a Broken Pipe message and the script just exits.
>
> How do I make sure that the server socket is open before I write to it?
>
An alternative to checking whether the socket is still open would be to
wrap the write to the socket in an eval to trap the fatal error and then
act appropriately if the write fails due to the socket being closed.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 18 Jun 2000 18:59:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: creating and opening a file
Message-Id: <8ij2mq$981$1@orpheus.gellyfish.com>
On 16 Jun 2000 17:48:05 GMT Tina Mueller wrote:
> hi,
>
> Ilja Tabachnik <billy@arnis-bsl.com> wrote:
>> In article
>> <Pine.OSF.3.96.1000616104953.17273A-100000@alpha2.csd.uwm.edu>,
>> Tyler Robert Wood <twood@csd.uwm.edu> wrote:
>>>
>>> $filename = $highest.".txt";
>>> open (FILE, $filename) || print "Can't open the file";
>
>> Also why not to use a more descriptive error message ?
>
>> open FILE, "> $filename" or die "cannot open $filename: $!\n";
>
> open FILE, "> $filename" or die "cannot open $filename: $!";
>
> better to leave that newline out:
> perldoc -f die
>
Some people might find that the printing of the line number is a
distraction especially where there might only be one open() in the
program or where the rest of the text of the error message provides
sufficient context.
In the end of the day it might just come down to aesthetics.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 20 Jun 2000 12:48:33 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Current time minus file's datestamp time
Message-Id: <8inp71$j92$1@solti3.sdm.de>
[Mailed && posted]
In article <hgdskssvmvg91m1ugtat38bis0ph8gt0fh@4ax.com>,
Abe Timmerman <abe@ztreet.demon.nl> wrote:
> ...
>> use Date::Calc qw(:all);
> ...
>> @date = (localtime($time))[5,4,3,2,1,0];
>> $date[0] += 1900;
>> $date[1]++;
>> @diff = Delta_DHMS(@date,Today_and_Now());
>> $diff = ((((($diff[0] * 24) + $diff[1]) * 60) + $diff[2]) * 60) + $diff[2];
>> next FILE if ($diff < 3600) # 3600 secs = 1 hour
> That looks like _huge_ overkill for this (and a typo):
> next if time()-$time < 3600;
Thanks a lot for the good hint!
Sometimes I think too complicated and do not see the simplest solution -
thanks for helping me out! :-)
I immediately changed my script where I am using this...
About the typo: Oh yeah, sorry, a semicolon was missing!
And why do you think that this doesn't answer the original poster's question?
Where did I understand him wrong?
With a cron job running in hourly intervals files might not get updated
for almost two hours - increasing the frequency only alleviates this
problem slightly but also causes more load. (But probably still less
than a daemon, of course.)
Best regards,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: Tue, 20 Jun 2000 04:11:40 -0700
From: warrenb10 <warrenNOwaSPAM@actcom.co.il.invalid>
Subject: debugging an already running program
Message-Id: <1b38a4a1.5b51056f@usw-ex0103-023.remarq.com>
Running 5.005-02 on Linux 2.0.35
I've got a program which is run hundreds of times a day, it
hangs once a day or so, haven't been able to find any way to get
it to hang on demand.
If I had this problem with a C program, I'd generate a core dump
and look at it with the debugger (or debug a running process if
the debugger on that system supported it). Is there a way to do
something similar with the Perl debugger? I read the doc, looks
like you have to start the program in the debugger.
If this can't be done, I'd settle for a stack trace (of my Perl
program, not of the interpreter).
thanks
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 18 Jun 2000 21:17:35 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: End delimiter line
Message-Id: <8ijaov$3sv$1@orpheus.gellyfish.com>
On Fri, 16 Jun 2000 09:22:50 +0200 Jean-Pascal Laux wrote:
> I want to write text lines in a file using print fonction but I also
> want that the en delimiter is line-feed (with no CR).
>
If you are doing this on a windows machine then you should binmode the
output filehandle.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 20 Jun 2000 11:54:28 GMT
From: akerne_orchids@my-deja.com
Subject: extracting data from web pages
Message-Id: <8inm1g$31t$1@nnrp1.deja.com>
Hi,
Some time I thought I found a perl script that could extract data from
URL supplied to it, unfortunately I lost the reference.
Could anyone point me towards existing perl scripts that can be used to
extract data (specific occurences) from web pages, or point me in the
right direction of a couple of partial solutions...
thanks,
Kenneth.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 19 Jun 2000 20:54:37 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how do I "redirect" a substitution?
Message-Id: <8iltpt$jg7$1@orpheus.gellyfish.com>
On Sat, 17 Jun 2000 00:47:36 GMT webqueen, queen of the web wrote:
> Thanks for the replies. The double ='s isn't too pretty is it? I'd hoped
> for something a little more elegant.
>
> Larry, I respectfully submit that this would fit very nicely into Perl
> 6.0:
>
> $scalar1 =~ s/cat/dog/gi,$scalar2;
>
Ugh ! Apart from it being ugly to this jaded eye it would also throw
the whole semantic of the binding operator and assignment up in the air.
With the :
( $scalar2 = $scalar1) =~ s/blah/woof/ ;
construct its visually clear what is being modified - the result of the
assignment which is in effect $scalar2 - it also makes it clear that the
binding operator is just that, adding some third operand to it in the way
you suggest would have an impact on tr/// and m// (and any other
hypothetical bindable operation that someone might be keeping in their
back pocket for a rainy day) - the binding operator would become bind
and assign.
> While I'm at it a "writeln" equivalent would be nice. How often do we
> use:
>
> print "$scalar\n";
>
> where
> println $scalar;
>
> would be neat.
>
> Yes yes I know it would be VERY EASY to define a sub for this, but still
> it would be a nice addition to the language. Subs for chop and chomp
> would be easy as well but they are in the language aren't they? I'd use
> println a lot more than either of those.
>
Of course this is what $\ is for (without rehearsing the arguments of a
month or so back).
I think you might want to go back to the thread about Standardization and
review what was said there about new language features versus stability.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 19 Jun 2000 20:29:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how do I "redirect" a substitution?
Message-Id: <8ilsae$ekv$1@orpheus.gellyfish.com>
On Sun, 18 Jun 2000 03:46:47 +1000 Michael Roper wrote:
>> >While I'm at it a "writeln" equivalent would be nice. How often do we
>> >use:
>> >
>> > print "$scalar\n";
>> >
>> >where
>> > println $scalar;
>> >
>> >would be neat.
>>
>> Set $\ to "\n".
>
> Thats only any good if you're always printing out newline terminated lines!
> Oh for a println!
>
It wasnt you who was ranting about this before was it ;-}
You can localize the assignment to $\ :
{
local $\ = "<somelineterminator>";
print 'whatever';
}
I would suggest going to Deja News with this as it was beaten to death when
it was discussed before - including the pros and cons of creating your
own subroutine for doing it. I dont think I have enough battery power left
to grep for 'println' or 'writeln' right now ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 18 Jun 2000 20:31:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: https
Message-Id: <8ij82m$qnj$1@orpheus.gellyfish.com>
On Fri, 16 Jun 2000 09:55:03 GMT Eric Mosley wrote:
> How can I download a file using https (notice the s for ssl) from within a
> perl program and save it to a local file.
>
> Any pointers to modules, etc, would be appreciated greatly!
>
You can do it with LWP::UserAgent if you have Net::SSL or IO::Socket::SSL
installed.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 20 Jun 2000 11:34:29 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Internet Programmers Wanted!
Message-Id: <9FI35.393$My4.38910@news.dircon.co.uk>
On Mon, 19 Jun 2000 21:34:35 GMT, Kevin McElligott Wrote:
> We will run scripts designed by
> people like you.
>
No you wont.
> DO NOT SPAM. IT HURTS ALL OF US
Dont make me laugh.
/J\
------------------------------
Date: Tue, 20 Jun 2000 15:06:22 +0300
From: Vlasis Hatzistavrou <vhatz@ccf.auth.gr>
Subject: Newbie question about subroutines...
Message-Id: <394F5E36.E5EFA482@ccf.auth.gr>
Hello,
I'd like to know if there is a way in Perl to laucnh different
subroutines running at the same time. If this is not possible, should I
use different programs? If so, how can I get themn to run at the same
time? I use Windows NT4.0.
Thanks for reading this posting. Any help would be greatly appreciated.
--
Vlasis Hatzistavrou,
Library of Physics & Informatics
Aristotle University of Thessaloniki
------------------------------
Date: Tue, 20 Jun 2000 12:08:05 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Newbie question about subroutines...
Message-Id: <F8J35.5790$fR2.64995@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <394F5E36.E5EFA482@ccf.auth.gr>,
Vlasis Hatzistavrou <vhatz@ccf.auth.gr> writes:
> I'd like to know if there is a way in Perl to laucnh different
> subroutines running at the same time. If this is not possible, should I
> use different programs? If so, how can I get themn to run at the same
> time? I use Windows NT4.0.
You either use different processes to accomplish this through fork(), or
you investigate threading. Start with:
perldoc -f fork
perldoc Thread
perldoc perlthrtut
Good luck, you're on an adventure.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Tue, 20 Jun 2000 13:17:21 +0200
From: "Thoren Johne" <thoren@southern-division.com>
Subject: Novell Server and Perl
Message-Id: <8injt7$m20$11$1@news.t-online.com>
what's up with novell?
i'd like to promote the german boy/girl scout organization (BDP) with some
perl programming to publish their archive online.
we've got free server space on a system running novell 5.1 with netscape
enterprise webserver and now the local administrator prodly told me that he
installed the latest release of perl for netware, which is from may 2000.
perl -v on this system gives me now:
5.003_07 (Netware build #334)
is this a very bad dream or just the real truth?
of course i'd like to use some modules like CGI.pm but i don't think they
will run with 5.003_07
any comments or hints?
gruß
thoren
8#X
--
----------------------------------------------------------------------
Thoren Johne - 8#X - thoren@southern-division.com
Southern Division Classic Bikes - www.southern-division.com
------------------------------
Date: Tue, 20 Jun 2000 11:05:29 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Builder 2.0 for LINUX - Beta Available
Message-Id: <ZdI35.385$My4.38842@news.dircon.co.uk>
On Mon, 19 Jun 2000 22:04:19 GMT, Alan Curry Wrote:
> In article <394E5E92.3C3D@solutionsoft.com>,
> Marty Ford <marty@solutionsoft.com> wrote:
>>We would like to invite everyone here try a pre-release copy of Perl
>>Builder 2.0 for Linux.
>
> Snip from pbtar/install2:
>
> wine -managed pb2linux.exe
>
> cd /home
>
> chmod -R 777 wine
> chmod -R 777 pb2
>
> I think you'll find it a little harder to get away with that kind of thing in
> the new world you're stumbling into.
>
What are we saying here - that it *requires* 'wine' to install or run - well
then it isnt a linux application is it ? I think they could do with a good
slashdotting over this ;-}
/J\
------------------------------
Date: Tue, 20 Jun 2000 13:02:49 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: Perl DBI Oracle?
Message-Id: <394F4F59.644993CA@bigfoot.com>
Robert wrote:
>
> Is perl the preferred method for pulling data out of an oracle
> database into text files? Can resident "bot" programs be written in
> perl for unix that would generate files on a schedule? Perl is
> generally available on unix boxes installed with the OS?
Yes. Note that you need to compile DBI for Oracle on the Unixbox you
want to work with, and _that_ requires having at least part of an Oracle
installation on the Unix machine.
The ActiveState Perl for Windows have a precompiled set of DBI files for
Oracle, and works out of the box.
>
> Sorry for the general questions. I'm a VB-Database programmer and I'm
> going to have to do some database work on a unix machine and I'm trying
> to figure out the best way to do it.
Depends on what you want to do. Oracle have JDBC drivers for Oracle
which can be used without any further ado if you want to work in Java
instead.
> Is the Perl DBI O-riley book the only one available that would cover
> databasing with perl?
The online documentation for DBI is quite good for a start. The DBI
book is good for reference and tips.
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: Tue, 20 Jun 2000 13:29:02 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: perl generated html response problem
Message-Id: <Pine.GHP.4.21.0006201317470.5388-100000@hpplus03.cern.ch>
On Sat, 17 Jun 2000, Markus Hediger wrote:
> > CGI Error
> > The specified CGI application misbehaved by not returning a complete
> > set of HTTP headers. The headers it did return are:
>
> all these lazy guys told you to look at cgi docs
What do you mean, "lazy"? I'm the one who was lazy in _that_ sense: I
read the posting, thought "that's too obvious" and hit the delete key.
Both Abigail and Lauren took the trouble to offer genuine help. It
wasn't a Perl language issue.
- but actually the
> answer is that easy. in any cgi-prog, normally, the first output at all
> should be a valid http-header,
Of course, but by suggesting to the hon Usenaut that this is the
place to ask CGI questions, you are storing up lots of trouble for
them, and not really helping at all.
The key to problem solving is learning to analyze a problem in terms
of its component parts, and knowing where to find answers relevant to
the various components. By trying to confuse the issues, you are
likely making their job harder. Confusing that with laziness in the
sense of turpitude is not helpful. Laziness in the true Perl sense
would be praiseworthy, which reflects badly on your own attitude.
good luck
------------------------------
Date: 18 Jun 2000 18:41:37 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PerlCRT 2.05 for Win32
Message-Id: <8ij1kh$64a$1@orpheus.gellyfish.com>
[ removed the non-existent comp.lang.perl ]
In comp.lang.perl.misc Bob Gregory <bgregory3@cs.com> wrote:
> Bill Hess <billhess2000@home.com> wrote in message
> news:TKp25.2022$fR2.28943@news1.rdc1.mi.home.com...
>> I am trying to build Perl 5.005_03 with PerlCRT so that sockets work on
>> Win98 and WinNT
>
> Hello Bill
> I recently downloaded ActivePerl v522 from ActiveState.com and Apache
> Web Server v 1.3.9 for windows (98) and started learning Perl. I am
> having problems with the installation, because I can write a script,
> execute it in a dos window (eg something simple like print a message 10
> times), but I want to have a form written in html which executes a perl
> program which takes the fields in the form as input (e.g. ordering a
> product xyz,and returns the data formatted (e.g. thank you for ordering
> xyz). the perl program sends the reply to the dos window instead of
> to the Win IE browser. I am assuming that when the Apache Web server
> software is running that it picks up the output from the Perl programm.
> This is very difficult to debug, but have you got any suggestions how I
> could home in on the error? Is this similar to what you are trying
> to do?
Bill is trying to build his Perl from the source, you have a configuration
problem with your web server. You should ask in the group
comp.infosystems.www.servers.ms-windows about this.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 20 Jun 2000 10:20:02 GMT
From: metza@my-deja.com
Subject: Re: redirection with cgi
Message-Id: <8ingge$vt9$1@nnrp1.deja.com>
Exellent, thanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 18 Jun 2000 19:57:15 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: redirection with cgi
Message-Id: <8ij62b$k41$1@orpheus.gellyfish.com>
On Sun, 18 Jun 2000 14:13:49 GMT metza@my-deja.com wrote:
> Hi,
>
> I'm new to perl, and I was writing a cgi script that after accepting form
> input displays a thank you message. I know I can produce this thankyou
> message using the print command, but I want be quite a complex looking page.
> What I would prefer to do, is instead of writing a message out using the
> print command, is indirect the user to a pre-prepared standard thank you
> message page. Can I do this?
>
> I guess if I cant redirect the user, I would have to copy the standard page
> in, then output it to the standard output. But this seems to be a waste of
> processing time. If I have to do this, can anyone tell me how to load a file
> in to a data structure (a linked list of strings I guess), then send it to
> the standard output?
>
Of course you can redirect from a CGI program written in Perl just as
you can in a CGI program written in any other language by outputting the
appropriate headers. You might want to ask in the newsgroup
comp.infosystems.www.authoring.cgi .
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 20 Jun 2000 11:06:04 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Reg Expression Question
Message-Id: <39514eab.8971614@news.skynet.be>
tony_123@my-deja.com wrote:
>I have the string
>
>$MyString='<img src="http://www.myhouse.com.au/house.gif">';
>
>Can someone please tell me how I can extract the house.gif part of this
>string.
I would advise using HTML::Parser or HTML::TokeParser to analyse the
HTML. You could then reliably:
* search for IMG tags,
* get the src attribute
and get the file base name from there.
For a quick (but pretty unreliable) solution:
/<img .*?\bsrc\s*=\s*"[^"]*\/([^"]*)/i
If you got "http://www.myhouse.com.au/house.gif" into $_ (without the
quotes), all you still need is
($basename) = /.*\/(.*)/;
--
Bart.
------------------------------
Date: 18 Jun 2000 16:18:41 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: running perl daemons from a shell script
Message-Id: <8iip8h$crv$1@orpheus.gellyfish.com>
On Sat, 17 Jun 2000 18:18:17 GMT a4kquattro@my-deja.com wrote:
> Hello,
>
> I've been trying to control a simple perl daemon
> from a shell script in /etc/rc.d/init.d under RH
> 6.0.
>
Of course your question is not really a Perl question at all, but one
better addressed in a general group about your OS.
Why cant you write the PID of the program out to a file like other
programs do and then use that PID to send signals to it .
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 18 Jun 2000 18:21:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: subdomain name forwarding scripts ??
Message-Id: <8ij0e6$2kg$1@orpheus.gellyfish.com>
On Sun, 18 Jun 2000 07:48:51 GMT Ramya wrote:
> In article <394A585E.1CB83AD6@lycosmail.com>,
> Johannes <gedichte@lycosmail.com> wrote:
>> Ramya wrote:
>>
>> > Hi,
>> > I am not sure a javascript can do this or you need a cgi/perl script
>> > but here is what I am looking for. I have a domain name
>> > www.myname.com and I want to create subdomain names like
>> > music.myname.com , geek.myname.com etc. which in turn will be
>> > pointing to www.myname.com/music and www.myname.com/geek for there
>> > respective index pages.
>>
>> This isn't done with a script, you have to change your DNS configuration,
>> to send *.myname.com to your webserver.
>> Then you can change your webserver to point anything different from www to
>> the subdirectory you want.
>>
>>
> Thanks for all the responses. However does this mean that I need to
> have multiple domain names parked. I mean do I need to register
> geeks.myname.com, music.myname.com etc parked separately in order to
> use them in the above url redirection.
>
You will need to have the administrator of the nameserver which holds
your domain add the appropriate records for each new virtual host. You
will not need to register anything else.
Anyhow this has nothing to do with Perl you should ask in some more
appropriate group.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 20 Jun 2000 08:13:13 -0400
From: "Rich" <rvanoni@e-estimating.com>
Subject: Thanks a lot!
Message-Id: <8inn73$aa6$1@slb7.atl.mindspring.net>
Ala Qumsieh <aqumsieh@hyperchip.com> wrote in message
news:7a66r5xy0a.fsf@merlin.hyperchip.com...
>
> "Rich" <rvanoni@e-estimating.com> writes:
>
> > If $x = 45.123456789 and I wanted to only show 2 decimal places I
> > would use the following command:
> >
> > printf("x=%.2f", $x);
>
> Yes.
>
> > Is there any way to do this type of formatting inside the print<<
statement?
>
> Not that I know of.
>
> > Or is there a way to change the value of $x from 45.123456789 to 45.12
> > before I use the print<< statement?
>
> Yes. You use sprintf():
>
> $x = sprintf "%.2f", $x;
>
> > And how do I print the "$" inside the print<< statement without Perl
> > trying to interpret it as a variable?
>
> The same way you do it inside double-quoted strings; you backwack it:
>
> print "\$";
>
> --Ala
------------------------------
Date: 18 Jun 2000 19:08:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: very simple cgi problem
Message-Id: <8ij37r$apq$1@orpheus.gellyfish.com>
On Fri, 16 Jun 2000 12:11:39 -0400 Drew Simonis wrote:
> [Posted and CC per request]
>
> Dr M Hughes wrote:
>>
>> For some reason the print to the file s:/common data/blasts/cgi will not
>> work. All the permissions on the file appear to be ok.
>
> "For some reason" isn't very helpfull. Change your die statment
> to also print the value of $!, and you may see exactly what that
> reason is.
probably including
use CGI::Carp qw(fatalsToBrowser);
might help in that the error message will be displayed in the browser
rather than in some mysterious log that people never seem to be able to
find on NT
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: 18 Jun 2000 16:07:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Very Strange Behaviour
Message-Id: <8iioiq$at0$1@orpheus.gellyfish.com>
On Sat, 17 Jun 2000 06:30:00 -0400 Ryan & Treena Carrier wrote:
>
> I know some out there will say this is not PERL related. It is.
>
No it isnt - it is related to the configuration of the HTTP server and is
applicable whichever language you might care to write your CGI programs
in. The appropriate group to discuss this stuff is whatever group in :
comp.infosystems.www.servers.(misc|unix|ms-windows)
is appropriate to your OS .
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Tue, 20 Jun 00 14:08:19 +0200
From: h.m.brand@hccnet.nl (H. Merijn Brand)
Subject: RE: Where to get CPAN CD?
Message-Id: <8F5991177Merijn@192.0.1.90>
phr@netcom.com (Paul Rubin) wrote in
<8in266$cki$1@slb3.atl.mindspring.net>:
>Eric Bohlman <ebohlman@netcom.com> wrote:
>>The problem is that such CD-roms (which can be found in some Perl books)
>>become outdated *very* quickly. Take a look at the "by recentness" list
>>on CPAN over a period of a couple weeks. By the time you get a CD ready
>>for distribution, the most popular modules on CPAN will be several
>>versions ahead of those on the CD.
>>
>>Some enterprising soul could consider running a CPAN mirror and, upon
>>request, burning a CD-R of it and FedExing it to the customer, but it
>>would probably be too expensive for most people to use.
>
>I don't mind if the CD is a few months behind. I know that companies
>like cheapbytes get CD's out to customers within a few weeks of having
>the bits ready. So a quarterly release would be fine with me. At
>that point downloading updates from a cpan mirror wouldn't be so slow.
>
>If someone with a mirror is offering to burn CPAN cd-r's for a
>reasonable fee, I'd be willing to buy one (Fedex not needed, regular
>mail is ok).
Become a member of the nearest Perl Mongers. One of them will probably
be able to make a snapshot of one of the closest mirrors.
We at Amsterdam.pm offer that possibility every month. Please do remember,
as Eric said, CPAN CD snapshots get outdated very soon. It takes a bit of
intelligent stripping though, cause a CD cannot contain a complete CPAN
mirror. You probably will have to leave all binaries out and `old' versions
of large modules like Tk.
--
H.Merijn Brand
using perl5.005.03 and 5.6.0 on HP-UX 10.20, HP-UX 11.00, AIX 4.2, AIX 4.3,
DEC OSF/1 4.0 and WinNT 4.0 SP-6a, often with Tk800.022 and/or DBD-Unify
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/H/HM/HMBRAND/
Member of Amsterdam Perl Mongers (http://www.amsterdam.pm.org/)
------------------------------
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 3429
**************************************