Nathan Torkington wrote:
>
> Hmm. This is exactly the same situation as with chomp() and somehow
> chomp() can tell the difference between:
>
> $_ = "hi\n";
> chomp;
>
> and
>
> @strings = ();
> chomp @strings;
Good point. I was looking at it from the general "What's wrong with how
@
Nathan Wiger writes:
> Honestly, not sure. Although, there are two things I'd say about it:
>
>1. I don't think it's a showstopper for this RFC, since the
> feature you are addressing is actually a new piece of
> functionality.
Hmm. This is exactly the same situation as with cho
Nathan Torkington wrote:
>
> When I was thinking about this very topic yesterday and today, I
> came up with this problem:
>
> @strs = ();
> match /pat/, @strs; # surprise! I'm matching on $_
>
> That is, how do you tell an empty array from no arguments?
Easy: We'll just use lazy evalua
Perl6 RFC Librarian writes:
>match; # all defaults (pattern is /\w+/?)
>match /pat/;# match $_
>match /pat/, $str; # match $str
>match /pat/, @strs; # match any of @strs
When I was thinking about this very topic yesterday and today, I
came up
> =head1 TITLE
>
> Replace =~, !~, m//, and s/// with match() and subst()
In a marked oversight, I'd also like to note that tr// would be replaced
with trade:
Perl 5 Perl 6
--- --
$str =~ tr/a/b/;$new =
On 27 Aug 2000 19:01:45 -, Perl6 RFC Librarian wrote:
>m//g just returns 1 for matching.
Er... but in a scalar context, m//g DOES only match once! If you want
more, repeat the match. Or use it in a list context, then it will try to
match them all.
$_ = "abaabbbababbbabbaaa";
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Additions to regexs
=head1 VERSION
Maintainer: Richard Proctor <[EMAIL PROTECTED]>
Date: 27 Aug 2000
Mailing List: [EMAIL PROTECTED]
Version: 1
Number: 166
=head1 A
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Allow Varibles in tr///
=head1 VERSION
Maintainer: Richard Proctor <[EMAIL PROTECTED]>
Date: 27 Aug 2000
Mailing List: [EMAIL PROTECTED]
Version: 1
Number: 165
=hea
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Replace =~, !~, m//, and s/// with match() and subst()
=head1 VERSION
Maintainer: Nathan Wiger <[EMAIL PROTECTED]>
Date: 27 Aug 2000
Version: 1
Mailing List: [EMAIL PROTECTED]
Number: 164
=h
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Behavior of empty regex should be simple
=head1 VERSION
Maintainer: Mark Dominus <[EMAIL PROTECTED]>
Date: 24 August 2000
Last Modified: 27 August 2000
Version: 2
Mailing List: [EMAIL PROTECTED]
>if (/Time: (..):(..):(..)/) {
> $hours = $1;
> $minutes = $2;
> $seconds = $3;
> }
>
> This then becomes:
>
> /Time: (?$hours=..):(?$minutes=..):(?$seconds=..)/
>
> This is more maintainable than counting the brackets and easier to understand
> for a complex r
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
counting matches
=head1 VERSION
Maintainer: Richard Proctor <[EMAIL PROTECTED]>
Date: 16 Aug 2000
Last Modified: 27 Aug 2000
Version: 2
Mailing List: [EMAIL PROTECTE
This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Assignment within a regex
=head1 VERSION
Maintainer: Richard Proctor <[EMAIL PROTECTED]>
Date: 16 Aug 2000
Date: 27 Aug 2000
Version: 2
Mailing List: [EMAIL PROTECTE
13 matches
Mail list logo