<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3122751#M717675</link>
    <description>not clin.? but clin2?&lt;BR /&gt;&lt;BR /&gt;the . will match anything but a newline, which also includes slashes, which is not what you want. 2? means zero ore one literal 2&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
    <pubDate>Wed, 19 Nov 2003 03:58:05 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2003-11-19T03:58:05Z</dc:date>
    <item>
      <title>Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3122749#M717673</link>
      <description>Dear All,&lt;BR /&gt;&lt;BR /&gt;   I am trying to search for a string and replace with another in a perl script. The search string can be "clin" or "clin2"  and replace string is "clin2".  &lt;BR /&gt;&lt;BR /&gt;Here is the example&lt;BR /&gt;$repl_str=clin2&lt;BR /&gt;$dir=/opt/data/clin/0001/view&lt;BR /&gt;# Search for clin? and replace clin with the replace string.&lt;BR /&gt;$dir =~ s/clin?/$repl_str/g;&lt;BR /&gt;### resulting value of $dir is /opt/data/clin2/0001/view   which is O.K.&lt;BR /&gt;&lt;BR /&gt;But it fails for scenario 2.&lt;BR /&gt;$repl_str=clin2&lt;BR /&gt;$dir=/opt/data/clin2/0001/view&lt;BR /&gt;# Search for clin? and replace clin with the replace string.&lt;BR /&gt;$dir =~ s/clin?/$repl_str/g;&lt;BR /&gt;### resulting value is $dir=/opt/data/clin22/0001/view, &lt;BR /&gt;but I expected the value as &lt;BR /&gt;/opt/data/clin2/0001/view.&lt;BR /&gt;&lt;BR /&gt;Could some body help in modifying the search command. TIA&lt;BR /&gt;&lt;BR /&gt;Kris&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Nov 2003 18:03:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3122749#M717673</guid>
      <dc:creator>Kris_5</dc:creator>
      <dc:date>2003-11-18T18:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3122750#M717674</link>
      <description>the n? in clin? will match zero or 1 n.&lt;BR /&gt;that means it will match cli and clin.&lt;BR /&gt;your pattern should be clin.?</description>
      <pubDate>Tue, 18 Nov 2003 19:38:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3122750#M717674</guid>
      <dc:creator>curt larson_1</dc:creator>
      <dc:date>2003-11-18T19:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3122751#M717675</link>
      <description>not clin.? but clin2?&lt;BR /&gt;&lt;BR /&gt;the . will match anything but a newline, which also includes slashes, which is not what you want. 2? means zero ore one literal 2&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Wed, 19 Nov 2003 03:58:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3122751#M717675</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-11-19T03:58:05Z</dc:date>
    </item>
  </channel>
</rss>

