[10396] in Perl-Users-Digest
Perl-Users Digest, Issue: 3989 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 16 06:01:31 1998
Date: Fri, 16 Oct 98 03: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 Fri, 16 Oct 1998 Volume: 8 Number: 3989
Today's topics:
Re: a camel? (Alan Barclay)
Re: Are there any "perl.newbie" group or forum? <rra@stanford.edu>
Assigning to $! <45jhp@earthling.net>
Copy File Function <qmnw@bigger.net>
Re: Copy File Function <jimbo@soundimages.co.uk>
Re: database, need perl and cgi? <e.christensen@netjob.dk>
Re: database, need perl and cgi? <e.christensen@netjob.dk>
HOW DO I INCLUDE OTHER LIBRARIES IN PERL FOR NT SERVER? <dmx83@gte.net>
IE problem when download from a cgi script iulian4992@my-dejanews.com
Internet Explorer problem with file extension when down iulian4992@my-dejanews.com
Re: Looking for a shopping cart firstcart@iname.com
Making perl function at all.... HELP! <oeselbek@online.no>
Mimicing 'tail -f' functionality in Perl john_aldiscon@my-dejanews.com
Mimicing 'tail -f' functionality in Perl john_aldiscon@my-dejanews.com
Mimicing 'tail -f' functionality in Perl john_aldiscon@my-dejanews.com
Mimicing 'tail -f' functionality in Perl john_aldiscon@my-dejanews.com
Re: Mimicing 'tail -f' functionality in Perl (Russell)
Re: Odd error message with ActivePerl on Windows NT (David D. Wertman)
Re: Perl FAQ - error found in "#How_do_I_get_a_file_s_t <dgris@perrin.dimensional.com>
perl win32: launching apps... <saxifrax@slip.net>
Re: perl win32: launching apps... <ibelgaufts@gfc-net.de>
Re: Perl5 on Solaris reading MS Access Database <thaynes@openlinksw.co.uk>
Re: Redirecting output of the system function (Martien Verbruggen)
Re: Reverse foreach loop <uri@sysarch.com>
Re: Reverse foreach loop (Andre L.)
Re: Reverse foreach loop <zenin@bawdycaste.org>
Re: Reverse foreach loop <webmaster@eswap.co.uk>
Re: Reverse foreach loop (Gregory Tod)
Re: Reverse foreach loop <aas@sn.no>
Re: Sorry (Craig Berry)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Oct 1998 04:40:32 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: Re: a camel?
Message-Id: <908512819.843851@elaine.drink.com>
In article <705r5p$39r@panix.com>, Adam Turoff <ziggy@panix.com> wrote:
>John Porter <jdporter@min.net> wrote:
>Methinks you forgot the bit where he wanted a name that had four characters
>instead of five. When 'camel' became 'caml', Larry had the problem
>of conflicting with CAML, so he thought of calling the language
>the 'new_caml', but that was longer than 4 chars.
>
>Then he was thinking of what to call a 'well rounded language'.
>So he started calling it pe[a]rl, since a how much more rounded can a
>pearl be? None. None more round. :-) :-)
>
Wasn't 'gloria' on the list at some point, changed to avoid confusion
with Mrs Wall?
------------------------------
Date: 16 Oct 1998 02:38:32 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <yl7ly0etif.fsf@windlord.stanford.edu>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
> Russ Allbery wrote:
>> You tend to find more Perl the less emphasis the CS department as a
>> whole has on theoretical compiler design and the like. Academics tend
>> not to like Perl very much for all of the sloppy, unconstrained reasons
>> that one may expect.
> Sloppy in what regard?
Snowhare pretty much answered this along the lines that I was thinking.
Perl is a fairly ugly language from a theoretical perspective, amongst
people who are used to LISP and ML. C is also an ugly language, but it's
machine language so people don't expect it to be clean. Perl is both
higher-level and ugly, so academics complain.
> It makes sense in a lot of ways that other more structured languages
> don't. Maybe I'm psycho.
Nah, I agree with you. But I've never really been an academic. I
intentionally did my stint in academics, and just as intentionally turned
down Stanford's Ph.D. program in favor of graduating with my master's and
going to work at what I've always wanted to do anyway, namely system
administration.
I think Perl is really fundamentally a system administrator's language,
not in the sense that that's all it's good for by any means, but in the
sense that it appeals strongly to people who want to write something that
solves a piece of the problem *now* and then can be later expanded into
something that solves bigger problems later. It's a highly iterative
language to write in, which appeals to the way I program and is much
harder to do in many other languages.
Quite a bit of the formality and structure of other languages seems aimed
at making you figure out what you're doing before you do it. That makes a
lot of sense for large group projects and other more traditional software
engineering endeavors. System administrators, though, usually figure out
what they want to do after they've done it. :)
> Academics aren't always right.
Oh, I certainly agree with you on that.
> Theory is great but it is just that theory. I used to go at one of the
> C++ godz who still writes for Dobbs. If I can't use it, why bother?
Well, theory is the stuff you'll be able to use twenty years from now. I
did my graduate work largely in the area of Chu spaces and theoretical
models of concurrent processing, which is not something that you're likely
to see anything of for a number of years. On the other hand, I think Chu
spaces have a fairly good shot at revolutionizing the whole way we think
about concurrent processing and the whole way we design and code processes
that are inherently parallel, and that that potential may well be realized
soon enough that I'll get to see it. :)
(For those who are interested, <URL:http://boole.stanford.edu/>.)
> Programming should be both practical and fun. If it is neither, then
> somewhere the point has been missed.
By and large, I'll also agree with that, although theory is its own brand
of fun and sometimes it's worth doing something just because you can.
>> The way we do that here is to teach classes where the assignments must
>> be completed in C but every submitted solution must also run completely
>> clean under Purify, including no leaked memory (even potentially).
> Admirable. Do you teach Perl as well?
Oh, I don't teach. I haven't taught for years, except for periodic
introductory lectures on Usenet. :) Sorry, the "we" is an engrained
habit from having spent too long doing academic support in all sorts of
different capacities; I'm used to thinking of what Stanford departments do
as stuff that "we're" doing.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 15 Oct 1998 17:07:04 -0700
From: 45jhp <45jhp@earthling.net>
Subject: Assigning to $!
Message-Id: <36268E28.F8A023AD@earthling.net>
I want to call one perl script from another and capture any error
messages if the called script terminates abnormally. Is there any way of
using $! as I would with a system call ? The docs seem to say that you
can assign to $! but my simple tests fail ... can someone offer some
enlightment ??
Thanks,
Alex
e.g.
I run foo.pl which calls bar.pl
bar.pl needs to return an error message to foo.pl
------------------------------
Date: Thu, 15 Oct 1998 23:45:15 -0700
From: QMN <qmnw@bigger.net>
Subject: Copy File Function
Message-Id: <3626EB7B.3F56@bigger.net>
Hello, I have very simple questions:
How can I use Perl to copy files from
one location to the other directory and delete them.
in UNIX and PC.( Like cp ./* /usr/newlocation in UNIX and
rm * in UNIX) what syntex will be?
Do I have to use system() or there are other ways.
Thanks
Frank
------------------------------
Date: 16 Oct 1998 07:59:12 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: Copy File Function
Message-Id: <u3e8pq9fj.fsf@jimbosntserver.soundimages.co.uk>
QMN <qmnw@bigger.net> writes:
>
> How can I use Perl to copy files from
>
use File::Copy;
A standard module. Avaialable along with the rest of Perl. Showing in
a directory on your system now. Part of a double feature. Also showing
with Perl documentation. perldoc File::Copy. Try before you
post. Reading the documentation.
--
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.
------------------------------
Date: Fri, 16 Oct 1998 10:10:34 +0100
From: EC <e.christensen@netjob.dk>
To: Elly <u6el@csc.liv.ac.uk>
Subject: Re: database, need perl and cgi?
Message-Id: <36270D8A.6DF98F90@netjob.dk>
Hi
If you use NT or win95, take a look at Win32ODBC - form Roth:
www.roth.net
Ernst
Elly wrote:
> I wonder if anyone can help me...i am doing a project and I am having
> some
> problems.
>
> the project is for an online questionaire..at the moment the
> questionaire is in
> HTNL...and the information from the questionaire will be inputted into a
> database, I am thinking of using Access to creat the database, but do I
> need
> Perl program and CGI script??? what does perl do? so do i need, CGI,
> Perl amd
> Access to do it? what if I want to retrievel information from teh
> database....what do I use to do that?
>
> can you email me if you can help..I am totally confused.
>
> :-(
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Elvina Lam
> Department of Computer Science,
> University of Liverpool
> http://www.csc.liv.ac.uk/~u6el
> u6el@csc.liv.ac.uk
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Fri, 16 Oct 1998 10:09:01 +0100
From: EC <e.christensen@netjob.dk>
To: Elly <u6el@csc.liv.ac.uk>
Subject: Re: database, need perl and cgi?
Message-Id: <36270D2D.C0EACA43@netjob.dk>
Hi
If you use NT or win95, take a look at Win32ODBC - form Roth:
www.roth.net
Ernst
Elly wrote:
> I wonder if anyone can help me...i am doing a project and I am having
> some
> problems.
>
> the project is for an online questionaire..at the moment the
> questionaire is in
> HTNL...and the information from the questionaire will be inputted into a
> database, I am thinking of using Access to creat the database, but do I
> need
> Perl program and CGI script??? what does perl do? so do i need, CGI,
> Perl amd
> Access to do it? what if I want to retrievel information from teh
> database....what do I use to do that?
>
> can you email me if you can help..I am totally confused.
>
> :-(
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Elvina Lam
> Department of Computer Science,
> University of Liverpool
> http://www.csc.liv.ac.uk/~u6el
> u6el@csc.liv.ac.uk
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Fri, 16 Oct 1998 02:36:21 -0700
From: Dan Miller <dmx83@gte.net>
Subject: HOW DO I INCLUDE OTHER LIBRARIES IN PERL FOR NT SERVER???
Message-Id: <36271395.F083C811@gte.net>
hi. i just recently put perl on our nt server, and was wondering what
the difference in syntax and keywords are between nt server and unix.
i've been working with perl in the unix environment, and use the
following code to include a library to use in the script:
push(@INC, "/cgi-bin");
require("cgi-lib.pl");
&ReadParse(*input);
could someone please tell me what the code is to include a library in my
script under the NT server?? one difference i've noticed is that the
shabang (#!/usr/bin/perl) isn't needed to find the perl interpreter.
thank you.
-dan-
------------------------------
Date: Fri, 16 Oct 1998 09:01:23 GMT
From: iulian4992@my-dejanews.com
Subject: IE problem when download from a cgi script
Message-Id: <707213$n4b$1@nnrp1.dejanews.com>
I try to write a Perl script that when called with a parameter
"?filename=name.ext" will download the specified file.
I wrote a script that will supply to the browser the following:
Content-type: application/x-unknown
Content-disposition: attachement; filename="name.ext"
Content-length = ... (some lenght)
This works fine with Netscape, but not with IE 4.x. IE disregards the Content-
type when the file has an extension like ".jpg" or ".gif", and, instead of
downloading it, it displays it in the frame the request was made from.
Sorrry for reposting this message because of some problems with subscribing to
Deja News.
Iulian
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 16 Oct 1998 08:39:51 GMT
From: iulian4992@my-dejanews.com
Subject: Internet Explorer problem with file extension when download
Message-Id: <7070on$l5b$1@nnrp1.dejanews.com>
I am trying to write a cgi script in Perl that, when called with a parameter
like "?filename=file.ext" will download the spedified file from the server the
script is running on.
I wrote a script that, under the above situation, returns the following header
to the browser:
Content-type: application/x-unknown
Content-disposition: attachement; filename="file.ext"
Content-length=...some size
This works fine with Netscape, but not with IE 4.X When IE sees a file with
".jpg" or ".gif" extension it will disregard "Content-type" and will display
the image in the frame the request initially came from. I found a way around
this, by appending an unknown extension to all files if the user agent was
IE. This is not an acceptable solution, that is why I want to know if someone
else had this problem and if someone found a better solution. Thanks, Iulian
Musat
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 16 Oct 1998 05:56:46 GMT
From: firstcart@iname.com
Subject: Re: Looking for a shopping cart
Message-Id: <706n6u$88g$1@nnrp1.dejanews.com>
In article <361BAA06.6FAE8329@vii.com>,
"Kerry J. Cox" <kjcox@vii.com> wrote:
> Howdy,
> I have several customers who would like to have shopping carts on their
> sites. I have been poking around using several free ones and not so
> free ones, but have not found anything to suit my tastes. I could write
> something, but have walked into this job with the customers needing
> something immediately.
> Could someone recommend a shopping cart program that runs anywhere from
> $0- $300 and that uses either comma or pipe delimited flat files, from
> which I can take MS Access database files, or Excel spreadsheet files
> and pipe them into the program for easy updates of the program? Any
> recommendations would be appreciated.
> Thank you very much.
> KJ
Kerry:
FIRSTCART e-commerce programs are shopping carts for small to medium size
businesses and services. Please visit our site and you'll see three demos
of the e-commerce products that we offer. Our JavaScript/HTML shopping
carts are very economical and won't cost you an arm and a leg (less than
$40). Any number of products can be added by replicating the product code
module. We will provide you with the MS Access DB to update the product
catalogs or create the start up shopping cart and catalog variables.
We provide you with e-mail tech support to get your client web stores
operational-even at this low price.
Please let us know if you are interested. You can find our shopping cart at:
http://www.firstcart.com/compshop/
Regards,
Jose Castilla, Jr, PE
firstcart@iname.com
>
> --
> .-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
> | Kerry J. Cox Vyzynz International Inc. |
> | kjcox@vii.com Systems Administrator |
> | (801) 596-7795 http://vii.com |
> `-------------------------------------------------'
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 16 Oct 1998 11:31:02 +0200
From: "Xystein Selbekk" <oeselbek@online.no>
Subject: Making perl function at all.... HELP!
Message-Id: <7073ol$fi2$1@readme.online.no>
I wonder if anyone can help me on this one:
I am trying to make Perl 5.0 work on a IIS 4 server. This is the message i
get when i try to execute a .pl script:
HTTP Error 403
403.2 Forbidden: Read Access Forbidden
This error can be caused if there is no default page available and directory
browsing has not been enabled for the directory, or if you are trying to
display an
HTML page that resides in a directory marked for Execute or Script
permissions only.
Please contact the Web server's administrator if the problem persists.
Any suggestions?
regards Oystein Selbekk
------------------------------
Date: Fri, 16 Oct 1998 06:28:09 GMT
From: john_aldiscon@my-dejanews.com
Subject: Mimicing 'tail -f' functionality in Perl
Message-Id: <706p1p$b1n$1@nnrp1.dejanews.com>
I am trying to write a Perl script that will mimic the function of the 'tail -
f' command. This will keep reading the contents of a file, usually a log file,
forever, without finding an EOF. This lets you watch log files entries as they
are placed in the file.
Is there a way to do that in Perl v4? The open() function will just come to
the EOF and stop, and I can't find any parameters to tell it otherwise.
Thanks!
-- John Allen, Operations Engineer
-- Logica Aldiscon
-- http://www.aldiscon.ie
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 16 Oct 1998 06:28:06 GMT
From: john_aldiscon@my-dejanews.com
Subject: Mimicing 'tail -f' functionality in Perl
Message-Id: <706p1n$b1k$1@nnrp1.dejanews.com>
I am trying to write a Perl script that will mimic the function of the 'tail -
f' command. This will keep reading the contents of a file, usually a log file,
forever, without finding an EOF. This lets you watch log files entries as they
are placed in the file.
Is there a way to do that in Perl v4? The open() function will just come to
the EOF and stop, and I can't find any parameters to tell it otherwise.
Thanks!
-- John Allen, Operations Engineer
-- Logica Aldiscon
-- http://www.aldiscon.ie
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 16 Oct 1998 06:28:08 GMT
From: john_aldiscon@my-dejanews.com
Subject: Mimicing 'tail -f' functionality in Perl
Message-Id: <706p1n$b1m$1@nnrp1.dejanews.com>
I am trying to write a Perl script that will mimic the function of the 'tail -
f' command. This will keep reading the contents of a file, usually a log file,
forever, without finding an EOF. This lets you watch log files entries as they
are placed in the file.
Is there a way to do that in Perl v4? The open() function will just come to
the EOF and stop, and I can't find any parameters to tell it otherwise.
Thanks!
-- John Allen, Operations Engineer
-- Logica Aldiscon
-- http://www.aldiscon.ie
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 16 Oct 1998 06:36:08 GMT
From: john_aldiscon@my-dejanews.com
Subject: Mimicing 'tail -f' functionality in Perl
Message-Id: <706pgo$bo6$1@nnrp1.dejanews.com>
I would like to mimic the functionality of the 'tail -f' command that will
allow me to view a text file while another process is added entries to it.
This works great on log files to what is happening in real time. I am working
on a Perl script that will be parsing through a debug file while it is being
written to by an application. My problem is that I can't find a way to make
the open() function keep the file open after reaching the EOF. This is in
Perl v4. Any ideas?? Thanks!
-- John Allen, Operations Engineer
-- Logica Aldiscon
-- http://www.aldiscon.ie
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 16 Oct 1998 07:46:15 GMT
From: c9415019@alinga.I.newcastle.HATE.edu.UCE.au (Russell)
Subject: Re: Mimicing 'tail -f' functionality in Perl
Message-Id: <slrn72dufu.5kd.c9415019@bezout.newcastle.edu.au>
On Fri, 16 Oct 1998 06:36:08 GMT, john_aldiscon@my-dejanews.com <john_aldiscon@my-dejanews.com> wrote:
+ I would like to mimic the functionality of the 'tail -f' command that will
+ allow me to view a text file while another process is added entries to it.
+ This works great on log files to what is happening in real time. I am working
+ on a Perl script that will be parsing through a debug file while it is being
+ written to by an application. My problem is that I can't find a way to make
+ the open() function keep the file open after reaching the EOF. This is in
+ Perl v4. Any ideas?? Thanks!
+
Any reason you posted this question 4 times?
r.
------------------------------
Date: Fri, 16 Oct 1998 05:35:00 GMT
From: David@WebChamps.com (David D. Wertman)
Subject: Re: Odd error message with ActivePerl on Windows NT
Message-Id: <3628d999.19782530@news-server.neo.lrun.com>
On 15 Oct 1998 15:47:08 -0600, WebEvent <webevent@MatadorDesign.com> wrote:
Well, my production server works fine with it. (once I rememvbered to
change the script mapping)
But I always install perl into the shortest possible path, i.e.
c:/perl/bin/perl.exe
Long paths with spaces and dashes and such make me very nervous as I run a
number of different servers, and keeping things simple seems to be the best
plan.
I dont know what script you run, but does it run from the command line, and
are you sure that it actuall produces a valid set of headers?
David
Web Champs
>
>Hi,
>
>We have a client who, despite all of our remote hand holding, has been
>unable to get ActivePerl (or Perl for Win32) to work with IIS3.0
>(system NT 4.0 Opt 3.0). Currently, after fresh installs, every perl
>script returns the following error message:
>
>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 "??????????????????l???????????????????f":
>Invalid argument
>
>The scripts run as expected from within Windows NT. The registry
>entry is supposedly correct:
>
>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\Sc
>ript Map
>
>c:\Perl\5.00502\bin\MSWin32-x86-object\perl.exe %s %s
>
>Any suggestions?
>
>-James Cameron
>Matador Design, Inc.
>http://www.MatadorDesign.com
------------------------------
Date: Fri, 16 Oct 1998 05:43:26 GMT
From: Daniel Grisinger <dgris@perrin.dimensional.com>
Subject: Re: Perl FAQ - error found in "#How_do_I_get_a_file_s_timestamp_"
Message-Id: <m37ly1kr3e.fsf@perrin.dimensional.com>
James Ludlow <ludlow@us.ibm.com> writes:
> What I failed to ask was whether or not the error was fixed in a more
> recent version of the Perl distribution. This has already been answered
> in another post. It has been fixed. A patch would be pointless.
Yes, you are correct, and if I hadn't been too lazy to go take a look
at _02 or _52 I'd have seen this and not bitched.
> In hindsight, I should have just emailed it to Tom. However, I don't
> see how pointing out an error in the documentation is somehow a sign of
> not "getting" free software.
You were simply in the line of fire for my irritation after I had
spent an hour reading utter cluelessness at slashdot. (Thank god
I cancelled the first post, you certainly didn't deserve to be
flamed that way).
Ummmmm.... call it weariness with the current influx of `consumers'
or `end-users' to the free software community. I've just gotten
really tired of hearing people complain about problems with free
software without bothering to fix the problems. You simply got in
the way of my bad mood. I apologize.
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
`Windows was created to keep the stoopid people away from Unix,
you know. An "MS advocate" is already beneath contempt.'
Tom Christiansen
------------------------------
Date: Thu, 15 Oct 1998 22:27:37 -0700
From: Tim <saxifrax@slip.net>
Subject: perl win32: launching apps...
Message-Id: <3626D949.A091E9B@slip.net>
Hi,
simple question (but not for me).
I'm trying to use perl5 to launch apps on a NT4 system. Why is it when
I use
exec "notepad";
or
system "notepad";
notepad pops right up (ditto "command"), but when I try to call any
other application nothing happens? I've tried using the full path,
escaping backslashes, single quotes, all to no avail.
Anyone point me in the right direction?
Thanks,
Tim.
------------------------------
Date: Fri, 16 Oct 1998 08:29:24 +0200
From: "J|rgen Ibelgaufts" <ibelgaufts@gfc-net.de>
Subject: Re: perl win32: launching apps...
Message-Id: <3626E7C4.5073D63E@gfc-net.de>
Hi Tim,
Try this:
print "Starting notepad ...\n";
system "start notepad";
print "Notepad started.\n";
I've also tried the unix-like
system "notepad&";
but i could not make it work.
the reason for "start notepad" is that you have to run notepad in a
separate process which will be generated by the windows nt "start"
command. otherwise notepad will run in the same process and perl will be
blocked until notepad is closed.
hope this helps
juergen ibelgaufts
---------------------------------------------------------------------
Tim schrieb:
>
> Hi,
> simple question (but not for me).
>
> I'm trying to use perl5 to launch apps on a NT4 system. Why is it when
> I use
>
> exec "notepad";
> or
> system "notepad";
>
> notepad pops right up (ditto "command"), but when I try to call any
> other application nothing happens? I've tried using the full path,
> escaping backslashes, single quotes, all to no avail.
>
> Anyone point me in the right direction?
>
> Thanks,
> Tim.
------------------------------
Date: Fri, 16 Oct 1998 09:07:33 GMT
From: Tim Haynes <thaynes@openlinksw.co.uk>
Subject: Re: Perl5 on Solaris reading MS Access Database
Message-Id: <7072ck$nof$1@nnrp1.dejanews.com>
Hi,
Right idea, Jim :)
OpenLink's ODBC (and JDBC) drivers are available for free non-expiry
evaluation download from http://www.openlinksw.com/ onwards.
Regards,
~Tim
In article <3626534E.3832@gecm.com>,
jim.michael@gecm.com wrote:
> scott@softbase.com wrote:
> >
> > Stephen Palmer (slpalmer@NOSPAM.flex.net) wrote:
> > > After a careful search of DejaNews, and CPAN, I'm still at a loss as to
>
> Not careful enough...
>
> > There is no good way to do this, because Access doesn't work in a
> > networked environment. Access is also not a multiuser database like
>
> Try a dejanews search in the old database on 'unix perl access openlink'
>
> HTH.
>
> Cheers,
>
> Jim
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 16 Oct 1998 06:09:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Redirecting output of the system function
Message-Id: <zqBV1.15$iK3.60509@nsw.nnrp.telstra.net>
In article <gbjyaqhxj79.fsf@saul.cis.upenn.edu>,
Olaf Meyer <olafm@seas.upenn.edu> writes:
> Is there an easy way of redirecting the output of commands
> executed via the system function?
>
> I would for example like to store the ouput in a string variable,
> similar to the bash command
> files=`pick -from whoever +folder`
Have you actuall ever looked at perl's documentation? You should...
# perldoc -f system
[snip]
This is I<NOT> what you want to use to capture
the output from a command, for that you should use merely backticks or
qx//, as described in L<perlop/"`STRING`">.
[snip]
Hmmm...
# perldoc perlop
[snip]
qx/STRING/
`STRING`
A string which is interpolated and then executed as
a system command. The collected standard output of
the command is returned.
[snip]
Well, what do you know? It has the exact same operators for this as
the bash shell has.
You were so close. All you missed was reading the documentation.
> Olaf (please also e-mail me, since I don't perl too much)
*start rant*
Errr.. I don't get it. What does the verb 'to perl' express? If you
mean that you don't read this group very much, then all I can say is
that that is your loss, and in this case also your problem. The
question you just asked comes up here so often that you would have
known the answer. Besides, if you don't read this group, you will miss
this answer, and probably a few others from people who don't believe
in being a personal help desk for people who are too lazy to read this
group, use dejanews, or read the documentation.
*end rant*
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: 16 Oct 1998 01:05:42 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Reverse foreach loop
Message-Id: <x790iht7tl.fsf@sysarch.com>
>>>>> "d" == darrensw <darrensw@my-dejanews.com> writes:
d> Hi
d> I am using a simple foreach loop;
d> e.g. foreach $i (0 .. $#array)
d> What I actually need is for it to go in reverse;
d> e.g. foreach $i ($#array .. 0)
d> Can this be done?
not this way. .. only counts up
just use a for loop and use a variable and -- like in C.
for ( $i = $#array ; $i > 0 ; $i-- ) {
BTW be sure to check your boundary conditions. this is a common bug with
odd loop counters.
my old favorite style from c is
for ( $i = $#array ; --$i >= 0 ; ) {
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 16 Oct 1998 00:56:30 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Reverse foreach loop
Message-Id: <alecler-1610980056300001@dialup-604.hip.cam.org>
In article <706gpf$v6k$1@nnrp1.dejanews.com>, darrensw@my-dejanews.com wrote:
> Hi
>
> I am using the following foreach loop:
>
> foreach $i (1 .. $#array)
>
> But, I want to do this in reverse, like:
>
> foreach $i ($#array .. 1)
>
> Can this be done, if so how?
Use the conventional for syntax:
for ($i = $#array; $i >= 1; $i--) {
}
HTH,
Andre
------------------------------
Date: 16 Oct 1998 05:26:56 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Reverse foreach loop
Message-Id: <908515600.269291@thrush.omix.com>
[posted & mailed]
darrensw@my-dejanews.com wrote:
: I am using a simple foreach loop;
: e.g. foreach $i (0 .. $#array)
: What I actually need is for it to go in reverse;
: e.g. foreach $i ($#array .. 0)
: Can this be done?
foreach my $i (reverse 0 .. $#array) { }
perldoc -f reverse
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Thu, 15 Oct 1998 22:13:27 -0700
From: "E-swap" <webmaster@eswap.co.uk>
Subject: Re: Reverse foreach loop
Message-Id: <706l53$1ea$1@nnrp3.snfc21.pbi.net>
Figured out a much simpler way ...
foreach $i (reverse(0 .. $#array))
Thanks anyway ...
Darren
Uri Guttman wrote in message ...
>>>>>> "d" == darrensw <darrensw@my-dejanews.com> writes:
>just use a for loop and use a variable and -- like in C.
>
> for ( $i = $#array ; $i > 0 ; $i-- ) {
>
>my old favorite style from c is
>
> for ( $i = $#array ; --$i >= 0 ; ) {
>
>uri
------------------------------
Date: 16 Oct 1998 06:41:42 GMT
From: gtod@netspace.net.au (Gregory Tod)
Subject: Re: Reverse foreach loop
Message-Id: <706pr6$nro$2@otis.netspace.net.au>
On Fri, 16 Oct 1998 04:07:11 GMT, <darrensw@my-dejanews.com> wrote:
>I am using the following foreach loop:
>foreach $i (1 .. $#array)
>
>But, I want to do this in reverse, like:
>foreach $i ($#array .. 1)
>
>Can this be done, if so how?
foreach $i (reverse 1 .. $#array)
is literally what you asked for -- but this will iterate over 1 less than
the total number of elements in the array. You may want either of these:
foreach $i (reverse 0 .. $#array)
foreach $i (reverse 1 .. @array) # @array evaluated in scalar context
which cover all elements. You may even want:
foreach my $i (reverse @array) # @array evaluated in list context
but now I'm mind reading...
Try from command line: perldoc -f reverse
--
Gregory Tod gtod@netspace.net.au
------------------------------
Date: 16 Oct 1998 10:10:03 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: Reverse foreach loop
Message-Id: <m3ems9orl0.fsf@furu.g.aas.no>
Uri Guttman <uri@sysarch.com> writes:
> >>>>> "d" == darrensw <darrensw@my-dejanews.com> writes:
>
> d> Hi
> d> I am using a simple foreach loop;
> d> e.g. foreach $i (0 .. $#array)
>
> d> What I actually need is for it to go in reverse;
>
> d> e.g. foreach $i ($#array .. 0)
>
> d> Can this be done?
>
> not this way. .. only counts up
Here reverse comes to rescue:
foreach $i (reverse 0 .. $#array)
Note that perl will not turn this into a plain counting loop as it
would do with Darren's first example. The Todo file in the perl
distribution still contains an entry for
Optimizations: foreach(reverse...)
--
Gisle Aas
------------------------------
Date: 16 Oct 1998 05:44:42 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Sorry
Message-Id: <706mga$lba$1@marina.cinenet.net>
Larry Wall (larry@kiev.wall.org) wrote:
: In article <362627ED.C42390AC@min.net>, John Porter <jdporter@min.net> wrote:
: >Larry Wall wrote:
: >>
: >> Perl is worse than Python because people wanted it worse.
: >
: >Meaning "wanted it more badly", I take it?
:
: I intended you to take it however you like. :-)
Ah. "There's more than one way to parse it," too. :) Fruit flies like a
banana...
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3989
**************************************