[11348] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4948 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 20 09:07:19 1999

Date: Sat, 20 Feb 99 06:00:33 -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           Sat, 20 Feb 1999     Volume: 8 Number: 4948

Today's topics:
    Re: ActivePerl for Windows 95 - browser <ebohlman@netcom.com>
    Re: Are there any distance locators? <gellyfish@btinternet.com>
    Re: automatic converters of perl4 to perl5 <gellyfish@btinternet.com>
    Re: Bad Request Header <gellyfish@btinternet.com>
    Re: beginners question <sjohns17@uic.edu>
    Re: beginners question <white.tj@mciworld.com>
    Re: can I run perl on Win 98?????? t_alter@hotmail.com
    Re: can I run perl on Win 98?????? t_alter@hotmail.com
    Re: can I run perl on Win 98?????? (Larry Rosler)
    Re: can I run perl on Win 98?????? <gellyfish@btinternet.com>
    Re: Change URL Displays <gellyfish@btinternet.com>
    Re: Database performance <gellyfish@btinternet.com>
        FAQ 8.36: How do I fork a daemon process?   <perlfaq-suggestions@perl.com>
        FAQ 8.37: How do I make my program run with sh and csh? <perlfaq-suggestions@perl.com>
        FAQ 8.38: How do I find out if I'm running interactivel <perlfaq-suggestions@perl.com>
        FAQ 8.39: How do I timeout a slow event?   <perlfaq-suggestions@perl.com>
        FAQ 8.40: How do I set CPU limits?   <perlfaq-suggestions@perl.com>
        FAQ 8.41: How do I avoid zombies on a Unix system?   <perlfaq-suggestions@perl.com>
    Re: Help with Piping <gellyfish@btinternet.com>
    Re: help with search <gellyfish@btinternet.com>
        How do ignore delimiters within quoted strings? <jpage@cwcom.net>
    Re: Installation Errors <gellyfish@btinternet.com>
    Re: Mail confirmation <gellyfish@btinternet.com>
        oops, maybe - Re: [Q] CGI.pm for CGI script? dturley@pobox.com
        Perl & anonym surfing <botta@workmail.com>
        perl 5.005_02 compile on FreeBSD 3.0 <ask@netcetera.dk>
    Re: Perl Criticism topmind@technologist.com
    Re: Perl Editors for WinNT? <jacklam@math.uio.no>
    Re: Perl Editors for WinNT? <gellyfish@btinternet.com>
    Re: Perl Installation Help Resource? <gellyfish@btinternet.com>
    Re: perl installation on Solaris 7 <gellyfish@btinternet.com>
    Re: Perl Xbase Module. <sjohns17@uic.edu>
    Re: Problems Executing Script from web. <gellyfish@btinternet.com>
        Searching for Files within a certain directory <bye@me.com>
    Re: splitting Pairs of characters (Larry Rosler)
    Re: Urgent String Manip. Question ? <gellyfish@btinternet.com>
    Re: Variable help!!! <gellyfish@btinternet.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sat, 20 Feb 1999 09:07:29 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: ActivePerl for Windows 95 - browser
Message-Id: <ebohlmanF7G40H.BqH@netcom.com>

droby@copyright.com wrote:
: If you're in a DOS window, just typing "whatever.pl"  will run the file in the
: window you've already got if you've got the .pl extension associated with
: perl.exe.  It sounds like you do.  You can also type "perl whatever.pl".

On Win95, you have to use the latter form.  The former works on NT only.



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

Date: 20 Feb 1999 12:59:36 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Are there any distance locators?
Message-Id: <7ambjo$kk$1@gellyfish.btinternet.com>

On Fri, 19 Feb 1999 08:34:19 -0600 Tad McClellan wrote:
> Poohba (poohba@io.com) wrote:
> : I am looking for a distance locator.  If anyone has any info on this
> : please drop me a line.
> 
> 
>    Go to a hardware store.
> 
>    Ask "the helpful hardware folk" for a "tape measure".
> 
>    Just the thing for determining short distances.
> 
> 
>    The Global Positioning System (GPS) seems a viable option
>    for longer distances.
> 

Or for those gadget freaks amongst us I have an ultrasonic measuring
device in my toolbox (Yeah a 'real' toolbox other than the one found in
/usr/bin ;-)

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 12:12:55 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: automatic converters of perl4 to perl5
Message-Id: <7am8s7$gc$1@gellyfish.btinternet.com>

On 19 Feb 1999 17:23:19 +0300 vvv@vvv.vsu.ru wrote:
> Hi,
> 
> are there automatic converters of perl4 scripts to perl5 available?
> 

Er no,  but for the most part a Program written for Perl 4 should run
unchanged with Perl 5 - there are a couple of gotchas but these are
described in the perltrap manpage.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 13:19:02 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Bad Request Header
Message-Id: <7amco6$l6$1@gellyfish.btinternet.com>

On Thu, 18 Feb 1999 10:44:49 -0500 Abukar Mohamed wrote:
> Hi
> 
> I have a script that creates cookie (name=prefs), but I got this message
> when I use Netscape. In IE there is no problem.
> 
> Bad Request
> Your browser sent a request that this server could not understand.
> Request header field is missing colon separator.
> ; prefs=USCUR&1
> 

If the problem with is caused by the different bugs in various browsers
then it is unlikely to be a Perl problem - I would suggest that you ask
in a group interested in browsers or make a bug report to the vendor of
whichever browser you dont think is behaving correctly.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Feb 1999 04:44:01 -0600
From: Seth David Johnson <sjohns17@uic.edu>
Subject: Re: beginners question
Message-Id: <Pine.A41.3.96.990220043846.71904B-100000@tigger.cc.uic.edu>

The reason is that system must wait for the process to terminate before
the script can proceed (the return value of system is the process's exit
status).

Is there a reason not to do this via shell script?

-Seth Johnson
 musician/programmer

On Sat, 20 Feb 1999, white.tj wrote:

> I am on a sun box running solaris 2.5.
> I wrote a simple script to create two xterm windows and a filemgr window. I
> now the system commands are correct I tested them. So now my problem. When I
> execute the script only one window at a time will come up. When I kill the
> first window the second one will pop up and so on. Why? and is there a
> better way to do this in perl? <script included>
> 
> #!/usr/perl/perl5.004/bin/perl
> 
> system '(xterm -title lpscript -g 75X35+1+1 -e /usr/lpscript)' ;
> system '(xterm -title lpmon -g 75X35-0-0 -e /usr/lpmon)' ;
> system '(/usr/openwin/bin/filemgr -d /var/spool/lp/tmp/hostname)' ;
> 
> 
> 
> 
> 



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

Date: Sat, 20 Feb 1999 13:18:02 GMT
From: "white.tj" <white.tj@mciworld.com>
Subject: Re: beginners question
Message-Id: <eCyz2.201$DG2.82730@PM01NEWS>

No, I could do this with a shell script.; However, I am trying to teach my
self a little perl and thought this may be a good way to do it. I thought
there was some way to spawn a process, basically kick off and let the OS
worry about the exit status.






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

Date: Sat, 20 Feb 1999 08:06:31 GMT
From: t_alter@hotmail.com
Subject: Re: can I run perl on Win 98??????
Message-Id: <7alqe4$9n1$1@nnrp1.dejanews.com>

How? Pleas inform.

In article <7al3ei$a82$2@news1.rmi.net>,
  Jonesy <jonesy@rmi.nospam.net> wrote:
> : <t_alter@hotmail.com> wrote in message
> :     news:7akdfb$4p8$1@nnrp1.dejanews.com
> :       can I run perl on Win 98??????
>
> You can if you stop using so many "?"s !
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 20 Feb 1999 08:06:09 GMT
From: t_alter@hotmail.com
Subject: Re: can I run perl on Win 98??????
Message-Id: <7alqde$9n0$1@nnrp1.dejanews.com>

How? Plaese inform, time is running out.


In article <36cdcb27.0@news.cgocable.net>,
  "Dave Mckeown" <davemck@cgocable.
net> wrote:
> yes you can
>
> --
> Net-Studios, full service website hosting and design.
> Website URL: http://www.net-studios.com
> Need Web hosting?: http://www.net-studios.com/hosting/
> Contact me : dave@net-studios.com
> <t_alter@hotmail.com> wrote in message
> news:7akdfb$4p8$1@nnrp1.dejanews.com...
> >Hi everybody;
> >I am starting to learn perl. Can I do it with my Win98 PC?
> >I have been informed that I will have to go for Either UNIX or WinNT for
> that.
> >
> >Please drop an email at t_alter@hotmail.com
> >
> >Thanks a million.
> >
> >Tom
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
>
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 20 Feb 1999 01:13:19 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: can I run perl on Win 98??????
Message-Id: <MPG.11381c7b8d67d832989a64@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7alqde$9n0$1@nnrp1.dejanews.com> on Sat, 20 Feb 1999 
08:06:09 GMT, t_alter@hotmail.com <t_alter@hotmail.com> says...
> How? Plaese inform, time is running out.
> 
> In article <36cdcb27.0@news.cgocable.net>,
>   "Dave Mckeown" <davemck@cgocable.net> wrote:
> > yes you can
 ...
> > <t_alter@hotmail.com> wrote in message
> > news:7akdfb$4p8$1@nnrp1.dejanews.com...
> > >Hi everybody;
> > >I am starting to learn perl. Can I do it with my Win98 PC?
> > >I have been informed that I will have to go for Either UNIX or WinNT for
> > that.

Well, you asked 'Can I do it...', not 'How can I do it...', so some wise 
guys answered what you asked.  I think you are owed an apology and a 
straight answer.

<URL:http://www.activestate.com/>

Look for ActivePerl; download and install it.  I have found it to be 
very clean and neat, and trivial to install.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 20 Feb 1999 12:04:17 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: can I run perl on Win 98??????
Message-Id: <7am8c1$fv$1@gellyfish.btinternet.com>

On Fri, 19 Feb 1999 19:19:17 GMT t_alter@hotmail.com wrote:
> Hi everybody;
> I am starting to learn perl. Can I do it with my Win98 PC?
> I have been informed that I will have to go for Either UNIX or WinNT for that.
> 

Yep.  Using the activestate version you should have know trouble - infact
it is a slight improvement over Win95 as you dont have to install the
DCOM thing as it is already there.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 13:21:07 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Change URL Displays
Message-Id: <7amcs3$l9$1@gellyfish.btinternet.com>

On Thu, 18 Feb 1999 15:15:41 +0100 Ricardo Jardin wrote:
> I am a beginner at using Perl, and I have a question for anyone who can
> help me.
> 
> I would like to mask or hide the URL that is automatically displayed by
> Netscape and Internet Explorer.
> 

Why ?

> For example :
> http://www.golfway.com/epga.shtml   I would like the people not to see
> the portion of epga.shtml.
> 
> I would like to accomplish this using Perl, if anyone can help me with
> this I would greatly appreciate it.
> 

A) This cant be done and

B) Even if it could be done it would be nothing to do with Perl.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 12:25:23 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Database performance
Message-Id: <7am9jj$gi$1@gellyfish.btinternet.com>

On Thu, 18 Feb 1999 16:48:36 -0700 Owl Screech, Inc. wrote:
> Hi,
> 
>     For a database containing approximately 700,000 records,
>     of the following which would be give the best performance
>     using x86 Linux and a Perl interface?
> 
>     Informix
>     Sybase
>     mySql
>     mSql
> 
>     We're currenly using mSql and it starts getting a bit slow when dealing
> with over 20,000 records.
> 

I think that a discussion of the relative performance merits of databases
would best be taken to some comp.databases.* newsgroup really.

All of the above mentioned systems work well with Perl and it is really
to do with the implementation of the database server that is pertinent.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 01:38:17 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.36: How do I fork a daemon process?  
Message-Id: <36ce7479@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I fork a daemon process?

    If by daemon process you mean one that's detached (disassociated from
    its tty), then the following process is reported to work on most Unixish
    systems. Non-Unix users should check their Your_OS::Process module for
    other solutions.

    *   Open /dev/tty and use the TIOCNOTTY ioctl on it. See the tty(4) manpage
        for details. Or better yet, you can just use the POSIX::setsid()
        function, so you don't have to worry about process groups.

    *   Change directory to /

    *   Reopen STDIN, STDOUT, and STDERR so they're not connected to the old
        tty.

    *   Background yourself like this:

            fork && exit;

-- 
"Make is like Pascal: everybody likes it, so they go in and change it. "
	    --Dennis Ritchie


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

Date: 20 Feb 1999 02:38:18 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.37: How do I make my program run with sh and csh?  
Message-Id: <36ce828a@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I make my program run with sh and csh?

    See the eg/nih script (part of the perl source distribution).

-- 
    "Computer Science is no more about computers than astronomy 
    is about telescopes." --E.W. Dijkstra


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

Date: 20 Feb 1999 03:38:24 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.38: How do I find out if I'm running interactively or not?  
Message-Id: <36ce90a0@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I find out if I'm running interactively or not?

    Good question. Sometimes `-t STDIN' and `-t STDOUT' can give clues,
    sometimes not.

        if (-t STDIN && -t STDOUT) {
            print "Now what? ";
        }

    On POSIX systems, you can test whether your own process group matches
    the current process group of your controlling terminal as follows:

        use POSIX qw/getpgrp tcgetpgrp/;
        open(TTY, "/dev/tty") or die $!;
        $tpgrp = tcgetpgrp(fileno(*TTY));
        $pgrp = getpgrp();
        if ($tpgrp == $pgrp) {
            print "foreground\n";
        } else {
            print "background\n";
        }

-- 
If the space is a problem, get a bigger computer.  Computers are supposed
to serve man, not vice versa, the experience of the last 40 years
notwithstanding.  --Larry Wall in <1995Jul30.033515.25114@netlabs.com>


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

Date: 20 Feb 1999 04:38:34 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.39: How do I timeout a slow event?  
Message-Id: <36ce9eba@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I timeout a slow event?

    Use the alarm() function, probably in conjunction with a signal handler,
    as documented the section on "Signals" in the perlipc manpage and
    chapter 6 of the Camel. You may instead use the more flexible
    Sys::AlarmCall module available from CPAN.

-- 
"Twisted cleverness is my only skill as a programmer." --Elizabeth Zwicky


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

Date: 20 Feb 1999 05:38:40 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.40: How do I set CPU limits?  
Message-Id: <36ceacd0@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I set CPU limits?

    Use the BSD::Resource module from CPAN.

-- 
"Let me control a planet's oxygen supply, and I don't care who makes the laws."
    --Great Cthuhlu's Starry Wisdom Band (via Roger Leroux)


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

Date: 20 Feb 1999 06:39:03 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.41: How do I avoid zombies on a Unix system?  
Message-Id: <36cebaf7@csnews>

(This excerpt from perlfaq8 - System Interaction 
    ($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I avoid zombies on a Unix system?

    Use the reaper code from the section on "Signals" in the perlipc manpage
    to call wait() when a SIGCHLD is received, or else use the double-fork
    technique described in the "fork" entry in the perlfunc manpage.

-- 
	And on the seventh day, He exited from append mode.


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

Date: 20 Feb 1999 11:55:22 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Help with Piping
Message-Id: <7am7ra$fi$1@gellyfish.btinternet.com>

On Fri, 19 Feb 1999 18:31:56 -0400 nullspace wrote:
> Hi,
> I'm trying to write a script that looks something like this (in chuncks):
> 
<snip>
> 
> So far, I can do (1) and (3) but I'm having trouble with the code for
> running the compiled program from my script.
> I thought it was the exec(" /test/a.out & ") command. It works to a point.
> The program runs but anything after that call in my perl script doesn't get
> reached. 

Yep thats the way that exec works I'm afraid - it replaces the current 
process with the one that it creates.

read the perlfunc entry for exec()

>           I thought that there
> must be a way to find out if a.out has finished but I just don't know the
> proper code.
> I assume this is called piping so I thought I would post it as such.
>  Any help would definitely be appreciated. Thanks!!
> 

What you are looking for is one of system() or the backticks or even
possibly the creation of a pipe using open(). You should read the perlfunc
manpage to determine which is more suitable and perhaps also perlipc.

However a quick synopsis:

$rc = system('a.out');  # a.out is run an its exit code is returned

$output = `a.out` ; # a.out is run and its output is returned
                    # exit code is in $?

open(AOUT,'a.out |') || die " - $!\n"; # a.out is run and its output is
                                       # available to be read through
                                       # the fielhandle AOUT

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 13:33:16 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: help with search
Message-Id: <7amdis$le$1@gellyfish.btinternet.com>

On Thu, 18 Feb 1999 11:14:11 GMT Natasha Boyd-Stevenson wrote:
> I have a copy of Matts Simple Search script that works fine for our site. 
> I am quite new to Perl and I would like to change the script so that when
> you look at one of the resulting pages, the search term is in bold.
> 

Generally Matts programs are held in very low esteem around here for
various reasons that are recounted so often that I dont think I need
repeat them.  If it works for you I am very happy however.

The problem is here that it is generally considered poor taste to be
asking here for support on these things and especially as the majority
of the people here are unlikely to have the source code lying around.

The best approach would be to examine the code and discover where the
output is generated and then alter that so any output text containing the
search term is emitted in the appropriate manner to make it appear bold.

This might be as simple as putting:

$output_text =~ s|($search_string)|<BOLD>$1</BOLD>|g;

somewhere in your code.  But somehow I doubt it.

Go ahead and try a few things and if you have any difficulty with the
Perl aspects then post the tiniest snippet that demonstrates the problem
so we might better help you.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Feb 1999 12:02:18 +0000
From: Jeremy Page <jpage@cwcom.net>
Subject: How do ignore delimiters within quoted strings?
Message-Id: <36CEA44A.97676783@cwcom.net>

I am looking to split a long csv text file into records and fields using
Perl, that I can then put into a PostgreSQL database. The only trouble
is that there are some commas within quoted strings which I don't want
the split function to recognise and split at.

Is there any way (or module someone has written) that can help me split
the strings into lists while ignoring the quoted commas? I have tried
all manner of substituion combinations, but nothing seems fool-proof.

Jeremy Page


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

Date: 20 Feb 1999 12:02:10 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Installation Errors
Message-Id: <7am882$fs$1@gellyfish.btinternet.com>

On Fri, 19 Feb 1999 21:25:31 GMT Scott Ranzal wrote:
> Trying to install Perl5.005_02 on a SCO Unix Release 3.2.  I am able to get
> through all the default options and then when I run make I hit problems.
> 
> cc my way through things and then I get to:
> 
> cc miniperl miniperlmain.o libperl.a and it comes up with
> 
> undefined    first referenced
> symbols          in file
> 
> atan2            libperl.a
> cos                libperl.a
> exp                libperl.a
> log                 libperl.a
> sqrt                libperl.a
> ...                    libperl.a
> ld fatal: Symbol referencing errors.  No output written to miniperl
> *** Error code 13
> #
> 

It appears that the linker requires you to explicitly tell it to use
the maths library to get those functions.  You will need to start the
configure process again and when it asks you if you want to specify any
additional libraries  you should type in the name of the maths library
most probably -lm as well as all of the ones that it suggests.

This is strange however because I built Perl on a similar platform the
other day and it went alright (once I had sorted out the dynamic loading)
are you sure that configure guessed the OS right ?

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 13:50:40 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Mail confirmation
Message-Id: <7amejg$li$1@gellyfish.btinternet.com>

On Wed, 17 Feb 1999 23:25:36 -0500 Professeur Alfred wrote:
> I'm making a cgi script with perl which sends e-mail from a Unix server
> using Sendmail. I saw that sometimes, e-mails are lost. So, I would like to
> be able to verify if the mailing is OK.
> 
> Does somebody know how my script can receive a confirmation from Sendmail
> that the e-mail is well gone?
> 

It is unlikely that this can be done as in all likelihood the mail sending
will occur asynchronously after the data has been handed to sendmail.

Most sendmail configurations will wait for some pretermined period before it
determines that it cannot send the message unless it encounters some fatal
error on its first attempt that would mean a retry is useless.

If it is at all possible it is likely that it something that will have to
be done to sendmail rather than in your program.  I would suggest that your
first port of call should be the sendmail manpage or a newsgroup that is
concerned with sendmail issues.

A possibility would be to create a second script that would be called from
procmail that would catch the 'bounce' messages and do something appropriate
but this not going to be something that you can do within a CGI program.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Feb 1999 12:55:16 GMT
From: dturley@pobox.com
Subject: oops, maybe - Re: [Q] CGI.pm for CGI script?
Message-Id: <7ambbi$msl$1@nnrp1.dejanews.com>

In article <7al6aj$pup$1@nnrp1.dejanews.com>,
  I wrote:
> In article <7akqjd$j1t$1@vixen.cso.uiuc.edu>,
>   research@proton.vlsi.uiuc.edu (green) wrote:
>
> > but all I can see on the Web is just a simple text file,
>
> Because that's what you sent:
>
> > print header('text/plain'), "Nothing to it!";
>
> Try:
>
> print header('text/html'), "Nothing to it!";

<and more...>

I may have misinterpreted your question. By a "simple text file" do you mean
that the output is text, not html or that the script is showing? If it's the
former, my answer aplies. If the latter, then either you didn't chmod the
script to be executable, or your server is misconfigured.

cheers,

--

____________________________________
David Turley

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 20 Feb 1999 15:19:48 +0200
From: Susan <botta@workmail.com>
Subject: Perl & anonym surfing
Message-Id: <36CEB674.105E253A@workmail.com>

Hi!

I'm willing to offer a free anonymous surfing service, but I can not
perl.
So could you please help me?

This code shows the code of a web-page:

  #!/usr/local/bin/perl
  use LWP::Simple;
  $code=get $ARGV[0];
  print "Content-type: text/html\n\n";
  print $code;

Now I need your help:
1) The Content-type must depend on the type of the requested file.
2) All 'HREF' and 'SRC' parameters must be changed to:
   http://my_cgi_url?[absolute URL]
3) All href mailto:
   http://my_mailto_cgi?[somebody@somewhere.com]
4) <TITLE>...</TITLE> must be changed to:
   <TITLE>Anonym:...</TITLE>

And somethin other you find out...

If you can help me, please contact me via e-mail!
Thanks in advance :-)

- Susan -
botta@workmail.com



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

Date: 20 Feb 1999 09:00:58 +0100
From: Ask Bjoern Hansen <ask@netcetera.dk>
Subject: perl 5.005_02 compile on FreeBSD 3.0
Message-Id: <m3n229ec79.fsf@ratatosk.netcetera.dk>


My compilation of perl5.005_02 (./Configure -des) ends like this:

 ....
`sh  cflags libperl.a util.o`  util.c
          CCCMD =  cc -DPERL_CORE -c -I/usr/local/include -O   
util.c: In function `vsprintf':
util.c:1639: structure has no member named `_ptr'
util.c:1640: structure has no member named `_cnt'
util.c:1644: structure has no member named `_flag'
util.c:1644: `_IOWRT' undeclared (first use this function)
util.c:1644: (Each undeclared identifier is reported only once
util.c:1644: for each function it appears in.)
*** Error code 1

Stop

83 root@dorothy16> uname -a
FreeBSD dorothy16.valueclick.com 3.0-RELEASE FreeBSD 3.0-RELEASE #0: \
Tue Jan 19 09:20:49 PST 1999 \
value@dorothy16.valueclick.com:/usr/src/sys/compile/01.19.1999 i386

What am I missing?


 - ask

-- 
ask bjoern hansen - <http://www.netcetera.dk/~ask/>


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

Date: Sat, 20 Feb 1999 08:59:11 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <7altgu$d23$1@nnrp1.dejanews.com>

In article <xkfsoc5erjv.fsf@valdemar.col.hp.com>,
  Eric The Read <emschwar@mail.uccs.edu> wrote:
> topmind@technologist.com writes:
> > In article <36A4C4A3.79F0EA81@ngb.se>,
> >   Staffan Liljas <staffan@ngb.se> wrote:
> > > Now you may ask: Why isn't there any dataservers in perl for SQL
> > > databases, as there is in, for example, Visual Objects? The reason, if
> > > you ask me, is that SQL and other so called relational databas models
> > > don't lend themselves well to database server objects of this type.
> > > Instead you use session objects etc, which, in fact, makes more sense.
> >
> > I am not quite sure what you mean here.
>
> <yoda>
> And that is why you fail.
> </yoda>
>
> -=Eric
> (sorry, couldn't help myself!)
>


Well excuse me, Cryptoman!

One of the few messages you wrote that
was less than 40% insults and you don't
want to explain it?

Figures.

-tmind-

P.S.  F Yoda

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sat, 20 Feb 1999 13:48:38 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: Perl Editors for WinNT?
Message-Id: <36CEAF26.FBC9D38F@math.uio.no>

"H.A." wrote:
> 
> I'm just starting on Perl and I do most of my programming on WinNT.
> I hate using Notpad for programming.  I was wondering if there is a
> nice CGI/Perl editor out there that I could use. Kind of like HTML
> editor (Not WYSIWYG).

Two popular editors are The Programmer's File Editor (PFE)

   http://www.lancs.ac.uk/people/cpaap/pfe/

and Emacs for Windows

  http://www.cs.washington.edu/homes/voelker/ntemacs.html

PFE does not support syntax highlighting and does not have a special
perl-mode.  Emacs has both syntax highlighting and a special perl-mode.

Peter

-- 
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam



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

Date: 20 Feb 1999 12:16:35 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perl Editors for WinNT?
Message-Id: <7am933$gf$1@gellyfish.btinternet.com>

In comp.lang.perl.misc H.A. <ns-am528@chebucto.ns.ca> wrote:
> I'm just starting on Perl and I do most of my programming on WinNT.  I hate 
> using Notpad for programming.  I was wondering if there is a nice CGI/Perl 
> editor out there that I could use. Kind of like HTML editor (Not WYSIWYG).
> 

In order to nip the inevitable useless thread advocating everyones
favourite editor in the bud - I would suggest that you take a look at :

<http://reference.perl.com/query.cgi?editors>

And find something that will suit you.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 13:03:48 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Perl Installation Help Resource?
Message-Id: <7ambrk$kp$1@gellyfish.btinternet.com>

On Thu, 18 Feb 1999 22:11:16 GMT Trevor Stone  nyx.net wrote:
> I know that the range of errors cannot hope to be covered in a help document,
> but some common ones might.  Specifically, the makefile seems to imply that
> miniperl often produces some problems.  Is there some resource which helps
> these sorts of problems, or am I completely on my own?
> 
> Specifically, when I run make, the following fun-filled errors show up:
> 
> cc  -L/usr/local/lib -o miniperl miniperlmain.o libperl.a 
> libperl.a(pp.o): In function `Perl_pp_pow':
> pp.o(.text+0x183e): undefined reference to `pow'
<snip>

Missing maths library - you will need to explicitly add it during
configure when it asks you for the additional libraries. And if you havent
got the maths library at all then its all over I'm afraid ...

Strangely this is the second of these I have seen today.

/J\

-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 13:16:35 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: perl installation on Solaris 7
Message-Id: <7amcjj$l3$1@gellyfish.btinternet.com>

On 18 Feb 1999 19:17:57 GMT Greg Ward wrote:
> 
> Sun makes binary versions of many popular free software packages
> available at www.sunfreeware.com -- I know for certain they have Perl
> there, and they might have gcc too.
> 

They do - one also has to remember to download the binutils package as well
in order to be able to compile anything useful.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Feb 1999 04:36:09 -0600
From: Seth David Johnson <sjohns17@uic.edu>
Subject: Re: Perl Xbase Module.
Message-Id: <Pine.A41.3.96.990220043331.71904A-100000@tigger.cc.uic.edu>

On Sat, 20 Feb 1999 ghill@n2.net wrote:

> Where can one find some sample scripts using Win32:ODBC?
> Thanks in advance.
> Greg Hill

Greg-

Have you checked out www.roth.net/odbc/ ? The author (Tim Roth) has a FAQ
there and (I think) a presentation he made with examples. Also, take a
look at the pod; it's fairly helpful.

-Seth Johnson
 musician/programmer



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

Date: 20 Feb 1999 13:11:11 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Problems Executing Script from web.
Message-Id: <7amc9f$l0$1@gellyfish.btinternet.com>

On Thu, 18 Feb 1999 16:52:03 -0500 Rabin Vongpaisal wrote:
> Hi,
> 
> I was wondering if any of you can quickly help me out.  I have written
> scripts for Unix and I am trying to get a script working under Win NT.
> 
> The perl interpreter and perl registry ars supposedly to be installed
> correctly.  I can run the script from a DOS prompt ok, but when I try to
> execute it from the web, it gives me this error:
> 

Of course this is a Server configuration error and as such would be best
taken up with an appropriate newsgroup such as 

   comp.infosystems.www.servers.ms-windows

> ---
> CGI Error
> 
> The specified CGI application misbehaved by not returning a complete set
> of HTTP headers. The headers it did return are:
> 
> Can't open perl script "???????????????ll????????????????????l??":
> Invalid argument
> ---

Unfortunately this question has been answered befor on this group - a 
judicious searching of DejaNews will throw up an answer.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sat, 20 Feb 1999 00:12:05 -0800
From: "Spanky" <bye@me.com>
Subject: Searching for Files within a certain directory
Message-Id: <7alqse$g9m$1@ash.prod.itd.earthlink.net>

Please help!

New to Perl and Active Perl 5.0 and would like some guidance.  I'm trying to
evaluate a certain condition within a directory which has many files with
different names.  The only thing in common is the extention.  How can I use
a file handler to read the file(s) using =~m "Criteria" against all the
files within that directory.

I have tried to use wildcards to no avail.

Thanks :-)





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

Date: Sat, 20 Feb 1999 00:19:40 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: splitting Pairs of characters
Message-Id: <MPG.11380ff291d6c290989a63@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7alkc1$ers$1@scream.auckland.ac.nz> on 20 Feb 1999 06:22:57 
GMT, Suad Musovich <suad@nix.tmk.auckland.ac.nz> says...
> Is it possible to split pairs of characters in a word?
> 
> I have messily split single characters and printed the 
> array in pairs but it would send a Perl coder screaming
> "philistine" if they saw my code :)
> 
> This is for splitting a HW address like 000502F3DD12
> into 00:05:02:F3:DD:12

#!/usr/local/bin/perl -w
use strict;

$_ = 'abcdefghi';

print join(':', /..?/gs), "\n";
__END__

This splits an arbitrary string into pairs of characters, allowing for 
an odd number of characters.  If you want to restrict to 'pairs of 
characters in a word', use /\w\w?/g or (identically) /\w{1,2}/g, or any 
other definition appropriate for your data.

Not messy at all, eh?

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 20 Feb 1999 13:07:48 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Urgent String Manip. Question ?
Message-Id: <7amc34$kt$1@gellyfish.btinternet.com>

On Thu, 18 Feb 1999 16:48:17 -0500 Murtuza Chhil wrote:
> Hi,
> I develp on a Win NT platform and I run into this strange problem....it
> probably sems strange to me as I  am relatively new to Perl.
> 
> 
> I extract the environment string from the path key of the registry and it
> contains a sting like
> 
> $strTemp = "D:\perl\bin;%SystemRoot%\system32"
> 
> Next I append the string ";D:\mypath" at the end of $strTemp
> 
> Next I write this appended value to the path key.
> 
>  When I  run cmd and type path I see
> D:\perl\bin;%SystemRoot%\system32;D:\mypath
> 
> instead of
> 
> D:\perl\bin;C:\Winnt\system32;D:\mypath
> 
> [ the %SystemRoot% implicitly gets changed to c:\winnt   ....Winnt behavior]
> 
> Q) Do I need to take special care of the % sign by putting quotes or "\"
> 
> or is this a Winnt problem rather than perl.
> 

This is Perl not a batch file.

Perl doesnt know anything about the %blah% construct that passes for
environment variable handling in the MS world.  You will have to actually
have to get the value of the SystemRoot variable from the ENV hash thus:

$SystemRoot = $ENV{'SystemRoot'};

and then put that in your string.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: 20 Feb 1999 12:57:15 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Variable help!!!
Message-Id: <7ambfb$kh$1@gellyfish.btinternet.com>

On Thu, 18 Feb 1999 19:08:22 -0500 Poohba wrote:
> I have a variable that is called host and the variable looks like this:
> hostname.mycompany.com
> The problem is that sometimes the space isn't arent the same length and I
> want to extract the hostname and use it but the hostname might be 4 char.
> or 8 chars. or 10.  How do I extract it?  This is what I have:
> 
> $host = substr($person,62);
> 
> Now as I said b4 $host could be long or short with 3 dots in the host
> variable or 2.
> 

I'm not entirely sure what it is that you want here.

I think that your problem is trying to use substr when it would be far
better to use a regex or  split();

alternatively you can use index() to locate the dots in your data and then
use the information thus gleaned to extract using substr().

ie:

#!/usr/bin/perl

$host = 'hostname.mycompany.com';

if ( $host =~ /^(\w+?)\..*/ )
  {
    $hostname1 = $1;
  }

($hostname2,$domain) = split(/\./,$host);

$firstdot = index($host,'.');
$hostname3 = substr($host,0,$firstdot);

print "By regex : $hostname1\n";
print "By split : $hostname2\n";
print "By substr: $hostname3\n";

A quick benchmark on these various methods gives this:

Benchmark: timing 262144 iterations of Regex, Split, Substr...
     Regex:  9 wallclock secs ( 9.56 usr +  0.00 sys =  9.56 CPU)
     Split:  8 wallclock secs ( 7.83 usr +  0.00 sys =  7.83 CPU)
    Substr:  3 wallclock secs ( 4.05 usr +  0.00 sys =  4.05 CPU)

So infact your substr approach is probably the most efficient except
that you were going about it the wrong way.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

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

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