[11798] in Perl-Users-Digest
Perl-Users Digest, Issue: 5398 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 16 10:10:58 1999
Date: Fri, 16 Apr 99 07:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 16 Apr 1999 Volume: 8 Number: 5398
Today's topics:
Re: accessing files across UNC paths <gellyfish@gellyfish.com>
Active Perl and DDE problem feketeroland11@my-dejanews.com
Re: Calling a function from s/// <vvb@ibm.net>
Re: Calling a function from s/// (Bart Lateur)
Re: Calling a function from s/// <gellyfish@gellyfish.com>
Re: Can I write a #!-style interpreter with Perl ? <jorma.laaksonen@hut.fi>
Re: Can PERL be used to do block editing? <ronald_f@my-dejanews.com>
Re: can Perl handle huge files <eedalf@eed.ericsson.se>
Re: checking filenames.. <ronald_f@my-dejanews.com>
Complicated reg. exp. question <eedalf@eed.ericsson.se>
Re: Complicated reg. exp. question <jdf@pobox.com>
Re: Core (Dan Wilga)
Re: How can I attach spaces before a text field or text <vvb@ibm.net>
How to install Perl onto a machine with no C compiler <pandp@ibm.net.nospam>
Re: How to install Perl onto a machine with no C compil (M.J.T. Guy)
Re: How to install Perl onto a machine with no C compil <yfang@gte.com>
htpasswd script problem hensonw@my-dejanews.com
Re: like print <<...; load a variable? (Leo Schalkwyk)
Re: like print <<...; load a variable? <tchrist@mox.perl.com>
Re: Module/Script for a WWW-Portal? <eedalf@eed.ericsson.se>
Need info on Perl vs. VB for manager persuasion (Keith Phillips)
Re: Need info on Perl vs. VB for manager persuasion <sb@sdm.de>
Re: Open an THML file but don't display it <gellyfish@gellyfish.com>
Re: Password encryption <wyzelli@yahoo.com>
Re: marlon_shakespeare@my-dejanews.com
Re: SQL using the ODBC module chatswood@my-dejanews.com
Re: SQL using the ODBC module <gellyfish@gellyfish.com>
Uploading script. <ours@casema.net>
Re: Using spaces in globbing? ([sp-])
Want to install printers with perl <h-montalan@i-france.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Apr 1999 11:28:23 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: accessing files across UNC paths
Message-Id: <371710c7@newsread3.dircon.co.uk>
erk <ericw@fikus.com> wrote:
>
> I am attempting to write a script which
> reads and writes files across UNC paths
> (ie: \\GEORGE\C$\WINNT\....).
> It works when run command line, but fails
> to access them when run from the 'Net. Does
> anyone know how I can either:
>
> a) get MS-IIS 4.0 to allow the scripts to read
> and write across UNC's , or
>
Get your NT administrator to give the IUSR_<whatever> user the
permissions to use the network and the share involved
> b) execute a process with username-password
> (syntax needed!)
>
LogonAsUser from Win32::AdminMisc
> c) get mapped "Logical drive letters"
> from UNC paths
>
AddConnection from Win32::NetResource
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Fri, 16 Apr 1999 11:31:38 GMT
From: feketeroland11@my-dejanews.com
Subject: Active Perl and DDE problem
Message-Id: <7f772r$i4s$1@nnrp1.dejanews.com>
Can anybody help me about AP DDE? Please - if aviable - send me some script
code. I want to use it with Symantec WinFax. (WinFax DDE is working! from
Visual Basic.) It's send me a message: Unable to initiate conversation. I use
the following code - based on the help:use Win32::DDE::Client; $Client = new
Win32::DDE::Client ('C:\Program files\Symantec\WinFax\FAXMGR32.exe',
'TRANSMIT); die "Unable to initiate conversation" if $Client->Error;
$Client->Disconnect; Thanks for the time. Fekete Roland
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 16 Apr 1999 13:49:27 +0200
From: "Vincent Vanbiervliet" <vvb@ibm.net>
Subject: Re: Calling a function from s///
Message-Id: <37172332@news.uk.ibm.net>
<hassanov@yahoo.com> wrote in message
news:7f5nb8$aao$1@nnrp1.dejanews.com...
> to absolute URL, but I can't do: $HtmlBuffer=~
> s/(<\s*A\s*.*HREF\s*=\s*)\"([^"]*)\"/$1\"&AbsoluteUrl($2)\"/gi; Instead, I
using the -w switch, and 'use diagnostics;' could tell you a lot about what
is going wrong.
It is perfectly possible to use a function in s///, just try using one with
only $1, e.g. s/<expression with brackets in>/myfunction($1)/gi; it will
work.
The problem lies in the concatinating of several strings in the second part
of the expression.
Basically, you're trying to substitute the left part by a concatination of 4
strings: $1, ", AbsoluteUrl($2) and "
Instead of using
$1\"&AbsoluteUrl($2)\"
use
$1.'"'.AbsoluteUrl($2).'"'
Remarks:
1. '"' is single, double, single quote, so ' " ' (but with more spaces)
2. You don't need the & before you function, since it has an argument,
so Perl recognizes it as a function. But it still works with the '&'.
Vincent Vanbiervliet
http://learn.ibm.be
------------------------------
Date: Fri, 16 Apr 1999 13:20:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Calling a function from s///
Message-Id: <3717383e.13994285@news.skynet.be>
Vincent Vanbiervliet wrote:
>> to absolute URL, but I can't do: $HtmlBuffer=~
>> s/(<\s*A\s*.*HREF\s*=\s*)\"([^"]*)\"/$1\"&AbsoluteUrl($2)\"/gi; Instead, I
>
>using the -w switch, and 'use diagnostics;' could tell you a lot about what
>is going wrong.
>It is perfectly possible to use a function in s///, just try using one with
>only $1, e.g. s/<expression with brackets in>/myfunction($1)/gi; it will
>work.
Not without the //e modifier switch. Which is probably just what the
original poster forgot.
Er... I just stumbled across ANOTHER possibility to execute code,
WITHOUT that //e modifier. It uses Randal's trick (hi Randal!) with
"@{[...]}" which you can use to execute code (in list context) in
interpolation in a string. The next example works (it can convert tab
delimited text to Perl code):
$_ = "15\tThere's something wrong\tHeh!\n";
print;
$" = ", ";
s/(.*)\t(.*)\t(.*)/ \[@{[map
{ (my $string = $_ ) =~ s!(['\\])!\\$1!g;"'$string'" }
$1,$2,$3]}\], /;
# hey, I didn't say it was *readable*! ;-)
print;
__END__
-->
15 There's something wrong Heh!
['15', 'There\'s something wrong', 'Heh!'],
Sorry about the code formatting, this is because of the newsreader's
wordwrap.
Bart.
------------------------------
Date: 16 Apr 1999 14:27:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Calling a function from s///
Message-Id: <37173ad2@newsread3.dircon.co.uk>
Vincent Vanbiervliet <vvb@ibm.net> wrote:
>
> <hassanov@yahoo.com> wrote in message
> news:7f5nb8$aao$1@nnrp1.dejanews.com...
>> to absolute URL, but I can't do: $HtmlBuffer=~
>> s/(<\s*A\s*.*HREF\s*=\s*)\"([^"]*)\"/$1\"&AbsoluteUrl($2)\"/gi; Instead, I
>
> using the -w switch, and 'use diagnostics;' could tell you a lot about what
> is going wrong.
> It is perfectly possible to use a function in s///, just try using one with
> only $1, e.g. s/<expression with brackets in>/myfunction($1)/gi; it will
> work.
> The problem lies in the concatinating of several strings in the second part
> of the expression.
I thought the problem lay in the fact that there was no /e modifier ;-}
/J\
------------------------------
Date: 16 Apr 1999 16:12:43 +0300
From: Jorma Laaksonen <jorma.laaksonen@hut.fi>
Subject: Re: Can I write a #!-style interpreter with Perl ?
Message-Id: <x4g16090ac.fsf@james.hut.fi>
Thank you very much for your replies Randal, Tom and Andrew.
I chose to use the #!/usr/bin/env trick. I also experimented with the
c-compiled perl -x parser. It works fine but writing the real Perl code
inside a c char array would be pain.
Thanks,
Jorma Laaksonen
--
Jorma Laaksonen, Dr. of Science in Technology email: jorma.laaksonen@hut.fi
Laboratory of Computer and Information Science http://www.cis.hut.fi/~jorma/
Helsinki University of Technology tel. +358-9-4513269
P.O.BOX 5400, FIN-02015 HUT, FINLAND fax. +358-9-4513277
------------------------------
Date: Fri, 16 Apr 1999 10:46:28 GMT
From: Ronny <ronald_f@my-dejanews.com>
Subject: Re: Can PERL be used to do block editing?
Message-Id: <7f74e3$g60$1@nnrp1.dejanews.com>
In article <37152B16.82E783A1@Central.Sun.Com>,
Trout <matthew.dewell@Sun.COM> wrote:
> I'm new to using PERL and wanted to know if there is a way that I can
> replace a block of ASCII code in a HTML file with another block of ASCII
> code. These two blocks of code are in ASCII files, so optimally I would
> maybe like to pass in the file to be searched (*.html) and the "good"
> and "bad" block files, i.e. switcheroo foo.html good bad. The trick is
> the blocks start with a <TD> and end with a </TD> so I can't just search
> for the <TD> and do the replacement, since there a lot of lone <TD>'s
> through out the document. I have to match the whole block of code
> before replacing. What is the best way to go about this?
[snip]
> Oh, you might be thinking, well why not just search for that line of
> text that's unique and do replacement from there. The problem is the
> data that needs to replace this bad section, starts right after the <TD>
> (i.e.) no newline and does not have a newline until it needs the </TD>
Just two things you might consider useful:
(1) You don't have to process the file line by line, unless it is ridiculously
big. You could as well swallow it into one string and process the string
character by character.
(2) '\n' is not necessarily a termination character. If you have several
"lines" lumped together in one string, you can treat '\n' like any other
character.
Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 16 Apr 1999 15:24:07 +0200
From: Alex Farber <eedalf@eed.ericsson.se>
Subject: Re: can Perl handle huge files
Message-Id: <371739F7.AFC17AAB@eed.ericsson.se>
martin@cutup.de wrote:
> Does anyone have any information on or experience with how Perl handles very
> large (possibly larger than available RAM) files?
Hi Martin,
normally it shouldn't, assuming that enough memory is there.
But I had a segmantation fault in one my script which was
performing regex searches on a big variable.
It always dumped core when I was trying to use $1. I have
spent much time to find it out and to modify my script :-(
/Alex
------------------------------
Date: Fri, 16 Apr 1999 10:16:38 GMT
From: Ronny <ronald_f@my-dejanews.com>
To: terral@cyberplex.com
Subject: Re: checking filenames..
Message-Id: <7f72m2$eri$1@nnrp1.dejanews.com>
In article <7f5i7u$mgi$1@bignews.fundy.net>,
"Terra Landry" <terral@cyberplex.com> wrote:
> I have a script written that checks if a filename exists..
I assume you mean: If a file with a given name exists.
> if it does, I
> want to add a sequential number to the end of the filename... how do I get
> the greatest sequential number from the filenames that already exist??
If I understand you right, you have families of filenames that consist of a
common stem, followed by a sequence number, such as abc0, abc1, abc2,..., and
you want to find out the highest sequence number given so far.
As a first step, I would grab all those names corresponding to a particular
stem into an array. Depending on the naming conventions of your application,
you could for instance use the glob function, to retrieve those filenames (or
you can use the KGlob module for more sophisticated globbing - see CPAN).
Alternatively, you also could read the names of all files of your directory
into an array and use the grep function to select those pertaining to your
stem.
Finding the highest sequence number from the set of file names obtained in
the above mentioned step, again depends on your conventions. If you
consistently pad the numbered file names to the same length, you can simply
sort them descending (see the 'sort' function) and take the first one.
Otherwise you could extract the stem part of each file
name - the map functions comes handy here - and then sort the remining names
*numerically*.
Hope that helps.
Ronald
--
Ronald Fischer <ronald_f@my-dejanews.com>
http://ourworld.compuserve.com/homepages/ronald_fischer/
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 16 Apr 1999 15:03:42 +0200
From: Alex Farber <eedalf@eed.ericsson.se>
Subject: Complicated reg. exp. question
Message-Id: <3717352E.4FABF6D1@eed.ericsson.se>
Hi guys,
in my files I have to insert into each string like this:
PCORI:BLOCK=SHMM,IA=H'2BBB;
something like ",CI=ABCDE1234" and get the following string:
PCORI:BLOCK=SHMM,IA=H'2BBB,CI=MNASF0276;
It works fine with the following regular expression
(please note that comments in my files start with a
"!" and all instructions end with a ";"):
s/ ( \n [^!\n]* # not commented out by "!"
\b PCORI # "PCORI"
\s* : \s* # ":", evtl. surr. by whitespase
[^!;]* ) ; # not a comment or new instruction
# the $load holds "ABCDE1234"
/$1,CI=$load;/ixg; # insert ",CI=..." before ";"
However I would like to be able to run my script several times
on the same files. So I must substitute the evtl. ",CI=ABCDE12345"
inserted in previous runs. However the following does not work,
because [^!;]* eats everything till ";" (so $2, $3 are empty):
s/ ( \n [^!\n]* # not commented out by "!"
\b PCORI # "PCORI"
\s* : \s* # ":", evtl. surr. by whitespase
[^!;]* ) # not comment or new instruction
( , \s* CI # comma, evtl. whitespace, "CI"
\s* = \s* # "=", evtl. surr. by whitespase
[A-Z]{5} [0-9]{4} \b )? # ignore evtl. previous ",CI=..."
( [^!;]* ) ; # the rest before ";"
/$1$3,CI=$load;/ixg; # insert ",CI=..." before ";"
I know I could first remove all the ",CI=..." and after that
insert the new ones. But I am interested, if it can be done
in one reg. exp.
So is it possible to make [^!;]* not so greedy?
/Alex
P.S. The [^!;]*? does not help here.
------------------------------
Date: 16 Apr 1999 09:01:10 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Alex Farber <eedalf@eed.ericsson.se>
Subject: Re: Complicated reg. exp. question
Message-Id: <m3r9pkk9d5.fsf@joshua.panix.com>
Alex Farber <eedalf@eed.ericsson.se> writes:
> s/ ( \n [^!\n]* # not commented out by "!"
Unless I am misreading your code, it seems that each of these data
chunks is on its own line. If that's the case, why are you going
through these complicated regex gymnastics? If you simply read the
file line by line, then skipping comments and blank lines looks like
this:
while (<THEFILE>) {
next if /^!/ || /^\s*$/;
> I know I could first remove all the ",CI=..." and after that
> insert the new ones. But I am interested, if it can be done
> in one reg. exp.
Do you need for your regexp to be so paranoid? In other words, it
seems you're not so much doing detection of a particular pattern as
you are checking the syntax. If you know that the lines are
well-formed, then you could just
s/\bCI=[A-Z]{5}\d{4}\b/CI=$whatever/ if /^PCORI/;
Hope this helps.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 16 Apr 1999 09:43:03 -0400
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: Core
Message-Id: <dwilgaREMOVE-1604990943040001@wilga.mtholyoke.edu>
> Some versions of 'file' will tell the program that made the corefile -
> alternatively you might be able to run a debugger on it to get it to
> reveal its secrets.
If you are using Gnu C, you would do this with the command `gdb -c`. Make
sure your working directory is the place where the core file is.
Once there, try a backtrace, the 'bt' command. That will show you the
program stack.
Dan Wilga dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply **
------------------------------
Date: Fri, 16 Apr 1999 12:36:13 +0200
From: "Vincent Vanbiervliet" <vvb@ibm.net>
Subject: Re: How can I attach spaces before a text field or text area
Message-Id: <3717148d@news.uk.ibm.net>
or you may consider asking this question in an html editing newsgroup, as it
is no perl. Of course, you could use a table, that's the best way, since
it's not dependend of fonts
Ysteric's <eyounes@aol.com> wrote in message
news:7f70s0$4t9@news.vtcom.fr...
> if you want a space to be display, use
>
> Eric - from France
>
>
>
------------------------------
Date: Fri, 16 Apr 1999 11:28:56 +0100 (BST)
From: "Philip Nelson" <pandp@ibm.net.nospam>
Subject: How to install Perl onto a machine with no C compiler
Message-Id: <cnaqcvozarg.faagc80.pminews@news3.ibm.net>
I've successfully built and tested Perl 5.005.03 on our development AIX server.
I now want to implement the same level onto our production server, which doesn't have a C compiler (or any development tools for that matter).
Therefore I can't use the standard make based installation procedure.
How should I go about putting Perl onto this server ?
TIA
Philip Nelson
(pandp@ibm.net)
Using OS/2 Warp and PMINews
------------------------------
Date: 16 Apr 1999 13:54:29 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: How to install Perl onto a machine with no C compiler
Message-Id: <7f7fel$gut$1@pegasus.csx.cam.ac.uk>
Philip Nelson <pandp@ibm.net.nospam> wrote:
>I've successfully built and tested Perl 5.005.03 on our development AIX server.
>
>I now want to implement the same level onto our production server, which doesn't have a C compiler (or any development tools for that matter).
>
>Therefore I can't use the standard make based installation procedure.
>
>How should I go about putting Perl onto this server ?
Assuming the production server is running the same software versions as the
development server, the section in the INSTALL file headed
=head2 Creating an installable tar archive
may do what you want.
Mike Guy
------------------------------
Date: Fri, 16 Apr 1999 09:57:34 -0400
From: Yu Fang <yfang@gte.com>
Subject: Re: How to install Perl onto a machine with no C compiler
Message-Id: <371741CE.8BEA564@gte.com>
Phil:
see the FAQ 2.3 which was posted here yesterday. (6:25 EST)
Philip Nelson wrote:
>
> I've successfully built and tested Perl 5.005.03 on our development AIX server.
>
> I now want to implement the same level onto our production server, which doesn't have a C compiler (or any development tools for that matter).
>
> Therefore I can't use the standard make based installation procedure.
>
> How should I go about putting Perl onto this server ?
>
> TIA
>
> Philip Nelson
> (pandp@ibm.net)
>
> Using OS/2 Warp and PMINews
--
------------------------------
Date: Fri, 16 Apr 1999 12:57:26 GMT
From: hensonw@my-dejanews.com
Subject: htpasswd script problem
Message-Id: <7f7c3h$mim$1@nnrp1.dejanews.com>
First, let me say I am neophyte but very interested in learning to code in
Perl. I am attempting to write a script that will take a text file of names
and passwords in the following format;
name,password
name,password
and gen the .htpasswd file for an apache web server using the Perl script
below;
#!/usr/bin/perl
open(INFILE,"userlist.txt") || die "cannot open userlist.txt: $!";
open(OUT,">.htpasswd") || die "cannot create .htpasswd: $!";
while(<INFILE>){ # read a line from file userlist.txt into $_
chomp;
$comma = rindex($_,",");
$name = substr($_,0,$comma);
$passwd = substr($_,$comma+1);
srand($$|time); # random seed
@saltchars=(a..z,A..Z,0..9,'.','/'); # valid salt chars
$salt=$saltchars[int(rand($#saltchars+1))]; # first random salt char
$salt.=$saltchars[int(rand($#saltchars+1))]; # second random salt char
$cpw = crypt($passwd,$salt);
print OUT "$name\:$cpw\n";
}
close(INFILE) || die "can't close userlist.txt: $!";
close(OUT) || die "can't close .htpasswd: $!";
The output to the .htpasswd file looks like it would work but doesn't.
What am I doing wrong?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 16 Apr 1999 12:45:40 GMT
From: schalkwy@minnie.RZ-Berlin.MPG.DE (Leo Schalkwyk)
Subject: Re: like print <<...; load a variable?
Message-Id: <7f7bdk$rk7$1@fu-berlin.de>
I'm sure I'm not the only one who had totally missed the existence
of single-quotish here-documents in the docs. Is it a recent
feature or have I been asleep for ages?
Discussion of here documents in the man pages seems to be a bit thin
(unless I missed most of it) perhaps because of the assumption that
people know all about them because of shell traditions. For example
it might be logical to mention them in the section of perlop on
quote and quote-like operators?
Leo Schalkwyk
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote:
: Tad McClellan <tadmc@metronet.com> wrote:
: >
: > There are "single quotish" here-docs (when delimiter string is
: > in single quotes) which have all of the
: > same "special characters" that plain old single quoted strings
: > have.
: Nope. There are *no* special characters in a single-quotish here-doc.
: \ represents \ and ' represents '. (A fact which I can't find in
: the documentation :-( )
: % perl -w
: print <<'EOF';
: Here are two backslashes \\ and an escaped \'.
: EOF
: __END__
: Here are two backslashes \\ and an escaped \'.
: Mike Guy
--
------------------------------------------------------------
schalkwy@mpimg-berlin-dahlem.mpg.de
Max-Planck-Institut f|r molekulare Genetik
------------------------------
Date: 16 Apr 1999 07:00:54 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: like print <<...; load a variable?
Message-Id: <37173486@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
schalkwy@minnie.RZ-Berlin.MPG.DE (Leo Schalkwyk) writes:
:I'm sure I'm not the only one who had totally missed the existence
:of single-quotish here-documents in the docs. Is it a recent
:feature or have I been asleep for ages?
It's always been there. It works just like the shell does in this
regard. Not only that, but you can also in shell tradition escape
the token to do the equivalent of single-quoting it:
print <<\Testing;
this is a test
of the $0 script
Testing
--tom
--
BTL didn't really have a distribution policy in the early days,
you got a disk with a note: Here's your rk05, Love Dennis. If UNIX
crapped on your rk05, you'd write to Dennis for another.
--Andy Tannenbaum, "Politics of UNIX," Washington, DC USENIX Conference, 1984
------------------------------
Date: Fri, 16 Apr 1999 15:25:55 +0200
From: Alex Farber <eedalf@eed.ericsson.se>
Subject: Re: Module/Script for a WWW-Portal?
Message-Id: <37173A63.BDC0B0EC@eed.ericsson.se>
Manuel Elgorriaga wrote:
> I'm wondering if anyone has implemented a Web-portal using Apache, Perl
> and some SQL-DB (e.g. MySQL). I don't like them in the Internet, but I
> think they could be quite useful in an enterprise-intranet environment.
Hi,
see http://www.openportal.org
/Alex
------------------------------
Date: 16 Apr 1999 07:04:38 -0500
From: kdp@nntp.hom.net (Keith Phillips)
Subject: Need info on Perl vs. VB for manager persuasion
Message-Id: <37171946@news.hom.net>
The IT manager at my company wants me to come up with a Perl-
vs-VB point sheet. I checked the FAQs, but came up empty. Is
there already a document somewhere that compares Perl to VB?
[ ... or do I need to write one and post it for all to use? :-) ]
---------------------------------------------------------------
| Keith Phillips User: "Um, I can't find my files..." |
| kdp@hom.net Admin: "Files? What files?" |
---------------------------------------------------------------
------------------------------
Date: 16 Apr 1999 11:28:43 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Need info on Perl vs. VB for manager persuasion
Message-Id: <7f76tb$qp7$1@solti3.sdm.de>
In article <37171946@news.hom.net>, Keith Phillips <kdp@nntp.hom.net> wrote:
> The IT manager at my company wants me to come up with a Perl-
> vs-VB point sheet. I checked the FAQs, but came up empty. Is
> there already a document somewhere that compares Perl to VB?
> [ ... or do I need to write one and post it for all to use? :-) ]
Well, basically I'd say that whenever you need to deal with the proprietary
innards of WinWord or Excel (i.e., VB for Applications), you're stuck with
VBA anyway.
All else I'd rather do with Perl because this makes you independent of a
monopolist (M$) determined to squeeze the last cent out of you...
So far for guts feeling and political reasoning.
Now for technical merits, I'd say Perl is much better because it allows
you to write clean code, whereas VB is an inconsistent mess, especially
regarding data types.
Perl is much more powerful, flexible and scalable than VB (e.g.: regular
expressions, large reusable code repository (CPAN), you can write your
own data types and OO classes, etc.).
Moreover, Perl lends itself better than any other language to prototyping
and glueing things together.
This is because Perl gives you much more freedom than VB. An example is
introspection and its XS interface - which allow you to do almost anything
you want in Perl and circumvent almost any restriction that Perl might
impose on you. Try to do that with VB!
The problem certainly is how to convince a suit, because in most cases
the job can be done with either language.
Especially if your manager is misguided by FUD into believing there'd be
no support for Perl etc., which is simply not true (see Perl Clinic,
Active State etc. besides USENET newsgroups).
An argument that might convince him is that you can say that you will be
able to develop faster under Perl and that maintenance will also be
easier (i.e.: cheaper) under Perl.
Of course this is not true for a well-written VB script compared with a
quick-and-dirty-hack in Perl...
But I dare to allege that a programmer equally well-trained in Perl and
VB will always prefer Perl and will also be faster in Perl and produce
better code - but I might be biased, as I have much less experience in
VB than in Perl... :-)
Hope this helps a little, or at least gives you some ideas.
Wish you best of luck and success!
Regards,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/
http://www.engelschall.com/u/sb/download/
http://www.perl.com/CPAN/authors/id/STBEY/
http://www.oreilly.de/catalog/perlmodger/bnp/
------------------------------
Date: 16 Apr 1999 11:46:01 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Open an THML file but don't display it
Message-Id: <371714e9@newsread3.dircon.co.uk>
Kevin <mpajot@club-internet.fr> wrote:
> Hi all,
>
> I would like to write a perl script which opens an URL but doesn't send it
> to the browser. It's just to analyze the contain of this file.
> I suppose there is just a function that makes the job...
> Can you help me please ?
>
use LWP::Simple;
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Fri, 16 Apr 1999 19:54:23 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Password encryption
Message-Id: <wdER2.1$5p2.1135@vic.nntp.telstra.net>
You gotta be kidding!
Wyzelli
Daniel Beckham wrote in message ...
>Well, you need to supply a little more info. If you are using the latest
>version of Apache on that NT box, there is now a program that comes with
>the dist. that is the equiv. of htpasswd for unix. (1.3.6) Check the
>release notes. If you are using a not so latest verison of Apache, you
>don't even need to encrypt your passwords... Security you say? Why are
>you using NT then?
>
>Daniel
>
>In article <371499a1@news.uk.ibm.net>, vvb@ibm.net says...
>>
>> Hi,
>>
>> I need to be able to create .htaccess and .htpasswd files on the fly. To
do
>> this, I thought I'd use a perl script where you can enter a userid and
>> password, and that would then create the needed files.
>> Problem is that I don't see any way to create the password file. I know
in a
>> Unix environment, there's this command 'htpasswd' that you can use, but
as
>> far as I know, there's no win32 variant of it (I'm using WinNT).
>>
>> Thanks,
>>
>> Vincent Vanbiervliet
>> http://learn.ibm.be
>>
>>
>>
------------------------------
Date: Fri, 16 Apr 1999 11:06:05 GMT
From: marlon_shakespeare@my-dejanews.com
Subject: Re:
Message-Id: <7f75iq$h33$1@nnrp1.dejanews.com>
Change the file association of .pl to:
C:\Perl\bin\Perl.exe -w %s %s
Or if you want to enable taint mode as well:
C:\Perl\bin\Perl.exe -wT %s %s
[Marlon]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 16 Apr 1999 10:22:14 GMT
From: chatswood@my-dejanews.com
Subject: Re: SQL using the ODBC module
Message-Id: <7f730g$f69$1@nnrp1.dejanews.com>
In article <7f4vq3$kdr$1@nnrp1.dejanews.com>,
chatswood@my-dejanews.com wrote:
> I'm not too familiar with WinNT so I'm not sure if I can get it to work. At
> the minute the machine doesn't have Access, so I downloaded the Data Access
> Pack from Microsoft and installed the drivers. They all work for my own
> command line stuff, the Win32ODBC Test.pl script etc.
>
> So it seems to be a problem between Apache 1.3.4 and the ODBC I guess!
>
Seems a little ridiculous to reply to my own message but I found a solution
to the problem. ODBC wouldn't let Apache access a user DSN so I had to
create a system DSN. I got the solution from
http://www.bioinf.cs.uni-potsdam.de/doc/Databases/odbcfaq.htm
Which was useful in addition to the proper Win32::ODBC FAQ. Thanks for
everyones help!
Maurice Kelly
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 16 Apr 1999 11:48:10 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: SQL using the ODBC module
Message-Id: <3717156a@newsread3.dircon.co.uk>
chatswood@my-dejanews.com wrote:
> Gus
>
>> I suggest trying a fairly simple query first. This should work:
>>
>
> tried it but it wouldn't work -
> D:\apache\cgi-bin>d:\perl\bin\perl any.cgi
> Can't locate object method "new" via package "CGI" at any.cgi line 7.
>
it needed a 'use CGI;' somewhere there but you saw that didnt you ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Fri, 16 Apr 1999 15:44:21 -0700
From: "Ours" <ours@casema.net>
Subject: Uploading script.
Message-Id: <7f7f4i$atb$1@news.casema.net>
Hi All,
I would like to have a script (write) that would upload an attachement to my
server.
Idea is to be able to browse my local drives and find the source-file and
then press UPLOAD to upload to a remote server.
Is this at all possible and can someone point me in the right direction/hand
me the script?
Thanks,
MW
------------------------------
Date: Fri, 16 Apr 1999 09:22:10 -0400
From: splice@videotron.ca ([sp-])
Subject: Re: Using spaces in globbing?
Message-Id: <MPG.1181038da148e89f9896a4@news.videotron.ca>
In article <slrn7hd68i.f5f.sholden@pgrad.cs.usyd.edu.au>,
sholden@pgrad.cs.usyd.edu.au says...
> On Thu, 15 Apr 1999 21:47:25 -0400, [sp-] <splice@videotron.ca> wrote:
> >In article <MPG.11805cd6427ea37a9896a1@news.videotron.ca>,
> >splice@videotron.ca says...
> >>
> >> Reply here or by email at splice(at)videotron(dot)ca
>
> What's the point of munging a the address in the body and leaving it
> correct in the headers... Very strange...
Just the way I type it, not to avoid spam or anything.
Yeah, I admit, I am strange. Oh well.
[sp-]
------------------------------
Date: Fri, 16 Apr 1999 15:28:04 +0200
From: "NCTECH" <h-montalan@i-france.com>
Subject: Want to install printers with perl
Message-Id: <7f7d82$t2b$1@news.nctech.fr>
I'm a system administrator.
I have a lot of script to automate administration task.
I would like to create a script to install a printer on a NT server
and to share it.
How to do ?
begin 666 Herve Montalan.vcf
M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..DUO;G1A;&%N.TAE<G9E#0I&
M3CI(97)V92!-;VYT86QA;@T*14U!24P[4%)%1CM)3E1%4DY%5#I(+4UO;G1A
M;&%N0&DM9G)A;F-E+F-O;0T*4D56.C$Y.3DP-#$V5#$S,C@P-%H-"D5.1#I6
&0T%21 T*
`
end
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5398
**************************************