bradcan has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks
I'm confused. This snippet behaves:
and prints 'that text'.my $text = "this text"; $text =~ /this/that; print $text;
But not this:
It prints '1', clearly the truth of the statement, but why?my $text = "this text"; print $text =~ /this/that/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inline substitution regex
by kennethk (Abbot) on Sep 28, 2009 at 22:14 UTC | |
|
Re: Inline substitution regex
by ikegami (Patriarch) on Sep 28, 2009 at 23:03 UTC | |
by bradcan (Novice) on Sep 29, 2009 at 00:47 UTC | |
by ikegami (Patriarch) on Sep 29, 2009 at 05:14 UTC | |
by vitoco (Hermit) on Sep 29, 2009 at 13:26 UTC | |
by ikegami (Patriarch) on Sep 29, 2009 at 16:31 UTC | |
| |
by LanX (Saint) on Sep 29, 2009 at 14:35 UTC | |
by ikegami (Patriarch) on Sep 29, 2009 at 16:12 UTC | |
|
Re: Inline substitution regex
by Marshall (Canon) on Sep 28, 2009 at 22:37 UTC | |
|
Re: Inline substitution regex
by johngg (Canon) on Sep 28, 2009 at 22:17 UTC |