Michael Fowler wrote:
> 
> On Wed, Dec 19, 2001 at 10:14:00PM +0100, Egor Brandt wrote:
> > #!/usr/bin/perl -w
> > while ( < i am fred     flintstone >) {
> 
> The text between the angle brackets is not what you're matching against;
> it's either a filehandle that you're reading from, or a globbing pattern to
> match files against in the current directory.  Not having Learning Perl on
> hand I couldn't tell you which, but I'm guessing it's a filehandle to read
> from.

Actually it is using globbing to do what you would normaly do with
split().

$ perl -MO=Deparse -e'while ( < i am fred     flintstone >) { print
">$_<\n" }'
while (defined($_ = CORE::GLOBAL::glob(' i am fred     flintstone ',
0))) {
    print ">$_<\n";
}
-e syntax OK
john@perl:~ > perl -e'while ( < i am fred     flintstone >) { print
">$_<\n" }'
><
>i<
>am<
>fred<
>flintstone<
><
 
Which is why the second regex is failing because it is trying to match
two words.



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to