[22785] in Perl-Users-Digest
Perl-Users Digest, Issue: 5006 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 19 14:06:06 2003
Date: Mon, 19 May 2003 11:05:14 -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 Mon, 19 May 2003 Volume: 10 Number: 5006
Today's topics:
Re: can't open perl script ??? <RJ-Gerry+news@wiu.edu>
Re: CGI Question: Submitting row in a form <nospam@raytheon.com>
Re: Help!: Error with 'Benchmark' module (entropy123)
Re: Help!: Error with 'Benchmark' module ctcgag@hotmail.com
Re: Help!: Hash or Array in this Situation? ctcgag@hotmail.com
How do I include a directory in the perl script? <rubberducky703@hotmail.com>
Re: How do I include a directory in the perl script? <nobull@mail.com>
Re: How do I pop this? <mark@nospam.com>
Re: How do I pop this? <nobull@mail.com>
Re: How do I pop this? <mbudash@sonic.net>
HTML formatting is wrong from my script.... (Jim Carter)
Re: making scalar variables from array elements, put in <nobull@mail.com>
Re: multiple sort subroutine (Quantum Mechanic)
Re: multiple sort subroutine <uri@stemsystems.com>
Re: Paths relative to a module <ben.goldberg@hotpop.com>
Re: Perl and MySQL <nospam@raytheon.com>
Re: perl to FTP ? <nospam@raytheon.com>
Re: PHP or Perl ? <kah@kahnews.cjb.net>
Re: PHP or Perl ? <postmaster@localhost.localdomain>
Re: PHP or Perl ? <jeremy@schoenhaar.com>
Re: PHP or Perl ? <wiz@wiz.wiz>
Re: PHP or Perl ? <spamblock@spamdetector.co.uk>
Re: PHP or Perl ? <spamblock@spamdetector.co.uk>
Re: PHP or Perl ? <duende_d@hotmail.com>
Re: why key is added to hash after defined ? <mpapec@yahoo.com>
Re: why key is added to hash after defined ? <mpapec@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 May 2003 10:34:42 -0500
From: Ryan Gerry <RJ-Gerry+news@wiu.edu>
Subject: Re: can't open perl script ???
Message-Id: <baatij$qfm$1@mail1.wiu.edu>
Can you provide the source code for your allform.pl script? Most likely
you are not printing the standard HTTP header which tells your browser
and web server how to interpret the rest of the output. Does your
script work from a command shell?
throni wrote:
> Hallo,
> ich habe folgendes Problem:
> wenn ich mein CGI Script "allform.pl" aufrufe, bekomme ich folgende
> Fehlermeldung:
>
> "The specified CGI application misbehaved by not returning a complete set of
> HTTP headers. The header it did return are:
>
> Can't open perl script "???????????????": Invalid argument."
>
> Kann mir bitte jemand helfen?
>
>
------------------------------
Date: Mon, 19 May 2003 11:33:19 -0500
From: Chris Olive <nospam@raytheon.com>
Subject: Re: CGI Question: Submitting row in a form
Message-Id: <1H7ya.3322$c6.3271@bos-service2.ext.raytheon.com>
Kevin Bass wrote:
> Hello:
>
> I am attempting to submit rows in a form individually. When the submit
> button is clicked,
> an individual row will be updated and the screen will return to its current
> state with the
> updated data from the submit. The submitted data is being stored in a
> database (Oracle).
>
> I have written the code that will handle this event but I am encountering
> problems. I can
> dynamically generate the form but the only the first submit works correctly.
> When I click the
> additional submits on the form (other then the first submit), they do not
> capture the data and return the prior data (if there was prior data sorted).
> So, in other words, only the first submit works and the others do not. How
> can I get pass this problem? If code is needed, please let me know. I hope
> that I am clear on this explanation. Thanks! Kevin
>
> -----------------------------------------
> | | | submit
> -----------------------------------------
> | | | submit
> -----------------------------------------
> | | | submit
> -----------------------------------------
> | | | submit
> -----------------------------------------
>
>
Dude, you're going to have to submit more than this cursory overview of
what you are attempting in order to get a clear answer. You may feel
you are making the right attempt at accomplishing this, but without some
code or a little more information, it's hard to say why it's not working.
Also, be aware that your problem may have absolutely nothing to do with
Perl (and very likely it DOESN'T, just sniffing at this), and many here
are a bit averse to dealing with CGI problems IN GENERAL, much less
those that have nothing to do with Perl. I don't mind. But others
sometimes do (and this isn't just my list), so just be aware of that
sentiment.
Assuming you are even using Perl for this solution, my gut feeling is
that somehow your form(s) are not set up properly to return the data as
you would expect. If you a ARE handing your data back correctly, then
you aren't interpretting it as you would like.
I'm sure help can be provided with more information provided.
Chris
-----
Chris Olive
Systems Consultant
Raytheon Technical Services Corporation
Indianapolis, IN
email: olivec(AT)indy(DOT)raytheon(DOT)com
------------------------------
Date: 19 May 2003 09:06:57 -0700
From: email_entropy123@yahoo.com (entropy123)
Subject: Re: Help!: Error with 'Benchmark' module
Message-Id: <90cdce37.0305190806.2374cfd1@posting.google.com>
here is my code, it is straight from the 'Mastering Algorithms with Perl' book....
Appreciate it if you look it over and find my error...
Matt
#!/usr/bin/perl -w
use strict;
use diagnostics;
use Benchmark;
sub quadtratic { #Compute the larger root of a quadtratic polynomial
my ($a, $b, $c) = @_;
return (-$b + sqrt($b*$b -4*$a*$c))/2*$a;
}
sub bruteforce { #Search linearly until we find a good enough choice
my ($low, $high) = @_;
my $x;
for ($x = $low; $x <= $high; $x += .001) {
return $x if abs($x * ($x+1)- .999) < .001;
}
}
timethese(10000, {quadratic => 'quadratic(1, 1, -1)',
bruteforce => 'forloop(0, 1)' });
------------------------------
Date: 19 May 2003 16:10:37 GMT
From: ctcgag@hotmail.com
Subject: Re: Help!: Error with 'Benchmark' module
Message-Id: <20030519121037.366$sD@newsreader.com>
email_entropy123@yahoo.com (entropy123) wrote:
> here is my code, it is straight from the 'Mastering Algorithms with Perl'
> book....
>
> Appreciate it if you look it over and find my error...
Is this a joke?
> timethese(10000, {quadratic => 'quadratic(1, 1, -1)',
> bruteforce => 'forloop(0, 1)' });
^^^^^^^
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: 19 May 2003 16:22:34 GMT
From: ctcgag@hotmail.com
Subject: Re: Help!: Hash or Array in this Situation?
Message-Id: <20030519122234.906$15@newsreader.com>
email_entropy123@yahoo.com (entropy123) wrote:
> >
> > By:
> >
> > a) copying (deeply) the data strucure, then deleteing the reference
> > from the copy once it's been traversed once.
> > b) creating a hash of links to pretend you don't see, or
> > c) deleting the reference from the original, assuming you don't mind
> > being destructive.
> >
> >
>
> I've tried c with catastrophic results. How would I implement a or b?
Copy the structure according to:
perldoc -q copy
Or using this subroutine, which I nabbed off this group a while ago
(Randal, I think):
sub deep_copy {
my $this = shift;
if (not ref $this) {
$this;
} elsif (ref $this eq "ARRAY") {
[map deep_copy($_), @$this];
} elsif (ref $this eq "HASH") {
+{map { $_ => deep_copy($this->{$_}) } keys %$this};
} else { die "what type is $_?" }
}
Then, once you have my $new_hash = deep_copy(\%hash);
you simply implement c) above, but using and destroying
$new_hash in place of the original. (being mindful, of course,
that it's a requires dereferencing)
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: Mon, 19 May 2003 16:50:13 +0100
From: "Paul Tomlinson" <rubberducky703@hotmail.com>
Subject: How do I include a directory in the perl script?
Message-Id: <baaufn$qvelc$1@ID-116287.news.dfncis.de>
I am using a custom module, lets call it foo::bar its in the directory
c:\made\up\directory
I want to include this directory in the script, I am not running this code
from the command line i'm running it in Komodo and I need to resolve this
unfound library, how can I include this location in the perl script itself?
PT
------------------------------
Date: 19 May 2003 17:29:35 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How do I include a directory in the perl script?
Message-Id: <u9y912ew7k.fsf@wcl-l.bham.ac.uk>
"Paul Tomlinson" <rubberducky703@hotmail.com> writes:
> I am using a custom module, lets call it foo::bar its in the directory
> c:\made\up\directory
> I want to include this directory in the script, I am not running this code
> from the command line i'm running it in Komodo and I need to resolve this
> unfound library, how can I include this location in the perl script itself?
use lib
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 19 May 2003 10:53:23 -0500
From: Mark <mark@nospam.com>
Subject: Re: How do I pop this?
Message-Id: <fNOcnUeo075uYFWjXTWcoA@giganews.com>
I don't think stopping "top-posting" is a worthwhile endeavour -- I'd
analogize it to correcting other people's spelling mistakes. In reality, a
good order in which to read a chain of messages you are (even only
somewhat) familiar with is in reverse chronological order. The most recent
stuff is probably the most relevant. At bottom, it comes down to style and
bureaucratizing style is (at least) undemocratic and (at worst) autocratic.
tadmc@augustmail.com (Tad McClellan) wrote in
news:slrnbchk9g.21q.tadmc@magna.augustmail.com:
> http://web.presby.edu/~nnqadmin/nnq/nquote.html
------------------------------
Date: 19 May 2003 17:38:41 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How do I pop this?
Message-Id: <u9of1yevse.fsf@wcl-l.bham.ac.uk>
Mark <mark@nospam.com> writes:
> I don't think stopping "top-posting" is a worthwhile endeavour -- I'd
> analogize it to correcting other people's spelling mistakes.
A better analogy would be it's like correcting other people's driving
on the wrong side of the road.
[ Snip oft repeated minority view as to why top-posting is better ]
> At bottom, it comes down to style and bureaucratizing style is (at
> least) undemocratic and (at worst) autocratic.
So expecting everyone fall in line with what the majority consider
acceptable behaviour is undemocratic. Hmmmm....
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Mon, 19 May 2003 17:53:11 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: How do I pop this?
Message-Id: <mbudash-89A913.10531019052003@typhoon.sonic.net>
[top-posting corrected]
In article <fNOcnUeo075uYFWjXTWcoA@giganews.com>,
Mark <mark@nospam.com> wrote:
> tadmc@augustmail.com (Tad McClellan) wrote in
> news:slrnbchk9g.21q.tadmc@magna.augustmail.com:
>
> > http://web.presby.edu/~nnqadmin/nnq/nquote.html
>
> I don't think stopping "top-posting" is a worthwhile endeavour -- I'd
> analogize it to correcting other people's spelling mistakes. In reality,
perhaps in *your* reality
> a good order in which to read a chain of messages you are (even only
> somewhat) familiar with is in reverse chronological order. The most recent
> stuff is probably the most relevant. At bottom, it comes down to style and
> bureaucratizing style is (at least) undemocratic and (at worst) autocratic.
>
ofercrissakes... if you want this group's excellent assistance, don't
top post. otherwise, goodbye. it doesn't matter whether you agree or
not. get it?
--
Michael Budash
------------------------------
Date: 19 May 2003 10:58:38 -0700
From: carterave@yahoo.com (Jim Carter)
Subject: HTML formatting is wrong from my script....
Message-Id: <9c2a26b6.0305190958.4bd4cf4b@posting.google.com>
Hi all,
I want to show a file output (__DATA__ as shown below in the script)
in a html page. I have three cloumns and I am using tab as a split
seperator. However, the output formatting in the html page doen't look
correct (from my script).
The html page I get is like this:
-----------------------------------------------------------
1. test1 Unisted States C:\john\hello1.txt
C:\john\hello2.txt
2. test2 Russia C:\john\hello4.txt
C:\john\hello6.txt
C:\john\hello3.tx
C:\john\hello10.txt
3. test3 Italy C:\john\hello111.txt
4. test10 France
5. test20 Mexico C:\john\hello34.txt
C:\john\hello4.txt
C:\john\hello36.txt
C:\john\hello8.txt
C:\john\hello9.txt
C:\john\hello10.txt
6. test12 Saudi Arabia
7. test7 Germany
---------------------------------------------------------------
But the html page has to be as follows:
----------------------------------------------------------------
1. test1 Unisted States C:\john\hello1.txt
C:\john\hello2.txt
2. test2 Russia C:\john\hello4.txt
C:\john\hello6.txt
C:\john\hello3.tx
C:\john\hello10.txt
3. test3 Italy C:\john\hello111.txt
4. test10 France
5. test20 Mexico C:\john\hello34.txt
C:\john\hello4.txt
C:\john\hello36.txt
C:\john\hello8.txt
C:\john\hello9.txt
C:\john\hello10.txt
6. test12 Saudi Arabia
7. test7 Germany
-------------------------------------------------------------------
How can I get the exact output (from __DATA__ in the script) on the
html page?
Thanks in advance,
Jim
Here is my script:
-------------------------------------------------------------------
#! C:/perl/bin/perl
use CGI ':standard';
use CGI::Carp 'fatalsToBrowser';
print "<P><FONT color=brown size=5><STRONG>Keys and Files on <FONT
color=green>$time:</FONT></STRONG></FONT></P>";
print "<TABLE BORDER=3><TR>
<TH align=left> <FONT color=red>Key</FONT> </TH>
<TH align=left> <FONT color=red>Location</FONT> </TH>
<TH align=left><FONT color=red>Files </FONT></TH> </TR>";
foreach (<DATA>)
{
($key,$loc, $files);
($key, $loc, $files) = split (/\t/);
print "<TR>
<TD><FONT color=green size = 2>$key</FONT></TD>
<TD><FONT color=green size = 2>$loc</FONT></TD>
<TD><FONT color=blue size = 2><a href = $files> $files
</FONT></TD></TR>";
}
print "</TABLE>";
__DATA__
1. test1 Unisted States C:\john\hello1.txt
C:\john\hello2.txt
2. test2 Russia C:\john\hello4.txt
C:\john\hello6.txt
C:\john\hello3.tx
C:\john\hello10.txt
3. test3 Italy C:\john\hello111.txt
4. test10 France
5. test20 Mexico C:\john\hello34.txt
C:\john\hello4.txt
C:\john\hello36.txt
C:\john\hello8.txt
C:\john\hello9.txt
C:\john\hello10.txt
6. test12 Saudi Arabia
7. test7 Germany
----------------------------------------------------------------
------------------------------
Date: 19 May 2003 17:33:59 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: making scalar variables from array elements, put into table
Message-Id: <u9smraew08.fsf@wcl-l.bham.ac.uk>
lepore@brandeis.edu (bryan) writes:
> so i guess the simple question is, can i make scalar variables from
> array elements?
Array elements are scalar variables.
I suspect you are looking for symbolic references.
Stop doing so - just use a suitably shaped array.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 19 May 2003 10:09:48 -0700
From: quantum_mechanic_1964@yahoo.com (Quantum Mechanic)
Subject: Re: multiple sort subroutine
Message-Id: <f233f2f0.0305190909.70374d17@posting.google.com>
veky@cromath.math.hr (Veky) wrote in message news:<baaksq$46a$1@bagan.srce.hr>...
>
> http://www.perldoc.com/perl5.8.0/pod/perlfaq4.html
> #What's-wrong-with-always-quoting--%24vars--
>
> I suppose this is authoritative enough... :-)
What about composite keys, such as:
$y = 'abc';
$z = '123';
$x{$y,$z} = 'something';
When I look at this in the debugger, the key is shown as 'abc\c123'.
If later your code is not expecting the '\c' in the key, but expects
',' [comma], your code is broken. I've found that quoting the key
saves me some headaches when the keys are composited like this:
$x{"$y,$z"} = 'something';
[Note that in some cases it makes more sense to use $x{$y}{$z}
instead.]
-QM
------------------------------
Date: Mon, 19 May 2003 18:03:32 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: multiple sort subroutine
Message-Id: <x71xyuhkzw.fsf@mail.sysarch.com>
>>>>> "QM" == Quantum Mechanic <quantum_mechanic_1964@yahoo.com> writes:
QM> What about composite keys, such as:
QM> $y = 'abc'; $z = '123'; $x{$y,$z} = 'something';
QM> When I look at this in the debugger, the key is shown as
QM> 'abc\c123'.
that isn't composite keying but the old perl4 (and still supported)
pseudo multilevel hash. if you access a scalar element in a hash with a
list of keys, they are joined with $; (see perlvar) and used as a single
key.
QM> If later your code is not expecting the '\c' in the key, but
QM> expects ',' [comma], your code is broken. I've found that quoting
QM> the key saves me some headaches when the keys are composited like
QM> this:
QM> $x{"$y,$z"} = 'something';
that is just the same as assigning ',' to $;. don't guess about this
stuff. it is fully documented.
QM> [Note that in some cases it makes more sense to use $x{$y}{$z}
QM> instead.]
in most cases it does. then most common code for handling hash trees
will work. and you never have to worry about checking if the key
separator ($; or ',' in your case) is in any key. there is very little
use for the old multilevel hash thing now. i expect it will not be in
perl6 at all as it not very beneficial. there are a few places where it
could be useful (mostly for speed) but the gain is usually not worth the
extra code.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Mon, 19 May 2003 11:57:56 -0400
From: Benjamin Goldberg <ben.goldberg@hotpop.com>
Subject: Re: Paths relative to a module
Message-Id: <3EC8FF04.93BB7A9B@hotpop.com>
emcee wrote:
>
> Anno Siegel wrote:
> > It is an error to assume that the current directory of a job will
> > always be the directory where the executable lives. Sometimes it
> > is, sometimes it isn't. You want to store a file in a location other
> > than the current directory, which is independent of the location
> > of the script.
>
> In this case the current directory is the location of the script, its a
> cgi script and the server software should be configured to chdir to the
> proper directory before launching the script.
It can be, depending on your server software, but the CGI specification
does not require that this be possible.
> > Look up the %INC hash in perlvar. It contains the path names of all
> > modules that have been loaded.
>
> I'm using use lib to load the module, so all thats in $INC{'module'} is
> what I sent to use lib.
Actually, $INC{'module'} should probably contain the path you passed to
lib.pm, followed by "/module".
> >A bit of fiddling with File::Spec
> > should give you the directory where the module is located, so you
> > can create files there.
>
> Installing additional modules isn't really an option, since I will run
> it on a remote server where done have that permission.
Then it's a good thing that File::Spec is a standard module, isn't it?
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: Mon, 19 May 2003 11:23:20 -0500
From: Chris Olive <nospam@raytheon.com>
Subject: Re: Perl and MySQL
Message-Id: <Gx7ya.3320$c6.3261@bos-service2.ext.raytheon.com>
Prodigy wrote:
> Prodigy wrote:
>
>
>>I want Perl to connect to a MySQL database, get some data from it, handle
>>the data (do some things with it), and after these actions, store the data
>>back in the database.
>
>
> Thank you all for the responses. I took a look at CPAN, and found the
> Net::MySQL module with UNIX socket support, which seems to fit exactly for
> what I need. Furthermore, the CPAN page contains excellent support for the
> use of the module, which doesn't need more than a little perl and SQL
> knowledge. Anyone who wants to do the same as I do, take a look at
> Net::MySQL. Once again, thank you for the feedback.
>
> - Prodigy
The DBI interface can also connect to a remote MySQL database using the
"host=" clause in the DSN parameter of the DBI->connect() method...
Just so you know.
my $dbh = DBI->connect( "dbi:mysql:host=someremoteplace.com;db=mydb",
"mydb", "n0debacles" );
Connects to remote db over port 3306 (that can be changed if necessary).
Chris
-----
Chris Olive
Systems Consultant
Raytheon Technical Services Corporation
Indianapolis, IN
email: olivec(AT)indy(DOT)raytheon(DOT)com
------------------------------
Date: Mon, 19 May 2003 11:37:27 -0500
From: Chris Olive <nospam@raytheon.com>
Subject: Re: perl to FTP ?
Message-Id: <UK7ya.3323$c6.3258@bos-service2.ext.raytheon.com>
Travis wrote:
> Is there a way to use perl to allow a script to ftp images to the server?
>
> Travis
>
>
perldoc Net::FTP
Chris
-----
Chris Olive
Systems Consultant
Raytheon Technical Services Corporation
Indianapolis, IN
email: olivec(AT)indy(DOT)raytheon(DOT)com
------------------------------
Date: Mon, 19 May 2003 15:38:08 GMT
From: KAH <kah@kahnews.cjb.net>
Subject: Re: PHP or Perl ?
Message-Id: <Xns9380B3878AA3Fkahatkahnewsdotcjbdo@193.213.112.21>
"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in
news:ba828p$i57$1@nets3.rz.RWTH-Aachen.DE:
> It's both good as long as myscript.pl and myscript.php do the same
> thing. Beyond web-content and local maintenance (which I wouldn't
> consider typical domains of all-purpose languages, btw) I was thinking
> of something like
>
> http://bioperl.org
>
> It's a conclusive project insofar as it also includes the need for
> GUI-bindings, generic database support, CORBA server- and client-wise
> etc. Incidentally, bindings for this bio-informatics project also
> exist for Python and Java, in short: other all-purpose languages.
There exists support for GUIs, generic DB support, not sure what CORBA is,
but if it's network based or Open Source it'd be no problem to implement if
there's no support already.
There are some people working on integrating Java and PHP together, and
they seem to be progressing well.
The real difference between PHP and Perl on this level is that Perl has
been there longer and thus there are more Perl libraries out there than PHP
libs. Since you can implement pretty much anything in either languages,
it'd probably be better to look at code style, performance, etc. when
choosing between them.
KAH
------------------------------
Date: Mon, 19 May 2003 18:18:56 +0100
From: bengee <postmaster@localhost.localdomain>
Subject: Re: PHP or Perl ?
Message-Id: <Ap8ya.21280$9C6.1099378@wards.force9.net>
Anonymous Joe wrote:
>>>is IMHO easier for website developing than cgi/perl (or cgi in general
> for that matter)
>>
>>What about Perl ASP then?
>>
>>Ben
>>
>
> Yeah, what about that?
>
> Me thinks they are two seperate things there....not one thing called "PERL
> ASP"
>
> ASP is Microsoft's own bullshit to combat the widespread usage of free
> languages.
I was merely stating that Perl can be used as an ASP, as well as CGI.
Also, ASP can be used with Apache, so not sure if it's purely Micro$ofts.
Ben
------------------------------
Date: Mon, 19 May 2003 19:17:45 +0200
From: "Hilfe" <jeremy@schoenhaar.com>
Subject: Re: PHP or Perl ?
Message-Id: <3ec911ed$3@news.nefonline.de>
When it really come right down to it every language has it's plus and minus
points. What doesn't work so well in one languages works with an eas in
anouther! For that perpose my suggestion would be use whats easiest for you
for what you want to do!
Death
------------------------------
Date: Mon, 19 May 2003 17:25:34 +0000 (UTC)
From: wizard <wiz@wiz.wiz>
Subject: Re: PHP or Perl ?
Message-Id: <bab42e$vo8$2@bird.wu-wien.ac.at>
In alt.html bengee <postmaster@localhost.localdomain> wrote:
> I was merely stating that Perl can be used as an ASP, as well as CGI.
Do you, by any chance, know what CGI means?
And how the f*** Perl can be used as CGI?
--
wizard
------------------------------
Date: Mon, 19 May 2003 17:28:05 +0000
From: Isofarro <spamblock@spamdetector.co.uk>
Subject: Re: PHP or Perl ?
Message-Id: <574bab.ab1.ln@sidious.isolani.co.uk>
[I've put back two of the groups, just so there's some peer reviewing of my
comments allowing for corrections and suggestions where appropriate]
Tassilo v. Parseval wrote:
> There is a slight bias towards PHP on webhosts perhaps. Most of them
> however have at least both of them.
That's a pity really - I don't see many established web hosts offering
mod_perl. If that were available, I'd certainly opt for Perl rather than
PHP, purely because its much easier to do big web applications and portal
type applications with Perl.
PHP is a bit of a nightmare when the application grows. At least with Perl
the app can be broken down to a set of modules.
> Such developments are hard to anticipate. A while back it looked as
> though Tcl would be on its decay. And suddenly there seemed to be a
> revival of this language when no one expected it.
I am surprised by that. Tcl seems to be the innards of most enterprise level
content management systems at the moment, including Vignette StoryBoard.
IMO it doesn't have the ease of use as Perl and PHP. It may have merit as a
shell scripting tool.
> Perl6 is on its way and will eventually be a major rewrite.
Is there an English version of the Apocalypse speeches out there for us mere
mortals? Heck, all I need to be convinced of Perl 6 is much better/easier
OO infrastructure.
--
Iso.
FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com/
Recommended Hosting: http://www.affordablehost.com/
Web Standards: http://www.webstandards.org/
------------------------------
Date: Mon, 19 May 2003 18:34:09 +0000
From: Isofarro <spamblock@spamdetector.co.uk>
Subject: Re: PHP or Perl ?
Message-Id: <138bab.oe1.ln@sidious.isolani.co.uk>
bengee wrote:
> I was merely stating that Perl can be used as an ASP,
What? as a complete scripting language with all the modules, or just some
watered down inferior facsimilie of the real thing?
--
Iso.
FAQs: http://html-faq.com http://alt-html.org http://allmyfaqs.com/
Recommended Hosting: http://www.affordablehost.com/
Web Standards: http://www.webstandards.org/
------------------------------
Date: Mon, 19 May 2003 17:51:28 GMT
From: "Wipkip" <duende_d@hotmail.com>
Subject: Re: PHP or Perl ?
Message-Id: <AQ8ya.5066$rO.493569@newsread1.prod.itd.earthlink.net>
wizard wrote:
> In alt.html bengee <postmaster@localhost.localdomain> wrote:
>> I was merely stating that Perl can be used as an ASP, as well as CGI.
>
> Do you, by any chance, know what CGI means?
>
Can't Get In ;)
--
Duende
------------------------------
Date: Mon, 19 May 2003 19:11:16 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: why key is added to hash after defined ?
Message-Id: <1q3icvs2tvd357km08ucvgd09lirrjsf3v@4ax.com>
X-Ftn-To: Veky
veky@cromath.math.hr (Veky) wrote:
>|>|What I want to do is just check if $hash{foo1}{foo2}, which should be a
>|>|string has already been defined. But why it add a key in %hash ?
>|>|So what's the proper way of checking undef if I don't want to add any extra
>|>|key ?
>|>Test for defined $hash{foo1} && defined $hash{foo1}{foo2} ...
>|>this way, if there is no foo1 key in hash, short-circuiting of "&&" will
>| ^^^^^^^^^^^^^^^^^^^
>|Actually 'exists' does that, although defined is just fine most of the time.
>
>Yes, but original poster tested with defined, so I thought that would be
>fine for him...
You firstly wrote "defined $hash{foo1}" and after that "this way, if there
is no foo1 key in hash"
from which it can be concluded that first statement tests for existence of
'foo1' key.
On the other hand this is pretty irrelevant here since if $hash{foo1} is
undef there surely can't be no $hash{foo1}{mykey}
>BTW, my statement is mathematically correct. I said "if...then", and
>that direction really holds. I never said anything about the
>converse...:-)
I see, you're mathematician.. PMF? :)
--
Matija
------------------------------
Date: Mon, 19 May 2003 19:11:42 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: Re: why key is added to hash after defined ?
Message-Id: <hg0icvg9es5im0dea5djiau9vmrknorjpm@4ax.com>
X-Ftn-To: Steffen Beyer
"Steffen Beyer" <steffen.beyer@de.bosch.com> wrote:
>> >|So what's the proper way of checking undef if I don't want to add any extra
>> >|key ?
>> >
>> >Test for defined $hash{foo1} && defined $hash{foo1}{foo2} ...
>> >this way, if there is no foo1 key in hash, short-circuiting of "&&" will
>> ^^^^^^^^^^^^^^^^^^^
>>
>> Actually 'exists' does that, although defined is just fine most of the time.
>
>Actually "exists" doesn't save you from autovivification (at least not on
>my system, using Perl 5.8.0).
Yes, but I was referring to Veky's statement about verifying hash key
existence with "defined".
>You should test
>
>if (exists $hash{foo1} and exists $hash{foo1}{foo2}) { ... }
Sure thing; maybe Perl6 will save us from autovivification head cache(just
whishfull thinking <g>).
--
Matija
------------------------------
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 5006
***************************************