Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] trying to cp a file

Expand Messages
  • rmillergraysharbor
    Thank you for the advice. And thanks to David Precious for the sample code that is more Perl-specific. I appreciate it. Regina
    Message 1 of 14 , Oct 31, 2011
    • 0 Attachment
      Thank you for the advice.
      And thanks to David Precious for the sample code that is more Perl-specific.

      I appreciate it.

      Regina
      --- In perl-beginner@yahoogroups.com, David Precious <davidp@...> wrote:
      >
      > On Monday 31 October 2011 18:23:03 rmillergraysharbor wrote:
      > > That was it!
      > > I didn't chomp!
      >
      > Yup, the newline from the `ls -at1` output was the reason behind the (fairly
      > clear) error message you received when using File::Copy.
      >
      > Whilst you now have a script doing what you want, for the sake of your future
      > code and those who come after you, I would urge you to consider executing
      > things like 'cp', 'ls' etc a Bad Thing, often leading to non-portable code
      > with potential security vulnerabilities - if you can avoid executing shell
      > commands and just do it in Perl, it'll usually be more secure and more
      > portable.
      >
      > Otherwise, you may as well be writing a shell script :)
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.