Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi ,
I am using following simple code
while(<c:/abc/*>) { print; }
I don't want "c:/abc/* to be hardcoded
Please post your comments
Thanks in advance

20041103 Edit by ysth: code tags

Replies are listed 'Best First'.
Re: Passing dynamic variable inside <>
by ikegami (Patriarch) on Nov 04, 2004 at 05:09 UTC
    $spec = 'c:/abc/*'; while (glob($spec)) { print; }
      Thank you very much
      It worked!!!!!!!!!!!!!
      I used following
      $currentpath='c:/abc/*';
      foreach (glob($currentpath))
      {
      print;
      }
Re: Passing dynamic variable inside <>
by gaal (Parson) on Nov 04, 2004 at 05:10 UTC
    See the standard module File::Glob.

    You do mean glob, right? Not <> in the sense of readline?)