Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101739

Re: Powerful perl paradigm I don't find in python

From Michael Vilain <vilain@NOspamcop.net>
Newsgroups comp.lang.python
Subject Re: Powerful perl paradigm I don't find in python
Date 2016-01-15 02:20 -0800
Organization DexLabs, Inc.
Message-ID <vilain-D8DAD1.02204215012016@news.individual.net> (permalink)
References <n7adse$k6$1@dont-email.me> <mailman.2.1452851041.15297.python-list@python.org>

Show all headers | View raw


In article <mailman.2.1452851041.15297.python-list@python.org>,
 Peter Otten <__peter__@web.de> wrote:

> Charles T. Smith wrote:
> 
> > while ($str != $tail) {
> >     $str ~= s/^(head-pattern)//;
> >     use ($1);
> > }
> 
> For those whose Perl's a little rusty: what does this do?
> A self-contained example might also be useful...

It does a string substitution of a line that contains "head-pattern".  
That looks like an error since who would search for a line starting with 
"head-pattern"?  The () is meant to encapsulate a substitution pattern 
to be used in the replacement string but they aren't doing that.

use ($1) would include whatever module is passed as the first argument.

This fragment is incomplete and makes no sense.  The OP will have to 
explain what they want because this is complete crap.

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Powerful perl paradigm I don't find in python "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2016-01-15 09:24 +0000
  Re: Powerful perl paradigm I don't find in python Peter Otten <__peter__@web.de> - 2016-01-15 10:43 +0100
    Re: Powerful perl paradigm I don't find in python Michael Vilain <vilain@NOspamcop.net> - 2016-01-15 02:20 -0800
  Re: Powerful perl paradigm I don't find in python Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2016-01-15 11:42 +0100
    Re: Powerful perl paradigm I don't find in python "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2016-01-15 11:04 +0000
      Re: Powerful perl paradigm I don't find in python "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2016-01-15 11:06 +0000
      Re: Powerful perl paradigm I don't find in python Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2016-01-15 14:20 +0100
        Re: Powerful perl paradigm I don't find in python "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2016-01-18 13:05 +0000
          Re: Powerful perl paradigm I don't find in python Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2016-01-18 14:33 +0100
      Re: Powerful perl paradigm I don't find in python Peter Otten <__peter__@web.de> - 2016-01-15 14:34 +0100
  Re: Powerful perl paradigm I don't find in python Ulli Horlacher <framstag@rus.uni-stuttgart.de> - 2016-01-15 13:51 +0000
    Re: Powerful perl paradigm I don't find in python me <self@example.org> - 2016-01-15 15:20 +0000
  Re: Powerful perl paradigm I don't find in python Nathan Hilterbrand <nhilterbrand@gmail.com> - 2016-01-15 11:54 -0500

csiph-web