in reply to File::Glob infinite loop with while loop unlike core glob function
For the benefit of anyone stumbling across this item in the future, there are several fixes being installed in the 5.16 release. The ':glob' tag has been removed from the synopsis and is actively discouraged in the documentation. Tag ':bsd_glob' will serve many of the same useful purposes, without the risk of infinite looping.
The discussion among the perl porters brought to light another alternative for globbing file names with embedded blanks. The <> operator usually embraces barewords. If it embraces a quoted string, splitting does not occur on blanks; they are treated as ordinary characters. So
while (<"em bedded/name*">} { print "$_\n"; }
would have done what the OP wanted, without the need for File::Glob.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File::Glob infinite loop with while loop unlike core glob function
by Anonymous Monk on Mar 20, 2012 at 08:53 UTC |