Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl and recursive copying?

Reply
Thread Tools

Perl and recursive copying?

 
 
Kyle Witherspoon
Guest
Posts: n/a
 
      08-14-2003
I'm trying to write a web based perl script that writes a self
replicating website.
For now, I'm trying to have it copy the contents of
/usr/apache/joe
to /usr/apache/bill.

So I need it to programmatically create bill and copy the entire
contents of joe...I'm using Perl 5.6.0 and none of the File::Copy
commands are working, or I am doing it wrong..anyone have a bone to
throw? thanks

 
Reply With Quote
 
 
 
 
Tore Aursand
Guest
Posts: n/a
 
      08-14-2003
On Thu, 14 Aug 2003 00:20:21 +0000, Kyle Witherspoon wrote:
> For now, I'm trying to have it copy the contents of
> /usr/apache/joe
> to /usr/apache/bill.


Why don't you use 'cp -R /usr/apache/joe/* /usr/apache/bill/.'?


--
Tore Aursand <>
 
Reply With Quote
 
 
 
 
James E Keenan
Guest
Posts: n/a
 
      08-14-2003
Kyle Witherspoon <> wrote in message news:<9BA_a.12846$. com>...
> I'm trying to write a web based perl script that writes a self
> replicating website.
> For now, I'm trying to have it copy the contents of
> /usr/apache/joe
> to /usr/apache/bill.
>
> So I need it to programmatically create bill and copy the entire
> contents of joe...I'm using Perl 5.6.0 and none of the File::Copy
> commands are working, or I am doing it wrong..anyone have a bone to
> throw? thanks


You'll have to show us your code in order for us to determine what's going wrong.
 
Reply With Quote
 
James Willmore
Guest
Posts: n/a
 
      08-16-2003
(Tad McClellan) wrote in message news:<>.. .
> James Willmore <> wrote:
>
> > use vars qw/$joe $bill/;

>
>
> You should always prefer lexical variables over package
> variables, except when you can't.
>
>
> And you can, but you aren't, and you should:
>
> my( $joe, $bill );


Okay, now you've given me a concept to read about (lexical). I seen
it, heard about it, and, I fear greatly to say this, but don't
understand it.

Thanks,

Jim
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      08-16-2003
James Willmore <> wrote:
> (Tad McClellan) wrote in message news:<>.. .



>> You should always prefer lexical variables over package
>> variables, except when you can't.


> Okay, now you've given me a concept to read about (lexical). I seen
> it, heard about it, and, I fear greatly to say this, but don't
> understand it.



Lexical variables are the ones that are _easy_ to understand.

It is package variables that are harder to understand.

Use the easy-to-understand kind whenever you can.


See also:

"Coping with Scoping":

http://perl.plover.com/FAQs/Namespaces.html


--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas
 
Reply With Quote
 
Jonathan Stowe
Guest
Posts: n/a
 
      08-17-2003
Tad McClellan <> wrote:
> James Willmore <> wrote:
> > (Tad McClellan) wrote in message news:<>.. .

>
>
> >> You should always prefer lexical variables over package
> >> variables, except when you can't.

>
> > Okay, now you've given me a concept to read about (lexical). I seen
> > it, heard about it, and, I fear greatly to say this, but don't
> > understand it.

>
>
> Lexical variables are the ones that are _easy_ to understand.
>
> It is package variables that are harder to understand.
>


Conceptually, perhaps, yes. But the term _lexical_ itself occludes
the simplicity of the idea. The term _package_ finds expression in the
perl syntax and is similar in its use there as it is in human languages,
whereas the _lexical_ is an uncommon word and it appears to be used in an
essentially metaphorical manner in describing the scope of stuff in Perl.
The perlfaq item:

How can I access a dynamic variable while a
similarly named lexical is in scope?

seems to make a further leap by assuming the reader will fill in the
'ly scoped variable' (yes, the patch is in the post

So on balance I'm not surprised that people find lexically scoped thingies
( and how much more difficult it is on the brain when these things aren't
simple identifiers like variables) more difficult to understand than
package scoped ones.

Now what was my point again?


/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
 
Reply With Quote
 
James Willmore
Guest
Posts: n/a
 
      08-18-2003
Jonathan Stowe <> wrote in message news:<ypU%a.11$>...
> Conceptually, perhaps, yes. But the term _lexical_ itself occludes
> the simplicity of the idea. The term _package_ finds expression in the
> perl syntax and is similar in its use there as it is in human languages,
> whereas the _lexical_ is an uncommon word and it appears to be used in an
> essentially metaphorical manner in describing the scope of stuff in Perl.
> The perlfaq item:
>
> How can I access a dynamic variable while a
> similarly named lexical is in scope?
>
> seems to make a further leap by assuming the reader will fill in the
> 'ly scoped variable' (yes, the patch is in the post
>
> So on balance I'm not surprised that people find lexically scoped thingies
> ( and how much more difficult it is on the brain when these things aren't
> simple identifiers like variables) more difficult to understand than
> package scoped ones.
>
> Now what was my point again?


LOL. I'm not sure if I should say this, but I felt, for just a
moment, that I was part of "The Hitchhicker's Guide to the Galaxy"
(the TV version, not the book or radio - which I have yet to hear).

I'm hoping that you were trying to be a little humorous in your post.
If not, my appologies in advance.

Jim
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveState Perl and MinGW [was: Perl 5.14 Windows Strawberry Perl 64 bits] Dilbert Perl Misc 0 11-10-2011 02:20 PM
recursive perl neiderer@arl.army.mil Perl Misc 1 03-10-2010 02:43 PM
Recursive functions Vs Non-recursive functions - performance aspect vamsi C Programming 21 03-09-2009 10:53 PM
Two recursive calls inside of a recursive function n00m C++ 12 03-13-2008 03:18 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments