in reply to Shell expansion with <> is funky

Your question has been answered, but I'd like to make another comment. Please do not use prototypes. It's clear from the code that you don't know how Perl requires them to be presented for them to operate properly.

A function with a prototype must be declared or defined prior to the function being called. In addition, a function that calls itself must be declared before it is defined, if it is to have a prototype. When calling the function, the prototype is ignored if you preface the function call with an ampersand. You've violated two of those rules; your prototype is wasted.

There's also the grim fact that prototypes in Perl are far less useful than most programmers expect them to be, and they enforce often bizarre requirements on the arguments to functions -- some of these have been fixed only in the most recent versions of Perl.

Prototypes are deep magic, and even the best magicians get by without invoking them.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: Shell expansion with is funky
by tommyboy (Initiate) on Jan 25, 2002 at 03:42 UTC
    I appreciate the work around the sage advice about prototypes - I would beg to differ with japhy , however, that my question has been answered. I could use glob , but I would rather use <> and I am not sure why the angle brackets are not behaving as advertised. My question is, in a nutshell - why are angle brackets not resulting in correct shell expansion on succesive iterations of a loop. This is puzzling and still remains unanswered. Thanks, Tom
      I cannot replicate your problem.

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;