[16193] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3605 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 10 19:44:15 2000

Date: Mon, 10 Jul 2000 16:44:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963272644-v9-i3605@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 10 Jul 2000     Volume: 9 Number: 3605

Today's topics:
        Symbolic References for Form parsing? (zawy)
    Re: Symbolic References for Form parsing? (Steven Smolinski)
    Re: Symbolic References for Form parsing? (zawy)
    Re: Symbolic References for Form parsing? <uri@sysarch.com>
    Re: Symbolic References for Form parsing? (Steven Smolinski)
    Re: Symbolic References for Form parsing? (Tad McClellan)
    Re: Symbolic References for Form parsing? (Tad McClellan)
    Re: Symbolic References for Form parsing? (Eric Bohlman)
    Re: Symbolic References for Form parsing? (Abigail)
    Re: Symbolic References for Form parsing? (brian d foy)
    Re: Symbolic References for Form parsing? <jeff@vpservices.com>
    Re: Symbolic References for Form parsing? (Eric Bohlman)
    Re: Symbolic References for Form parsing? (zawy)
    Re: Symbolic References for Form parsing? (Abigail)
    Re: Symbolic References for Form parsing? (zawy)
    Re: Symbolic References for Form parsing? <iltzu@sci.invalid>
    Re: Symbolic References for Form parsing? (zawy)
    Re: Symbolic References for Form parsing? <iltzu@sci.invalid>
    Re: Symbolic References for Form parsing? (Abigail)
    Re: Symbolic References for Form parsing? (zawy)
    Re: Symbolic References for Form parsing? (Tad McClellan)
        synchronization, process control melet@my-deja.com
    Re: synchronization, process control <care227@attglobal.net>
        Syntax? system("copy $src_dir $tgt_dir") dejafcarlet@my-deja.com
    Re: Syntax? system("copy $src_dir $tgt_dir") newsposter@cthulhu.demon.nl
    Re: Syntax? system("copy $src_dir $tgt_dir") <lauren_smith13@hotmail.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 08 Jul 2000 16:13:00 GMT
From: zawy@yahoo.com (zawy)
Subject: Symbolic References for Form parsing?
Message-Id: <396752b7.172354620@news.mindspring.com>

Is there a module that that can parse a html form so that you can just
start using the variables that were on the form rather than having to
hardcode the values into the variables? I didn't see a way to do it
with CGI.pm.  If there isn't a module to do this, then why?  It looks
like Symbolic References could be easily used to do it.  

How good is the Perl CGI.pm book (by Stein) ?  


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

Date: Sat, 08 Jul 2000 16:34:25 GMT
From: sjs@yorku.ca (Steven Smolinski)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <slrn8mem0e.dd8.sjs@john.sympatico.ca>

zawy <zawy@yahoo.com> wrote:
>Is there a module that that can parse a html form so that you can just
>start using the variables that were on the form rather than having to
>hardcode the values into the variables? I didn't see a way to do it
>with CGI.pm.  If there isn't a module to do this, then why?  It looks
>like Symbolic References could be easily used to do it.  

I cannot think of a situation in which I would recommend symrefs.

To accomplish your purpose while using CGI.pm, I usually put my 
parameters into a hash named params:
 
my %params = map { $_ => param($_) } param();

You can then access any parameters with $params{whatever}.

Steve


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

Date: Sat, 08 Jul 2000 16:49:25 GMT
From: zawy@yahoo.com (zawy)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <39675af8.174467473@news.mindspring.com>


>You can then access any parameters with $params{whatever}.

Besides having fnger tendonitis problems, I am a firm believer in
minimizing code so that you don't have to scan as much text when
debugging or changing code.  I want to type name="whatever" in the
form and $whatever in my Perl code, like PHP allows.


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

Date: Sat, 08 Jul 2000 17:04:07 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Symbolic References for Form parsing?
Message-Id: <x7lmzco8oo.fsf@home.sysarch.com>

>>>>> "z" == zawy  <zawy@yahoo.com> writes:

  >> You can then access any parameters with $params{whatever}.

  z> Besides having fnger tendonitis problems, I am a firm believer in
  z> minimizing code so that you don't have to scan as much text when
  z> debugging or changing code.  I want to type name="whatever" in the
  z> form and $whatever in my Perl code, like PHP allows.

then stick with php. this is perl, a real language.

and symrefs are evil in general. read these articles:

http://www.plover.com/~mjd/perl/varvarname.html
http://www.plover.com/~mjd/perl/varvarname2.html
http://www.plover.com/~mjd/perl/varvarname3.html

and if you insist on shooting yourself in the foot, don't come back here
hopping mad on the other foot.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sat, 08 Jul 2000 17:04:53 GMT
From: sjs@yorku.ca (Steven Smolinski)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <slrn8menph.dd8.sjs@john.sympatico.ca>

zawy <zawy@yahoo.com> wrote:

[ You may want to keep attribution information. The
  conversation was about CGI parameters and symrefs; I offerred a 
  solution which used a hash instead of a set of symrefs: ]

>>You can then access any parameters with $params{whatever}.

>Besides having fnger tendonitis problems, I am a firm believer in
>minimizing code so that you don't have to scan as much text when
>debugging or changing code.  I want to type name="whatever" in the
>form and $whatever in my Perl code, like PHP allows.

You can do whatever you want; you're not writing anything I'll 
have to maintain, so I don't care that much.  If you are willing
to obfuscate code in order to type fewer characters, you're
beyond hope anyway.  If you want to use (e.g.) $type to equal
the 'type' parameter, then do that explicitly:

my $type = param('type');

This lets those reading the program know what you're up to.  But to
create a set of symrefs and then just go referencing them through
the program is unnecessarily confusing and therefore dangerous.

But if you're intent on symrefs, go read the docs and write your code.
I certainly won't tie that noose for you.

Steve


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

Date: Sat, 8 Jul 2000 13:07:58 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <slrn8menve.p1d.tadmc@magna.metronet.com>

On Sat, 08 Jul 2000 16:13:00 GMT, zawy <zawy@yahoo.com> wrote:

>Is there a module that that can parse a html form so that you can just
>start using the variables that were on the form rather than having to
>hardcode the values into the variables? 


Yes. CGI.pm can do that.

But it doesn't "parse a html form". It relies on programs that
are designed to parse HTML forms (called "browsers" :-)

It parses the form data sent by the browser.


>I didn't see a way to do it
>with CGI.pm.  


See the section titled:


   "FETCHING THE NAMES OF ALL THE PARAMETERS PASSED TO YOUR SCRIPT"


>It looks
>like Symbolic References could be easily used to do it.  


Symbolic References are evil.

You can nearly always get what you want without them.

Don't be evil, be good.


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


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

Date: Sat, 8 Jul 2000 13:12:10 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <slrn8meo7a.p1d.tadmc@magna.metronet.com>

On Sat, 08 Jul 2000 16:49:25 GMT, zawy <zawy@yahoo.com> wrote:
>
>>You can then access any parameters with $params{whatever}.
>
>Besides having fnger tendonitis problems, I am a firm believer in
>minimizing code so that you don't have to scan as much text when
 ^^^^^^^^^^^^^^^

At the expense of a terrible increase in the amount of
maintenance time required when something goes wrong.

You can pay (a little) now, or pay (a lot) later.

Paying less is generally desirable.


>debugging or changing code.  I want to type name="whatever" in the
>form and $whatever in my Perl code, like PHP allows.


Symrefs are global variables.

Global variables are bad.


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


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

Date: 8 Jul 2000 18:16:15 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <8k7r5f$3d5$2@nntp9.atl.mindspring.net>

Uri Guttman (uri@sysarch.com) wrote:
: >>>>> "z" == zawy  <zawy@yahoo.com> writes:
: 
:   >> You can then access any parameters with $params{whatever}.
: 
:   z> Besides having fnger tendonitis problems, I am a firm believer in
:   z> minimizing code so that you don't have to scan as much text when
:   z> debugging or changing code.  I want to type name="whatever" in the
:   z> form and $whatever in my Perl code, like PHP allows.
: 
: then stick with php. this is perl, a real language.

We're obviously dealing with the 21st-century version of the physicist 
who writes Fortran in any language.



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

Date: 08 Jul 2000 15:14:05 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <slrn8mf0df.rbj.abigail@alexandra.delanet.com>

zawy (zawy@yahoo.com) wrote on MMDIII September MCMXCIII in
<URL:news:39675af8.174467473@news.mindspring.com>:
'' 
'' >You can then access any parameters with $params{whatever}.
'' 
'' Besides having fnger tendonitis problems, I am a firm believer in
'' minimizing code so that you don't have to scan as much text when
'' debugging or changing code.  I want to type name="whatever" in the
'' form and $whatever in my Perl code, like PHP allows.


You _can_ do that with CGI.pm. RTFM.



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: Sat, 08 Jul 2000 18:18:34 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <brian-ya02408000R0807001818340001@news.panix.com>

In article <slrn8menph.dd8.sjs@john.sympatico.ca>, sjs@yorku.ca posted:

> zawy <zawy@yahoo.com> wrote:

> >>You can then access any parameters with $params{whatever}.

> >Besides having fnger tendonitis problems, I am a firm believer in
> >minimizing code so that you don't have to scan as much text when
> >debugging or changing code.  

hashes do that beautifully - especially when it's time to loop 
through all of the parameters to do something.  for instance,
notice the one line of code that was offered to create the
entire hash.  that's certainly a lot less typing than explicity
naming several form variables as separate scalar variables.

> > I want to type name="whatever" in the
> >form and $whatever in my Perl code, like PHP allows.

i answered this part in the .cgi group already.  use CGI.pm's
clearly documented import_names() routine.

> You can do whatever you want; you're not writing anything I'll 
> have to maintain, so I don't care that much. 

you'd be surprised what you might have to maintain in the future.
i've certainly come across situations where i had to maintain crap
that i have reviled in this very newsgroup.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>


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

Date: Sat, 08 Jul 2000 20:38:43 -0400
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Symbolic References for Form parsing?
Message-Id: <3967C993.BC8E9353@vpservices.com>

zawy wrote:
> 
> >You can then access any parameters with $params{whatever}.
> 
> Besides having fnger tendonitis problems, I am a firm believer in
> minimizing code so that you don't have to scan as much text when
> debugging or changing code.  

Well, I can sympathize with those goals.  I usually dump form params
into a hash named %u or %v (user-input variables) so there is less to
type than a longer hash name and so my user-derived input stands out. 
Is it harder to type $u{foo} than to type $foo?  Well a bit.  Is it
harder to scan code for one rather than the other?  Definitely, the
$u{foo} format stands out much better (even without something like cperl
emacs highlighting of hashes) and immediately identifies variables
coming from user input whereas $foo hides itself in with the rest of the
code and makes it really hard to debug.  Just try glancing at this
paragraph rapidly and see if the places I typed $u{foo} are visually
easier to pick out than the places I typed $foo.

A lot of research has shown that the ease with which humans (and other
species as well) grok things is related to the degree of patterning in
the thing, not the overall amount of the thing.  Grouping all user input
under %u buys you a pattern at the cost of 3 characters per variable. 
Not a bad trade off.

All that on top of the problems with symrefs the other posters have
pointed out.

-- 
Jeff


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

Date: 9 Jul 2000 02:51:04 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <8k8pao$1hl$2@slb1.atl.mindspring.net>

zawy (zawy@yahoo.com) wrote:
: 
: >You can then access any parameters with $params{whatever}.
: 
: Besides having fnger tendonitis problems, I am a firm believer in
: minimizing code so that you don't have to scan as much text when
: debugging or changing code.  I want to type name="whatever" in the
: form and $whatever in my Perl code, like PHP allows.

If you've got a repetitive motion injury, saving 3 characters each time 
you type the name of a variable is a classic case of micro-optimization.  
Using an editor that lets you define macros would do a lot more for the 
health of your fingers then deliberately cramping your coding style.



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

Date: Sun, 09 Jul 2000 03:34:25 GMT
From: zawy@yahoo.com (zawy)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <3967f142.212947522@news.mindspring.com>

>You _can_ do that with CGI.pm. RTFM.

The closest I could find was this:
===================================
import_names 
    $req->import_names('R')
Convert all request parameters into perl variables in a specified
package. This avoids the need to use $req->param('name'), you can
simply sat $R::name ('R' is the recommended package names). 
===========================

As you can see, it still requires 3 extra keystrokes, so PHP still
does it more easily.  RTFM yourself, where M means my message, unless
you had a different method in mind.

Thanks to all the posters who actually understood my posts (about 2
out 3?)



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

Date: 09 Jul 2000 01:37:01 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <slrn8mg4te.t4j.abigail@alexandra.delanet.com>

zawy (zawy@yahoo.com) wrote on MMDIV September MCMXCIII in
<URL:news:3967f142.212947522@news.mindspring.com>:
?? >You _can_ do that with CGI.pm. RTFM.
?? 
?? The closest I could find was this:
?? ===================================
?? import_names 
??     $req->import_names('R')
?? Convert all request parameters into perl variables in a specified
?? package. This avoids the need to use $req->param('name'), you can
?? simply sat $R::name ('R' is the recommended package names). 
?? ===========================
?? 
?? As you can see, it still requires 3 extra keystrokes, so PHP still
?? does it more easily.  RTFM yourself, where M means my message, unless
?? you had a different method in mind.

I guess I assumed you did a little thinking yourself, and were able
to understand 'R' isn't a mythical constant, but you could actually
subsitute it for something useful. I'm sorry I assumed a working
braincell.

        $req -> import_names (__PACKAGE__);



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: Sun, 09 Jul 2000 12:46:44 GMT
From: zawy@yahoo.com (zawy)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <39686fb3.245321539@news.mindspring.com>

OK, but why is my system able to find and use CGI and CGI::Carp but
not CGI:Request?


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

Date: 9 Jul 2000 13:05:45 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Symbolic References for Form parsing?
Message-Id: <963147857.14904@itz.pp.sci.fi>

In article <3967f142.212947522@news.mindspring.com>, zawy wrote:
>The closest I could find was this:
>===================================
>import_names 
>    $req->import_names('R')
>Convert all request parameters into perl variables in a specified
>package. This avoids the need to use $req->param('name'), you can
>simply sat $R::name ('R' is the recommended package names). 
>===========================

 ..and what would happen if you put "package R;" after that?

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method."  -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.



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

Date: Sun, 09 Jul 2000 13:26:26 GMT
From: zawy@yahoo.com (zawy)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <39687cce.248676711@news.mindspring.com>

On 9 Jul 2000 13:05:45 GMT, Ilmari Karonen <iltzu@sci.invalid> wrote:

>..and what would happen if you put "package R;" after that?

Finally, someone who doesn't underestimate my ignorance.  I assume
replacing R with main would work, but I haven't figured out why
CGI::Request doesn't load.  Here's the error:

Request.pm: Can't locate CGI/Request.pm in @INC (@INC contains:
/usr/lib/perl5/i386-linux/5.00404 /usr/lib/perl5
/usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl .) 


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

Date: 9 Jul 2000 14:30:55 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Symbolic References for Form parsing?
Message-Id: <963152992.21670@itz.pp.sci.fi>

In article <39687cce.248676711@news.mindspring.com>, zawy wrote:
>Request.pm: Can't locate CGI/Request.pm in @INC (@INC contains:
>/usr/lib/perl5/i386-linux/5.00404 /usr/lib/perl5
>/usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl .) 

It means you don't have CGI::Request installed.  You need to get it
from http://www.cpan.org/ and install it first.

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method."  -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.



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

Date: 09 Jul 2000 10:31:47 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <slrn8mh483.tts.abigail@alexandra.delanet.com>

zawy (zawy@yahoo.com) wrote on MMDIV September MCMXCIII in
<URL:news:39687cce.248676711@news.mindspring.com>:
;; On 9 Jul 2000 13:05:45 GMT, Ilmari Karonen <iltzu@sci.invalid> wrote:
;; 
;; >..and what would happen if you put "package R;" after that?
;; 
;; Finally, someone who doesn't underestimate my ignorance.  I assume
;; replacing R with main would work, but I haven't figured out why
;; CGI::Request doesn't load.  Here's the error:
;; 
;; Request.pm: Can't locate CGI/Request.pm in @INC (@INC contains:
;; /usr/lib/perl5/i386-linux/5.00404 /usr/lib/perl5
;; /usr/lib/perl5/site_perl/i386-linux /usr/lib/perl5/site_perl .) 


Djee. What did perldiag had to say about this?


Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


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

Date: Sun, 09 Jul 2000 15:35:13 GMT
From: zawy@yahoo.com (zawy)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <396897f7.255630983@news.mindspring.com>


>It means you don't have CGI::Request installed.  You need to get it
>from http://www.cpan.org/ and install it first.

I had thought :: meant it was inside the CGI module. I didn't see any
modules with "request" in the name. Maybe I need to find yet another
book that talks about modules.  



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

Date: Sun, 9 Jul 2000 12:11:38 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Symbolic References for Form parsing?
Message-Id: <slrn8mh91q.s00.tadmc@magna.metronet.com>

On Sun, 09 Jul 2000 15:35:13 GMT, zawy <zawy@yahoo.com> wrote:
>
>>It means you don't have CGI::Request installed.  You need to get it
>>from http://www.cpan.org/ and install it first.
>
>I had thought :: meant it was inside the CGI module. 
                                              ^^^^^^

It means it was inside the CGI _hierarchy_ (i.e. it is "related to" 
CGI stuff).

The module hierarchy is reflected in the filesystem's directory
hierarchy.

use CGI:

   means find a file named CGI.pm in one of the @INC dirs.

use CGI::Request;

   means find a file named Request.pm in a subdirectory named
   CGI in one of the @INC dirs. (i.e. look for CGI/Request.pm)



>I didn't see any
>modules with "request" in the name. 

You are looking for the wrong name.

Look for ones with "Request" in the name.


>Maybe I need to find yet another
>book that talks about modules.  


Are the perlmod*.pod files not helpful to you?


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


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

Date: Thu, 06 Jul 2000 17:04:06 GMT
From: melet@my-deja.com
Subject: synchronization, process control
Message-Id: <8k2e5u$75j$1@nnrp1.deja.com>

hello,

My main sript launch an other program. The main must use results of the
second process to working. How to synchronize my process?

Thanks

fred


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 06 Jul 2000 13:35:09 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: synchronization, process control
Message-Id: <3964C34D.9B6905C6@attglobal.net>

melet@my-deja.com wrote:
> 
> hello,
> 
> My main sript launch an other program. The main must use results of the
> second process to working. How to synchronize my process?


Sounds like you want to capture the results of an externam program 
for use within the calling program.  Perl offers you backticks (the 
` char on your keyboard) to do just that.  You can also use the 
quoting method qx{}, it doesn't make a difference.

$results = `who am i`; #$results now has my login name

@files = `ls -al` #files now holds the output of ls -l in an array


Look like what you need?

HTH


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

Date: Mon, 10 Jul 2000 17:43:03 GMT
From: dejafcarlet@my-deja.com
Subject: Syntax? system("copy $src_dir $tgt_dir")
Message-Id: <8kd1v2$ved$1@nnrp1.deja.com>

Can anyone know why the system command does not worK?  I'm runing on NT
4.0.

Thanks in advance.
Forrest Carleton

*****************************************

 print "ntf = $ntf  copying $source_dir to $target_dir  \n";
 system("copy $source_dir $target_dir");

*****************************************
source file = CONFIG.SYS      # first file to copy
  copying c:/src to c:/tgt   # source and target resolved

error message received
The syntax of the command is incorrect


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 10 Jul 2000 18:08:26 GMT
From: newsposter@cthulhu.demon.nl
Subject: Re: Syntax? system("copy $src_dir $tgt_dir")
Message-Id: <8kd3eq$61g$2@internal-news.uu.net>

dejafcarlet@my-deja.com wrote:

> Can anyone know why the system command does not worK?  I'm runing on NT
> 4.0.

>  print "ntf = $ntf  copying $source_dir to $target_dir  \n";
>  system("copy $source_dir $target_dir");


> source file = CONFIG.SYS      # first file to copy
>   copying c:/src to c:/tgt   # source and target resolved

> error message received
> The syntax of the command is incorrect

And you get that error message when you type 'copy c:/src c:/tgt' in
a dos shell as well.  So it's not system that doesn't work, but
the copy. You have to specify correct dos paths ...
 

Erik



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

Date: Mon, 10 Jul 2000 11:05:36 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: Syntax? system("copy $src_dir $tgt_dir")
Message-Id: <8kd3ak$lrc$1@brokaw.wa.com>


<dejafcarlet@my-deja.com> wrote in message
news:8kd1v2$ved$1@nnrp1.deja.com...
> Can anyone know why the system command does not worK?  I'm runing on NT
> 4.0.
> *****************************************
>
>  print "ntf = $ntf  copying $source_dir to $target_dir  \n";
>  system("copy $source_dir $target_dir");
>
> *****************************************
> source file = CONFIG.SYS      # first file to copy
>   copying c:/src to c:/tgt   # source and target resolved
>
> error message received
> The syntax of the command is incorrect

That is not a Perl error.  And besides, you don't really want to spawn a
separate process for each file that you copy.

Do yourself a favor and see the documentation for File::Copy.  You'll be
glad you did.

Lauren





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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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 V9 Issue 3605
**************************************


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