[9019] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2637 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 19 09:07:13 1998

Date: Tue, 19 May 98 06:01:00 -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           Tue, 19 May 1998     Volume: 8 Number: 2637

Today's topics:
    Re: ' Premature end of script headers ' is pissing me o <dorr@cetrel.lu>
        .db file corrupt - repair tool? soulhuntre@earthling.net
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
    Re: COUNTING DAYS UNTIL 2000 (M.J.T. Guy)
    Re: Determining data types using Win32::ODBC <agruskin@melbpc.org.au>
    Re: Does Perl have a IDE?I don't like command line. (Tom Grydeland)
    Re: generating hash of complex records (Mike Stok)
    Re: Here a real stupid question <perlguy@inlink.com>
        how to call SmallEiffel classes from Perl? gary@ashton-jones.com.au
    Re: How to generate random passwords? <dorr@cetrel.lu>
        I need help using the system command <steved@lynden.com>
        Oraperl <marshall@pindar.com>
    Re: perl text editor for windows95 <Kai.Jendrian@prodacta.de>
    Re: RE question <jklein@alerts.co.il>
    Re: Running Perl on Windows (Petr Prikryl)
        Sockets and system() give segfault <c.martin@sheffield.ac.uk>
    Re: Something like "Visual Perl"? <Kai.Jendrian@prodacta.de>
    Re: Something like "Visual Perl"? <webmaster@fccjmail.fccj.org>
    Re: This, I believe has a simple solution. (Tom Grydeland)
    Re: uniq in perl <ravn@jyderup.mip.ou.dk>
        uploading but getting 0 bytes (chris chapman)
        Who loves Hex? Help me. <mindmore@mindless.com>
    Re: Who loves Hex? Help me. <Tony.Curtis+usenet@vcpc.univie.ac.at>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 19 May 1998 10:46:35 +0200
From: Denis DORR <dorr@cetrel.lu>
Subject: Re: ' Premature end of script headers ' is pissing me off, although it seems to work
Message-Id: <356146EB.A8D3532@cetrel.lu>

Tom Phoenix wrote:

> On Sun, 17 May 1998, Peter Hudson wrote:

> > open (COUNT,">>$RefererFile");

> Even when your script is "just an example" (and perhaps especially in that
> case!) you should _always_ check the return value after opening a file.
> Thanks!


Do you have an "auto-mailer" that detects every open-without-or_die
command and sends the originator this little piece of text ? ;-)

In this special case, I was expecting the one about "choosing a good
subject" ...


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

Date: Tue, 19 May 1998 10:33:48 GMT
From: soulhuntre@earthling.net
Subject: .db file corrupt - repair tool?
Message-Id: <6jrn6c$kmf$1@nnrp1.dejanews.com>

Hey all,

Does anyone have something that will repair .db files?

I have a perl program that maintains em, but somewhere in the file (it is
big) a key got corrupted. Perl can't give me a list of all the keys, and I
can't get to the low level stuff.

Anyone have a tool for this?

Ken

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 19 May 1998 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage895573441.26884@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 18 May 1998

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Spring of
1997; of course, ongoing updates are made as needed. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://cpan.perl.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
403_662_481 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://cpan.perl.org/
    http://www.perl.com/CPAN/
    http://cpan.perl.org/doc/FAQs/FAQ/html/perlfaq.html
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq.html

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:

    setdir usenet-by-group/news.announce.newusers
    send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: 19 May 1998 10:06:55 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: COUNTING DAYS UNTIL 2000
Message-Id: <6jrljv$836$1@lyra.csx.cam.ac.uk>

Bob Trieger  <sowmaster@juicepigs.com> wrote:
>
>I'm not sure if Benchmark went out and imported the Date::DateManip
>module for every iteration but it must have atleast once and I don't see
>any great difference.
>
>Below is my source, please let me know if this is a bogus test:
>
>use Benchmark;
>timethese 100000, {
>    module     => sub {
>	use Date::DateCalc;
>	my @foo = qw(just a bunch of crap);
>    }
>    importsub     => sub {
>	use Date::DateCalc "calc_new_date";
>	my @foo = qw(just a bunch of crap);
>    },
>    no_module => sub {
>	my @foo = qw(just a bunch of crap);
>    }
>};

Yes  -  that is totally bogus.   "use" is done at compile time, so
any time it takes isn't included in your measurements.


Mike Guy


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

Date: Tue, 19 May 1998 22:01:54 +1000
From: Andrew Gruskin <agruskin@melbpc.org.au>
Subject: Re: Determining data types using Win32::ODBC
Message-Id: <356174B1.2A76CA7C@melbpc.org.au>

Dmitri Budchenko wrote:

> Is there any way to determine data types of fields in Access database
> operated through Win32::ODBC? If not, can it be done programmatically
> (analyze the kind of information stored)?

 Try opening the database as an object through Win32::OLE.  You can
access all the properties of the Fields through TableDefs.

I hope I don't get chastised for using more MS Access object words than
Perl words :-)

Andrew



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

Date: 19 May 1998 11:29:17 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <slrn6m2r8d.rgu.Tom.Grydeland@mitra.phys.uit.no>

On 18 May 1998 19:18:11 GMT,
angst <angst@scrye.com> wrote:

> You have to pay for _Sun's_ c compiler...you can get a better c compiler
> than sun's (gcc) for free very easily.                 ^^^^^^

Not bloody likely.

The only architecture for which gcc does good optimisation is x86.  On
Sparc9, it's slow and produces slow code.

I'm not trying to bash gcc or its developers; at the price it can't be
beat.  It just doesn't seem to enjoy working in RISC environments.
(PA-RISC, Alpha, Sparc)

> Erik Nielsen <eln@rmci.net>

9 any Sparc I've tried it on, anyway
-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
      - Do radioactive cats have 18 half-lives? -


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

Date: 19 May 1998 12:54:32 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: generating hash of complex records
Message-Id: <6jrve8$ft9@news-central.tiac.net>

In article <35610510.E92579A6@census.gov>,
Chris Stuber  <cstuber@census.gov> wrote:
>I need to be able to store the equivilent of a C structure into
>a hash.  I am sort of following a simple version of an example
>on page 274 of the Camel book (Generation of a hash of complex
>records.  The code below yields "George 21" which isnt quite what
>I had hoped for.  I have tried dozens of different things, but
>nothing working so far.  Any assistance would be greatly appreciated.
>
>$rec = {};
>
>$rec->{NAME} = "George";
>$rec->{NUMBER} = "41";
>$AA{ $rec->{NAME} } = $rec;
>
>$rec->{NAME} = "Bob";
>$rec->{NUMBER} = "21";
>$AA{ $rec->{NAME} } = $rec;
>
>$key = "George";
>print "$key $AA{$key}{NUMBER}\n";

You're using the same $rec for both entries in $AA, if you use the
debugger and look at %AA just before assigning to $key you'll see
something like:

  DB<9> X AA
%AA = (
   'Bob' => HASH(0x80503f0)
      'NAME' => 'Bob'
      'NUMBER' => 21
   'George' => HASH(0x80503f0)
      -> REUSED_ADDRESS
)

Tour assignments into $rec reuse the 'structure'.

Maybe you meant to create a copy of $rec to stash in $AA e.g.

  $AA{$rec->{'NAME'}} = {%$rec};

This makes an anonymous copy of the hash referenced by $rec each time and
stores it in %AA:

  DB<17> X AA
%AA = (
   'Bob' => HASH(0x819f9d8)
      'NAME' => 'Bob'
      'NUMBER' => 21
   'George' => HASH(0x819dce0)
      'NAME' => 'George'
      'NUMBER' => 41
)

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Tue, 19 May 1998 11:16:04 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Here a real stupid question
Message-Id: <356169F4.9FDFAAD4@inlink.com>

Try:

$myargument=$ENV{'QUERY_STRING'};

Although this is not a real Perl question, here is the Perl answer.  If
you are on a "time line", you may want to try to do a little searching
on your own first.

I did a search on Alta-Vista for "+CGI +passing +arguments +perl" and
found many resources that would have answered your question.  

Also, the Perl-CGI FAQ answers this question.  You can find it at:
http://www.perl.com/CPAN-local/doc/FAQs/cgi/perl-cgi-faq.html

Hope this helps,

Brent


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

Date: Tue, 19 May 1998 11:38:37 GMT
From: gary@ashton-jones.com.au
Subject: how to call SmallEiffel classes from Perl?
Message-Id: <6jrqvt$rkp$1@nnrp1.dejanews.com>

I am aware of SWIG and XS which allow C functions to be called from Perl.
Trouble is I find it easier to write SmallEiffel code than C these days and I
want to put a fast text handling method I've written into a Perl program I'm
using.

The 'cecil' examples that ship with SmallEiffel all assume that a SmallEiffel
class is called first which then calls a C function which then calls a
SmallEiffel method which seems a bit unusual to me. Does anyone have an
example of a C 'main' function calling a SE class that I can copy and
hopefully turn into a Perl-callable module?

TIA

Gary Ashton-Jones

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Tue, 19 May 1998 11:10:15 +0200
From: Denis DORR <dorr@cetrel.lu>
Subject: Re: How to generate random passwords?
Message-Id: <35614C77.BFFEBF96@cetrel.lu>

Jennifer Telisky wrote:
> 
> Thanks for all your suggestions...  However, I'm still stumped on actually
> assigning the password to the account.  Does anyone know how to use the
> "getpwent", "setpwent" functions in perl.  I have an inkling that this will
> do the trick, however I can't find any synopsis on how to use these
> functions..

from perldoc perlfunc :

 ...skipping...
      setpwent

      setgrent

      sethostent STAYOPEN

      setnetent STAYOPEN

      setprotoent STAYOPEN

      setservent STAYOPEN

      endpwent

      endgrent

      endhostent

 ...
              These routines perform the same functions as their
              counterparts in the system library.  Within a list
context,
 ...

so, if you have a look at man setpwent, you will see that - if getpwent
does what you guess - setpwent DOESN'T, and there is no putpwent in
Perl.

You will then have to proceed differently, maybe as describe in the FAQ
:

 ...

  How do I modify the shadow password file on a Unix system?

    If perl was installed correctly, the getpw*() functions described in
the perlfunc manpage provide (read-only) access to the shadow password
file. To change the file, make a new shadow password file (the format
varies from system to system - see the passwd(5) manpage for specifics)
and use pwd_mkdb(8) to install it (see the pwd_mkdb(5) manpage for more
details).

 ...


-- 
HTH.

dorr@cetrel.lu


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

Date: Tue, 19 May 1998 01:34:46 -0700
From: Steve DeWitt <steved@lynden.com>
Subject: I need help using the system command
Message-Id: <35614426.B5635AB7@lynden.com>

The following script checks the printers and I am currently trying to
get it to do other things. I am ok with the way it checks the printers.
I need help using the system command or not using it. I cannot get the
commands I want to execute to execute. 

##########################
Steve DeWitt 5/98
##########################
#! /local/bin/perl 
require ("steved.lib");
&GetSplitData;
#this will get the data request from the web page
if ($FORM{'R1'} eq "aml") {
	$printers = `lpstat -o aml -l`;
} elsif ($FORM{'R1'} eq "laf") {
	$printers = `lpstat -o laf -l`;
} elsif ($FORM{'R1'} eq "kent") {
	$printers = `lpstat -o kent -l`;
} elsif ($FORM{'R1'} eq "gcom") {
	$printers = `lpstat -o gcom -l`;
} elsif ($FORM{'R1'} eq "fuji") {
	$printers = `lpstat -o fuji -l`;
} elsif ($FORM{'R1'} eq "ci1000") {
	$printers = `lpstat -o ci1000 -l`;
} elsif ($FORM{'R1'} eq "all") {
	$printers = `chall`;
} elsif ($FORM{'R1'} eq "dp") {
	$printers = `lpstat -o dp -l`;
} elsif ($FORM{'R1'} eq "enable") {
	#the lines after this is where I have questions
	if ($FORM{'D3'} eq "disable") { 
		if ($FORM{'D2'} eq "laf") {
			system disable laf;
		} elsif ($FORM{'D2'} eq "kent") {
			system disable kent;
		} elsif ($FORM{'D2'} eq "gcom") {
			system disable gcom;
		} elsif ($FORM{'D2'} eq "fuji") {
			system disable fuji;
		} elsif ($FORM{'D2'} eq "ci1000") {
			system disable ci1000;	
		}	
	} elsif ($FORM{'D3'} eq "enable") {
		if ($FORM{'D2'} eq "laf") {
			system enable laf;
		} elsif ($FORM{'D2'} eq "kent") {
                        system enable kent;
		} elsif ($FORM{'D2'} eq "gcom") {
                        system enable gcom;
		} elsif ($FORM{'D2'} eq "fuji") {
                        system enable fuji;
		} elsif ($FORM{'D2'} eq "ci1000") {
                        system enable ci1000;	
		}		
	#this is the end of my question area
	}	
} elsif ($FORM{'R1'} eq "move") {
	#the following line is for testing purposes
	$cmd = "lpmove $FORM{'T2'} $FORM{'D1'}";
} elsif ($FORM{'R1'} eq "hold") {
	#the following line is for testing purposes
	$cmd = "lp -i $FORM{'job_number'} -H $FORM{'hold_resume'}";
}
chomp ($printers);
@printers = $printers;
&PrintHeader;
print <<EOH;
<html>
<head>
<script language="javascript">
         function goBack(){
            history.go(-1);
         }
      </script>
</head>
<body>
<div align="center">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<pre>
EOH
foreach $line (@printers) {
	system print "$line";
}
print <<EOH;
</pre>
</td>
</tr>
<tr>
<td>
<pre>
EOH
#the following line is for testing purposes
system print $cmd;
$cmd;
print <<EOH;
</pre>
</td>
</tr>
</table>
</div>
<a href="javascript:goBack()"><font size=+3>Go Back</font></a>
</body>
</html>
EOH


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

Date: Tue, 19 May 1998 10:14:35 +0100
From: "Roj :-)" <marshall@pindar.com>
Subject: Oraperl
Message-Id: <6jrifi$c0k@akira.pindar.com>

Anybody had any problems using this package ? I've found that every so often
my software will crash because of an error returned by Oracle that the
oraperl package cannot handle.

I could write a wrapper around this package but If anybody OUT THERE has
already done this or found anyway around this problem I would be gratefull
to hear from you :-)

Cheers Roj




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

Date: Tue, 19 May 1998 11:55:01 +0200
From: "Kai Jendrian" <Kai.Jendrian@prodacta.de>
Subject: Re: perl text editor for windows95
Message-Id: <6jrkqq$not$1@news.nacamar.de>

Hi,

I recommend:

Textpad: http://www.textpad.com
Multiedit: http://www.multiedit.com

Both are worth the money yxou have to pay for.
Both can be used as Perl IDE!

Have fun,
kai.


Diane Strahl schrieb in Nachricht <355B7208.91A@sgi.net>...
>Can someone recommend a good, easy-to-use text editor to use for writing
>perl programs on windows95? I used bbedit on a friend's mac, which is
>the sort of thing I'm looking for. I've looked at vim and emacs, but
>they seem more complicated than what I want. Are they worth spending the
>time to learn? What are the advantages of these? Anything out there with
>pull-down menus rather than having to memorize all the commands which
>need to be typed in? Right now I'm using the basic windows95 text
>editors - notepad and wordpad. It'd be nice to use something that at
>least had syntax coloring.
>
>Thanks!
>
>Diane




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

Date: Tue, 19 May 1998 13:19:39 +0300
From: Yossi Klein <jklein@alerts.co.il>
Subject: Re: RE question
Message-Id: <Pine.SOL.3.95.980519125128.27159X-100000@cain>

On Tue, 19 May 1998, Dan Boorstein wrote:

> Tom Mornini wrote:
> 
> [SNIP]
> 
> > 
> > The quest was matching and extracting the last two domain elements
> > in an e-mail address to summarize subscribers to a mailing list.
> > 
> > 1) This didn't work.
> > 
> >    /(?:@|\.)(.+?)\.(.+?)$/;
> > 
> > 2) This did work.
> > 
> >    /.*(@|\.)(.+?)\.(.+?)$/;
> > 
> > When using #1, I was getting greedy matches on the pair of (.+?) but
> > I thought the ? after the + avoided that behavior!
> > 
> > Any insights from the gurus?
> 
> no guru here, but i can hopefully offer some insight. for instance the
> following script (using your exact RE's):
>
 .
 .
 .
> 
> it seems to be doing what you want in my estimation. however, i would
> probably use something like:
> 
> @last2 = (/([^.]+)/g)[-2,-1];
> 
> or even:
> 
> @last2 = (/([^.]+)/g)[-1,-2];
> 

I'm not a guru either, but let me try my hand at this anyway...

First of all..

> @last2 = (/([^.]+)/g)[-2,-1];
>   
> or even:
>  
> @last2 = (/([^.]+)/g)[-1,-2];

won't work properly since there is no reference to the @. Therefore,

a.b@c.d

will get you

b@c d

which is not what Tom wanted. 

As to the original question, the RE

   /(?:@|\.)(.+?)\.(.+?)$/

will attempt the earliest match and (.+?) will be stingy in that context -
(.+?) won't necessarily be the shortest across ALL possible matches.
Therefore, the earliest match in my example above is to have the first
parens match the first '.'. The second parens will then match b@c and the
third set will match 'd'

However, in the second RE

  /.*(@|\.)(.+?)\.(.+?)$/;

the .* at the beginning will greedily grab the whole string and keep on
backing up until the rest of the RE can match successfully. Once the RE
backs up to before the @, the rest of the RE can match the rest of the
string with the first parens matching the @, the 2nd set matching the 'c',
and the 3rd one matching the 'd'.

I hope this makes sense. I'm pretty sure it's right.

----
Yossi Klein
Expert Alerts



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

Date: 19 May 1998 12:28:12 GMT
From: prikryl@dcse.fee.vutbr.cz (Petr Prikryl)
Subject: Re: Running Perl on Windows
Message-Id: <6jrtss$38c$1@boco.fee.vutbr.cz>

genfil@my-dejanews.com wrote:
>I need help!
>I write perl scripts on unix and now I have to write scripts on NT and
>Win95.
>Is there an equivalent of  "#!/usr/bin/perl" on NT and Win95?

Yes, there is also other way than to create the association between
Perl and .pl. It is rather tricky, but it works also in DOS perls.

Firstly, you have to make the script executable. You can do it by
saving it to *.bat instead to *.pl. Secondly, you have to force
MS DOS/Windows thinking that it is a batch without any DOS syntax
error. Thirdly, you have to force Perl to think that it is a Perl
script without syntax errors. Here is the example.

script.bat                         - name of the file
--------------------------------
@rem = '                           - a comment for DOS, an array for Perl
@echo off                          - a command for DOS, content of @rem for Perl
c:\perl\bin\perl -w script.bat %1  - ditto, just notice the 'script.bat' here
goto END                           - ditto
';                                 - end of @rem content for Perl; will not 
                                     be reached by DOS
@rem = @rem;                       - just to avoid warning about not using @rem

use strict;                        - you can even use the strict mode

{
    perl body...
}
__END__                            - recognized by Perl as end of input
:END                               - label for DOS to jump over the Perl part
--------------------------------

It is the basic idea. You can add more DOS commands, more passed arguments,
etc. My observation from later time: It is better to use separate .pl
script and add one simple .bat file. Some editors like .pl to switch on
syntax highlighting. Also, .bat will probably run in DOS Window. If the 
Perl creates its own window, there still will be a DOS Window related to
the .bat. Separating the .bat and .pl you can use both approaches -- association
with Win32 Perl and also running as .bat.

Another observation: It is quite unreliable to call system() in DOS/Windows
ports of Perl (it depends on how good is the Perl port with respect to 
collaboration/interaction with native utilities. I did observe some problems
like hanging the system when Novell utilities were called from one of the
Perl ports). It may be easier to generate a DOS batch with native commands
and to launch it later. The .bat version is very suitable for this
(you can add DOS-native test if the generated bat was really generated
and then launch it).

Petr

--
Petr Prikryl (prikryl@dcse.fee.vutbr.cz)   http://www.fee.vutbr.cz/~prikryl/
TU of Brno, Dept. of Computer Sci. & Engineering;    tel. +420-(0)5-7275 218


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

Date: 19 May 1998 12:18:54 +0100
From: Chris Martin <c.martin@sheffield.ac.uk>
Subject: Sockets and system() give segfault
Message-Id: <7090nycxup.fsf@stoat.acs-sol.shef.ac.uk>

I have installed a copy of perl 5.004_04 on a Sun Ultra running
Solaris 2.6 -- I have compiled with with gcc (also created on an Ultra
running Solaris 2.6). It passes all tests.

(I have also tried this with perl 5.004_04 compiled by Sun's cc).

I have set up a demo client-server using the examples in perlipc.

I have modified the accept loop in the server to:

[...code in perlipc deleted...]

$SIG{CHLD} = \&REAPER;

for ( ; $paddr = accept(Client,Server); close Client) {
    my($port,$iaddr) = sockaddr_in($paddr);
    my $name = gethostbyaddr($iaddr,AF_INET);
    syslog('notice', "connection from %s [%s] at port %d",
	   $name, inet_ntoa($iaddr), $port);
    $i = 1;
    my $oldhdl = select Client; $| = 1; select $oldhdl;
    while ($line = <Client>) {
	my $logmsg;
	printf "%d) %s", $i++,$line;
	chop($line);
	$logmsg = $line;
	$logmsg .= " ... OK.\n";
#	$rc = system "/opt/gnu/bin/ls", "-l", '.';
#	print "Return code is $rc";
	print Client $logmsg;
    }
    print "End of connection.\n";
}

[Is "$SIG{CHLD} = \&REAPER;" a mistake? There is no REAPER sub...]

This works well without the two lines

	$rc = system "/opt/gnu/bin/ls", "-l", '.';
	print "Return code is $rc";

but fails with a segmentation fault if run with the two lines
uncommented.

This is a cut down example -- other lines which cause it to fail are

	$cwd = `pwd`;

	system "/opt/gnu/bin/rm", '-rf', $dirname;

Is this just something which happens when a script using sockets tries
to use system as well?

I have built a larger script around this server code and I have had to
remove all system or shell calls for it to work (in crippled mode).

The script starts with

  BEGIN { $ENV{PATH} = '/usr/ucb:/bin:/sbin:/opt/gnu/bin' }

slightly longer than the perlipc example:  by default, $SHELL is set
to /sbin/sh -- I have also tried setting $SHELL to /opt/gnu/bin/bash.

The shell I am using is bash -- BASH_VERSION='2.01.1(1)-release'.

I would be very grateful for any light anybody can shed on this.


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

Date: Tue, 19 May 1998 11:57:46 +0200
From: "Kai Jendrian" <Kai.Jendrian@prodacta.de>
Subject: Re: Something like "Visual Perl"?
Message-Id: <6jrkvv$o42$1@news.nacamar.de>

Heribert Wettels schrieb in Nachricht <356146EE.6BC2E820@respublica.de>...
>Has anybody heard about a programming environment for Perl similar to
>Visual Basic? Or at least an editor that creates indents and does some
>highlighting?


You might give MultiEdit (http://www.multiedit.com)
a try.
I love it!

HTH,
Kai.




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

Date: Tue, 19 May 1998 10:06:21 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: Something like "Visual Perl"?
Message-Id: <356157BF.3CE8B078@fccjmail.fccj.org>

Heribert Wettels wrote:
> 
> Has anybody heard about a programming environment for Perl similar to
> Visual Basic? Or at least an editor that creates indents and does some
> highlighting?

BBEdit =)  Oh, sorry, that's a Mac-thing =)

Get the VooDoo extensions...
-Sneex- 
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster


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

Date: 19 May 1998 11:45:06 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: This, I believe has a simple solution.
Message-Id: <slrn6m2s62.rgu.Tom.Grydeland@mitra.phys.uit.no>

On 18 May 1998 22:07:30 GMT,
WercRB <wercrb@aol.com> wrote:
> I just re-built Perl and when I try to run a program using Perl, I get the
> messages:
> 
> %s: Command not found
> %s: Undefined variable
> 
> However when I put the perl file in the bin directory and run perl "<file.pl>",
> it works fine.  According to the docs, these messages mean I am running Perl
> from a "Bourne Shell", but I can't find anything on how not to #!use perl from
> a bourne shell.  help?

man perlrun


-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
      - Do radioactive cats have 18 half-lives? -


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

Date: 19 May 1998 11:33:28 +0200
From: Thorbjoern Ravn Andersen <ravn@jyderup.mip.ou.dk>
Subject: Re: uniq in perl
Message-Id: <0zvhr2zjtj.fsf@jyderup.mip.ou.dk>

Randal Schwartz <merlyn@stonehenge.com> writes:

> Thorbjoern> $ cat whatever | perl -ne 'print if (! $seen_before{$_}++)'
> 
> If this was comp.unix.*, I would have pointed out the "useless use of cat"
> there.  But I won't. :-)

Depends on the point you want to make :-)  

cat is such a nice place-holder in examples...
--
  Thorbjxrn Ravn Andersen               "...and...Tubular Bells!"
  http://www.mip.ou.dk/~ravn (+PGP)


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

Date: 19 May 1998 11:39:10 GMT
From: cchapman@chat.carleton.ca (chris chapman)
Subject: uploading but getting 0 bytes
Message-Id: <6jrr0u$4l5$1@bertrand.ccs.carleton.ca>
Keywords: upload gives 0 bytes


Using a form written in perl I'm trying to upload binary files, but the system
always reports 0 bytes found.
I think it may be a configuration problem in possibly the operating system
which is linux or the web server which is apache.

thanks

chapman@engsoc.carleton.ca


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

Date: Tue, 19 May 1998 14:24:32 +0300
From: Fain <mindmore@mindless.com>
Subject: Who loves Hex? Help me.
Message-Id: <35616BF0.85BB51C9@mindless.com>

What is %0A? (this is what I find on some of the URL strings sent to my
script from my browser). At the moment I'm using it to substitute line
breaks.

I ask because for some reason whenever I have my script substitute %0A
it will substitute %2B as well (%2B is the '+'). I would like to keep
the '+'.

I was thinking that maybe %0A was a group of characters.. in particular
I think it may be all space characters (line breaks, tabs, spaces, but
why is it doing %2B (my '+')?).

Thanks in advance.
- Nathan



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

Date: 19 May 1998 14:00:34 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Who loves Hex? Help me.
Message-Id: <7x1ztqxyfx.fsf@beavis.vcpc.univie.ac.at>

Re: Who loves Hex? Help me., Fain <mindmore@mindless.com>
said:

Fain> I ask because for some reason whenever I have my
Fain> script substitute %0A it will substitute %2B as well
Fain> (%2B is the '+'). I would like to keep the '+'.

No you wouldn't :-) `+' is a CGI meta-character and requires
encoding.

Fain> I was thinking that maybe %0A was a group of

ASCII NL (new-line, do "man ascii").

Fain> characters (line breaks, tabs, spaces, but why is it
Fain> doing %2B (my '+')?).

`+' is used to separate parameters in the request, e.g.

    .../script?a+b+c

`+' is an old form of the %20 (space) escape if my brain is
working.

If you use a standard CGI library/module like CGI.pm

  http://www-genome.wi.mit.edu/ftp/pub/software/WWW/

then the "recovery" of the arguments is done for you.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,      | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/

"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.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 2637
**************************************

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