[12310] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5910 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 7 10:08:31 1999

Date: Mon, 7 Jun 99 07:00:21 -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           Mon, 7 Jun 1999     Volume: 8 Number: 5910

Today's topics:
    Re: Coloring text in DOS console? <gellyfish@gellyfish.com>
    Re: doppelte Werte in einem Array? (H. Camphausen)
    Re: Help needed and much appreciated (Stuart Wright)
    Re: Help needed and much appreciated <gellyfish@gellyfish.com>
    Re: Help needed and much appreciated <gellyfish@gellyfish.com>
    Re: Help needed and much appreciated (Stuart Wright)
    Re: Help needed and much appreciated (Stuart Wright)
        Help with regular expression needed <gustafl@algonet.se>
    Re: Help with regular expression needed <gellyfish@gellyfish.com>
        HELP: Can't find winsock.h / .ph !!! <silent1@bigpond.com>
        How do you do user input with opendir? <spammerswill@beshot.com>
    Re: How do you do user input with opendir? <cs004@wg.waii.com>
    Re: How to generate iterations of an array? <jdf@pobox.com>
        how to use a module if ISP wont install? <dtbaker@bus-prod.com>
    Re: how to use a module if ISP wont install? <matt-news@sergeant.org>
        Howto substitute contiguous lines <tim.schelfhout@alcatel.be>
        left$ in basic -- also in perl? <ralawrence@my-deja.com>
    Re: left$ in basic -- also in perl? (brian d foy)
    Re: left$ in basic -- also in perl? <droby@copyright.com>
    Re: left$ in basic -- also in perl? <gellyfish@gellyfish.com>
    Re: left$ in basic -- also in perl? (William Herrera)
        MS Access, Linux, DBI, DBD::ODBC, Easysoft's ODBC-ODBC  <john.bjorgen@cplc.com>
    Re: PERL and SMTP <jdporter@min.net>
        perlcc in HPUX 10.20 massimobalestra@my-deja.com
    Re: Problem running '.exe' from 'CGI' <abey@cs.ucr.edu>
        Redirect ftp://...? <slivings@digitalriver.com>
    Re: Regular Expressions <tim.schelfhout@alcatel.be>
    Re: REQ:>> How do the components know how to communicat <dan@softdisk.com>
    Re: The artistic license and perl: (Chris Nandor)
        Win32:  How to set PW for a service that logs in as a l <Maxtreme@worldnet.att.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 7 Jun 1999 12:40:47 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Coloring text in DOS console?
Message-Id: <375bafbf@newsread3.dircon.co.uk>

smnayeem@my-deja.com wrote:
> In article <7jftbb$h44$1@gatekeeper.ornano.kapt.com>,
>   "Fred Ruffet" <fruffet@kaptech.com> wrote:
>>
>> >> - How can I color the output of a Perl program in a MS-DOS shell.
>> >> - How can I reposition the cursor in a MS-DOS shell.
>>
>> >Probably the same way that you do for a non-Perl program. You almost
>> >certainly output some special codes that tell your system what you
> want it
>> >to do. The docs, FAQs, and newsgroups about MS-DOS may be able to
> help you
>> >here. Good luck!
>>
>> Right ! And, even if it's not a perl question, let me tell you that
> typing
>> "help" in a dos shell will help you. Note that Microsoft was a bit
> more
>> logic that it's now : you had to type "help" to get help, and not to
> click
>> "start" to stop your computer... Anyway, I don't remember which
> command you
>> need to look help on, but I know there's something about the escape
> codes
>> you need in the help on a command which deals with video modes or
> something
>> like that.
>>
> I tried checking the help files, but it doesnt say anything about
> escapse sequences, I know escape sequences works with PCL but its not
> working on the standard output. Anyone knows where i can find these
> infos, maybe some links or soemting?
> 

Check out :

  <http://enterprise.aacc.cc.md.us/~rhs/ansi.html>

If you dont understand it you will want to ask in a newsgroup that
is interested in MS-DOS

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: 7 Jun 1999 13:34:04 GMT
From: h.camp@scm.de (H. Camphausen)
Subject: Re: doppelte Werte in einem Array?
Message-Id: <MPG.11c5e8828a09613a989682@news.scm.de>

In article <375A8E12.BF1F5981@t-online.de>, christian.knebel@t-online.de 
says...
> Hallo,
> 
> kleine Frage:
> 
> ich schreibe verschiedene Strings in einen Array und es kann auch
> passieren, das einige der geschriebenen Strings gleich sind. Stehen
> diese Werte dann in diesem Array nur einmal, oder sooft wie ich sie
> reingeschrieben habe?
> 
> Falls sie mehrmals drinstehen: gibt es Lvsungen, so das jeder String nur
> einmal im Array steht (soll sowas wie ein Stichwortindex werden...)?
> 
> Danke,
> 
> Christian Knebel.
> 

Hi,

Meine Vorredner haben das wesenzielle schon gesagt, hier
gleichwohl noch ein Tip:

# Strings merken und Vorkommen zdhlen:
while ($string = <datenquelle>) {
	$hash { $string}++;
	# mach sonstwas n|tzliches...
}

# Falls Array mit Strings gew|nscht:
@unique_strings = keys (%hash);

hth, Harmut



-------------------------------------
CREAGEN Computerkram
Hartmut Camphausen
Kirchstrasse 8
35042 Marburg
Fon: 06424/923826
Fax: 06424/923827
Emil: h.camp@scm.de


------------------------------

Date: Mon, 07 Jun 1999 12:01:29 GMT
From: stuw@dial.pipex.com.remove.everything.after.com (Stuart Wright)
Subject: Re: Help needed and much appreciated
Message-Id: <375bb2d1.8692148@news.demon.co.uk>

On 8 Jun 1999 01:39:58 GMT, hasant@trabas.co.id (Hasanuddin Tamir) wrote:

>On Mon, 07 Jun 1999 08:48:38 GMT,
>Stuart Wright <stuw@dial.pipex.com.remove.everything.after.com> wrote:
>
>> [snip]
>> (I don't - I have to do perl programming about twice a year.  I avoid it
>> wherever possible !
>
>I avoid to do non-perl programming whenever possible.

It's not actually possible to create a full blown windows 32 bit GUI stock
control system connecting to an SQL database from start to finish in 3 days
using Perl, now is it?
With Powerbuilder, it's a snip.

>
>> After 10 years programming professionally for business
>> apps, 90% of the perl I use is gobbledygook to me, and I do it the hard way
>> with wordpad and uploading to a remote web server for testing.
>
>'Cause you choose the hard way.

Yeah, you got me.

>
>> If a script doesn't work, I comment out all the lines
>> and uncomment each line,upload and test 'till I find the bug.
>> It's usually an omitted semi-colon or squiggly bracket.  Rediculous.
>
>You're right, it's ridiculous to do so since Perl provides
>
>   perl -c script_name
>
>to show you the exact line and token where you might
>get wrong if any.
>

If you read my first posting, you'll see that perl running locally doesn't
pick up on my specific problems.  It works fine.  Only when I run the
script on the server does it fall over.
Granted any semi-colon, squiggly bracket problems are picked up.  What I'm
saying above, I suppose, is that after years of more user friendly
programming platforms, coming back to such a fussy one is a bit of a
culture shock.  Still, it's horses for courses and I'm sure Perl is loved
by many.  I suppose Perl's extra, very unreadable features are cool but
naturally take a while to learn.  I'm trying to program here without
learning them.

Any help from you lovely wizz kids is much appreciated.
-- 
Stuart Wright  stu-w@usa.net.remove.everything.after.net
Software Developer,
Web author for the Hi-Fi and Home Cinema Industries,
MIDI sequencer, Drummer and Motorcyclist.
Visit my web site http://ds.dial.pipex.com/town/road/xmk67/


------------------------------

Date: 7 Jun 1999 14:18:42 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help needed and much appreciated
Message-Id: <375bc6b2@newsread3.dircon.co.uk>

Stuart Wright <stuw@dial.pipex.com.remove.everything.after.the.com> wrote:
> foreach $rp (sort {$a->{$sort_on} cmp $b->{$sort_on}} values %record){
> 
> similar to that found here
> http://webreview.com/wr/pub/98/10/23/perl/index.html
> for some reason causes a 500 error as does
> $new_rec = $rp->{key};
> 
> I think it's the '->' bit.
> When I comment these lines out, the script works.  Perl locally
> doesn't complain about these lines.
> 

This may well be because the Perl on the server is not version 5 and
thus knows nothing of the -> construct.  You will have to ask the system
administrator what version it is if you dont have access to a shell on
that system.

It would also be helpful if you could see the error log for the web server
as this will usually contain the exact text of the error message that
Perl emitted.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: 7 Jun 1999 14:22:12 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help needed and much appreciated
Message-Id: <375bc784@newsread3.dircon.co.uk>

Stuart Wright <stuw@dial.pipex.com.remove.everything.after.com> wrote:
> On 8 Jun 1999 01:39:58 GMT, hasant@trabas.co.id (Hasanuddin Tamir) wrote:
> 
>>On Mon, 07 Jun 1999 08:48:38 GMT,
>>Stuart Wright <stuw@dial.pipex.com.remove.everything.after.com> wrote:
>>
>>> [snip]
>>> (I don't - I have to do perl programming about twice a year.  I avoid it
>>> wherever possible !
>>
>>I avoid to do non-perl programming whenever possible.
> 
> It's not actually possible to create a full blown windows 32 bit GUI stock
> control system connecting to an SQL database from start to finish in 3 days
> using Perl, now is it?
> With Powerbuilder, it's a snip.
> 

Why not ?  If you can do it with Powerbuilder you can certainly do it
with Perl ?  What kind of GUI do you want and to what database do you
want to connect ?

>           I suppose Perl's extra, very unreadable features are cool but
> naturally take a while to learn.  I'm trying to program here without
> learning them.
> 

Then why are you using Perl at all - for CGI type stuff ?  You can use
any language you like as long as it complies with the I/O requirements
of the CGI.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: Mon, 07 Jun 1999 13:57:43 GMT
From: stuw@dial.pipex.com.remove.everything.after.com (Stuart Wright)
Subject: Re: Help needed and much appreciated
Message-Id: <375bcefb.15901455@news.demon.co.uk>

On 7 Jun 1999 14:22:12 +0100, Jonathan Stowe <gellyfish@gellyfish.com>
wrote:

>Stuart Wright <stuw@dial.pipex.com.remove.everything.after.com> wrote:
>> On 8 Jun 1999 01:39:58 GMT, hasant@trabas.co.id (Hasanuddin Tamir) wrote:
>> 
>>>On Mon, 07 Jun 1999 08:48:38 GMT,
>>>Stuart Wright <stuw@dial.pipex.com.remove.everything.after.com> wrote:
>>>
>>>> [snip]
>>>> (I don't - I have to do perl programming about twice a year.  I avoid it
>>>> wherever possible !
>>>
>>>I avoid to do non-perl programming whenever possible.
>> 
>> It's not actually possible to create a full blown windows 32 bit GUI stock
>> control system connecting to an SQL database from start to finish in 3 days
>> using Perl, now is it?
>> With Powerbuilder, it's a snip.
>> 
>
>Why not ?  If you can do it with Powerbuilder you can certainly do it
>with Perl ?  What kind of GUI do you want and to what database do you
>want to connect ?

You can't do it with Perl because Perl is not a GUI application development
platform.  Unless you can produce an .exe which runs on windows without any
third party software (like internet explorer).  The database is Oracle BTW.

>
>>           I suppose Perl's extra, very unreadable features are cool but
>> naturally take a while to learn.  I'm trying to program here without
>> learning them.
>> 
>
>Then why are you using Perl at all - for CGI type stuff ?  You can use
>any language you like as long as it complies with the I/O requirements
>of the CGI.
>

I guess I don't really appreciate the difference between Perl and CGI.  I
assumed that CGI was a 'subsection' of Perl commands if you like.  But I
don't really care.  I just want the scripts to work.  I imagine most of the
people asking questions here don't want to learn how to use Perl rather
than get a particular script to work.
-- 
Stuart Wright  stu-w@usa.net.remove.everything.after.net
Software Developer,
Web author for the Hi-Fi and Home Cinema Industries,
MIDI sequencer, Drummer and Motorcyclist.
Visit my web site http://ds.dial.pipex.com/town/road/xmk67/


------------------------------

Date: Mon, 07 Jun 1999 13:58:45 GMT
From: stuw@dial.pipex.com.remove.everything.after.com (Stuart Wright)
Subject: Re: Help needed and much appreciated
Message-Id: <375ccfe3.16133789@news.demon.co.uk>

On 7 Jun 1999 14:18:42 +0100, Jonathan Stowe <gellyfish@gellyfish.com>
wrote:

>Stuart Wright <stuw@dial.pipex.com.remove.everything.after.the.com> wrote:
>> foreach $rp (sort {$a->{$sort_on} cmp $b->{$sort_on}} values %record){
>> 
>> similar to that found here
>> http://webreview.com/wr/pub/98/10/23/perl/index.html
>> for some reason causes a 500 error as does
>> $new_rec = $rp->{key};
>> 
>> I think it's the '->' bit.
>> When I comment these lines out, the script works.  Perl locally
>> doesn't complain about these lines.
>> 
>
>This may well be because the Perl on the server is not version 5 and
>thus knows nothing of the -> construct.  You will have to ask the system
>administrator what version it is if you dont have access to a shell on
>that system.
>
>It would also be helpful if you could see the error log for the web server
>as this will usually contain the exact text of the error message that
>Perl emitted.
>

So is '->' new to Perl 5 then ?  That's odd because I thought Perl 5 had
been out for ages.  Server is at www.tabnet.com
-- 
Stuart Wright  stu-w@usa.net.remove.everything.after.net
Software Developer,
Web author for the Hi-Fi and Home Cinema Industries,
MIDI sequencer, Drummer and Motorcyclist.
Visit my web site http://ds.dial.pipex.com/town/road/xmk67/


------------------------------

Date: Mon, 7 Jun 1999 13:14:23 +0200
From: "Gustaf Liljegren" <gustafl@algonet.se>
Subject: Help with regular expression needed
Message-Id: <7jgc4o$q5s$1@zingo.tninet.se>

I'm learning Perl for the sake of XML, and now I'm writing code for 
searching a XML- or HTML-file. I need a regular expression to find 
a special string ($search) within a special tag ($tag). If the tag contains 
sub-elements, those shall not be included in the search. How can I
formulate that expression?

Regards,

Gustaf Liljegren




------------------------------

Date: 7 Jun 1999 14:25:13 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help with regular expression needed
Message-Id: <375bc839@newsread3.dircon.co.uk>

Gustaf Liljegren <gustafl@algonet.se> wrote:
> I'm learning Perl for the sake of XML, and now I'm writing code for 
> searching a XML- or HTML-file. I need a regular expression to find 
> a special string ($search) within a special tag ($tag). If the tag contains 
> sub-elements, those shall not be included in the search. How can I
> formulate that expression?
> 

You use HTML::Parser or XML::Parser

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: Mon, 07 Jun 1999 22:19:47 +1000
From: "silent1@bigpond.com" <silent1@bigpond.com>
Subject: HELP: Can't find winsock.h / .ph !!!
Message-Id: <fEO63.6495$PN5.18605@newsfeeds.bigpond.com>

Help!

I can't find the file winsock.h / winsock.ph which socket.ph in my Perl
requires!

Running  Perl 5.00402 for Win95 from CPAN.

Can anyone tell me where I can get this file?

Julian



------------------------------

Date: Mon, 7 Jun 1999 08:31:59 -0700
From: "Mike" <spammerswill@beshot.com>
Subject: How do you do user input with opendir?
Message-Id: <7jgeak$7ik$1@holly.prod.itd.earthlink.net>

I wrote the following script, but activestate perl doesn't like it. I
haven't tried it out in my copy of redhat though:

print "Enter a directory to log: ";
$the_dir=<STDIN>;
print "You have selected to log $the_dir\n";
chomp($the_dir);
opendir(that_dir, '$the_dir');
open(LOG, '>log.txt');
@the_filez=readdir(that_dir);
foreach $lfile (@the_filez) {
        print "$lfile has been logged\n";
        print LOG "$lfile\n";
}

--
---Got Coffee?---
Linux and BeOS, sanity in a Win32 world





------------------------------

Date: Mon, 07 Jun 1999 08:26:00 -0500
From: Art Haas <cs004@wg.waii.com>
Subject: Re: How do you do user input with opendir?
Message-Id: <375BC868.E7616306@wg.waii.com>

Mike wrote:

> I wrote the following script, but activestate perl doesn't like it. I
> haven't tried it out in my copy of redhat though:
>
> print "Enter a directory to log: ";
> $the_dir=<STDIN>;
> print "You have selected to log $the_dir\n";
> chomp($the_dir);
> opendir(that_dir, '$the_dir');
> open(LOG, '>log.txt');
> @the_filez=readdir(that_dir);
> foreach $lfile (@the_filez) {
>         print "$lfile has been logged\n";
>         print LOG "$lfile\n";
> }
>
> --
> ---Got Coffee?---
> Linux and BeOS, sanity in a Win32 world

You need to check to see if 'opendir' and 'open' succeeded.
You should also close the directory and file when
you're done with it.

print "Enter a directory to log: ";
chomp($the_dir = <STDIN>);
print "You have selected to log $the_dir\n";
opendir(THAT_DIR,"$the_dir") || die "Can't open '$the_dir'! $!\n";
@the_filez = readdir(THAT_DIR);
closedir(THAT_DIR);
open(LOG,">log.txt") || die "Can't open 'log.txt'! $!\n";
foreach  $lfile (@the_filez) {
    print "$lfile has been logged\n";
    print LOG "$lfile\n";
}
close(LOG);

You should also be adding 'use strict;'

--
###############################
# Art Haas
# (713) 689-2417
###############################





------------------------------

Date: 07 Jun 1999 09:12:21 -0400
From: Jonathan Feinberg <jdf@pobox.com>
To: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to generate iterations of an array?
Message-Id: <m3u2skp32i.fsf@joshua.panix.com>

Tom Phoenix <rootbeer@redcat.com> writes:

> [ Followups set to c.l.p.modules ]

Deliberately ignored :)

> On Sun, 6 Jun 1999, Dmitry P. expressed a desire for a good way to
> generate the permutations of an array. I recently had a need for such a
> thing, and whipped up a small module for it. I'm not sure what to call the
> module, though. 

mjd has posted permutations code once or twice; here's a DejaNews link
to an example:

  http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=358292592&fmt=text


-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf


------------------------------

Date: Mon, 07 Jun 1999 08:33:42 -0500
From: Dan Baker <dtbaker@bus-prod.com>
Subject: how to use a module if ISP wont install?
Message-Id: <375BCA36.90E4D87D@bus-prod.com>

What is the best way to use a module (at a personal website for
instance) if the ISP won't install it to the regular perl directories on
the server? I have a couple things downloaded from CPAN that I would
like to use, but am not sure how to deal with it...

Is there a way I can put the .pm on my site, and maybe add to @INC?
would this approach work, or is there a better one?

-- 
Thanx, Dan

# If you would like to reply-to directly, remove the - from my username
* no spam please... regulated by US Code Title 47, Sec.227(a)(2)(B)  *


------------------------------

Date: Mon, 07 Jun 1999 14:56:03 +0100
From: Matt Sergeant <matt-news@sergeant.org>
Subject: Re: how to use a module if ISP wont install?
Message-Id: <375BCF73.FABE0762@sergeant.org>

Dan Baker wrote:
> 
> What is the best way to use a module (at a personal website for
> instance) if the ISP won't install it to the regular perl directories on
> the server? I have a couple things downloaded from CPAN that I would
> like to use, but am not sure how to deal with it...
> 
> Is there a way I can put the .pm on my site, and maybe add to @INC?
> would this approach work, or is there a better one?

Read "perldoc ExtUtils::MakeMaker" for the INST_ options to "make
install". Then once you've picked an appropriate directory, add that to
the search path via "use lib" (see "perldoc lib").

Matt.


------------------------------

Date: Mon, 07 Jun 1999 14:17:46 +0200
From: Timpie <tim.schelfhout@alcatel.be>
Subject: Howto substitute contiguous lines
Message-Id: <375BB869.DA2EBAF2@alcatel.be>

Hello there,

I'm looking at a way to substitute several lines at once.
While browsing through a HTML page which contains the
following lines several times

<CENTER>
<FONT COLOR="#505050">
Cell Manager: bt0131.net.alcatel.be
<BR>
Creation Date: 06/03/99 06:00:16
</FONT>
</CENTER>

I need only at the top of the page.


So every time I come accross these lines they need to be removed.  Is
there a way to do this. I recall
some variable that needs to be reset to nothing ?

TIm



------------------------------

Date: Mon, 07 Jun 1999 11:07:57 GMT
From: Richard Lawrence <ralawrence@my-deja.com>
Subject: left$ in basic -- also in perl?
Message-Id: <7jg969$kv7$1@nnrp1.deja.com>

Bit of a silly question this but I can't seem to find much information
(I'm probably looking in the wrong place).

In the dim dark depths of time I vaugly remember a left$ command which
took a string and a number (n) and returned the first n chars so:

  left$("hello",2) = he
  left$("fish and chips", 7) = fish an
  left$("bottoms", 99999) = bottoms

Is there any equivilant in Perl? I've been looking through the
programming perl book and some web help but haven't seemed to see
anything that would indicate Perl can do this (which I'm sure it can).

Thanks!

Rich


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Mon, 07 Jun 1999 08:37:48 -0400
From: brian@pm.org (brian d foy)
Subject: Re: left$ in basic -- also in perl?
Message-Id: <brian-ya02408000R0706990837480001@news.panix.com>

In article <7jg969$kv7$1@nnrp1.deja.com>, Richard Lawrence <ralawrence@my-deja.com> posted:

> In the dim dark depths of time I vaugly remember a left$ command which
> took a string and a number (n) and returned the first n chars so:
> 
>   left$("hello",2) = he

see substr()

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


------------------------------

Date: Mon, 07 Jun 1999 11:54:15 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: left$ in basic -- also in perl?
Message-Id: <7jgbt5$lmv$1@nnrp1.deja.com>

In article <7jg969$kv7$1@nnrp1.deja.com>,
  Richard Lawrence <ralawrence@my-deja.com> wrote:
> Bit of a silly question this but I can't seem to find much information
> (I'm probably looking in the wrong place).
>

You're just not looking in all of the right places.  ;-)

> In the dim dark depths of time I vaugly remember a left$ command which
> took a string and a number (n) and returned the first n chars so:
>
>   left$("hello",2) = he
>   left$("fish and chips", 7) = fish an
>   left$("bottoms", 99999) = bottoms
>
> Is there any equivilant in Perl? I've been looking through the
> programming perl book and some web help but haven't seemed to see
> anything that would indicate Perl can do this (which I'm sure it can).
>

Well yes, of course it can.  Use substr().

Please add the FAQ to your reading list.  This and many other simple
questions are answered there.  It should be on your system somewhere,
and is also available on-line at http://www.perl.com/faq.

--
Don Roby


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: 7 Jun 1999 14:00:02 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: left$ in basic -- also in perl?
Message-Id: <375bc252@newsread3.dircon.co.uk>

Richard Lawrence <ralawrence@my-deja.com> wrote:
> Bit of a silly question this but I can't seem to find much information
> (I'm probably looking in the wrong place).
> 
> In the dim dark depths of time I vaugly remember a left$ command which
> took a string and a number (n) and returned the first n chars so:
> 
>   left$("hello",2) = he
>   left$("fish and chips", 7) = fish an
>   left$("bottoms", 99999) = bottoms
> 
> Is there any equivilant in Perl? I've been looking through the
> programming perl book and some web help but haven't seemed to see
> anything that would indicate Perl can do this (which I'm sure it can).
> 

I think what you are looking for is substr():

   perldoc -f substr

This performs more like MID$ in BASIC .

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



------------------------------

Date: Mon, 07 Jun 1999 13:31:02 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: left$ in basic -- also in perl?
Message-Id: <375bc988.88346002@news.rmi.net>

On Mon, 07 Jun 1999 11:07:57 GMT, in comp.lang.perl.misc you wrote:

>In the dim dark depths of time I vaugly remember a left$ command which
>took a string and a number (n) and returned the first n chars so:
>
>Is there any equivilant in Perl? I've been looking through the
>programming perl book and some web help but haven't seemed to see
>anything that would indicate Perl can do this (which I'm sure it can).

look up substr in the perlfunc file.


---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


------------------------------

Date: Mon, 7 Jun 1999 08:46:39 -0400
From: "John Bjorgen" <john.bjorgen@cplc.com>
Subject: MS Access, Linux, DBI, DBD::ODBC, Easysoft's ODBC-ODBC Bridge
Message-Id: <7jgevg$ioa$1@gaddy.interpath.net>

Does anyone have experience using these components together to connect to an
MS Access database on a Windows NT machine from a Linux/Apache server?  I
would like to confirm that this will work before I invest the time and money
into trying to configure it.  Also for anyone who has experience, what are
the pitfalls I may face?  I have experience with Perl and ODBC Database
usage for Windows, but know relatively nothing about installing modules for
Perl or Apache. I appreciate any feedback I can get.

John Bjorgen
Assistant Webmaster
Emmanuel Baptist School
meatballman@bigfoot.com




------------------------------

Date: Mon, 07 Jun 1999 12:50:34 GMT
From: John Porter <jdporter@min.net>
Subject: Re: PERL and SMTP
Message-Id: <7jgf6n$mpl$1@nnrp1.deja.com>

In article <375b8430@news.uk.ibm.net>,
  " `V" <pdeeman@ibm.net> wrote:
> I could do with some help finding a Perl script that will accept form
fields
> and converting them into an email form.
> I have, but this uses Sendmail from UNIX...it wont work with any other
mail
> server.

If the script doesn't use CGI, throw it out and write your own.
If it does, rewrite the part that uses sendmail to use the Net::SMTP
module instead.  perldoc Net::SMTP.

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Mon, 07 Jun 1999 12:33:34 GMT
From: massimobalestra@my-deja.com
Subject: perlcc in HPUX 10.20
Message-Id: <7jge6u$meh$1@nnrp1.deja.com>

Hi,

I have problems runnung perlcc  in HPUX 10.20

I simpley type
perlcc test.pl

and the program is simply
print "hello world\n";

the result is a loop on this :
----------------------------------------------------------
Compiling
testwho.pl:
----------------------------------------------------------
Making C(testwho.pl.c) for
testwho.pl!
perlcc -I/opt/perl5/lib/5.00503/PA-RISC1.1
    -I/opt/perl5/lib/5.00503 -I/opt/perl5
    /lib/site_perl/5.005/PA-RISC1.1
     -I/opt/perl5/lib/site_perl/5.005 -I. -MO=CC,
    -otestwho.pl.c
testwho.pl
Unknown option:
    i/opt/perl5/lib/5.00503/pa-risc1.1
Unknown option:
    i/opt/perl5/lib/5.00503
Unknown option:
    i/opt/perl5/lib/site_perl/5.005/pa-risc1.1
Unknown option:
    i/opt/perl5/lib/site_perl/5.005
Unknown option:
    i.
Option mod does not take an
    argument


This is the result of perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3)
configuration:
Platform:

osname=hpux, osvers=10.20,
   archname=PA-RISC1.1
uname='hp-ux ithpg50 b.10.20 d 9000887 438366282
   64-user license '
hint=recommended, useposix=true,
d_sigaction=define
usethreads=undef useperlio=undef
d_sfio=undef
Compiler:

cc='cc', optimize='-O',
gccversion=
cppflags='-D_HPUX_SOURCE -Aa -
I/usr/local/include'
ccflags ='-D_HPUX_SOURCE -Aa -
I/usr/local/include'
stdchar='unsigned char', d_stdstdio=define,
    usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=undef, longlongsize=, d_longdbl=define, longdblsize=16
alignbytes=8, usemymalloc=y, prototype=define

Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib/pa1.1 /lib /usr/lib /usr/ccs/lib
libs=-lnsl_s -lndbm -ldld -lm -lc -lndir -lcrypt
libc=/lib/libc.sl, so=sl, useshrplib=false,
    libperl=libperl.a
Dynamic Linking:
dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef,
    ccdlflags='-Wl,-E -Wl,-B,defed '
cccdlflags='+z', lddlflags='-b -L/usr/local/lib'


Characteristics of this binary (from libperl):
Built under hpux
Compiled at Mar 31 1999 12:45:42
@INC:
/opt/perl5/lib/5.00503/PA-RISC1.1
/opt/perl5/lib/5.00503
/opt/perl5/lib/site_perl/5.005/PA-RISC1.1
/opt/perl5/lib/site_perl/5.005
 .

and I just installed it from the source.

What am I doing wrong?


Thank you




--
 Massimo Balestra
 System Engineer
 Torino Italy


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Mon, 7 Jun 1999 05:15:44 -0700
From: Abraham Grief <abey@cs.ucr.edu>
To: Steve Hoadley <sjhoadle@inwave.com>
Subject: Re: Problem running '.exe' from 'CGI'
Message-Id: <Pine.LNX.4.05.9906070500430.27580-100000@hill.cs.ucr.edu>


On Thu, 3 Jun 1999, Steve Hoadley wrote:

> Alright, I beat my head against a wall all day and now I need YOUR help.
> 
> Heres the layout:
>    windows NT
>    microsoft Internet Information Server (IIS) 4.0
>    Active state perl
> 
> I've written a 'cgi-bin' perl program and put it in the right place
> (c:inetpub/wwwroot/cgi-bin), access it from a web page and it works!
> EXCEPT. It skips over all of the 'system' calls that I use
> (ie 'system "C:/winnt/.../notepad.exe";'). My question is "how do I run
> an external application from the 'cgi-bin' area when it is accessed by a
> 
> web page". Oh yea. Just to really get me the program works fine if I
> just run it in a command window.
> 
> I'm off to take some tylenol. I'll check back later.
> In advance, THANKS. I owe ya.

If you're not specifying the full path in your system calls, you might
need to add something like

use lib 'c:inetpub/wwwroot/cgi-bin';

near the start of your script.  When your webserver runs the cgi script,
the cgi-bin might not be in the path.  Also, I don't know if you can use /
like that in your path on windows.  It's been a while since I wrote any
perl scripts on windows, but I always had to use backslashes for my paths.
If the path isn't the problem, maybe your script is running in taint mode
when executed by the web server and you're trying to give the system calls
tainted data.  If so, try passing system a list of arguments instead of
one string.

Hope this helps.




------------------------------

Date: Mon, 07 Jun 1999 08:14:33 -0500
From: Steve Livingston <slivings@digitalriver.com>
Subject: Redirect ftp://...?
Message-Id: <375BC5B9.7FCB7602@digitalriver.com>

Is it possible to redirect ftp-urls like http-urls?

Cheers,
Steve



------------------------------

Date: Mon, 07 Jun 1999 13:45:19 +0200
From: Timpie <tim.schelfhout@alcatel.be>
To: slegarre@ireste.fr
Subject: Re: Regular Expressions
Message-Id: <375BB0CE.DF97A424@alcatel.be>

/(\d*)\s*/;
$num=$1;

Then do your tests on the $num variable.

Check out
ftp://ftp.digital.com/pub/plan/perl/CPAN/doc/manual/html/pod/perl.html.
You can find up to date info
on syntax, explained functions, etc...  Good basis to start from.
Otherwise the Perl books (from O'reilly &
associates) are pretty good.

Have fun

slegarre@ireste.fr wrote:

> Hello,
>
> I have a string of characters like bellow:
>
> 125 Jean-Paul Gaultier 45 rue Champs Elysee 75 001 Paris
>
> I want to make some tests, on the first number(125).
>
> How regular expression can I use.
> I tried this one but it doesn't work:
> (.*?)(/d)
>
> Thank you for your answers
>
> Steven
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



------------------------------

Date: Sun, 06 Jun 1999 23:04:27 -0500
From: "Daniel R. Tobias" <dan@softdisk.com>
Subject: Re: REQ:>> How do the components know how to communicate... (-ej-)
Message-Id: <375B44CB.B4B26EAF@softdisk.com>

Euro Jake wrote:
> 
> - how does html in web knows where to look for scripts
> - how does perl know to send back output to browser instead of dos window

If you put the Perl scripts in the cgi-bin directory of your server
(assuming it's configured to expect scripts to be there), then any URL
of the form "http://www.yourdomain.com/cgi-bin/yourscript.pl" will cause
the script named "yourscript.pl" in the cgi-bin directory to run.  It's
not the "HTML" that's looking for the scripts, but the server that's
running them when the browser sends the appropriate URL.  And when a
script is run in this way, any output to standard output will go to the
browser.  You need to start with an HTTP response header, like:

print "Content-type: text/html\n\n";

I'm not really sure what other configurations you might have to set up
to get your server to know how to run Perl; that's operating-system and
server-software specific.

-- 
--Dan
Dan's Web Tips: http://www.softdisk.com/comp/dan/webtips/


------------------------------

Date: Mon, 07 Jun 1999 12:01:49 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: The artistic license and perl:
Message-Id: <pudge-0706990801550001@192.168.0.77>

In article <yl1zfqb99q.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:

# Chris Nandor <pudge@pobox.com> writes:
# 
# > Well, part of my point is that you won't provide any specific examples
# > of how they are used, or how they could be used for Bad.
# 
# Sure.  I've only been doing it for the past two posts, after all....

Yes, but I feel I adequately explained your examples away.


# > But unless there's precedent for them being necessarily treated as
# > separate things, I'm not sure I will accept that this is a problem.
# 
# The fact that licenses treat them as necessarily separate things rather
# sets that precendent, I'd say.

Who says they "necessarily" do?  I mean, besides you?


# > Russ Allbery wrote:
# >> Of course you can call it Perl.  Where in point 5 does it say you can't
# >> call it Perl?
# 
# > Where it says that you cannot advertise this Package as a product of
# > your own.  If you make it proprietary, and still call it Perl, you are
# > therefore claiming Perl to be "a product of your own".
# 
# Um.  No, you're not.  You're calling it Perl and claiming that the parts
# you added to it are a product of your own and then selling the whole
# thing.

In your example, the whole thing was proprietary.  Maybe I have absolutely
no idea what "proprietary" is, but it seems to me that if you claim that
something is your proprietary product, you are necessarily claiming it as
a product of your own.

I suppose you could distribute Perl as non-proprietary, which means that
it is open, and only distribute a portion as proprietary.  And in that
case, who cares?  You are in that case fully documenting what is and is
not Perl, so as to not claim Perl as your own.  And if that happens, then
you are not calling anything Perl that is not Perl.  So again, I see no
problem.


# So I've now named three separate ways that the Artistic License can be
# used by someone like Microsoft to fork a proprietary version of Perl and
# still call it Perl.

I've refuted them, in my opinion.  Summary:

* You talked about charging fees for copying, but did not demonstrate how
this could cause a fork in perl.

* You talked about the lack of the word "use", and I disagreed with the
intepretation that "the item itself" does not necessarily include "use" of
the item.

* You claimed that you can possibly distribute a proprietary package
called "Perl" without claiming it as your own, which I maintain isn't
possible.


# You've not refuted any of the three except with
# handwaving about how you don't *think* a jury would accept that argument,
# and agreed that one part of the license should be changed.

Please do not misrepresent me.  I claimed it COULD be changed.  I said I
did not care either way.


# I think I'm
# making my point, frankly.

I don't.  I mean, sure, you can claim I haven't refuted it.  I claim I
have.  And I like my opinions better than yours, so I win.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


------------------------------

Date: Mon, 7 Jun 1999 06:43:59 -0700
From: "Robert Hampton" <Maxtreme@worldnet.att.net>
Subject: Win32:  How to set PW for a service that logs in as a local user?
Message-Id: <7jgigt$o96$1@bgtnsc01.worldnet.att.net>

I've got  some services logging in as a local user account on an NT server.
When I change the password of the local user account, I need to update the
password for each service that uses the local account for logging in.

I've been scrounging David Roth's book on Win32 programming with Perl, but I
haven't seen this solution yet.  'Scuse me if I missed something obvious.

Your help would be appreciated.

Thanks.

-Max





------------------------------

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 5910
**************************************

home help back first fref pref prev next nref lref last post