[19123] in Perl-Users-Digest
Perl-Users Digest, Issue: 1318 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 17 18:11:27 2001
Date: Tue, 17 Jul 2001 15:10:21 -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: <995407821-v10-i1318@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 17 Jul 2001 Volume: 10 Number: 1318
Today's topics:
Getting Date/Time of a file <john@trumpetweb.co.uk>
Re: Getting Date/Time of a file <john@trumpetweb.co.uk>
Re: Getting Date/Time of a file <tony_curtis32@yahoo.com>
Re: Getting Date/Time of a file <ren@tivoli.com>
Re: hiding user/password while connecting to FTP site nobull@mail.com
How to determine email quoting & level <sun_tong@users.sourceforge.net>
Re: How to determine email quoting & level <james@zephyr.org.uk>
Re: How to determine email quoting & level <sun_tong@users.sourceforge.net>
Re: How to run Perl on MS-DOS (Scott Porter)
Re: How to run Perl on MS-DOS (Tim Hammerquist)
Re: How to run Perl on MS-DOS <stumo@bigfoot.com>
Re: How to run Perl on MS-DOS (Harri Haataja)
Re: How to run Perl on MS-DOS <monty@primenet.com>
Re: How to stop the scrolling when I open a large text <iltzu@sci.invalid>
imanewbie <ted_godwin@mindspring.com>
Re: imanewbie <rsherman@ce.gatech.edu>
Re: imanewbie (Jay Tilton)
Re: imanewbie <philip@zaynar.demon.co.uk>
Re: imanewbie <ted_godwin@mindspring.com>
Re: Including flock in code while developing in Windows <godzilla@stomp.stomp.tokyo>
Re: Including flock in code while developing in Windows <godzilla@stomp.stomp.tokyo>
lib files stopped working <gbcren@mediaone.net>
Re: Looking for Usenet-->HTML script <iltzu@sci.invalid>
Re: Perl or PHP? <krahnj@acm.org>
Re: Perl or PHP? (Chris)
Re: please help urgent <gnarinn@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Jul 2001 18:46:17 GMT
From: "ffg" <john@trumpetweb.co.uk>
Subject: Getting Date/Time of a file
Message-Id: <ZJ%47.7566$FC5.993452@news1.cableinet.net>
Simple Question, hope the answers is too!
I want to get the date/time of a file. It's a backup file and I want to
display its date so that users can decide whether to restore it or not
Thanks in advance.
------------------------------
Date: Tue, 17 Jul 2001 18:51:20 GMT
From: "ffg" <john@trumpetweb.co.uk>
Subject: Re: Getting Date/Time of a file
Message-Id: <IO%47.7588$FC5.996940@news1.cableinet.net>
Don't Worry, I got It. Thanks.
"ffg" <john@trumpetweb.co.uk> wrote in message
news:ZJ%47.7566$FC5.993452@news1.cableinet.net...
> Simple Question, hope the answers is too!
>
> I want to get the date/time of a file. It's a backup file and I want to
> display its date so that users can decide whether to restore it or not
>
> Thanks in advance.
>
>
------------------------------
Date: 17 Jul 2001 13:54:27 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Getting Date/Time of a file
Message-Id: <87y9pnpesc.fsf@limey.hpcc.uh.edu>
>> On Tue, 17 Jul 2001 18:46:17 GMT,
>> "ffg" <john@trumpetweb.co.uk> said:
> Simple Question, hope the answers is too! I want to get
> the date/time of a file. It's a backup file and I want
> to display its date so that users can decide whether to
> restore it or not
"its date" is (very) ambiguous. Which "date" do you want?
In any case, see
perldoc File::stat
for atime, mtime and ctime (just make sure you realise
that ctime is not creation time).
Or...do you want the date that the file was backed up? If
so, your backup software may well have to maintain some
kind of database. That's another story in itself, so
let's leave that one dangling until there's some more info
on the table.
hth
t
--
Beep beep! Out of my way, I'm a motorist!
------------------------------
Date: 17 Jul 2001 13:49:18 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Getting Date/Time of a file
Message-Id: <m31ynfs85t.fsf@dhcp9-161.support.tivoli.com>
On Tue, 17 Jul 2001, john@trumpetweb.co.uk wrote:
> Simple Question, hope the answers is too!
As it happens, it's not just simply, it's Frequently Asked.
> I want to get the date/time of a file. It's a backup file and I want
> to display its date so that users can decide whether to restore it
> or not
Modern Perl installations include the "perldoc" command with the
capability of searching the Perl FAQs that are also included with
Perl.
In this case, running:
perldoc -q time
finds:
How do I get a file's timestamp in perl?
as the second hit. Check there for you answer.
> Thanks in advance.
Better would be to check the FAQ in advance.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 17 Jul 2001 17:31:12 +0100
From: nobull@mail.com
Subject: Re: hiding user/password while connecting to FTP site
Message-Id: <u9hewbmsa7.fsf@wcl-l.bham.ac.uk>
rene.nyffenegger@gmx.ch (Rene Nyffenegger) writes:
> Emmanuel E wrote:
> >one last thing that u can do is to embed the perl script into C and then
> >acess the encrypted file
>
> What can C do that perl can't regarding encrypted data?
Not encrypted data, hidden data.
A compiled binary executable (e.g. a C program) can have execute-only
permission.
An interpreted script cannot (under normal circumstances) have
execute-only permission.
You can get arround this using a SUID script.
If you use sperl and hack out the check that prevents you using sperl
on non-SUID scripts you don't even need to use an SUID script.
If you are using an SUID script anyhow you may as well leave the
script source readable and put the password in a file that's only
readable by the user to which the script SUIDs.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 17 Jul 2001 15:10:35 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: How to determine email quoting & level
Message-Id: <sa8puaza0kk.fsf@suntong.personal.users.sourceforge.net>
* Tong * <sun_tong@users.sourceforge.net> writes:
> Can you give me some suggestion on how to produce the colored mail
> quotations in Html pages, just like what the google news is doing?
>
> Any tips on the algorithm or points on the web is welcome. Thanks.
Hi,
Thanks every one who replied -- So it seems that no one has ever
done this in Perl before?
I'm trying to use the following RE to identify quote email lines:
((?:>|:|\S+>)\s*)+
This will identify the following sample quoting:
: > BtC> Can you ...
: > sure..
:
Please suggest that if this is appropriate, and most important, how
can I determine the quoting level? (Answer for above 3 lines would
be 3, 2 and 1)
Thanks
--
Tong (remove underscore(s) to reply)
*niX Power Tools Project: http://xpt.sourceforge.net/
- All free contribution & collection
------------------------------
Date: Tue, 17 Jul 2001 19:39:16 +0100
From: James Coupe <james@zephyr.org.uk>
Subject: Re: How to determine email quoting & level
Message-Id: <88o$yhkUZIV7EwZ3@gratiano.zephyr.org.uk>
In message <sa8puaza0kk.fsf@suntong.personal.users.sourceforge.net>, *
Tong * <sun_tong@users.sourceforge.net> writes
>Thanks every one who replied -- So it seems that no one has ever
>done this in Perl before?
Erm, you did read the replies you got didn't you?
--
James Coupe PGP Key: 0x5D623D5D
EBD690ECD7A1F
She twirled a lock of hair around her forefinger and smiled B457CA213D7E6
faintly. "Actually, I'd settle for a small Greek." 68C3695D623D5D
------------------------------
Date: 17 Jul 2001 18:46:33 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: Re: How to determine email quoting & level
Message-Id: <sa8lmln9qkm.fsf@suntong.personal.users.sourceforge.net>
James Coupe <james@zephyr.org.uk> writes:
> Erm, you did read the replies you got didn't you?
Erhhh, you meant this is not a perl question?
--
Tong (remove underscore(s) to reply)
*niX Power Tools Project: http://xpt.sourceforge.net/
- All free contribution & collection
------------------------------
Date: Tue, 17 Jul 2001 18:52:00 GMT
From: scott@nospamthankx.javascript-games.org (Scott Porter)
Subject: Re: How to run Perl on MS-DOS
Message-Id: <3b5488d0.3329656@news.freeserve.co.uk>
On Mon, 16 Jul 2001 09:40:10 +0100, "Stuart Moore" <stumo@bigfoot.com> wrote:
>Scott Porter <scott@nospamthankx.javascript-games.org> wrote in message
>news:3b5211a8.181348984@news.freeserve.co.uk...
>> This might sound silly, but you do realise you have to use the short (8+3)
>filenames
>> when moving between directories with cd? You can see the short names by using
>>
>> dir /X
>>
>> I hope this is right anyway - I only use NT5 and Linux, I've forgotten if
>Win98 is
>> the same as NT...
>
>cd "\my documents\" works fine for me in 98
Oops! I live and learn... Your example actually works in NT5 too. My excuse for this
is... erm... my mad linux skills have eroded my meagre knowledge of MS' strange and
unusual command-line. :-)
------------------------------
Date: Tue, 17 Jul 2001 19:54:37 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: How to run Perl on MS-DOS
Message-Id: <slrn9l96lr.uqm.tim@vegeta.ath.cx>
Me parece que Scott Porter <scott@nospamthankx.javascript-games.org> dijo:
> Oops! I live and learn... Your example actually works in NT5 too. My excuse for this
> is... erm... my mad linux skills have eroded my meagre knowledge of MS' strange and
> unusual command-line. :-)
I can sometimes feel my IQ dropping when in COMMAND.COM or CMD.EXE.
Does that happen to you too? =)
--
It is a fool's prerogative to utter
truths that no one else will speak.
-- Morpheus, The Sandman
------------------------------
Date: Tue, 17 Jul 2001 21:18:18 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Re: How to run Perl on MS-DOS
Message-Id: <e3157.44065$WS4.6821382@news6-win.server.ntlworld.com>
Tim Hammerquist <tim@vegeta.ath.cx> wrote in message
news:slrn9l96lr.uqm.tim@vegeta.ath.cx...
> Me parece que Scott Porter <scott@nospamthankx.javascript-games.org> dijo:
> > Oops! I live and learn... Your example actually works in NT5 too. My excuse
for this
> > is... erm... my mad linux skills have eroded my meagre knowledge of MS'
strange and
> > unusual command-line. :-)
>
> I can sometimes feel my IQ dropping when in COMMAND.COM or CMD.EXE.
> Does that happen to you too? =)
I find it raised, but that's compared to when I'm running Windows normally.
I find it ironic that as MS banish the command line, MacOS gains one (so I
believe)
------------------------------
Date: Tue, 17 Jul 2001 20:25:29 GMT
From: harri@haataja.net (Harri Haataja)
Subject: Re: How to run Perl on MS-DOS
Message-Id: <slrn9l9714.tk2.harri@tolppa.kotisivupalvelu.fi>
Tim Hammerquist wrote:
>Me parece que Scott Porter <scott@nospamthankx.javascript-games.org> dijo:
>> Oops! I live and learn... Your example actually works in NT5 too. My excuse for this
>> is... erm... my mad linux skills have eroded my meagre knowledge of MS' strange and
>> unusual command-line. :-)
>
>I can sometimes feel my IQ dropping when in COMMAND.COM or CMD.EXE.
>Does that happen to you too? =)
Well, it's not nearly as embarrassing as when you after a session in
those brain-fart by typing "dir" into a real shell or such.
--
And like the fellow said, the 911 is basically a pig and you can't
make a race horse out of a pig, but you can make a really fast pig.
-- RKMcF on alt.autos.porsche
------------------------------
Date: 17 Jul 2001 21:56:56 GMT
From: Jim Monty <monty@primenet.com>
Subject: Re: How to run Perl on MS-DOS
Message-Id: <9j2cb8$jgq$1@nnrp1.phx.gblx.net>
Tim Hammerquist <timmy@cpan.org> wrote:
> Scott Porter <scott@nospamthankx.javascript-games.org> wrote:
> > sam <jimstad@cyberway.com.sg> wrote:
> > > I have installed ActivePerl 5.6.1.628 MSI on Windows 98 from
> > > http://aspn.activestate.com . After I opened MS-DOS and type in cd
> > > C:\Perl.in. , it says invalid directory. Can anyone kindly help me on
> > > this?
> >
> > This might sound silly, but you do realise you have to use the short (8+3)
> > filenames when moving between directories with cd? You can see the short
> > names by using
> >
> > dir /X
> >
> > I hope this is right anyway - I only use NT5 and Linux, I've forgotten if
> > Win98 is the same as NT...
>
> Win98SE:
> C:\ > cd "\my documents"
> C:\My Documents > cd LongOneWordDirectory
> C:\My Documents\LongOneWordDirectory >
>
> My linux box is more flexible.
>
> [tim@vegeta ~]$ cd /mnt/c/My\ D<Tab>/LongOne<Tab><CR>
>
> bash's autocomplete is so nice when cruising the MS file structure!
Windows NT and 2000 have similar path/file name completion. Set
the value of the REG_DWORD CompletionChar in the registry key
HKEY_CURRENT_USER\Software\Microsoft\Command Processor to, say, 9
(TAB key). This works well for navigating Windows-ish "folders"
with names containing spaces.
See
<URL:http://www.zdnet.com/pcmag/pctech/content/solutions/uu1702a.htm>
or
<URL:http://www.bytamin-c.com/Howto/comlinecomplet.htm>
--
Jim Monty
monty@primenet.com
Tempe, Arizona USA
------------------------------
Date: 17 Jul 2001 20:14:02 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: How to stop the scrolling when I open a large text file
Message-Id: <995400430.9773@itz.pp.sci.fi>
In article <9it0ta$khmhs$1@ID-78052.news.dfncis.de>, hzi@uol.com.br wrote:
>
> My problem is that I've got this huge word list. Whenever I open it, it scrolls out of sight.
>I'd like to buffer it, in order to get the equivalent effect as in "ls -a|more" (GNU/Linux)
Okay, how about this:
open WORDS, "/usr/dict/words" or die $!;
open PAGER, "| more" or die $!;
print PAGER $_ or last while <WORDS>;
close PAGER or die "Pager failed ($?): $!\n";
Of course, the other solutions, which don't use an external program,
work too. But why reinvent the wheel, when you're bound to do it badly?
A good pager program will do a lot more than just <STDIN>.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: Tue, 17 Jul 2001 12:56:30 -0400
From: "TedWeb" <ted_godwin@mindspring.com>
Subject: imanewbie
Message-Id: <9j1qr9$ojv$1@slb6.atl.mindspring.net>
Hello everyone,
I am sending data to a perl script from a web-page using POST. The script
defines variables and prints out a response page. However, when the script
runs, the browser pops up a dialog box for saving a file??? I realize that
this is probably a rather simple problem with an evasive solution... can
someone help?
Many thanks,
TedWeb
------------------------------
Date: Tue, 17 Jul 2001 14:59:44 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: imanewbie
Message-Id: <3B540C90.E34B12B@ce.gatech.edu>
TedWeb wrote:
>
> Hello everyone,
>
> I am sending data to a perl script from a web-page using POST. The script
> defines variables and prints out a response page. However, when the script
> runs, the browser pops up a dialog box for saving a file??? I realize that
> this is probably a rather simple problem with an evasive solution... can
> someone help?
>
> Many thanks,
> TedWeb
not a perl problem (yet)...post to a cgi group, and when you do, post
your code or you won't get much help...
-rob
------------------------------
Date: Tue, 17 Jul 2001 19:38:06 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: imanewbie
Message-Id: <3b549350.109474299@news.erols.com>
On Tue, 17 Jul 2001 12:56:30 -0400, "TedWeb" <ted_godwin@mindspring.com>
wrote:
>Subject: imanewbie
In future, choose a subject that relates to the problem rather than to
yourself. A suject like that is useless. It will very likely cause your
question to be ignored.
>I am sending data to a perl script from a web-page using POST. The script
>defines variables and prints out a response page. However, when the script
>runs, the browser pops up a dialog box for saving a file???
The question has no content relating to Perl, and would be more appropriate
to comp.infosystems.www.authoring.cgi.
However, evidence suggests you're using MSIE, which is notorious for
ignoring a document's declared Content-type, preferring instead to act on
its own flawed intuition. If there is a solution, it's more likely to be
known by the readers of the previously mentioned group than to the readers
of this group.
------------------------------
Date: Tue, 17 Jul 2001 21:17:02 +0100
From: Philip Taylor <philip@zaynar.demon.co.uk>
Subject: Re: imanewbie
Message-Id: <GrOvgDA+0JV7Ewub@zaynar.demon.co.uk>
In article <9j1qr9$ojv$1@slb6.atl.mindspring.net>, TedWeb
<ted_godwin@mindspring.com> writes
>Hello everyone,
>
>I am sending data to a perl script from a web-page using POST. The script
>defines variables and prints out a response page. However, when the script
>runs, the browser pops up a dialog box for saving a file??? I realize that
>this is probably a rather simple problem with an evasive solution... can
>someone help?
>
>Many thanks,
>TedWeb
I think I've had this problem occasionally while using .pl files -- it
was fixed by converting them all to .cgi...
--
Philip Taylor
philip @ zaynar . demon . co . uk
http://robowarriors.ultrastore.com/legoworld.shtml
-- If the Earth was made of Lego...
------------------------------
Date: Tue, 17 Jul 2001 16:30:03 -0400
From: "TedWeb" <ted_godwin@mindspring.com>
Subject: Re: imanewbie
Message-Id: <9j27bv$os$1@slb0.atl.mindspring.net>
My apologies for the subject heading... it's as flawed my IE browser. It was
thought to be a Perl scripting problem which is why the message was posted
here. Nonetheless, greater attention will be given to all future scripting
problem posts. Thanks for the tip.
cheers,
TedWeb
"Jay Tilton" <tiltonj@erols.com> wrote in message
news:3b549350.109474299@news.erols.com...
> On Tue, 17 Jul 2001 12:56:30 -0400, "TedWeb" <ted_godwin@mindspring.com>
> wrote:
>
> >Subject: imanewbie
>
> In future, choose a subject that relates to the problem rather than to
> yourself. A suject like that is useless. It will very likely cause your
> question to be ignored.
>
> >I am sending data to a perl script from a web-page using POST. The script
> >defines variables and prints out a response page. However, when the
script
> >runs, the browser pops up a dialog box for saving a file???
>
> The question has no content relating to Perl, and would be more
appropriate
> to comp.infosystems.www.authoring.cgi.
>
> However, evidence suggests you're using MSIE, which is notorious for
> ignoring a document's declared Content-type, preferring instead to act on
> its own flawed intuition. If there is a solution, it's more likely to be
> known by the readers of the previously mentioned group than to the readers
> of this group.
------------------------------
Date: Tue, 17 Jul 2001 09:57:00 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Including flock in code while developing in Windows for Unix??
Message-Id: <3B546E5C.9676ABEC@stomp.stomp.tokyo>
Mark Grimshaw wrote:
> Bart Lateur wrote:
> > David Coppit wrote:
(snipped)
> ... Given that flock works on
> WinNT/2000 but not Win9x and that $^O reports 'MSWin32' on both,
> is there any way to tell the two apart from within perl?
There are a number of methods to attain a system type.
I am not sure which of these methods is most effective
and most quick. A number of files exists which can be
opened and indexed for an operating system or, a system
call for version can be made. Appears the relative time
lags for open () and system () are closely the same.
A problem with checking for files inherent to a specific
operating system is a directory path may or may not be
correct, depending on installation method and, depending
on what changes have been made, subsequently. This method
is inherently less reliable than a system call.
Below my signature is a method which will return an
operating system version for DOS / Windows machines
and return a false 0 (zero) for the system call itself.
This is one of my typical rogue methods which works well
and, no regulars here have discussed. A catch is a very
slight time lag, less than a second, due to a system call
return evaluation.
You will do better to simply test for flock ability. It
is illogical to use an operating system type as a deciding
factor on flock or not flock. Checking a system type
introduces unwarranted program activity; flock will
either work or not work regardless of system type.
Godzilla!
--
TEST SCRIPT:
____________
#!perl
print "Content-type: text/plain\n\n";
print "Perl Build Version:\n\n";
print $^O;
print "\n\n\nSystem Version No Return:\n";
$version = system (ver);
print $system;
print "\nSystem Version With Return:\n";
print system (ver);
exit;
PRINTED RESULTS:
________________
Perl Build Version:
MSWin32
System Version No Return:
Windows 98 [Version 4.10.2222]
System Version With Return:
Windows 98 [Version 4.10.2222]
0
------------------------------
Date: Tue, 17 Jul 2001 10:29:17 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Including flock in code while developing in Windows for Unix??
Message-Id: <3B5475ED.35ED45D4@stomp.stomp.tokyo>
Godzilla! wrote:
> Mark Grimshaw wrote:
> > Bart Lateur wrote:
> > > David Coppit wrote:
(snipped with a fearful laugh)
> TEST SCRIPT:
> ____________
> $version = system (ver);
> print $system;
I feel some guilt for pulling a con like this
on some of you sissified geeks. This is unfair
to those whom are not prone to pitching a total
anal retentive fit.
This snippet will perform the same function as
my two lines of code snippet above:
system (ver);
Perhaps if my little Godzilla, who is actually taller
than me, didn't make me attend church every Sunday,
I could pull a con like this without feelings of guilt
and, would not suffer a lightening bolt burnt butt,
each Sunday.
I must work on a way to con God into not striking my
big butt with one of Her lightening bolts at church.
It is only this blistering fear which motivates me
to sometimes confess my sins to you geeks.
Godzilla!
------------------------------
Date: Tue, 17 Jul 2001 21:36:28 GMT
From: "Geoff Crenshaw" <gbcren@mediaone.net>
Subject: lib files stopped working
Message-Id: <wd257.25048$ca.6153988@typhoon.we.rr.com>
I have several scripts which make use of a couple of small libraries. They
"used" to work just fine, then all of a sudden -- WHOMP! Now they don't work at
all, I just keep getting 500 errors.
Here is a sample of what I had that worked:
---
#!/usr/bin/perl
require "cooklib.pl";
require "cartlib.pl";
---
Now when I use this I get a 500 error. *If* I plug the subroutine into the main
perl file it works fine, I just can't seem to get a call, *any* call to a lib to
work.
Can, more accurately will, anyone help me?
Thanks!
Geoff
------------------------------
Date: 17 Jul 2001 20:22:42 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Looking for Usenet-->HTML script
Message-Id: <995400952.9977@itz.pp.sci.fi>
In article <150720011551264964%cometlinear@yahoo.com>, dot-comet wrote:
>
>I want to be able to include (and interact with) two or three actual
>Usenet newsgroups in my HTML documents.
Simple solution: <a href="news:alt.dev.null">the bit bucket</a>
If what you want is an actual web-usenet gateway, I'd suggest
http://directory.google.com/Top/Computers/Usenet/Web_Based/
as a starting point. Some of those have GPLed their source.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: Tue, 17 Jul 2001 19:52:54 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Perl or PHP?
Message-Id: <3B549791.F235493C@acm.org>
Martin Jericho wrote:
>
> Two questions:
> 1. What are the main differences/advantages between perl and PHP? As I
> understand it, PHP is used inline in HTML and perl is purely a CGI language.
^^^^^^^^^^^^^^^^^^^^
> In that case, what is the advantage of perl over PHP?
Maybe PHP is only for CGI but I've been programming in perl for over six
years and I've never done anything even remotely involved with CGI.
John
--
use Perl;
program
fulfillment
------------------------------
Date: Tue, 17 Jul 2001 21:53:45 GMT
From: someone@home.com (Chris)
Subject: Re: Perl or PHP?
Message-Id: <3b55a0b0.4915957@news.rchmd1.bc.wave.home.com>
On Wed, 18 Jul 2001 00:08:06 +0930, "Martin Jericho"
<mjericho.nospam@gmx.net> wrote in comp.lang.perl.misc:
>1. What are the main differences/advantages between perl and PHP? As I
>understand it, PHP is used inline in HTML and perl is purely a CGI language.
>In that case, what is the advantage of perl over PHP?
Web servers can use quite a variety of languages to generate dynamic
content. In some cases they call an external program and pass connection
info using a predefined API (CGI) and send the program's output directly
to the client, while in other cases the interpreter is embedded within the
server and interprets codes embedded within a prototype HTML document
(shtml).
PHP is a scripting language that is exclusively (AFAIK) interpreted by the
web server. It has no other use other than to generate web pages. It
performs this task well.
Perl is a general-purpose scripting language. It can be launched (CGI) or
embedded (eperl, mason) to generate web content. Perl can also be used
without a web server to run batch, text-interactive or GUI programs. Perl
is rapidly replacing bash/sh shell scripts as the main scripting language
used to maintain Linux computers.
Other languages to consider for use on web servers are Python, Ruby and
Java (for all platforms) and VisualBasic Script (for Microsoft IIS ASP
pages).
>2. What is the difference between c.l perl.misc, alt.perl and
>alt.comp.perlcgi.freelance?
The naming convention of the USENET news goes back more than 20 years now.
The alt.* groups are less regulated in terms of creation and content than
the other heirarchies and often duplicate content of the other TLD groups.
You would have to check the charters of the groups to be sure what the
intent was, but can normally infer it from the name:
comp.lang.perl.misc - discussion of perl language constructs not covered
by another comp.lang.perl newsgroup
alt.perl - general discussion of perl syntax, advocacy, religious wars
alt.comp.perlcgi.freelance - presumably an employment advertisement group
YMMV.
------------------------------
Date: Tue, 17 Jul 2001 18:13:55 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: please help urgent
Message-Id: <995393635.102686535101384.gnarinn@hotmail.com>
In article <9XG47.9408$W6.4159971@news2.rdc1.ab.home.com>,
Ibrahim Hamouda <iham@internode.net> wrote:
>thanks for yor reply.
>can you give me a hint what to do with the security issue, I'm really new to
>this stuff
>
ok. first note that you should not top-post.
by that, I mean to write a follow up at the start of an article,
and then quote the whole of the article you are replying to, including
signature and everything
you should quote relevant parts, snip away the rest and put your
comments after the parts you are replying to
>"gnari" <gnarinn@hotmail.com> wrote in message
>news:995286805.126196279190481.gnarinn@hotmail.com...
>> In article <p%o47.7040$W6.3662854@news2.rdc1.ab.home.com>,
>> Ibrahim Hamouda <iham@internode.net> wrote:
>>
>> (snipped problem about cgi params not working correctly when used as
>> arguments to shell command)
>>
>> (snipped overly long script with lots of irrelevant stuff)
>>
>> >
>> >open (FAX, "|/usr/local/bin/sendemailfax $email $ADDRESS $MSGS");
here you are essentially creating a command to pass to the shell
if $email,$ADDRESS and $MSGS come from an untrusted source, you must be
very careful about this kind of construct.
untrusted does not necessarily mean malicious, but can also just mean
non-expert.
the exact traps depend on what shell or operating system will execute
the command, but as a rule you should only allow the input to conform
the the strictest patterns you can.
examples:
a blank (or space only) $email will make the $ADDRESS
be interpreted as the email value
a space in the $email will make the $ADDRESS be the MSGS
a semicolon or pipe in $email could have disastrous effect:
'|rm -r *.*' might have some side-efects
so what you should do is make sure these variables only contain
alphanumerics, underscore,period and @
if it turns out some of them need more characters, enable them
one by one, after considering the effect they may need
gnari
------------------------------
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 1318
***************************************