I have to say - I am totally enamored with regex. Color me 'goober'. I just think that is a beautiful, concise, elegant way to make a substitution. All of that capability in one short string of characters... No if, then, else construct. Just - capture what is there; if it matches a .\w then change it to a .out. If there isn't a .\w at the end of the string, just append the .out.

On Mar 7, 2007, at 9:45 PM, Chas Owens wrote:

On 3/7/07, Jennifer Foo <[EMAIL PROTECTED]> wrote:
$_=abc.eeeee.i;

This is short for:

$_ = 'abc' . 'eeeee' . 'i';

Which is the same as saying:

$_ = 'abceeeeei';



Thanks.I never knew that it can write a string like this way.

You probably shouldn't though.  It is a carry over from the earlier
days of Perl.  Modern Perl should use the strict pragma (which bans
barewords outside of a few special cases).

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




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


Reply via email to