how do prlglobs expand (was Re: 'nobody' using sudo -- scary!)



This raises an intersting pint )for me at least)

I'm not that used to perl globs:


let's assume I work in a setup where /home/*/.forward expands to > 15000 files.


What would happen if I use follwing statement in perl"


foreach my $file (</home/*/.forward>){
do_something($file);
}

would perl
- iterate through the files
- or would perl first create a list of all the files and then
iterate through them.
- or would it hit a linit and not provide all hits.
- or does it depend on the system perl is running on
?

Just being curious?



Big and Blue wrote:
RedGrittyBrick wrote:
Jens Thoms Toerring wrote:

for i in `ls -a /home/*/.forward`; do rm $i; done
. . .

Neither of which would necessarily work if /home were an automount point, as "*" won't expand (and if it did, could have > 15000 matches in at least one case I know of, which is why you wouldn't want it to expand).

.



Relevant Pages

  • Re: missing newlines
    ... Using perl v5.10.0 on my GNU/Linux box, running the script and the data ... The idea of the script is to insert the major hyphenation points of `in2' ... my $hit = 0; ...
    (comp.lang.perl.misc)
  • Re: PERL or PYTHON from FORTRAN?
    ... subsequently processed separately using a Perl script. ... Did you get it done, lose enthusiasm, get hit by a russian satellite, get ... I make liberal use of flash memory sticks. ... if you have a windows partition at all. ...
    (comp.lang.fortran)
  • Re: perl 5.8.5 segfaults on patternmatch
    ... }} I recently discovered segfaulting of perl 5.8.5 doing many ... It's questionable whether this is a bug or not - ... an eigth the size that makes Perl 5.000 hit the limit. ...
    (comp.lang.perl.misc)
  • Re: dwarf stars histogram again
    ... >> CPU usage, so perl is out. ... Unless I hit a brick wall, ... sys 0m0.080s ...
    (comp.unix.shell)
  • Re: Is there a quick way to generate combinations
    ... > More specifically, Google ... > "Perl and math and combinations" ... > and you'll hit it along with some other possible solutions. ...
    (comp.lang.perl.misc)