[10508] in Perl-Users-Digest
Perl-Users Digest, Issue: 4100 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 29 07:06:26 1998
Date: Thu, 29 Oct 98 04:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 29 Oct 1998 Volume: 8 Number: 4100
Today's topics:
Re: ActiveState Perl: problem with PerlPacketManager: p <msergeant@ndirect.co.uk_NOSPAM>
Re: Checking Input for Exactly 2 numbers (Ronald J Kimball)
Docs on hints for perl <ksv@gw.al.lg.ua>
Help with Problem in Readdir. <843943n34@knight_storm@usa.net.sprynet.com>
HTTP Get not working? (Warren Miller)
Re: HTTP Get not working? <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: Is undef the best way to initialize a hash? (Ronald J Kimball)
Re: More Serial Port Problems <griessl@ihs.ac.at>
Re: Not to start a language war but.. (Ilya Zakharevich)
Re: Not to start a language war but.. (Ronald J Kimball)
Re: Not to start a language war but.. (David Formosa)
Re: Perl & Y2K - booby trap code (Abigail)
Re: Perl & Y2K - booby trap code (Larry Rosler)
Re: Perl & Y2K - booby trap code (Larry Rosler)
Re: Perl & Y2K - booby trap code (David Formosa)
Re: Perl Question kottelo@my-dejanews.com
Perl vs ASP in MS IIS 4.0 <iaminnet@concentric.net>
Re: Perl vs ASP in MS IIS 4.0 <msergeant@ndirect.co.uk_NOSPAM>
Re: Perl vs ASP in MS IIS 4.0 <perlguy@technologist.com>
Re: Problem with Win32 reg exp (Ronald J Kimball)
Re: Sending mail using perl (I.J. Garlick)
Re: Simple regular expression (HELP)..... (Abigail)
Unlink problems with passed glob <lucasdave@hotmail.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 29 Oct 1998 10:10:59 +0000
From: Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
Subject: Re: ActiveState Perl: problem with PerlPacketManager: ppm.pl (proxy/internet)
Message-Id: <36383F33.A047C959@ndirect.co.uk_NOSPAM>
rk wrote:
>
> I need to install the tk package for Active State Perl.
> Has anybody an idea, how this could work (or where else I could download
> the packages) ???
>
> Documentation:
>
> Q:\perl\5.00502\bin>echo %HTTP_proxy%
> proxy.fth.sbs.de <=
> same proxy as defined in netscape navigator (Internet access via Proxy)
>
It should be "http://proxy.fth.sbs.de:[port]" (port is optional if it's
80)
--
<Matt/>
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Thu, 29 Oct 1998 00:38:42 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Checking Input for Exactly 2 numbers
Message-Id: <1dhmuv8.1rlm5ki9mzchcN@bay1-214.quincy.ziplink.net>
Mike <support@counter.w-dt.com> wrote:
> How would you check the input then to make sure it has exactly two
> numbers inputed. Not more not less.
2 == (() = /\d+/g);
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 29 Oct 1998 10:12:58 +0200
From: "Sergey V. Kolychev" <ksv@gw.al.lg.ua>
Subject: Docs on hints for perl
Message-Id: <Pine.LNX.3.96.981029100023.910B-100000@gw.al.lg.ua>
May be anybody have docs about $^H magic variable ?
I search in docs contributed whith perl,perl source,
and sources of pragma modules and I find something and write this
-------------------------------------------------------------------------
#!/usr/bin/perl
%hints =
( 0x00000001 => 'Integer result expression',
0x00000002 => 'Restricted refs',
0x00000200 => 'Restricted subs',
0x00000400 => 'Restricted vars',
0x00000800 => 'POSIX locales',
0x00001000 => 'Overload rules for integer constants by sub referensed
$^H{integer}',
0x00002000 => 'Overload syntax rules for float constants by sub referensed
$^H{float}',
0x00004000 => 'Overload syntax rules for binary constants by sub referensed
$^H{binary}',
0x00008000 => 'Overload syntax rules for strings constants by sub referensed
$^H{q}',
0x00010000 => 'Overload syntax rules for regex by sub referensed
$^H{qr}',
0x00020000 => 'Enable overload syntax rules by %^H',
0x00100000 => 'Taint regex',
0x00200000 => 'Eval regex',
);
print << 'EOF';
This is perl compiler hints by $^H |= $_
EOF
map { printf "0x%x\n%s\n%s\n\n",$_,bits($_),$hints{$_} }
sort {$a <=> $b} keys %hints;
sub bits{
my $res;
my($digit) = shift;
for(my $i = 31;$i>=0;$i--){
$res .= $digit >> $i & 1
}
return $res
}
------------------------------------------------------------------------
May be it wrong ?
I want additional knowledges ;))
Gurus , please help me. ;)
P.S. Sorry my poor english.
----------------------Alchevsk Linux User Group-----------------------
UNIX is user friendly. It's just selective who the friends are.
Linux is like wigwam - no windows, no gates, apache inside.
http://www.ic.al.lg.ua/~ksv | e-mail: ksv@gw.al.lg.ua
PGP key & Geekcode: finger ksv@gw.al.lg.ua
------------------------------
Date: Wed, 28 Oct 1998 22:28:06 -0800
From: "Knight" <843943n34@knight_storm@usa.net.sprynet.com>
Subject: Help with Problem in Readdir.
Message-Id: <7191vu$evu$1@juliana.sprynet.com>
I am running perl on win95 and have created a program that opens a directory
and it's subdirectories, reads them, them creates a html page with links to
any files of a specified type. The problem is that when I download a binary
file through ftp, such as a jpg or gif, and run this program on the
directory which contains that file, it is not recognized. (It is not listed)
other files in the directory are. Then when I rename the file it is
recognized. Why does this happen and how can I fix it?
-with thanks
Knight
------------------------------
Date: 29 Oct 1998 08:55:00 GMT
From: wmiller@mars.cs.unp.ac.za (Warren Miller)
Subject: HTTP Get not working?
Message-Id: <909651300.506839@mars.cs.unp.ac.za>
Hiya
Can anyone help me . I kinda adapted this code to get a webpage off a site
can anyone tell me why it's not working, thanx
#!/usr/local/bin/perl
use IO::Socket;
$host="mars.cs.unp.ac.za";
$document="index.html";
$remote = IO::Socket::INET->new(Proto =>"tcp",
PeerAddr => $host,
PeerPort => "http(80)",
);
$remote->autoflush(1);
print $remote "GET $document HTTP/1.0\en\en";
while (<$remote>) {print}
close $remote;
-------------
wmiller@mars.cs.unp.ac.za
------------------------------
Date: 29 Oct 1998 10:11:07 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: HTTP Get not working?
Message-Id: <83af2f7mxg.fsf@vcpc.univie.ac.at>
Re: HTTP Get not working?, Warren
<wmiller@mars.cs.unp.ac.za> said:
Warren> Hiya Can anyone help me . I kinda adapted this code
Warren> to get a webpage off a site can anyone tell me why
Warren> it's not working, thanx
Warren> use IO::Socket;
Why bother doing all the nasty socket work yourself?
perldoc LWP::Simple
or for a more comprehensive version:
perldoc LWP::UserAgent
perldoc HTTP::Request
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Thu, 29 Oct 1998 00:38:45 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Is undef the best way to initialize a hash?
Message-Id: <1dhmvlw.h5gqus1tot92kN@bay1-214.quincy.ziplink.net>
Joseph Norris <sirron@mail.mcoe.k12.ca.us> wrote:
> Subject: Is undef the best way to initialize a hash?
No, but it's a pretty good way to *uninitialize* a hash. ;-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 29 Oct 1998 11:47:50 +0100
From: Peter Griessl <griessl@ihs.ac.at>
To: scott@jtsmith.com
Subject: Re: More Serial Port Problems
Message-Id: <363847D6.85A326B3@ihs.ac.at>
Use the POSIX module for setting up the communication (Camel p.469) and
then
read/write using sysread/syswrite and select(2). You probably want to
read
the manpages select(2), termios(3) first.
This is a small code example for reading/writing to a modem connected to
the
serial port (say "AT" to the modem, receive "OK", ....).
note: see select(2) for timeouts instead of blocking mode
#!/usr/bin/perl -w
use POSIX qw(:termios_h :fcntl_h);
sysopen ( MODEM, "/dev/ttyS0", O_RDWR | O_NONBLOCK ) || die "cannot
sysopen";
$in = POSIX::Termios->new;
$insave = POSIX::Termios->new;
$mo = POSIX::Termios->new;
# STDIN: raw
$in->getattr(fileno(STDIN));
$insave->getattr(fileno(STDIN));
$in->setiflag(0); # see termios
$in->setoflag(0);
$in->setlflag(0);
$in->setcc(VMIN, 1);
$in->setcc(VTIME, 0);
$in->setattr(fileno(STDIN), TCSANOW);
# Modem: like STDIN plus baudrate
$mo->getattr(fileno(STDIN));
$mo->setcflag(CREAD | CS8 | B9600 | HUPCL);
$mo->setattr(fileno(MODEM), TCSANOW);
my $rbits = "";
vec($rbits, fileno(STDIN), 1) = 1;
vec($rbits, fileno(MODEM), 1) = 1;
my $n = 0;
do {
$n = select($selrbits = $rbits, undef, undef, undef); # BLOCKING
die "cannot select" if ($n == -1);
if (vec($selrbits, fileno(STDIN), 1)) {
$len = sysread(STDIN, $buf, 100 );
syswrite(MODEM, $buf, $len );
}
if (vec($selrbits, fileno(MODEM), 1)) {
$len = sysread(MODEM, $buf, 100 );
syswrite(STDOUT, $buf, $len );
}
} while ( $buf ne "q" ); # enter q to quit
close MODEM;
$insave->setattr(fileno(STDIN), TCSANOW); # restore terminal
settings
------------------------------
Date: 29 Oct 1998 05:30:40 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Not to start a language war but..
Message-Id: <718ui0$krv$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Abigail
<abigail@fnx.com>],
who wrote in article <718rsc$ctn$1@client3.news.psi.net>:
> ++ I was writing C extensions in Perl 20 minutes from the moment I
> ++ started reading the perlxstut man page, and I'm far from the C
> ++ expert. Perl has also been embedable for likely longer then
> ++ Python has existed.
>
> You must be an exception, and you don't hear people often claim XS
> is easy. Perhaps you are the person who could write a good tutorial
> about XS then?
You got it backward: a persone who could go after 20 minutes of
reading perlxstut cannot write a good tutorial. You need to fight
your way through XS to able to understand problems people have with XS.
Ilya
------------------------------
Date: Thu, 29 Oct 1998 00:38:46 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Not to start a language war but..
Message-Id: <1dhmvrt.xn2971k8y9i3N@bay1-214.quincy.ziplink.net>
[posted to clpm only]
John Klassa <klassa@aur.alcatel.com> wrote:
> The $, @ and % tell you what you're getting when all the dereferencing is
> done... Thus, @a is an array and $a[0] is the 0th element of @a, which is
> a scalar. Something like @a[0,1] is itself an array, so it's prefixed by
> @. The information is useful -- when you see a $ in front of something,
> you've got a scalar; when you see an @, you've got an array; when you've
> got a %, you've got a hash.
@a[0,1] is actually an array slice, not an array.
Some important differences between arrays and array slices:
DB<1> @a = (4, 5)
In a scalar context, an array evaluates to the number of elements in the
array. An array slice evaluates to the last element in the slice.
DB<2> x scalar @a
0 2
DB<3> x scalar @a[0,1]
0 5
An array slice cannot be used as an ARRAY argument with arguments such
as push and splice. An array can, of course.
DB<4> push @a, 1
DB<5> push @a[0,1], 1
Type of arg 1 to push must be array (not array slice) at (eval 4) line 2
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 29 Oct 1998 11:14:53 GMT
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Not to start a language war but..
Message-Id: <slrn73gjhd.vvh.dformosa@godzilla.zeta.org.au>
In article <718qep$4ka$1@client3.news.psi.net>, Abigail wrote:
>Dirk Heise (dheise@metronet.de) wrote on MDCCCLXXXIV September MCMXCIII
>in <URL:news:01be02bf$c70a4260$LocalHost@dreadzone>:
[...]
>It might change the behaviour of some existing code severly, it will
>not change Perl severely. And that was what Klaus asked.
use gc Boehm;
Would be nice.
--
Please excuse my spelling as I suffer from agraphia. See the URL in my
header to find out more.
------------------------------
Date: 29 Oct 1998 05:03:34 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <718sv6$ctn$3@client3.news.psi.net>
Larry Rosler (lr@hpl.hp.com) wrote on MDCCCLXXXIV September MCMXCIII in
<URL:news:MPG.10a148746fb84072989845@nntp.hpl.hp.com>:
++
++ The description of 'struct tm' in <time.h> is exactly as we know it,
++ with these exceptions:
++
++ The range of 'tm_sec' is (correctly) 0 to 59, instead of the 60 or 61
++ that was sneaked into the C Standard later by 'clever' people.
I disagree that 0 .. 59 is correct. 61 is of course pure silliness,
but what do you expect from those who gave us year - 1900?
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
------------------------------
Date: Wed, 28 Oct 1998 21:38:11 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <MPG.10a19f236694c4b19898ea@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <718sv6$ctn$3@client3.news.psi.net> on 29 Oct 1998 05:03:34
GMT, Abigail <abigail@fnx.com> says...
> Larry Rosler (lr@hpl.hp.com) wrote on MDCCCLXXXIV September MCMXCIII in
> <URL:news:MPG.10a148746fb84072989845@nntp.hpl.hp.com>:
> ++ The range of 'tm_sec' is (correctly) 0 to 59, instead of the 60 or 61
> ++ that was sneaked into the C Standard later by 'clever' people.
>
> I disagree that 0 .. 59 is correct. 61 is of course pure silliness,
> but what do you expect from those who gave us year - 1900?
As has been discussed, no minute in the Unix epoch time scale can have
61 seconds, because by fiat (the POSIX Standard) no cognizance is taken
of leap seconds. So astronomical time and POSIX time drift very slowly
apart, but our calculations of time intervals are sane and simple.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 29 Oct 1998 00:44:19 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <MPG.10a1cabddb5f04a79898eb@nntp.hpl.hp.com>
In article <70t79u$6q1$1@mathserv.mps.ohio-state.edu> on 24 Oct 1998
18:46:22 GMT, Ilya Zakharevich <ilya@math.ohio-state.edu> says...
> [A complimentary Cc of this posting was sent to Larry Rosler
> <lr@hpl.hp.com>],
> who wrote in article <MPG.109b91f83063bb279898dc@nntp.hpl.hp.com>:
> > Perl is full of little
> > "gotchas" (samples on request), of which this is one of the smallest, or
> > at least one that has lots of history behind it.
>
> Request.
>
> Ilya
Several people have asked me to show some of the small
"gotchas" that I have encountered in Perl. All the items in
the list below could be described as "got-me's" because they
are errors that were pointed out in response to my postings
in this newsgroup (a scarifying experience). In most cases,
they are documented correctly, but I got them wrong even
though I RTFM and RTFFAQ more than many Perl users, I think.
Command line:
perl -we '...' (correct) is not the same as perl -ew '...' (wrong).
In this respect, Perl command-line processing differs from the
Unix norm, in which any number of single-letter no-argument
options may be mixed with one single-argument option, in any order.
Functions:
substr('x', 1) returns a null string, but substr('x', 2) returns
undef and generates a warning. [The reason is so that the first
expression can be used as an lvalue to extend the string. I do
not think this is documented.]
Operators:
grep -f => readdir DIR; returns all the entries in the directory,
not just the files, because the => operator 'forces any word to
the left of it to be interpreted as a string' (from perlop). So
the grep is for '-f', which is TRUE. But '-f' is not a word, it
is an operator. Perl defines a 'word' as a string that matches
/^\w+$/. See perlre: '\w Match a "word" character (alphanumeric
plus "_") ... To match a word you'd need to say \w+.' But perl
doesn't seem to think so.
Regexes and tr:
Unescaped '$' at the end of a regex does not necessarily match
the end of the operand string. From perlop: '$ Match the end
of the line (or before newline at the end)'. But this caught me
and others.
$n = /xyz/g; does not count the number of 'xyz's in $_, but has
values TRUE or FALSE. To count them, one may say $n = () = /xyz/g;
or ++$n while /xyz/g; or $n = s/xyz/xyz/g; (as someone posted
recently; ugh!).
$n = tr/x//; counts the number of 'x's in $_, the same as tr/x/x/;
To delete them, one must say tr/x//d;
SUMMARY
The above are half a dozen recent "got-me's" off the top of my head.
I don't remember all the various gotchas I've pointed out to other
posters -- *they* were the ones burned, not me.
Surely some others will care to embarrass themselves by adding their
own "got-me's" to the list.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 29 Oct 1998 11:20:23 GMT
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <slrn73gjrn.vvh.dformosa@godzilla.zeta.org.au>
In article <718sv6$ctn$3@client3.news.psi.net>, Abigail wrote:
[...]
>I disagree that 0 .. 59 is correct. 61 is of course pure silliness,
>but what do you expect from those who gave us year - 1900?
What about leap seconds?
--
Please excuse my spelling as I suffer from agraphia. See the URL in my
header to find out more.
------------------------------
Date: Thu, 29 Oct 1998 09:36:47 GMT
From: kottelo@my-dejanews.com
Subject: Re: Perl Question
Message-Id: <719cvf$bd9$1@nnrp1.dejanews.com>
This is your best anwser?
I have Perl in my computer... but not a newbie documentation!!!!
In article <Pine.GSO.4.02A.9810280829480.3421-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> On Wed, 28 Oct 1998 kottelo@iname.com wrote:
>
> > Subject: Perl Question
>
> Please check out this helpful information on choosing good subject
> lines. It will be a big help to you in making it more likely that your
> requests will be answered.
>
> http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
>
> > I'm new in Perl-World... Where are a good manual of perl?
>
> It comes with Perl. If it's not already installed on your system, ask your
> system administrator.
>
> > (best in Spanish)
>
> I don't think that the Perl docs have been translated into Spanish.
> (Though I'd love to hear that I'm mistaken about that.) But you may be
> able to get a translation of the Camel or Llama books; see the perlbook
> manpage. I've heard that those books have been translated into several
> languages, but I don't know which ones. Check with your favorite
> bookstore. Good luck!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
--
Nos vemos...
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 28 Oct 1998 21:21:46 PST
From: "IamInNet" <iaminnet@concentric.net>
Subject: Perl vs ASP in MS IIS 4.0
Message-Id: <718u1a$boj@chronicle.concentric.net>
Can anybody give me any comparisons between Perl vs ASP in MS IIS 4.0?
(Speed, scalability, stability, etc)
Thanks in advance.
------------------------------
Date: Thu, 29 Oct 1998 10:25:15 +0000
From: Matt Sergeant <msergeant@ndirect.co.uk_NOSPAM>
Subject: Re: Perl vs ASP in MS IIS 4.0
Message-Id: <3638428B.45BC4E30@ndirect.co.uk_NOSPAM>
IamInNet wrote:
>
> Can anybody give me any comparisons between Perl vs ASP in MS IIS 4.0?
> (Speed, scalability, stability, etc)
> Thanks in advance.
Well, there are several different "Perl"s you need to compare:
Perl.exe (perl running as pure CGI)
========
Most stable of all the options, also the slowest. Poor scalability.
PerlIS.dll (perl as an ISAPI filter)
==========
Quite stable, although still some extremely minor issues that are being
fixed by the day. In-process execution means speed is good to excellent.
Scales well.
PerlScript (perl in ASP instead of VBScript)
==========
Excellent object model (the ASP object model). Fantastic documentation
(sorry, that was a shameless plug - the docs are on my web site).
Suffering from speed problems at the moment because of Win32::OLE
loading overhead - these _can_ and _will_ be sorted out soonish though.
Scales reasonably well.
PerlEx (custom ISAPI plugin - commercial from Activestate)
======
Pre-compiles perl code (sort of like mod_perl). VERY quick, even
compared to VBScript ASP. Stable once you figure out how your scripts
need to be modified, and you make sure that you understand what's going
on. Supports persistant DB connections, CGI.pm (pre-loaded so no
overhead). Very scalable. The best option if you can afford it, although
the object model of PerlScript is nicer to have for me.
ASP - I take it you mean VBScript - ASP is just the object model
===
Well, it's VBScript. What can I say? You'll spend 80% of your time
debugging the application to figure out what's going wrong. In the end
you'll probably end up re-writing it because you couldn't fix the
problem (personal experience). However, it executes fast, about the same
speed/scalability of PerlIS. But VBScript can't do a lot of things that
are trivial in PerlScript - open files, directories, use sockets, etc.
Hope that helps you some.
--
<Matt/>
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Thu, 29 Oct 1998 11:44:06 GMT
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Perl vs ASP in MS IIS 4.0
Message-Id: <36385506.E5AEDAE1@technologist.com>
IamInNet wrote:
>
> Can anybody give me any comparisons between Perl vs ASP in MS IIS 4.0?
> (Speed, scalability, stability, etc)
> Thanks in advance.
I was recently asked to work on a small web application that connected
to an Access database. It was written in ASP.
The ASP code was 4-1/2 pages long and VERY hard to follow, even though I
DO know ASP pretty well. I decided to convert it to Perl using the DBI
and DBD:ODBC modules.
The resulting page was 1 page long, very readable, easy to follow, and I
had many more capabilities to work with the data with Perl rather than
ASP.
For me, there is no question what is better to use. The choice though,
is up to you. If you are an ASP guru and like how it works, use it.
Personally, I find Perl a much better language to use for writing web
applications.
Brent
--
Java? I've heard of it, it is what I drink when I am hacking Perl. -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Thu, 29 Oct 1998 00:38:48 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Problem with Win32 reg exp
Message-Id: <1dhmwva.1u4nqmxstxj1vN@bay1-214.quincy.ziplink.net>
Patrick Timmins <ptimmins@netserv.unmc.edu> wrote:
> perl -pi.bak -e "s/foo/bar/gi" test.txt
>
> will loop through the file (thanks to the -p switch),
> will apply the substitution to each line (thanks to the -e switch),
Actually, if you have any switch to thank for that step, it's -p again,
which is responsible for putting the substitution inside a loop.
Consider the following:
~> cat > temp
s/foo/bar/gi
~> perl -pi.bak temp test.txt
The same effect, without the -e switch. :-)
-e simply allows you to specify the script on the command line instead
of in a file or on standard input.
> will print out the results (thanks to -p switch, again),
> and and will write this back to the file (thanks to the -i switch)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Thu, 29 Oct 1998 09:57:29 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: Sending mail using perl
Message-Id: <F1L2Bu.35t@csc.liv.ac.uk>
In article <36390b89.20061748@news.urbanet.ch>,
pub @ alma . ch (M.) writes:
>>> You can use sendmail, but it's probably safer (and more portable) to
>>
>>Tell me why is it safer to use SMPT over sendmail when sendmail is available?
>>
>
> "Safer" is probably disputable (how do you define "safer"?). But a
> sockets Perl script is definitely more portable: 90% machines don't
> have sendmail.
The portability I can not dispute (don't know enough).
> And obviously more customizable (MIME encoding, custom headers,
> attachments, ...).
>
Howverer that last statement I do dispute. So your effectively saying that
you can't send MIME encoded attachments using sendmail? Sendmail can probably
cope with custom headers as well, I have never tried. All sendmail does for
outgoing mail is send it what you give it, (simplest deffinition) it's upto
the mail client to construct the message. Of course sendmail is highly
configurable and i don't know how to do that :-) I just use it.
So if sendmail can't send attachments like you say I would dearly love to be
told what has been sending the mail my project is creating, because that's
exactly what I told the script to do.
Besides Martien is right, this no longer has anything to do with Perl, and we
should terminate this part of the thread right here. Afterall a search of
deja-news on this subject will turn up more than you could possible ever want
or need to know. Yes it's been a holy war the SMTP or Sendmail question,
Which is best', I don't think we need another, the answers out there.
--
--
Ian J. Garlick
<ijg@csc.liv.ac.uk>
<postmaster@merseymail.com>
One difference between a man and a machine is that a machine is quiet
when well oiled.
------------------------------
Date: 29 Oct 1998 05:07:33 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Simple regular expression (HELP).....
Message-Id: <718t6l$ctn$4@client3.news.psi.net>
amatot@my-dejanews.com (amatot@my-dejanews.com) wrote on MDCCCLXXXIV
September MCMXCIII in <URL:news:717v8g$abv$1@nnrp1.dejanews.com>:
++ Hi,
++
++ Could someone help me with this. I'm sure it's easy, but I can't get it to
++ work. All I won't to do is create a regular expression that searchs a string
++ for the first occurance of a double quote (") or the end of line (which ever
++ comes first) and substitutes everything up to but not including the double
++ quote or new line. Can one expression cover both case? For example:
So, you want to replace all non double quotes, non-newlines with something
else.
s/^[^"\n]*/@(#)%Z% %M%/;
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|8;
.qq;8768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F;
.qq;76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V
/=$^U}while$^V!=$^W'
------------------------------
Date: Thu, 29 Oct 1998 03:22:55 -0500
From: Dave Knight <lucasdave@hotmail.com>
Subject: Unlink problems with passed glob
Message-Id: <363825DF.B76@hotmail.com>
I am having problems getting the unlink command to work with the glob
filename that I pass to the subroutine for deleting a file. The
subroutine is shown below.
The subroutine is called with the following line, where form_data is a
hash passed from a CGI script, including the name of the file to be
deleted (unlinked).
&delete_file(*form_data, $main_script_url);
## Subroutine
sub delete_file
{
local (*in, $main_script) = @_; ## *in = hash containing form_data
and file to delete
# Next I try copying path into a separate variable to eliminate
reference
# ($session_dir is a global variable set outside this subroutine)
local ($completefilepath) = "$session_dir/$in{'session_id'}.dat";
if ((-e "$session_dir/$in{'session_id'}.dat")
&& (-r "$session_dir/$in{'session_id'}.dat"))
{
# Fails at the unlink line next
(unlink ($completefilepath)) or die "Unlink failed: $!";
}
} # End of sub delete_file
Perl seems to work fine up until the unlink command. It determines that
the file does indeed exist correctly, but then stops completely, without
even giving the die message. I have tried to copy the filename into
another local variable ($completefilepath) thinking that would eliminate
the reference but still unlink fails. I have also tested printing out
the contents of $completefilepath right before the unlink command and
the filename and path is indeed correct. That is why it is so
frustrating that the unlink is failing. The permissions are correct for
the file and directory - the subroutine works when I set the file and
path name directly as constants in the subroutine, so I believe it is
not a problem with the permissions on the file.
I would appreciate any suggestions; I think it has something to do with
the fact that I passed a glob but need comments from the group.
Dave
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4100
**************************************