ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: cornet <cornet@zmail.ru>
To: mandrake-russian@altlinux.ru
Subject: Re: [mdk-re] Re: [mdk-re] Обратно perl
Date: Fri Jul 20 12:23:01 2001
Message-ID: <3B57EDF4.D28389B2@zmail.ru> (raw)
In-Reply-To: <13506.010720@globetravel.spb.ru>

Sergey Degtyaryov wrote:
> 
> Доброго времени суток, cornet,
> 
> 20.07.2001 в 11:49 Вы сказали буквально следующее:
> 
> c> Есть строка, полученная программой из вне.
> c> $string
> c> Есть шаблон, полученный программой из вне.
> c> $template
> 
> c> Как проверить наличие шаблона в строке если шаблон хранится в
> c> переменной и на момент написания программы не известен???
> 
> c> if($string=~/^.*<как то указать на $template>.*$/)
> c> {
> c> print "Ok\n";
> c> }
> 
> А Вы пробуете решить задачу, перед тем как спросить? =)
> Кажется Вы и так все знаете =)

Как выясняется вовсе не все :-))
 
> $_ = 'Here we will find any template';
> $tpl = 'template';
> print "Looks like we found this f...ing \$tpl\n" if (/$tpl/);

Я не знал про это свойство if(/переменная_содержащая_шаблон/)
искать этот шаблон в $_ как подстроку.
Спасибо ОГРОМНОЕ! Все получилось :-))

-- 
******** FIRE & STEEL ********



  reply	other threads:[~2001-07-20 12:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-20 11:35 cornet
2001-07-20 11:55 ` [mdk-re] " Sergey Degtyaryov
2001-07-20 12:23   ` cornet [this message]
2001-07-20 12:33     ` Sergey Degtyaryov
2001-07-20 12:46       ` cornet
2001-07-20 12:59         ` Sergey Degtyaryov
2001-07-20 13:00         ` Artem K. Jouravsky
2001-07-20 13:11           ` cornet
2001-07-21  0:28       ` [mdk-re] " Mikhail Zabaluev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B57EDF4.D28389B2@zmail.ru \
    --to=cornet@zmail.ru \
    --cc=mandrake-russian@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git