in reply to Re: shell to perl question
in thread shell to perl question

In case you're wondering exactly how that works, perl is implicitly splitting the output on a newline character, because it's being assigned to an array. The following is an equivalent, explicit version of what's going on.
my $files = `find ./Images | egrep '\.jpe?g$'`; my @files = split(/\n/, $files);
UPDATE: My split was slightly off, as corrected below. Who does this guy think he is, correcting my code? ;-)
---
my name's not Keith, and I'm not reasonable.

Replies are listed 'Best First'.
Re^3: shell to perl question
by TimToady (Parson) on Aug 18, 2005 at 17:51 UTC
    Close. Actually, it's equivalent to
    my @files = split(/^/, $files);
    since it leaves the newlines on each indivdual list element.