in reply to Some automation on Perlscripts?

I think scanning a directory for files and making them executable without knowing what is really in there- is a security risk. If you already know what's in there, using chmod 0755 or whatever should not be a big deal.
I'm assuming here your ~/perl are scripts written- not something out of a package.

Consider putting your stuff in cvs/svn, making packages out of them- then you use your Makefile.PL to get those to install properly and chmod etc.

As for issue #1, I understand your point. I even agree. However, I feel this is a waste of time. For reference, may I suggest 'The Mythical Man Month' by Fred Brooks. He talks about this kind of thing. How coders are toolmakers, and when we go out to chop wood, we first sharpen the axe. Then we find a better way to sharpen the axe. Then we find a better way to prepare the better way to sharpen the axe. Then..

Anyhow. I think the solution for that shortcut you mention is better left to people writing the innards of perl itself. This is the kind of thing amateurs like us would just be shooting ourselves in the foot with.

++ For your ambition and curiosity. I applaude it.

Replies are listed 'Best First'.
Re^2: Some automation on Perlscripts?
by matze77 (Friar) on Dec 04, 2008 at 16:51 UTC

    Thanks for your entertaining reply. Is it right like i seemed to have learned that it is "somewhat complicated" to manipulate files with Perl and Perl is better suited for "manipulating text" so i would use Perl for inserting the text and bash (or anything else) for manipulating file permissions, or i entirely use bash ...? What do you think of using "syscalls" from Perl to start a shell function?


    Sorry for asking a no go question ...

    I never was aware before that some things you would better not do in (or are even impossible) language "x" but that answers the questions why there are so many languages out there ...

    Thanks for sharing your thoughts.
    MH

      Using syscalls from perl to shell..
      From a point of view of getting things done, do it.

      If you're developing software for release and installating in multiple machines over which you have no control- there's a few things you gotta do extra in your software. Like, checking that the stuff exists, etc.

      Perl, CPAN, will check great for perl module dependencies. But it's little bit harder for system applications. Purely perl speaking.

      The things I pointed out, it's not that you should never do it. It's about picking your battles.
      A system to properly do this, without corrupting data, etc is harder than it sounds.

      There's a difference between something that *looks* like it works, and something that does.

      And then, being on posix, that's part of what the whole thing is about, you use all these things together. Perl, bash, c, whatever.

      You can manipulate files and set permissions fine with perl. Fletch was cracking a joke. Perl is the answer to the question.