On 8/9/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
> This mostly works, but doesn't do the right thing for START inside the range
>
> #!/usr/bin/perl -n
>
> print if /START/ .. /END/ and not (/START/ or /END/)
>
> This works, but doesn't use the filpflop* operator
>
> #!/usr/bin/perl
>
> my $in = 0;
> while (<>) {
>     $in = 0 if /END/;
>     print if $in;
>     $in = 1 if /START/;
> }
>
> In Perl 6 the range and flipflop operators are being separated into ..
> and ff respectively.  Both will have the ability to exclude the
> extreme item on either side using ^.  So, in Perl 6 your code would
> look something like this
>
> #!/usr/bin/perl
>
> use v6-alpha;
>
> for =<> {
>     print if /START/ ^ff^ /END/;
> }
>
> * in scalar context .. is the flipflop operator, in list context .. is
> the range operator
> ** or at least this is how I read S03
>
snip

Whoops, s/START/FROM/g in my last email.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to