in reply to (tye)Re: Perlish way of copying files
in thread Perlish way of copying files

Why the angle brackets tye? Pardon my ignorance, please.
  • Comment on Re: (tye)Re: Perlish way of copying files

Replies are listed 'Best First'.
(Ovid - angle brackets) Re(3): Perlish way of copying files
by Ovid (Cardinal) on May 03, 2001 at 19:49 UTC
    Sifmole asked:
    Why the angle brackets tye?

    As you've probably noticed, I'm not tye. I hope you won't be so thoroughly dissappointed as to disregard my comments ;)

    tye wrote the following:

    system('cp',<source/*>,'dest/.') and die

    The angle brackets are what are known as a "filename globbing operator". Want all text files from the current directory?

    my @test_files = <*.txt>;

    However, if you want to use this with variables, it's better to use the glob operator:

    my @files = glob( $foo );

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

      Thank you kindly. I think I now have something to go read up on.

      And no I was not too terribly disappointed.