[22942] in Perl-Users-Digest
Perl-Users Digest, Issue: 5162 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 1 11:06:18 2003
Date: Tue, 1 Jul 2003 08:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 1 Jul 2003 Volume: 10 Number: 5162
Today's topics:
Child signal behaviour on HPUX (Jorge)
Devel::Coverage (Himal)
Re: Fast CGI Vs Java Application Servers <cwilbur@mithril.chromatico.net>
Re: foreach county <corporate@scriptsmiths.com>
fork, childs, zombies, start a process in the backgroun (Rex Gustavus Adolphus)
Re: fork, childs, zombies, start a process in the backg (Greg Bacon)
funny printf behaviour in need of explanation (Dov Levenglick)
Re: funny printf behaviour in need of explanation news@roaima.freeserve.co.uk
Re: How do you sort a 2D array with column headers? (John D)
How to deal with Debug information in a large program. <pengtaoli@hotmail.com>
Re: How to deal with Debug information in a large progr <scriptyrich@yahoo.co.uk>
include ASP scripts in PERL (wimf)
Re: include ASP scripts in PERL <richard@zync.co.uk>
Re: Is there a good free/not so expensive Perl IDE for <scriptyrich@yahoo.co.uk>
Re: need a cheap JOIN on 3 large tables under Win32 <zawrotny@jaguar.sb.fsu.edu>
Re: Q: detect non-existent hash entries w/function? <nobull@mail.com>
Re: Q: detect non-existent hash entries w/function? <cwilbur@mithril.chromatico.net>
What are 'Perl 5 style templates'? <kasp@epatra.com>
Re: What are 'Perl 5 style templates'? (Greg Bacon)
Re: What are 'Perl 5 style templates'? <abigail@abigail.nl>
Re: What are 'Perl 5 style templates'? <mjcarman@mchsi.com>
Re: What are 'Perl 5 style templates'? <kasp@epatra.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Jul 2003 05:38:57 -0700
From: jom_es@yahoo.es (Jorge)
Subject: Child signal behaviour on HPUX
Message-Id: <f580ae77.0307010438.3271371f@posting.google.com>
All,
I've got a process that creates some children and want to be alerted
when they die. To do this, the SIGCHLD signal is registered in the
process using sigaction to jump to a subprogram as soon as it's
received.
The problem comes when many children exit at the same time and their
father seems to miss some of them. This happens quite often, but not
always.
Why are the signals being missed? I'm pretty sure it's something with
the flags on sigaction, but I've tryed several options and it's always
the same.
I appreciate your suggestions. Thanks in advance.
PS: Perl 2.5.1, hpux 11.00
CODE----------------
#!/bin/env perl
use strict;
use POSIX;
# empty set
my $sigset = POSIX::SigSet->new;
# sigaction structure
my $newaction = POSIX::SigAction->new( 'my_handler', $sigset,
SA_NODEFER);
my $oldaction = POSIX::SigAction->new;
my $return;
sub my_handler
{
my($sig) = @_;
my($hpid) = wait();
$return = POSIX::WEXITSTATUS($?);
print "Im $$. Caught a SIG$sig from $hpid returning $return\n";
sleep(10);
print "Ending handler of $hpid\n";
}
sigaction(SIGCHLD, $newaction, $oldaction);
if (!fork())
{
print "Im $$ sleeping 3 s\n";
sleep(3);
print "Im $$ returning 7\n";
exit(7);
}
if (!fork())
{
print "Im $$ sleeping 3 s\n";
sleep(3);
print "Im $$ returning 7\n";
exit(7);
}
if (!fork())
{
print "Im $$ sleeping 3 s\n";
sleep(3);
print "Im $$ returning 7\n";
exit(7);
}
if (!fork())
{
print "Im $$ sleeping 3 s\n";
sleep(3);
print "Im $$ returning 7\n";
exit(7);
}
if (!fork())
{
print "Im $$ sleeping 3 s\n";
sleep(3);
print "Im $$ returning 7\n";
exit(7);
}
print "Im father process $$\n";
sleep(20);
exit(0);
SOME CUT&PASTE FROM THE TERM---------- as you can see only 4 signals
out of 5 are detected
$ dwmanager_v4_en.pl
Im 6406 sleeping 3 s
Im 6407 sleeping 3 s
Im 6408 sleeping 3 s
Im 6409 sleeping 3 s
Im father process 6405
Im 6410 sleeping 3 s
Im 6406 returning 7
Im 6405. Caught a SIGCHLD from 6406 returning 7
Im 6408 returning 7
Im 6407 returning 7
Im 6409 returning 7
Im 6405. Caught a SIGCHLD from 6409 returning 7
Im 6410 returning 7
Im 6405. Caught a SIGCHLD from 6408 returning 7
Im 6405. Caught a SIGCHLD from 6410 returning 7
Ending handler of 6410
Ending handler of 6408
Ending handler of 6409
Ending handler of 6406
$
------------------------------
Date: 1 Jul 2003 07:56:52 -0700
From: himal5@hotmail.com (Himal)
Subject: Devel::Coverage
Message-Id: <365e1935.0307010656.8378c1d@posting.google.com>
Hi all,
I am new to using Perl and am trying to do some coverage analysis.
When I do
perl -d:Coverage temp.pl
I get Cant locate Devel/Coverage.pm. What should I do for this.
Also do I alway have to do
perl -d:Coverage temp.pl
to get/update the .cvp file.
Thanks for any input.
himal.
------------------------------
Date: Tue, 01 Jul 2003 12:44:30 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: Fast CGI Vs Java Application Servers
Message-Id: <87brwexw81.fsf@mithril.chromatico.net>
paul@boddie.net (Paul Boddie) writes:
> ctcgag@hotmail.com wrote in message
> news:<20030630120924.209$qh@newsreader.com>...
> > Switching a working application to a new language is about the
> > greatest possible crime there is against code reuse.
>
> "We believe in code reuse. Apart from the system we just threw away,
> of course."
It's also possible that the old application just barely works, and
that it will take more work to bolt new things onto the side of it
than to rewrite it from scratch. If we're talking about a 15-year-old
C application that had a web interface bolted onto it a few years
back and which has been undergoing continual change and occasional
expansion, I could certainly see a case for rewriting the whole mess.
Charlton
------------------------------
Date: Tue, 1 Jul 2003 16:19:00 +0200
From: "Mark Hewitt" <corporate@scriptsmiths.com>
Subject: Re: foreach county
Message-Id: <3f0197a7$0$227@hades.is.co.za>
"Todd Anderson" <todd@asgweb.net> wrote in message
news:3F00692D.48B8C073@asgweb.net...
> Dear Persons,
> The code below doesn't work on some computers. The county list isn't
> being displayed. I can't firgure out why it would on most computers but
[snip]
> sub Chooser_page {
> if($name eq "Defaults"){ @counties = split (/\,/, $Defaults); }
> if($name eq "Trustees"){ @counties = split (/\,/, $Trustees); }
> if($name eq "Fsbos"){ @counties = split (/\,/, $Fsbos); }
>
And what if $name does not contain any of those three values you check for?
Then what will @counties contain? Same goes for $Defaults,$Trustees,$Fsbos
you sure they contain valid data?
Perhaps one of there have bad data in them, hence countries array is empty
and nothing get printed? (depending on what you mean by "doesn't work" of
course!)
Maybe put in some error checking, or default mechanism to fall back on if
$name does not contain what you except
Also, drop the \, you don't need to escape comma's in regular expressions,
more readable this way!
if ( $name eq "Defaults" ) { @counties = split ( /,/ , $Defaults ); }
[snip]
Thanks,
Mark
---------------------------------------------------------------------------
Windows, Linux and Internet Development Consultant
Email: corporate@scriptsmiths.com
Web: http://www.scriptsmiths.com
---------------------------------------------------------------------------
------------------------------
Date: 1 Jul 2003 04:48:55 -0700
From: uffesterner@spamhole.com (Rex Gustavus Adolphus)
Subject: fork, childs, zombies, start a process in the background without waiting for it
Message-Id: <c70a85ff.0307010348.69336671@posting.google.com>
Hi
I have a parent program, that should loop (eternally), and start other
programs without waiting for them, so many programs can be started at
the same time by the parent.
Is it true that it's not necessary to handle childsignals if you use
this type of logic when you fork processes:
if ($pid = fork) {
# parent
} elsif (defined $pid) {
# child
exec $agent
or die "Can't do $agent";
} else {
# fork error
die "can't fork\n";
}
------------------------------
Date: Tue, 01 Jul 2003 14:00:21 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: fork, childs, zombies, start a process in the background without waiting for it
Message-Id: <vg34vlkjvc5b61@corp.supernews.com>
In article <c70a85ff.0307010348.69336671@posting.google.com>,
Rex Gustavus Adolphus <uffesterner@spamhole.com> wrote:
: I have a parent program, that should loop (eternally), and start other
: programs without waiting for them, so many programs can be started at
: the same time by the parent.
Careful not to create a forkbomb. :-)
: Is it true that it's not necessary to handle childsignals if you use
: this type of logic when you fork processes:
:
: if ($pid = fork) {
: # parent
: } elsif (defined $pid) {
: # child
: exec $agent
: or die "Can't do $agent";
: } else {
: # fork error
: die "can't fork\n";
: }
According to the perlipc manpage, it might even be easier, depending
on your surroundings:
On most Unix platforms, the CHLD (sometimes also known
as CLD) signal has special behavior with respect to a
value of 'IGNORE'. Setting $SIG{CHLD} to 'IGNORE' on
such a platform has the effect of not creating zombie
processes when the parent process fails to wait() on
its child processes (i.e. child processes are
automatically reaped). Calling wait() with $SIG{CHLD}
set to 'IGNORE' usually returns -1 on such platforms.
Greg
--
Ideologically [sound money] belongs in the same class with political
constitutions and bills of rights.
-- Ludwig von Mises, *The Theory of Money and Credit*
------------------------------
Date: 1 Jul 2003 06:20:19 -0700
From: stam_doar@hotmail.com (Dov Levenglick)
Subject: funny printf behaviour in need of explanation
Message-Id: <8ebf3385.0307010520.5ff0e1e4@posting.google.com>
Hi,
i am attaching a snippet of code and two results that it produces. the
first result is when the printf line is not commented out while the
second result is when the line is commented. the code was run on a
UNIX station running SunOS 5.8
result #1:
big_endian: 123456 78
big_endian: 1234 7856
big_endian: 12 785634
big_endian: 0 78563412
Result: 12345678 78563412
result #2:
Result: 12345678 ffffffff
i am aware that $a reaches the value of 0 only after many divisions by
256 (since divisions are in floating point context) and therefore
$result reaches Infinity (hence ffffffff), my question is how and why
does the printf change the context of $a from floating point to
integer.
btw, i am aware that "use integer" or $a=int($a/256)" would avoid the
problem as well, therefore please dont offer them as an answer to my
question.
my $a = 0x12345678;
$b = &big_endian($a);
printf ("Result: %x %x\n",$a,$b);
sub big_endian {
my $data = shift;
my $result = 0;
while ($data) {
$result *= 256;
$result += $data%256;
$data /= 256;
printf "big_endian: %x %x\n",$data,$result;
} return ($result);
}
------------------------------
Date: Tue, 1 Jul 2003 15:21:27 +0100
From: news@roaima.freeserve.co.uk
Subject: Re: funny printf behaviour in need of explanation
Message-Id: <70i8t-4oe.ln1@moldev.cmagroup.co.uk>
Dov Levenglick <stam_doar@hotmail.com> wrote:
> i am attaching a snippet of code and two results that it produces
> [... on] SunOS 5.8
> result #1:
> Result: 12345678 78563412
> result #2:
> Result: 12345678 ffffffff
Using perl 5.005_03, as provided with Solaris 8, I too get these
results. However, running against 5.8.0 (compiled using gcc 3.3 from
sunfreeware.com) I get this regardless of whether the debugging printf
is used or not:
Result: 12345678 ffffffff
I know this doesn't answer your actual question, but maybe installing
5.8.0 (alongside 5.005_03) may be an option for you.
Chris
--
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
------------------------------
Date: 1 Jul 2003 07:52:34 -0700
From: johndageek@yahoo.com (John D)
Subject: Re: How do you sort a 2D array with column headers?
Message-Id: <c608545f.0307010652.6b90e1c1@posting.google.com>
Dennis@NoSpam.com wrote in message news:<95prfvg1r96onjgq0h3bbevdqre832ecsc@4ax.com>...
> I have a numerical array consisting of 5000 rows and 30 columns. The first row
> consists of 30 ascii column labels for example L1,L2.....L30. I would like to
> sort the column with the header L5 in ascending order leaving the header labels
> intact on the first row.
>
> I'm familiar with code
>
> @array =sort { $a->[1] <=> $b->[1]} @array;
>
> and I have read the perdoc -f sort.
>
> But the code above doesn't allow me to sort the array by column labels.
>
> How would I do that?
>
>
> Any help would be appreciated.
>
> Dennis
Just for grins, here is another way (hope it helps)
- if column name is passed in , you will need to scan your first row
to set your subscript for column_to_sot_by
use strict;
my $col_to_sort_by = "0";
my $ax;
my @idx;
my @sorted;
my @arrx = (["l1","l2","l3","l4","l5","l6"],
[1,2,3,4,5,6],
[6,5,4,3,2,1],
[3,4,5,6,1,2],
[2,1,6,5,4,3]);
print "\n\noriginal order\n";
foreach $ax (@arrx)
{
print "$ax->[0], $ax->[1], $ax->[2], $ax->[3], $ax->[4], $ax->[5],
$ax->[6]\n";
}
print "\n\nsorted by first column less first row\n";
## build an array to sort on from column to sort by
for (@arrx)
{
push @idx,$_->[$col_to_sort_by];
}
## sort by all but first column (assume you have column headers)
@sorted = @arrx[sort {$idx[$a] <=> $idx[$b]} 1 .. $#idx]; ## skip
first entry
unshift @sorted,$arrx[0]; ## prepend column headers
foreach $ax (@sorted)
{
print "$ax->[0], $ax->[1], $ax->[2], $ax->[3], $ax->[4], $ax->[5],
$ax->[6]\n";
}
Enjoy!
JD
------------------------------
Date: Tue, 1 Jul 2003 16:42:41 +0800
From: "Franklin Lee" <pengtaoli@hotmail.com>
Subject: How to deal with Debug information in a large program.
Message-Id: <bdrhib$gp2@netnews.proxy.lucent.com>
Hi All,
I'm in trouble with Debug information in a large program.
Some info I just want to print in degug phase.
Now I do as follow:
###########################################################
...
use vars qw($Debug);
$Debug ||= 0;
...
#Define option -D
$Debug=1 if(defined($opt{'D'});
...
#Print Debug info when necessary
if($Debug) {
print("Debug:xxxxxx\n");
}
############################################################
Do you think it's a good way to deal with Debug info.
Or do you have a better way to deal with it?
Any suggestions are welcome!
Thank you!
Franklin
------------------------------
Date: Tue, 01 Jul 2003 14:06:02 +0000
From: Rich <scriptyrich@yahoo.co.uk>
Subject: Re: How to deal with Debug information in a large program.
Message-Id: <bds0vf$76g$1@news7.svr.pol.co.uk>
Franklin Lee wrote:
> Hi All,
>
> I'm in trouble with Debug information in a large program.
> Some info I just want to print in degug phase.
> Now I do as follow:
> ###########################################################
> ...
> use vars qw($Debug);
> $Debug ||= 0;
>
> ...
> #Define option -D
> $Debug=1 if(defined($opt{'D'});
>
> ...
> #Print Debug info when necessary
> if($Debug) {
> print("Debug:xxxxxx\n");
> }
> ############################################################
>
> Do you think it's a good way to deal with Debug info.
> Or do you have a better way to deal with it?
>
> Any suggestions are welcome!
This will make your life hell in the long run, because it's an all or
nothing approach. As your codebase grows, you'll have more and more
debugging messages - many of which will be useless when you're trying to
debug specific problems.
Look at Log::Log4perl:
"Logging beats a debugger if you want to know what's going on in your code
during runtime. However, traditional logging packages are too static and
generate a flood of log messages in your log files that won't help you.
Log::Log4perl is different. It allows you to control the amount of logging
messages generated at three different levels:
At a central location in your system (either in a configuration file or in
the startup code) you specify which components (classes, functions) of your
system should generate logs.
You specify how detailed the logging of these components should be by
specifying logging levels.
You also specify which so-called appenders you want to feed your log
messages to ("Print it to the screen and also append it to /tmp/my.log")
and which format ("Write the date first, then the file name and line
number, and then the log message") they should be in.
This is a very powerful and flexible mechanism. You can turn on and off your
logs at any time, specify the level of detail and make that dependent on
the subsystem that's currently executed."
So, in my code I have lines such as:
Log::Log4perl->get_logger(__PACKAGE__)->debug
("conditionally creating home directory: $home") if DEBUG;
In my debug module (heavily edited):
our @EXPORT_OK = qw( DEBUG );
BEGIN
{
if ( $ENV{RIDAS_DEBUG} )
{
*DEBUG = sub () {1};
}
else
{
*DEBUG = sub () {0};
}
}
This now gives me control of the amount of debugging info emitted on a
module by module basis, specified by a simple Log4perl configuration file.
Having the "if DEBUG" conditional allows debugging calls to be optimized
away at compile time when not required, so performance does not suffer.
Sure, this seems like a hastle to begin with, and the Log::Log4perl docs are
heavy in places, but its a well designed framework, based off the widely
used and respected Java log4j project.
That's my suggestion anyway - it's worked very well for me, but others are
sure to have equally good ways of doing things :)
Cheers,
--
Rich
scriptyrich@yahoo.co.uk
------------------------------
Date: 1 Jul 2003 03:49:22 -0700
From: wimf@gmx.de (wimf)
Subject: include ASP scripts in PERL
Message-Id: <dcd2e192.0307010249.4747ccf7@posting.google.com>
hello everybody,
I want to include a ASP script in my PERL scripts (about 15 scripts).
Is it possible to execute ASP scripts within PERL?
If yes how?
My problem is that I have to include "checksession.asp" to make sure
that you can only access the PERL scripts after you are logged in my
application. (loggin in with ASP before).
If I can't execute the ASP script "checksession.asp" within PERL, is
there any (easy) way to retrieve the appropriate session variables
with PERL commands? If yes, how?
I really could need some help. Thank you in advance for your time.
------------------------------
Date: Tue, 01 Jul 2003 12:16:57 +0100
From: "Richard Gration" <richard@zync.co.uk>
Subject: Re: include ASP scripts in PERL
Message-Id: <20030701.121656.1544617505.1117@richg.zync>
In article <dcd2e192.0307010249.4747ccf7@posting.google.com>, "wimf"
<wimf@gmx.de> wrote:
> hello everybody,
> I want to include a ASP script in my PERL scripts (about 15 scripts).
> Is it possible to execute ASP scripts within PERL? If yes how?
Hi,
Perl is not capable of parsing and executing ASP scripts. You will need a
web server with an ASP module in it (eg. IIS or Apache with Chillisoft's
ASP module). When the ASP checksession script has successfully
authenticated the user it must hand over to a perl script. Off the top of
my head, you could HTTP redirect to the perl script or you could run the
perl script as an external process from within the asp script and collect
it's output. On *nix you could probably even exec the perl script.
The basic problem here is: Perl scripts run as CGI's, which have to produce
full html pages as output, whereas ASP is code mixed in with the html in the
pages and is parsed and executed by the webserver before it sends the page
out (the same principle as PHP).
HTH
Rick
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Tue, 01 Jul 2003 12:05:42 +0000
From: Rich <scriptyrich@yahoo.co.uk>
Subject: Re: Is there a good free/not so expensive Perl IDE for Linux
Message-Id: <bdrpts$29n$1@news7.svr.pol.co.uk>
Gary Blydenburgh wrote:
> OK... How about any similar to Komodo.
Well I'm going to rock the boat and try to give you a sensible answer (runs
for cover!)
http://www.perl.org.il/editors.html
Gives a list of IDEs, though most are Win32 only. There's also:
http://www.indigostar.com/perledit.html
But that appears to need Qt2 to work.
Also consider Eclipse with the epic plugin if you can put up with the time
it takes to load - in that respect it's just like Komodo:
http://e-p-i-c.sourceforge.net/main.html
From my limited experience, none were particularly great, which is why
vim/emacs may well be better in reality.
Cheers,
--
Rich
scriptyrich@yahoo.co.uk
------------------------------
Date: 1 Jul 2003 12:24:40 GMT
From: Michael Zawrotny <zawrotny@jaguar.sb.fsu.edu>
Subject: Re: need a cheap JOIN on 3 large tables under Win32
Message-Id: <slrnbg2vc8.l9o.zawrotny@jaguar.sb.fsu.edu>
On Tue, 01 Jul 2003 01:58:19 GMT, JT <woland99@earthlink.net> wrote:
> Howdy - I have three tab-delimited files that represent tables of
> records with 3 to 20 fields in them. Files have between 3K and 30K lines.
> I need to do JOIN operation on them with with all three tables.
> The easiest solution would be not to import the data into any database.
> I tried DBD::CSV driver but it is not able to handle the size of the data.
> Is SQLite capable of doing such task?
In my somewhat limited experience, yes. I've been using SQLite to
prototype an application that I may be working on. One of the queries
I've been running (using DBD::SQLite) does a join on six tables, two
of which have 7-10K rows and one has 25K. With a reasonable set of
indices, the program takes about 2 seconds to run and print out the
7K rows that match the query.
Mike
--
Michael Zawrotny
Institute of Molecular Biophysics
Florida State University | email: zawrotny@sb.fsu.edu
Tallahassee, FL 32306-4380 | phone: (850) 644-0069
------------------------------
Date: 01 Jul 2003 12:33:35 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Q: detect non-existent hash entries w/function?
Message-Id: <u9wuf2a3cg.fsf@wcl-l.bham.ac.uk>
tadmc@augustmail.com (Tad McClellan) writes:
> Daniel Friedman <danielf@erols.com> wrote:
>
> > my var1 = $_[0]; # maybe a scalar, maybe not
>
>
> No "maybe not" about it.
>
> If it starts with a dollar sign, it *is* a scalar.
Yes, this is so.
This is why I find the following annoying
my $glob;
my $r = \$glob;
print ref $r; # prints SCALAR
$glob = *FOO;
print ref $r; # prints GLOB
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 01 Jul 2003 12:59:30 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: Q: detect non-existent hash entries w/function?
Message-Id: <877k72xvnv.fsf@mithril.chromatico.net>
danielf@erols.com (Daniel Friedman) writes:
> I'm trying to figure out how to to detect non-existent hash entries
> via a function, something of this general nature:
If I understand what you're trying to do, why not just use
exists $hash{$key}
instead of creating a messy, complicated function to do the same thing?
Or, if you wanted to check multiple keys simply,
@nonexistent = grep { not exists $hash{$_} } @possible_keys;
Charlton
------------------------------
Date: Tue, 1 Jul 2003 16:42:17 +0530
From: "Kasp" <kasp@epatra.com>
Subject: What are 'Perl 5 style templates'?
Message-Id: <bdrqav$sj2$1@newsreader.mailgate.org>
My client wrote to me...
"All scripts must be written in perl 5. Use Perl 5 style templates for all
pages and emails associated with the perl scripts"
Can someone please mention a few good links for style templates? as I have
now idea what they mean.
TIA.
--
"Accept that some days you are the pigeon and some days the statue."
"A pat on the back is only a few inches from a kick in the butt." - Dilbert.
------------------------------
Date: Tue, 01 Jul 2003 13:56:40 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: What are 'Perl 5 style templates'?
Message-Id: <vg34oo6tvic906@corp.supernews.com>
In article <bdrqav$sj2$1@newsreader.mailgate.org>,
Kasp <kasp@epatra.com> wrote:
: My client wrote to me...
: "All scripts must be written in perl 5. Use Perl 5 style templates for
: all pages and emails associated with the perl scripts"
:
: Can someone please mention a few good links for style templates? as I
: have now idea what they mean.
I have no idea either. Perl culture isn't nearly as straightjacketed
as your client imagines. Perhaps he means the suggestions from the
perlstyle manpage?
http://www.perldoc.com/perl5.6/pod/perlstyle.html
Hope this helps,
Greg
--
While it may be gung-ho macho to strap on an assault rig and kick in a
door, is this really the America you want to live in?
-- Tim McVeigh in a letter to Soldier of Fortune
------------------------------
Date: 01 Jul 2003 14:03:22 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: What are 'Perl 5 style templates'?
Message-Id: <slrnbg3559.2vo.abigail@alexandra.abigail.nl>
Kasp (kasp@epatra.com) wrote on MMMDXCI September MCMXCIII in
<URL:news:bdrqav$sj2$1@newsreader.mailgate.org>:
"" My client wrote to me...
"" "All scripts must be written in perl 5. Use Perl 5 style templates for all
"" pages and emails associated with the perl scripts"
""
"" Can someone please mention a few good links for style templates? as I have
"" now idea what they mean.
"" TIA.
Why don't you ask your client? It would be quite embarrassing if someone
here told you what (s)he thinks Perl 5 style templates are, and they
turn out to be totally different from what your client thinks.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: Tue, 01 Jul 2003 08:22:42 -0500
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: What are 'Perl 5 style templates'?
Message-Id: <bds1v3$khv1@onews.collins.rockwell.com>
On 7/1/2003 6:12 AM, Kasp wrote:
> My client wrote to me...
> "All scripts must be written in perl 5. Use Perl 5 style templates for all
> pages and emails associated with the perl scripts"
>
> Can someone please mention a few good links for style templates? as I have
> now idea what they mean.
Then you shouldn't have pretended that you did. Did you *ask* your
client what they wanted? No? Then you have to guess, and it's quite
likely that you'll guess wrong.
Don't fall into the trap of wanting to impress your clients by appearing
as an Omnipotent Perl Master who doesn't need to ask any questions. Even
if you are one, they're not (or they wouldn't need your services). They
may not even know enough to properly express what they want. If nothing
else, they'll have a different perspective and express what they want in
a different vocabulary. So ask questions and make sure that you really
understand what it is they want before you start madly coding.
Now, as for templates...
There are no standard templates in the Perl community. The closest thing
that I can think of is the perlstyle manpage (perldoc perlstyle) but
that's more like a coding standard. Maybe that's what your client meant.
If not, and they really want you to follow a template, I would expect
them to provide it.
-mjc
------------------------------
Date: Tue, 1 Jul 2003 20:07:07 +0530
From: "Kasp" <kasp@epatra.com>
Subject: Re: What are 'Perl 5 style templates'?
Message-Id: <bds6aq$ifl$1@newsreader.mailgate.org>
Thanks people. I learnt my lesson.
That question simply came out due to lack of my experience or/and my
knowledge :)
--
"Accept that some days you are the pigeon and some days the statue."
"A pat on the back is only a few inches from a kick in the butt." - Dilbert.
------------------------------
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 5162
***************************************