Mr. Shawn H. Corey wrote:
> On Tue, 2006-09-05 at 01:30 -0700, John W. Krahn wrote:
>>Anything used as a pattern is a string.  See the "Quote and Quote-like
>>Operators" section of perlop:
> 
> Huh?
> 
> Do you mean all strings can be used as a pattern?

A pattern is a string.  Perl does string interpolation on patterns before
passing them on to the regular expression engine.

>   split( quotemeta( $split_string ), $data_string );

Which could also be written as:

    split( "\Q$split_string", $data_string );

Or:

    split( /\Q$split_string/, $data_string );


> Or that patterns are built from strings?
> 
>   split( /$split_string/, $data_string );
> 
> 
> What I meant was that:
> 
>   split( $split_string, $data_string );
> 
> works like the second one, which can surprise you since you would expect
> it to work like the first.

I don't understand what you are trying to say.



John
-- 
use Perl;
program
fulfillment

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


Reply via email to