[19854] in Perl-Users-Digest
Perl-Users Digest, Issue: 2049 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 1 18:06:08 2001
Date: Thu, 1 Nov 2001 15:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1004655910-v10-i2049@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 1 Nov 2001 Volume: 10 Number: 2049
Today's topics:
ANNOUNCE: Object::Registrar 0.01 - A global registry fo (Arun Kumar U)
Re: Contents of a hash blank in only *part* of a module <tsee@gmx.net>
Re: desperate: perl scripts called from init.d/... scri (Clinton A. Pierce)
Re: desperate: perl scripts called from init.d/... scri (Richard J. Rauenzahn)
Re: desperate: perl scripts called from init.d/... scri <ddunham@redwood.taos.com>
Re: desperate: perl scripts called from init.d/... scri <stuart@otenet.gr>
Re: desperate: perl scripts called from init.d/... scri <Robert.Lopez@abq.sc.philips.com>
Re: Help modifying a sort routine <tsee@gmx.net>
Re: Help modifying a sort routine <markbright@optusnet.com.au>
help with simple script <tdupuis@omafra.gov.on.ca>
Re: help with simple script <Tassilo.Parseval@post.rwth-aachen.de>
Re: How can I fix this? (AVL)
Re: How can I fix this? <jeff@vpservices.com>
Re: How can I fix this? (Tad McClellan)
how to detect broken link <adustipujo1@mediaone.net>
Re: how to detect broken link <comdog@panix.com>
It works, but why do you put "/dev/null" at the end? <shenxin@sympatico.ca>
Re: It works, but why do you put "/dev/null" at the end <shenxin@sympatico.ca>
Re: Leftmost SHORTEST <stuart@otenet.gr>
Re: Leftmost SHORTEST (Tad McClellan)
Re: ms-word doc's & perl <cpryce@pryce.net>
Re: ms-word doc's & perl <camerond@mail.uca.edu>
Re: Need advice on getting off a SIGTTIN signal from my <avila_edgar@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Nov 2001 07:04:50 -0800
From: u_arunkumar@yahoo.com (Arun Kumar U)
Subject: ANNOUNCE: Object::Registrar 0.01 - A global registry for objects
Message-Id: <tu3f7h2f97fgce@corp.supernews.com>
NAME
Object::Registrar - A global registry of objects that can
be resolved by names
SYNOPSIS
use Object::Registrar;
my $or = new Object::Registrar();
$nm->bind('Test/Foo', new Foo()); ## or use register()
$nm->bind('Test/Bar', new Bar());
my $foo = $nm->resolve('Test/Foo');
$nm->rebind('Test/Bar', $bar); ## or use reregister()
my %objhash = $or->list();
my %objhash = $or->list('Test/*');
my $bool = $or->exists('Test/Foo');
$or->unbind('Test/Bar'); ## or use unregister()
## ----------------------------------- ##
## Typical usage with error handling ##
## ----------------------------------- ##
use Object::Registrar;
use Error qw(:try);
my $or = new Object::Registrar();
try {
$or->resolve('Null');
}
catch Object::NotFoundException with {
my ($ex) = shift;
print "Caught NotFoundException: $ex\n";
};
DESCRIPTION
The Object::Registrar implements is a global registry of
objects. This module makes use of the Singleton Pattern
to achieve the desired functionality.
Using this module an application can register its Object
instances in the Registrar with a unique name. Later on in
the application these object instances can be retrieved /
resolved by providing the unique name.
The names provided for identifying the Objects can be
anything that would be acceptable as a valid hash key in
Perl.
For a detailed description of the Singleton Pattern, refer
Design Patterns, Gamma et al, Addison-Wesley, 1995, ISBN
0-201-63361-2.
COPYRIGHT
Copyright (c) 2001 Arun Kumar U <u_arunkumar@yahoo.com>.
All rights reserved.
This library is free software; you can redistribute it
and/or modify it under the same terms as Perl itself.
AUTHORS
Arun Kumar U <u_arunkumar@yahoo.com>
------------------------------
Date: Thu, 1 Nov 2001 20:32:54 +0100
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Contents of a hash blank in only *part* of a module
Message-Id: <9rs7tg$7km$03$1@news.t-online.com>
"Nick Temple" <nicktemple2000@yahoo.com> schrieb im Newsbeitrag
news:a9fe2341.0111011100.2c4c4d59@posting.google.com...
| I think someone has been jacking themselves off too much.
I think someone should learn how to quote.
*plonk*
Steffen
--
$_=q;0cb212c210b0bb010c0113bb0c410c0b516c0bb3d212c2b0b0b016b6cb2b2c21010c0
b41110b3bba0e0c0d2c4b2b6bc013d2c0d0b01012b0b0;;s/\n//g;s/(\d)/$1<2?$1:'0'x
$1/ge;s/([a-f])/'1'x(ord($1)-97)/ge;print"\n";$o=$_;push@o,substr($o,$_*8,
8)for(0..24);for(@o){print"\0"x(26-$i).chr(oct('0b'.($_)))."\n";$i++}#st_m
------------------------------
Date: Thu, 01 Nov 2001 19:50:16 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: desperate: perl scripts called from init.d/... scripts
Message-Id: <3be1a57b.189622452@localhost>
On 01 Nov 2001 10:19:29 -0700, Robert Lopez
<Robert.Lopez@abq.sc.philips.com> wrote:
>With respect to the runlevel changing scripts such as in /etc/init.d
>on some systems and in /sbin/init.d on other systems:
>
>If run level start/stop scripts, written in posix shell, start and
>stop other scripts written in perl is there any reason to expect
>problems? in general? in HP-UX 11?
> [...]
>The scripts work perfectly when run by root manually by running them
>directly and via the run level links.
> [...]
>The problems include:
>
The places to look are:
* Missing pieces of the environment (PATH, TERM, HOME, etc...)
* Filehandles not open to expected places. Are you reading STDIN and
it's connected to /dev/null? Or something that's not a tty?
* Permissions/user environment are screwy. You say the init scripts
aren't actually run by root in Real Life, but by a dba user? Can you
su - to that user and run them okay?
* Filesystems aren't all there yet. Perl's obviously there... are the
appropriate module directories?
For starters.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours *and*
clintp@geeksalad.org Perl Developer's Dictionary
"If you rush a Miracle Man, for details, see http://geeksalad.org
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: 1 Nov 2001 19:37:06 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: desperate: perl scripts called from init.d/... scripts
Message-Id: <1004643426.225176@hpvablab.cup.hp.com>
Robert Lopez <Robert.Lopez@abq.sc.philips.com> writes:
>With respect to the runlevel changing scripts such as in /etc/init.d
>on some systems and in /sbin/init.d on other systems:
>
>If run level start/stop scripts, written in posix shell, start and
>stop other scripts written in perl is there any reason to expect
>problems? in general? in HP-UX 11?
I don't think so. The first rc script is /sbin/rc -- I didn't trace it,
but I would expect it to just exec whatever it finds in /sbin/init.d/...
[...]
>
>The problems include:
>
>When the system is actually changing run levels and the init process
>executes the scripts they fail to stop on going down run levels.
I don't understand what you mean by the scripts fail to stop. The
scripts never exit? Or the services that the scripts control don't
stop?
>When the system is actually changing run levels and the init process
>executes the scripts they fork off another process when going up run
>levels.
> eg:
>dba 19000 1 10 00:07:01 ... /bin/sh /dba/dbscripts/loadall /dba/cfg/cfg21
>dba 19005 1900 4 00:07:01 ... /bin/sh /dba/dbscripts/loadall /dba/cfg/cfg21
I don't have any idea what you're showing us above.
>The posix scripts are owned by root. The database control scripts
>written in perl are owned by dba. The posix scripts have lines like:
>
> su - dba -c /dba/dba/dbscripts/loadall /dba/cfg/cfg21& > /logs/dba/cfg21 2>&1
So your init script _isn't_ written in perl? But rather sh, which calls
a perl script?
>HP support rep thinks the problem is the use of perl.
I hesitate to contradict a colleague, but my gut feeling is that it may
have more to do with that su -- and possibly the receipt of a SIGHUP.
That's a common problem, but usually only with daemons. I've seen other
init scripts fail, though, when su is involved.
What does /etc/rc.log say?
And you may find better answers at comp.sys.hp.hpux....
Rich
--
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant | I speak for me, | 19055 Pruneridge Ave.
Development Alliances Lab| *not* HP | MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014
------------------------------
Date: Thu, 01 Nov 2001 21:05:32 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: desperate: perl scripts called from init.d/... scripts
Message-Id: <wOiE7.9032$T36.2891616364@newssvr14.news.prodigy.com>
Robert Lopez <Robert.Lopez@abq.sc.philips.com> wrote:
> The scripts work perfectly when run by root manually by running them
> directly and via the run level links.
> eg:
> cd /sbin/init.d; ./script.pl start_msg < -- works
> cd /sbin/init.d; ./script.pl start < -- works
> cd /sbin/init.d; ./script.pl stop_msg < -- works
> cd /sbin/init.d; ./script.pl stop_msg < -- works
> cd /sbin/rc2.d; ./K96script.pl .... < -- works
> cd /sbin/rc3.d; ./S96script.pl .... < -- works
Try running it the way rc2 will (on Solaris)...
/sbin/sh /etc/rc2.d/K96script.pl < -- works?
If that doesn't work (it shouldn't), then it won't work at startup.
The script is not executed by rc2. The script is given to sh as an
argument. If sh doesn't understand it, it won't work.
Solution:
Write a different script.
/etc/rc2.d/S96script.pl
#!/bin/sh
/etc/init.d/someperlscript $1
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< How are you gentlemen!! Take off every '.SIG'!! >
------------------------------
Date: Thu, 1 Nov 2001 22:56:23 +0200
From: "Stuart Gall" <stuart@otenet.gr>
Subject: Re: desperate: perl scripts called from init.d/... scripts
Message-Id: <9rsdkv$f4t$2@usenet.otenet.gr>
> su - dba -c /dba/dba/dbscripts/loadall /dba/cfg/cfg21& >
/logs/dba/cfg21 2>&1
>
> HP support rep thinks the problem is the use of perl.
>
> Any ideas?
look at /sbin/rc2 to see what, if anything, wired is going on?
--
Stuart Gall
------------------------------------------------
This message is not provable.
------------------------------
Date: 01 Nov 2001 14:37:06 -0700
From: Robert Lopez <Robert.Lopez@abq.sc.philips.com>
Subject: Re: desperate: perl scripts called from init.d/... scripts
Message-Id: <jc6hese896l.fsf@abqb1k.abq.sc.philips.com>
nospam@hairball.cup.hp.com (Richard J. Rauenzahn) writes:
> Robert Lopez <Robert.Lopez@abq.sc.philips.com> writes:
> >With respect to the runlevel changing scripts such as in /etc/init.d
> >on some systems and in /sbin/init.d on other systems:
> >
> >If run level start/stop scripts, written in posix shell, start and
> >stop other scripts written in perl is there any reason to expect
> >problems? in general? in HP-UX 11?
>
> I don't think so. The first rc script is /sbin/rc -- I didn't trace it,
> but I would expect it to just exec whatever it finds in /sbin/init.d/...
>
> [...]
> >
> >The problems include:
> >
> >When the system is actually changing run levels and the init process
> >executes the scripts they fail to stop on going down run levels.
>
> I don't understand what you mean by the scripts fail to stop. The
> scripts never exit? Or the services that the scripts control don't
> stop?
I mean the /bin/sh program looks up the pid of the perl program and
sends a signal to the perl program which it traps and then does an
orderly shutdown. From a shell this always works. But some how it
fails when init tries to tell it to shut down. The evidence is in the
log file. It never logs a shutdown complete message. So it finally
killed but not in an orderly fashion.
>
> >When the system is actually changing run levels and the init process
> >executes the scripts they fork off another process when going up run
> >levels.
> > eg:
> >dba 19000 1 10 00:07:01 ... /bin/sh /dba/dbscripts/loadall /dba/cfg/cfg21
> >dba 19005 1900 4 00:07:01 ... /bin/sh /dba/dbscripts/loadall /dba/cfg/cfg21
>
> I don't have any idea what you're showing us above.
That is because I was trying to shorten a long line and took out an
extra 0. The init (1) starts process 19000 and 19000 [1900 above]
starts 19005.
>
> >The posix scripts are owned by root. The database control scripts
> >written in perl are owned by dba. The posix scripts have lines like:
> >
> > su - dba -c /dba/dba/dbscripts/loadall /dba/cfg/cfg21& > /logs/dba/cfg21 2>&1
>
> So your init script _isn't_ written in perl? But rather sh, which calls
> a perl script?
Correct the /sbin/init.d/ script is written in posix shell are
required by HP. It then starts a program written in perl,
the /dba/dbscripts/loadall program above. [Again in hand typing
I errored; one too many /dba]
>
> >HP support rep thinks the problem is the use of perl.
>
> I hesitate to contradict a colleague, but my gut feeling is that it may
> have more to do with that su -- and possibly the receipt of a SIGHUP.
> That's a common problem, but usually only with daemons. I've seen other
> init scripts fail, though, when su is involved.
Do you recall how they were fixed? The object here is to have a
reboot now (and ServiceGuard fail-over later) start all the data
loading processes. The dba account can hand start them but we do not
want to wait for the dba to hand start things. So we are trying to
make the dba's tools do what they need to do in the dba's absence.
We do the exact same thing with canned software like Informix and
FlexLM and they do not have the problems. The EDS staff here says HP
has told them that these packages know that su causes a forked process
and they then kill off the first process. They say we must do the same
in our perl scripts.
>
> What does /etc/rc.log say?
The log says just what the posix shell tells it to say on startup;
which is that the processes have started. I have never seen any
shutdown messages in that log. I think the system must replace it when
it begins to reboot.
>
> And you may find better answers at comp.sys.hp.hpux....
I have addressed this issue there. I have as carefully as I know how to
followed all of the advice.
>
> Rich
> --
> Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
> Technical Consultant | I speak for me, | 19055 Pruneridge Ave.
> Development Alliances Lab| *not* HP | MS 46TU2
> ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014
--
Robert.Lopez@Philips.com
------------------------------
Date: Thu, 1 Nov 2001 20:30:32 +0100
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Help modifying a sort routine
Message-Id: <9rs7p0$rud$07$1@news.t-online.com>
"Mark Bright" <markbright@optusnet.com.au> schrieb im Newsbeitrag
news:3be1043a$0$13590$afc38c87@news.optusnet.com.au...
| Hi all,
|
| I was wondering if anyone can help me with this sort routine.
I doubt it ;) It's not very efficient.
This isn't guaranteed to be either, but it should be better in many ways.
It's your problem to get the letter to sort by.
my @ary = ('ABC', 'aBC', 'Ba', 'cc'..'dd');
my $sort_by = 'c';
my @ary = ('ABC', 'aBC', 'Ba', 'Cc'..'Dd');
my $sort_by = 'c' ;
@ary = map { $_->[0] }
sort { $a->[1] cmp $b->[1] }
map { [ $_, lc $_ ] } @ary;
foreach (@ary) {
push @ary, shift(@ary);
last if lc substr($_,0,1) eq $sort_by;
}
One advantage is that the sort routine is very simple. You should do your
modifications to the search data before sorting b/c the sort routine is
called multiple times per data element.
Surely someone will be able to make this more efficient, but this should be
a great improvement already.
HTH,
Steffen
--
$_=q;0cb212c210b0bb010c0113bb0c410c0b516c0bb3d212c2b0b0b016b6cb2b2c21010c0
b41110b3bba0e0c0d2c4b2b6bc013d2c0d0b01012b0b0;;s/\n//g;s/(\d)/$1<2?$1:'0'x
$1/ge;s/([a-f])/'1'x(ord($1)-97)/ge;print"\n";$o=$_;push@o,substr($o,$_*8,
8)for(0..24);for(@o){print"\0"x(26-$i).chr(oct('0b'.($_)))."\n";$i++}#st_m
------------------------------
Date: Fri, 2 Nov 2001 09:31:24 +1100
From: "Mark Bright" <markbright@optusnet.com.au>
Subject: Re: Help modifying a sort routine
Message-Id: <3be1cda6$0$9816$afc38c87@news.optusnet.com.au>
Hi Steffen,
I really appreciate you taking a look at this for me, As I said before my
perl knowledge is very limited, in fact almost non existent :(
Are you suggesting I replace my current sort routine by the one you posted,
or just a part of it?
I'm sorry to be a real pain.
The original sort routine is taken from a Gossamer Threads script (Links2),
so my initial thought was to modify the existing routine based on the same
sort procedure, bit it appears that I was wrong (which doesnt suprise me
:)).
I understand the initial part of the original sort routine ie.
my (@unsorted) = @_;
my ($num) = ($#unsorted+1) / ($#db_cols+1);
my (%sortby, $hit, $i, @sorted);
for ($i = 0; $i < $num; $i++) {
$sortby{$i} = $unsorted[$db_sort_links + ($i * ($#db_cols+1))];
}
is to establish the the database fields on which the sort is to be executed
(I think).
If I use the sort routine you posted how do I establish the above?
Perhaps I should post the other routines that the script uses to establish
this, I dont know if that will help.
the following are from links.def
# Field Number of some important fields. The number is from %db_def above
# where the first field equals 0.
$db_category = 4; $db_modified = 3; $db_url = 2;
$db_hits = 8; $db_monthhits = 9; $db_isnew = 10;
$db_ispop = 11;
$db_ismonthpop = 12; $db_contact_name = 6; $db_contact_email = 7;
$db_title = 1;
$db_votes = 14; $db_rating = 13; $db_mail = 15; $db_ishot
= 18;
$db_alt = 19;
# Field number to sort links by:
$db_sort_links = 1;
# Build up some variables from your definitions. Internal use only.
@db_cols = ();
foreach (sort { $db_def{$a}[0] <=> $db_def{$b}[0] } keys %db_def) {
push (@db_cols, $_);
$db_sort{$_} = $db_def{$_}[1];
$db_form_len{$_} = $db_def{$_}[2];
$db_lengths{$_} = $db_def{$_}[3];
$db_not_null{$_} = $db_def{$_}[4];
$db_defaults{$_} = $db_def{$_}[5];
$db_valid_types{$_} = $db_def{$_}[6];
($_ eq $db_key) and $db_key_pos = $db_def{$_}[0];
}
This is from db.utlis.pl along with the sub sort_link
sub array_to_hash {
# --------------------------------------------------------
# Converts an array to a hash using db_cols as the field names.
#
my ($hit, @array) = @_;
my ($i);
return map { $db_cols[$i] => $array[$hit * ($#db_cols+1) + $i++] } @_;
}
I am sure you can see by now that I am a complete novice at this, but I am
trying to grasp it :)
Thanks again for your time
Mark
------------------------------
Date: Thu, 01 Nov 2001 15:48:11 -0500
From: Terry <tdupuis@omafra.gov.on.ca>
Subject: help with simple script
Message-Id: <3BE1B50B.D936B3B5@omafra.gov.on.ca>
X-No-Archive: Yes
Hello,
Could someone help converting this to perlscript?
Thanks in advance,
Terry
==========================================
Dim domain1, domain2, domain3, domain4, refDomain
refDomain = Request.ServerVariables("HTTP_REFERER")
domain1 = inStr(refDomain,"http://www.abc.com")
domain2 = inStr(refDomain,"http://www.def.com")
domain3 = inStr(refDomain,"http://www.ghi.com")
domain4 = inStr(refDomain,"http://www.jkl.com")
If domain1 <> True And domain2 <> True And domain3 <> True And domain4
<> True Then
Response.Write("Error.<br><br>This script cannot be run from this
domain.")
Response.End
End If
------------------------------
Date: Thu, 01 Nov 2001 22:14:08 +0100
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: help with simple script
Message-Id: <3BE1BB20.4000705@post.rwth-aachen.de>
Terry wrote:
> X-No-Archive: Yes
>
> Hello,
>
> Could someone help converting this to perlscript?
You already asked that a couple of days ago and I received an answer.
[...]
Tassilo
--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};
------------------------------
Date: 1 Nov 2001 11:59:48 -0800
From: xotrm@yahoo.com (AVL)
Subject: Re: How can I fix this?
Message-Id: <b80a47eb.0111011159.3269a148@posting.google.com>
Hello. Please, could you explain it
a bit more, I really don't know Perl.
Thanks.
tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9tu4gu.vhj.tadmc@tadmc26.august.net>...
> AVL <xotrm@yahoo.com> wrote:
>
> > Subject: How can I fix this?
>
>
> use CGI;
>
>
> for parsing form data.
------------------------------
Date: Thu, 01 Nov 2001 12:01:38 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: How can I fix this?
Message-Id: <3BE1AA22.93FE7ADB@vpservices.com>
[please put your comments *after* the things they comment on]
[post rearranged as if that had already been done]
AVL wrote:
>
> tadmc@augustmail.com (Tad McClellan) wrote in message > news:<slrn9tu4gu.vhj.tadmc@tadmc26.august.net>...
> >
> > AVL <xotrm@yahoo.com> wrote:
> >
> > > Subject: How can I fix this?
> >
> >
> > use CGI;
> >
> >
> > for parsing form data.
>
> Hello. Please, could you explain it
> a bit more, I really don't know Perl.
It means there is already a module used for parsing CGI scripts. It is
called CGI.pm. If you put the line "use CGI;" at the top of your script
you can then use all of the methods of that module. To find out what
those methods are and how to use them, read the documentation for CGI.pm
which almost certainly came included with your version of perl.
--
Jeff
------------------------------
Date: Thu, 01 Nov 2001 22:02:43 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How can I fix this?
Message-Id: <slrn9u3dvs.9ic.tadmc@tadmc26.august.net>
[ Please have a look at:
http://mail.augustmail.com/~tadmc/clpmisc.shtml
Text rearranged.
]
AVL <xotrm@yahoo.com> wrote:
>tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9tu4gu.vhj.tadmc@tadmc26.august.net>...
>> AVL <xotrm@yahoo.com> wrote:
>>
>> > Subject: How can I fix this?
>>
>>
>> use CGI;
>>
>>
>> for parsing form data.
>Hello. Please, could you explain it
>a bit more, I really don't know Perl.
Installed along with 'perl' itself is a program called 'perldoc'.
You can use it to look stuff up in the over 1000 "pages" of
documentation that you also got with the perl distribution.
The -q switch has perldoc look up Frequently Asked Questions for you:
perldoc -q CGI
How can I generate simple menus without using CGI or Tk?
How can I make my CGI script more efficient?
Where can I learn about CGI or Web programming in Perl?
My CGI script runs from the command line but not the
browser. (500 Server Error)
How can I get better error messages from a CGI program?
How do I make sure users can't enter values into a form
that cause my CGI script to do bad things?
==> How do I decode a CGI form?
The answers to those (and more) are already on your hard disk,
all you have to do is read them.
perldoc not only looks stuff up in the "standard" documentation,
it is smart enough to look up the docs for modules that have
been installed on your system too. To see the docs for the
CGI module:
perldoc CGI
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 01 Nov 2001 21:54:11 GMT
From: "Pujo C A" <adustipujo1@mediaone.net>
Subject: how to detect broken link
Message-Id: <7wjE7.59299$bK.648020@typhoon.mw.mediaone.net>
Hi,
I am trying to make a bots , but I encounter a new problem. with a broken
link the LWP::simple is not doing very good job.
So I wonder is there any way that I can sense that first.
thanks
--
Pujo C Agustiyanto
http://www.geocities.com/pujoca
<!-- Veryly man is in loss if they gain the same today and think not to be
better tomorrow -->
------------------------------
Date: Thu, 01 Nov 2001 16:01:40 -0600
From: brian d foy <comdog@panix.com>
Subject: Re: how to detect broken link
Message-Id: <comdog-78D292.16014001112001@news.panix.com>
In article <7wjE7.59299$bK.648020@typhoon.mw.mediaone.net>, "Pujo C A"
<adustipujo1@mediaone.net> wrote:
> I am trying to make a bots , but I encounter a new problem. with a broken
> link the LWP::simple is not doing very good job.
> So I wonder is there any way that I can sense that first.
well, you could try HTTP::SimpleLinkChecker, but it might make more
sense to investigate a link when LWP::Simple returns undef rather
than before every use of it. :)
--
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html
------------------------------
Date: Thu, 1 Nov 2001 16:39:55 -0500
From: "xin" <shenxin@sympatico.ca>
Subject: It works, but why do you put "/dev/null" at the end?
Message-Id: <X9jE7.21696$8D4.3463857@news20.bellglobal.com>
------------------------------
Date: Thu, 1 Nov 2001 16:53:40 -0500
From: "xin" <shenxin@sympatico.ca>
Subject: Re: It works, but why do you put "/dev/null" at the end?
Message-Id: <QmjE7.21705$8D4.3472865@news20.bellglobal.com>
Sorry, I paste it at the wrong place because I am new on newsgroups.
"xin" <shenxin@sympatico.ca> wrote in message
news:X9jE7.21696$8D4.3463857@news20.bellglobal.com...
>
>
>
------------------------------
Date: Thu, 1 Nov 2001 22:48:05 +0200
From: "Stuart Gall" <stuart@otenet.gr>
Subject: Re: Leftmost SHORTEST
Message-Id: <9rsdku$f4t$1@usenet.otenet.gr>
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrn9u32ke.8pt.tadmc@tadmc26.august.net...
> Zilt <zilt@iname.com> wrote:
>
> >in comp.lang.perl (searched with google).
>
>
> The comp.lang.perl newsgroup was removed about *6 years* ago!
>
It is still going stong on many news servers. How can a newsgroup be
removed?
--
Stuart Gall
------------------------------------------------
This message is not provable.
------------------------------
Date: Thu, 01 Nov 2001 22:02:45 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Leftmost SHORTEST
Message-Id: <slrn9u3ev3.9ic.tadmc@tadmc26.august.net>
Stuart Gall <stuart@otenet.gr> wrote:
>"Tad McClellan" <tadmc@augustmail.com> wrote in message
>news:slrn9u32ke.8pt.tadmc@tadmc26.august.net...
>> Zilt <zilt@iname.com> wrote:
>>
>> >in comp.lang.perl (searched with google).
>>
>> The comp.lang.perl newsgroup was removed about *6 years* ago!
>
>It is still going stong on many news servers.
Many news servers are configured incorrectly. There are lots
and lots of unclued, lazy, or busy news admins in the world.
The important thing to keep in mind is that the clued members
of the Perl community know that it is defunct, so they don't
go there. You can make your own deductions about the
clue level of any answerers who might be there. :-)
Some readers of _this_ newsgroup even use the presence of
comp.lang.perl in the Newsgroups header for their score files.
You are greatly reducing the readership of your articles by
posting or cross-posting to a defunct newsgroup.
>How can a newsgroup be
>removed?
How Usenet works is hardly on topic in a Perl programming
newsgroup. It has been discussed here a bunch of times
before, no point in repeating it (long URL wrapped):
http://groups.google.com/groups?as_q=rmgroup%20comp.lang.perl&
as_ugroup=comp.lang.perl.misc
You can also ask your Usenet question in a Usenet newsgroup,
such as the new.admin.* newsgroups or the news.answers newsgroup.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 01 Nov 2001 15:18:42 -0600
From: cpryce <cpryce@pryce.net>
Subject: Re: ms-word doc's & perl
Message-Id: <B8071851.216E%cpryce@pryce.net>
in article 3BDEF050.E289EA53@mail.uca.edu, Cameron Dorey at
camerond@mail.uca.edu wrote on 10/30/01 12:24 PM:
> peter wrote:
>>
>> hi,
>> i am required to create very verbose m$-word doc's for the project i am
>> on. these doc's are created from a m$-word template and alot of the
>> work necesary is repeatative and tedious. if they were UNIX doc's, i
>> could set something up to search/substitute keywords with the specific
>> phrases needed.
>>
>> i looked at the m$-word doc's w/ vim and there is virtually no way, i
>> can see, to decode them into "key words" as i would like.
>
> Figure out what you want to automate, record a macro in Word (WARNING:
> VB here), then translate it into Perl using Win32::OLE to run M$Word.
> It's not all that hard, particularly if you just want to insert
> words/phrases at specific points from a database or other text file.
You might look at Word's Data Merge functions. Basically, you would use Perl
on the Unix to create a tab or comma delimited data file, and then mark-up
the Word template with field codes. I'm sure that if you search the help
files in word for data merge, you will come up with a solution that doesnıt
involve VB/macros.
cp
------------------------------
Date: Thu, 01 Nov 2001 15:47:21 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: ms-word doc's & perl
Message-Id: <3BE1C2E9.DDCDBC09@mail.uca.edu>
cpryce wrote:
>
> You might look at Word's Data Merge functions. Basically, you would use Perl
> on the Unix to create a tab or comma delimited data file, and then mark-up
> the Word template with field codes. I'm sure that if you search the help
> files in word for data merge, you will come up with a solution that doesnıt
> involve VB/macros.
Macros are the mechanism by which M$Word is automated. No, you don't
have to _use_ VB, but if you record your keystrokes to perform a task,
they are recorded as VB statements. You can do any (AFAIK) of these
statements in Perl using Win32::OLE, but you get what you have to do
from the VB you recorded.
Why would you use a Unix box for your Perl when you are going to have to
use Window$ to run Word in the first place? This is making things
unnecessarily complicated. He never said he had to do this on networked
computers. You can set up your database/file/whatever on a Window$
computer just as easily.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Thu, 1 Nov 2001 14:37:32 -0600
From: "Edgar Avila" <avila_edgar@hotmail.com>
Subject: Re: Need advice on getting off a SIGTTIN signal from my script.
Message-Id: <xpiE7.18$hy.13143@nn1-lan0.avantel.net.mx>
I really appreciate your help... it's done
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
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 V10 Issue 2049
***************************************