[12038] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5638 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 12 11:07:29 1999

Date: Wed, 12 May 99 08:00:20 -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           Wed, 12 May 1999     Volume: 8 Number: 5638

Today's topics:
    Re: Breaking a File on Keywords (Tad McClellan)
    Re: Conditional search and replace within a text file <hawkwynd@adelphia.net>
    Re: Conditional search and replace within a text file <microchip@centuryinter.net>
    Re: DBD-Oracle-0.61 install problem <Albert.Trojanowski@Dresdner-Bank.com>
    Re: Exists win32 equivalent for fork? (Scott McMahan)
    Re: FAQ 9.10: How do I redirect to another page? <hartleh1@westat.com>
        Formmail/Multiple Email address (HX Man)
    Re: Formmail/Multiple Email address <gellyfish@gellyfish.com>
    Re: MS-HTML must die! (Larry Rosler)
    Re: Need a little looping help (Larry Rosler)
    Re: Newbie needs help <awalrant@softhome.net>
    Re: problem with MIME::Lite module <gellyfish@gellyfish.com>
    Re: PWS and Perl (Scott McMahan)
        Request: JPL mailing list info kucerar@hhmi.org
    Re: Seizing the Bull by the Horns (Chris Nandor)
    Re: Sorting is too slow for finding top N keys... - GOT (Michel Dalle)
    Re: sub return undef @array ? (Bart Lateur)
    Re: Ten Tips toward *DIVERSITY COMPLIANCE* in Web Desig <droby@copyright.com>
    Re: Ten Tips toward *DIVERSITY COMPLIANCE* in Web Desig <hartleh1@westat.com>
        THE GD PACKAGE !!! <miri@coral.co.il>
        un esprit lisp dans un corps C <tchrist@mox.perl.com>
    Re: Win32 system problem and quotes alexmc@my-dejanews.com
    Re: Win32 system problem and quotes (Bart Lateur)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 12 May 1999 03:46:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Breaking a File on Keywords
Message-Id: <jlbbh7.v3g.ln@magna.metronet.com>

tigerstr@postoffice2.bellatlantic.net wrote:
: I need to break a file on a keyword and create seperate files with the
: new file names. For example a text file would contain:


: I need to create two files named chapter1 and 2 with the appropriate
: data. Any suggestions for the best way to do this.


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

open(OUT, '>front_stuff') || die "could not open 'front_stuff'  $!";
while (<DATA>) {
   if ( /^BREAK (.*)$/ ) {
      open(OUT, ">$1") || die "could not open '$1'  $!";
      next;
   }
   print OUT;
}
close(OUT);


__DATA__

BREAK chapter1

some text 1

BREAK chapter2

some text 2
-----------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 12 May 1999 12:19:22 GMT
From: "Hawkwynd" <hawkwynd@adelphia.net>
Subject: Re: Conditional search and replace within a text file
Message-Id: <ele_2.1997$5g5.19120@server1.news.adelphia.net>


Bob MacCallum wrote in message <373969BE.673A9B53@not.my.address.ok>...

>you might want to check in the manual for the difference between
>
>m/abc/ or /abc/;
>s/abc/xyz/;
>and
>tr/abc/xyz/;


After checking the manual, I think the following would be the correct usage,
as I am looking to remove
all instances of the word NOTES: that have no text following it on that
line.


if ($_ = ~m/NOTES:/s) {

This would check to verify if the word NOTES: is the ONLY match on a single
line, correct?






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

Date: Wed, 12 May 1999 08:38:33 -0400
From: MicroChip <microchip@centuryinter.net>
Subject: Re: Conditional search and replace within a text file
Message-Id: <37397649.2240@centuryinter.net>

Hawkwynd wrote:
> 
> Bob MacCallum wrote in message <373969BE.673A9B53@not.my.address.ok>...
> 
> >you might want to check in the manual for the difference between
> >
> >m/abc/ or /abc/;
> >s/abc/xyz/;
> >and
> >tr/abc/xyz/;
> 
> After checking the manual, I think the following would be the correct usage,
> as I am looking to remove
> all instances of the word NOTES: that have no text following it on that
> line.
> 
> if ($_ = ~m/NOTES:/s) {
> 
> This would check to verify if the word NOTES: is the ONLY match on a single
> line, correct?

close...

## to turn a line "NOTES:" into "" use

s/^NOTES:$//;           ## is string is in $_
$line =~ s/^NOTES:$//;  ## if string is in $line

## if you want to perform other things if NOTES: was by itself...

if ($line =~ /^NOTES:$/) {  ## if (/^NOTES:$/) {
    ## do this stuff
};
-- 
________________________________
  MicroChip Technical Services
  backwoods [at] backwoods.org


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

Date: Wed, 12 May 1999 15:08:25 +0200
From: Trojanowski Albert <Albert.Trojanowski@Dresdner-Bank.com>
Subject: Re: DBD-Oracle-0.61 install problem
Message-Id: <37397D49.D3ACD062@Dresdner-Bank.com>

have a look on DBI:Oracle README file
Be sure to set ENVIROMANT

for informix:

INFORMIXDIR     = "/usr/lib/informix";
INFORMIXSERVER  = "demo_se";
LD_LIBRARY_PATH = "/usr/lib/informix/lib:/usr/lib/informix/lib/esql";
DBPATH          = "/usr/lib/informix/bin:[your_dbms_paths]";
PATH            = "/usr/lib/informix/bin";

i think it have to be similar for Oracle


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

Date: 12 May 1999 14:27:45 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Exists win32 equivalent for fork?
Message-Id: <37398fe1.0@news.new-era.net>

Pavel Kotala (pkotala@logis.cz) wrote:
> Can I create child processes on Win32? Fork does not work.

No, you can not create a child process the way
UNIX does. The Win32 process model doesn't allow it.

Use threads.

Scott

PS: If you're interested in the mechanics of why it doesn't work I hold
forth at length on this issue in my new book, coming out in Aug. I can't
remember what I said, but I used a lot of acronyms. I explained it all,
I think, but it's been a while since I've seen the manuscript.


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

Date: Wed, 12 May 1999 09:17:53 -0400
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: FAQ 9.10: How do I redirect to another page?
Message-Id: <37397F80.1A226C4E@westat.com>

TRG Software : Tim Greer wrote:

> Henry Hartley wrote:
> >
> > print "Location: http://www.domain.com/newpage\nWindow-target: <FrameName>\n\n";
>
> Unless you use IE and not Netscape, and it doesn't work 1/2 the time.

I can think of one solution to that... <grin>

HHH




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

Date: Wed, 12 May 1999 13:12:43 GMT
From: hx101@novanet.ns.ca (HX Man)
Subject: Formmail/Multiple Email address
Message-Id: <37397d30.766177208@news.dal.ca>

Is it possible to set up a form and have different recipients when a
certain person is selected in a drop down box????? For example when
they select Jim from the dropdown box, Jim gets the email form....
When they select Bob from the dropdown box, Bob gets the email
information.

Thanks


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

Date: 12 May 1999 14:57:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Formmail/Multiple Email address
Message-Id: <373988b5@newsread3.dircon.co.uk>

HX Man <hx101@novanet.ns.ca> wrote:
> Is it possible to set up a form and have different recipients when a
> certain person is selected in a drop down box????? For example when
> they select Jim from the dropdown box, Jim gets the email form....
> When they select Bob from the dropdown box, Bob gets the email
> information.
> 

Yes. I'm sure it is - however I'm not quite sure what that has to do with 
Perl.

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



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

Date: Wed, 12 May 1999 07:45:14 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: MS-HTML must die!
Message-Id: <MPG.11a333d3597ef278989a39@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <37393556@cs.colorado.edu> on 12 May 1999 02:01:26 -0700, Tom 
Christiansen <tchrist@mox.perl.com> says...
> In comp.lang.perl.misc, 
>     lr@hpl.hp.com (Larry Rosler) writes:
> :I promised to redo the demoroniser (British spelling) in one page.  It's 
> :actually somewhat more (88 lines including comments).  It would probably 
> :run at least an order of magnitude faster than the original; perhaps 
> :two.
> 
> Your code has the Sed Essence, but was not so phrased.  Now it is.

I'm not sure what the Sed Essence is, and whether it's good or bad.  
(For some of us, sed came a lot sooner than Perl.)  I guess you mean the 
line-by-line editing 'script' with the implicit loop over the input 
data.

So thanks for the '-0777pw'.  I knew the 'p' could create the loop, but 
overlooked the (very idiosyncratic :-) 0777 to suppress $RS (a.k.a. $/) 
and read each file as a single 'line'.

> Also, I fixed an $ARGV bug you had, and added a multiple break munge.
> 
> --tom

Thanks for those, too.  A fun exercise, vetted by the ultimate pro.

Now on to the proxy (but not with the idea of improving it -- perish the 
thought!).

> #!/bin/perl -0777pw
 ...
> $1 eq "\n" ? ++$iline : printf STDERR
>    "$0: warning -- untranslated character 0x%.2X in line $iline of `%s'\n",
> 	 ord $1, ($ARGV eq '-' ? 'standard input' : $ARGV)
> 	     while /([\x00-\x08\n\x10-\x1F\x80-\x9F])/g;
 ...
> #   Repair idiotic double breaks
> s@<BR>(?:\s*<BR>)+@<P>@gi;
 ...

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


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

Date: Wed, 12 May 1999 07:07:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Need a little looping help
Message-Id: <MPG.11a32ae3684dda13989a38@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <m1k8uekax1.fsf@halfdome.holdit.com> on 12 May 1999 00:24:42 
-0700, Randal L. Schwartz <merlyn@stonehenge.com> says...
> >>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:
 ...
> Larry>         $code = qq(for my $_ (1..2) {\n).indent($code).qq(}\n);
> 
> Larry> I don't know why the squigglies were backslashed.
> 
> GNU Emacs cperl-mode was complaining about mismatched parens.
> Yes, I'll probably get a rash of mail from people that think I shouldn't
> change my Perl code just to help an editor along, but that's life.

LOL!  I don't have access to that editor, so I can't experiment.  ('vi' 
rules!, in modern verncular.)  Would Emacs have been 'smart' enough to 
complain about this:

                 $code = qq<for my $_ (1..2) {\n>.indent($code).qq<}\n>;

Had you faked out the editor that way, one might still think it weird 
style, but not redundant (like backslashing squigglies).

In other words, is it smart enough to recognize all four sets of 
brackets, or just the round ones?

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


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

Date: Wed, 12 May 1999 15:22:28 +0200
From: Alain Walrant <awalrant@softhome.net>
Subject: Re: Newbie needs help
Message-Id: <37398094.F680AB72@softhome.net>

A simple question:
is the file containing the 'counter' reachable from the path you use when
your server execute the script( cgi-bin directory ?).
To test it, add a "|| die 'cant open file';"   atfer your open file command.

Just to test..



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

Date: 12 May 1999 14:47:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: problem with MIME::Lite module
Message-Id: <37398664@newsread3.dircon.co.uk>

David Craig <david@icon.screaming.net> wrote:
> I'm sure I'm doing something really stupid, but I can't seem to get the
> MIME::Lite module to work.  I have installed Lite.pm into the /cgi-bin/
> directory on the web server, and trying to run the script below.  Can anyone
> spot what I am doing wrong?
> 

Yes.  You have not installed the module correctly - read the perlmod
manpage if you dont understand why .  Is there some reason that you
cannot follow the instructions given in the modules README file ?


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


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

Date: 12 May 1999 14:30:09 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: PWS and Perl
Message-Id: <37399071.0@news.new-era.net>

paul_rahe@cissc.canon.com wrote:

>How can I use Perl scripts with Personal Web Server?

It used to be an unholy nightmare, but ActiveState has
a new setup program that does it all for you.
Download their latest and greatest, be sure Perl for IIS
is checked, and install it using that setup program.
The last few times I've done it, it went flawlessly.

Scott


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

Date: Wed, 12 May 1999 12:15:33 GMT
From: kucerar@hhmi.org
Subject: Request: JPL mailing list info
Message-Id: <7hbrd5$u00$1@nnrp1.deja.com>

Could anyone post or send the sign-on for this list?
TIA


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


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

Date: Wed, 12 May 1999 12:21:08 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Seizing the Bull by the Horns
Message-Id: <pudge-1205990821110001@192.168.0.77>

In article <3738aefc@cs.colorado.edu>, tchrist@mox.perl.com (Tom
Christiansen) wrote:

# You know, it's very disappointing to see so many followups
# to the prose, but nary a single one to the code. :-(

I got one.  Compress::Zlib could be used to compress the documents before
sending them to the client if the client supports it (such as Randal did
in a recent WT column).  That's a nice feature to add ... though if you
have a good connection, it doesn't matter much.  But if your proxy is
better connected than you and has a fast processor, it can be a good
thing.

Regardless, that's really peripheral to the point.  Thanks for posting
this, last time I tried to find it I couldn't.

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


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

Date: Wed, 12 May 1999 12:03:07 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Sorting is too slow for finding top N keys... - GOT IT !
Message-Id: <7hbql2$j0a$1@news.mch.sbs.de>

In article <lziu9yy6m2.fsf_-_@linux_sexi.neuearbeit.de>, mriedel@neuearbeit.de (Marko R. Riedel) wrote:
>
>I also ran QuickSelect on Larry's sample data. (The algorithm is the
>same and makes no use of the properties of hashes. It copies key data
>that the user may not not be interested in.) I had to disambiguate
>keys (hash values) by randomization in order to prevent QuickSelect
>from going quadratic.
>
>[SNIP] > ./lrosler1.pl 6 < lrosler.dat 
>ZZYYXXWWVVUUTTSSRRQQ
>ZZYYXXWWVVUUTTSSRRQQ
>AABBCCDDEEFFGGHHIIJJ
>aAbBcCdDeEfFgGhHiIjJ
>aAbBcCdDeEfFgGhHiIjJ
>zZyYxXwWvVuUtTsSrRqQ
>31012
>79 59 56 52 50 41 41 37 37 37 33 32 32 31 31 31 31 30 30 30 
>79 59 56 52 50 41 41 37 37 37 33 32 32 31 31 31 31 30 30 30 
>Benchmark: timing 6 iterations of Internal, Qsel, Sortsub...
>  Internal: 30 wallclock secs (28.53 usr +  0.03 sys = 28.56 CPU)
>      Qsel: 31 wallclock secs (30.76 usr +  0.01 sys = 30.77 CPU)
>   Sortsub: 58 wallclock secs (55.79 usr +  0.02 sys = 55.81 CPU)
>

Thanks for the benchmarks, Marko. The sample data that Larry used
was based on the value distribution of my original dataset. Obviously, the 
original dataset is NOT sorted by value but quite random...

Unfortunately, I AM interested in the keys corresponding to the highest
values in the hash (and I'm probably not the only one in this case).
As I said before, my adaptation of qsel to sorting the values of hashes
is certainly not ideal, but it seems to be highly dependant on the
order of the hash keys !? Any candidates for modifying qsel to hashes ?

In the meantime, I finally managed to reproduce the "slow sort" with the
latest Perl version and a fast machine ! The reason that a simple Perl
sort can take MUCH longer than Larry1 etc. seems to be due to memory
usage and excessive paging rather than simple CPU usage.

Here is a simple test I ran with 411406 entries (actual time spent, not CPU
time) :

Michel1 (simple sort) : 252 seconds
Michel3 : 74 seconds
Larry1 : 16 seconds
Larry2 : 16 seconds
Larry4 : 202 seconds
Bart1 : interrupted after 10 minutes
 ..
Only Larry1 and Larry2 seemed to be using the CPU at more than 10%.
And in this case, Larry4 (with binary insertion) is actually worse than Larry2
(linear insertion).

So, since the CPU penalty for using Larry1/Larry2 is quite small compared
to the potential gain, I'll go that way any day :-)

I haven't tested yet whether the problem I had with 31013 entries with Perl
5.004 and 5.003 was also due to paging... Can anyone else verify that for
large hashes, simple sorting with Perl5.005.0x can slow down excessively
due to paging, and that LarryX (and other algorithms) are more appropriate ?

Thanks,

Michel.


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

Date: Wed, 12 May 1999 12:35:37 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: sub return undef @array ?
Message-Id: <373b746d.6557935@news.skynet.be>

Stephen Warren wrote:

>I've trying to write a function that takes a scalar, does some processing to
>split it up and returns the various components in an array. This bit works
>fine.
>
>However, if the original scalar is of a certain pattern, I want to return
>undef. When I do something like the code below, it doesn't work as expected.
>Any idea why?

Yes. You return an array with one element: undef.

>sub retundef
>{
>   return undef ;
>}
>
>my @x = retundef() ;

If you want a general solution, just do a bare "return".

  sub retundef
  {
     return;
  }

It returns undef in scalar context, and an empty array in list context.
I bet that this is what you would want it to do.

	Bart.


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

Date: Wed, 12 May 1999 11:57:54 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: Ten Tips toward *DIVERSITY COMPLIANCE* in Web Design
Message-Id: <7hbqc2$t7a$1@nnrp1.deja.com>

In article <37387ff8@cs.colorado.edu>,
  tchrist@mox.perl.com (Tom Christiansen) wrote:
>  [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
>     "J|rgen Exner" <juex@my-dejanews.com> writes:
> :Somehow I fail to see the relation with Perl.
> :Do you mind to explain?
>
> It's in my followup -- a perl-based proxy to fix a lot
> of this totally evil crap.
>

You could write a Perl program to fix badly formatted Lisp programs too.
Shall we start a Lisp thread?

--
Don Roby


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


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

Date: Wed, 12 May 1999 09:55:46 -0400
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: Ten Tips toward *DIVERSITY COMPLIANCE* in Web Design
Message-Id: <37398862.75F67113@westat.com>

Tom Christiansen wrote:

> 8) Never use plug-ins of any sort.  Are they available for all platforms?
>    Are they available for all browsers?  Of course not.  Therefore,
>    plug-ins only limit your audience.  They probably violate several
>    of the other principles outlined about.

Is there a non-plug-in way to provide audio or video content over the web?  I
enjoyed listening to a few NCAA tournament games in an interior office (which
prevents the radio from hearing the outside world).  I also distribute our
church's sunday message in RealAudio each week.  How do you suggest I do that
without using a plug-in?

Henry Hartley





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

Date: Wed, 12 May 1999 14:58:51 +0200
From: "Miri Bar" <miri@coral.co.il>
Subject: THE GD PACKAGE !!!
Message-Id: <7hbqcr$mdm$1@lnews.actcom.co.il>

hello, i'm miri from israel.
i tried to submit my question at the developer.com site but
there was an error....
my question: i need to use the gd package in perl, i downloaded
the files and installed it according to instructions and still i get:

"Can't locate loadable object for module GD in @INC (@INC contains:
c:\perl\lib c:\perl\site\lib .) at test.pl line 2
BEGIN failed--compilation aborted at test.pl line 2."

why ?
i don't understand.
i heard that the new version of perl includes the gd package.
where can i get it?
thank you very much,
miri@coral.co.il





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

Date: 12 May 1999 06:46:49 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: un esprit lisp dans un corps C
Message-Id: <37397839@cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, Don Roby <droby@copyright.com> writes:
:You could write a Perl program to fix badly formatted Lisp programs too.
:Shall we start a Lisp thread?

Sure!  Perl people could stand to learn a bit of lisp.  After all,
on dit que Perl a un esprit lisp dans un corps C, n'est-ce pas? :-)

(in a Monty Pythonesque voice from the Holy Grail...)
Bring out your closures!
Bring out your closures!
Bring out your closures!

--tom
-- 
"I find this a nice feature but it is not according to the documentation.
   Or is it a BUG?"
"Let's call it an accidental feature. :-)" Larry Wall in <6909@jpl-devvax.JPL.NASA.GOV>


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

Date: Wed, 12 May 1999 13:06:19 GMT
From: alexmc@my-dejanews.com
Subject: Re: Win32 system problem and quotes
Message-Id: <7hbuca$2b$1@nnrp1.deja.com>


> alexmc@my-dejanews.com wrote:
>
> : $cmd = "\"ls\" \"c:\\program files\" ";
> : system $cmd;                          # DOESN'T Work
> : print "This completed ($cmd) \n";


 makarki.NOSPAM@news.hit.fi (Matti Johannes Kdrki) wrote:
> This doesn't work because if you put quotes around the whole command
> including parameters. The system function of the OS (NT or Win95)
> thinks that the quoted text is only a name of the executable
> with some spaces in
> it. ie the system tries to start the executable named as:
>
>   "ls c:\program files"
>
> I think that this isn't a bug. It is a 'feature' of the
> Microsoft product.


To re-iterate...

If I have a batch file with

"c:\winnt\notepad.exe" "C:\winnt\win.ini"

in it, it works fine.

but if I have a perl script with

system '"c:\winnt\notepad.exe" "C:\winnt\win.ini"'

I get:

The filename, directory name, or volume label syntax is incorrect.

Now if I do the same thing in MS Visual C++ I get the same problem,
so it doesn't look like a perl problem at all - just a difference
between the way the system command works, as you suggested...


Sorry to bother the newsgroup with a "non-perl" problem.

Oh - and I can thus work around the problem by saving the command
to a batch file, and using system to run that batch file...


I wonder what compiler ActiveState perl is compiled with, and whether
using Borland makes any difference.

PS - I really didn't mean "ls". I meant "dir", but that wasn't relevant
to the problem. Sorry for the confusion.

Alex McLintock



--
Alex McLintock	http://www.arcfan.demon.co.uk/sf/books/    SF REVIEWS


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


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

Date: Wed, 12 May 1999 14:13:56 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Win32 system problem and quotes
Message-Id: <373a8ac9.12282328@news.skynet.be>

alexmc@my-dejanews.com wrote:

>To re-iterate...
>
>If I have a batch file with
>
>"c:\winnt\notepad.exe" "C:\winnt\win.ini"
>
>in it, it works fine.
>
>but if I have a perl script with
>
>system '"c:\winnt\notepad.exe" "C:\winnt\win.ini"'
>
>I get:
>
>The filename, directory name, or volume label syntax is incorrect.
>
>Now if I do the same thing in MS Visual C++ I get the same problem,
>so it doesn't look like a perl problem at all

>Oh - and I can thus work around the problem by saving the command
>to a batch file, and using system to run that batch file...

A more elegant solution would be to avoid the shell completely. I can't
test this myself, but according to the docs, system() behaves in a
completely different manner if you pass it more than one argument. So I
would definitely try:

	system 'c:\winnt\notepad.exe','C:\winnt\win.ini'

without quotes, even if a filename contains spaces, as the shell isn't
invoked.

   HTH,
   Bart.


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

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

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