<?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 Perl question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/5223770#M679261</link>
    <description>perl -pi.back -e "s:(ap\d+) :ap1 \$1 :" filename&lt;BR /&gt;&lt;BR /&gt;Can you explain in detail the above command, I understand the part abt ap\d+ but dont quite get the rest of colons and $1.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
    <pubDate>Fri, 05 Feb 2010 20:06:56 GMT</pubDate>
    <dc:creator>Allanm</dc:creator>
    <dc:date>2010-02-05T20:06:56Z</dc:date>
    <item>
      <title>Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/5223770#M679261</link>
      <description>perl -pi.back -e "s:(ap\d+) :ap1 \$1 :" filename&lt;BR /&gt;&lt;BR /&gt;Can you explain in detail the above command, I understand the part abt ap\d+ but dont quite get the rest of colons and $1.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Fri, 05 Feb 2010 20:06:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/5223770#M679261</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-02-05T20:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/5223771#M679262</link>
      <description>HI Allan:&lt;BR /&gt;&lt;BR /&gt;The colons are used as delimiters.  As written, the whitespace is considered part of the characters to match (which seems odd).&lt;BR /&gt;&lt;BR /&gt;The parenthesized part captures the match which is then available in $1 and used as a backreference in the substitution.&lt;BR /&gt;&lt;BR /&gt;Thus:&lt;BR /&gt;&lt;BR /&gt;# echo "I am ap3 "|perl -pe 's:(ap\d+) :ap1 $1 :'&lt;BR /&gt;I am ap1 ap3&lt;BR /&gt;&lt;BR /&gt;Yet, if we don't have trailing whitespace there is no match:&lt;BR /&gt;&lt;BR /&gt;# echo "I am ap3"|perl -pe 's:(ap\d+) :ap1 $1 :'&lt;BR /&gt;I am ap3&lt;BR /&gt;&lt;BR /&gt;Unless we use the 'x' modified to write more readable expressions where whitespace can be used to spread out the pieces:&lt;BR /&gt;&lt;BR /&gt;# echo "I am ap3"|perl -pe 's:(ap\d+) :ap1 $1 :'x&lt;BR /&gt;I am ap1 ap3&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Feb 2010 20:22:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/5223771#M679262</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-02-05T20:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/5223772#M679263</link>
      <description>awesome explaination and analysis.Is there something more than 10!! :)&lt;BR /&gt;&lt;BR /&gt;Allan.</description>
      <pubDate>Sat, 06 Feb 2010 02:01:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/5223772#M679263</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-02-06T02:01:49Z</dc:date>
    </item>
  </channel>
</rss>

