<?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 help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769547#M657654</link>
    <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;# BV='"BuildVersion" = "/tmp/maven-build-nHNMkWwtlz/applicationABC-20101029-105300-31abb9224ff046fe84f3914293a8cae0"'&lt;BR /&gt;&lt;BR /&gt;# echo ${X} | perl -nle 'm{(".*[^"]\s*=\s*")/.*?/(.*)} and print "$1$2"'&lt;BR /&gt;"BuildVersion" = "maven-build-nHNMkWwtlz/applicationABC-20101029-105300-31abb9224ff046fe84f3914293a8cae0"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Thu, 24 Mar 2011 11:18:22 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2011-03-24T11:18:22Z</dc:date>
    <item>
      <title>Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769545#M657652</link>
      <description>Hi ALL,&lt;BR /&gt;&lt;BR /&gt;I have a piece of perl code which makes a http call to a URL and in return gets a bunch of data related to application version.&lt;BR /&gt;&lt;BR /&gt;There is a string which gets returned from the http call - &lt;BR /&gt;&lt;BR /&gt;"BuildVersion" = "/tmp/maven-build-nHNMkWwtlz/applicationABC-20101029-105300-31abb9224ff046fe84f3914293a8cae0";&lt;BR /&gt;&lt;BR /&gt;I have made a piece of code which returns this information for me but I need it to return just "maven-build-.....cae0" and not /tmp.&lt;BR /&gt;&lt;BR /&gt;Here is the snippet of the code - &lt;BR /&gt;&lt;BR /&gt;                  my $BV = $httpmethod-&amp;gt;objectForKey("BuildVersion");&lt;BR /&gt;                   if ($BV &amp;amp;&amp;amp; $$BV) {&lt;BR /&gt;                       if ($version) {&lt;BR /&gt;                           $version .= ", ";&lt;BR /&gt;                       }&lt;BR /&gt;                       $BV = $BV-&amp;gt;UTF8String();&lt;BR /&gt;                       $version .= "BV=$BV";&lt;BR /&gt;&lt;BR /&gt;I want the output to return - &lt;BR /&gt;&lt;BR /&gt;BuildVersion = "maven...."&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Thu, 24 Mar 2011 05:51:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769545#M657652</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2011-03-24T05:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769546#M657653</link>
      <description>Hello Allan,&lt;BR /&gt;&lt;BR /&gt;Just add:&lt;BR /&gt;&lt;BR /&gt;print "BuildVersion=";&lt;BR /&gt;$BV =~ m/^\/(.*)\/(.*)\/(.*)/;&lt;BR /&gt;&lt;BR /&gt;print $2;&lt;BR /&gt;print "\/";&lt;BR /&gt;print $3;&lt;BR /&gt;&lt;BR /&gt;$OUT = "BuildVersion=".$2."\/".$3;&lt;BR /&gt;&lt;BR /&gt;in $OUT var. you would have the string you are looking for.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Horia.</description>
      <pubDate>Thu, 24 Mar 2011 11:01:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769546#M657653</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2011-03-24T11:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769547#M657654</link>
      <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;# BV='"BuildVersion" = "/tmp/maven-build-nHNMkWwtlz/applicationABC-20101029-105300-31abb9224ff046fe84f3914293a8cae0"'&lt;BR /&gt;&lt;BR /&gt;# echo ${X} | perl -nle 'm{(".*[^"]\s*=\s*")/.*?/(.*)} and print "$1$2"'&lt;BR /&gt;"BuildVersion" = "maven-build-nHNMkWwtlz/applicationABC-20101029-105300-31abb9224ff046fe84f3914293a8cae0"&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Mar 2011 11:18:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769547#M657654</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-24T11:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769548#M657655</link>
      <description>@James:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;# echo ${X} | ...&lt;BR /&gt;&lt;BR /&gt;This is a shell code. Please provide a perl code, as Allan asked from the first time.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Horia.</description>
      <pubDate>Thu, 24 Mar 2011 11:29:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769548#M657655</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2011-03-24T11:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769549#M657656</link>
      <description>@ Horia:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; @James: &amp;gt;# echo ${X} | ...This is a shell code. Please provide a perl code, as Allan asked from the first time.&lt;BR /&gt;&lt;BR /&gt;I'll leave that to Allan to decide what helps him or doesn't.  I don't need to be told what to post and what not to post.&lt;BR /&gt;&lt;BR /&gt;If you look more closely at what I posted, the only shell code is the 'echo' into a pipe for Perl to read from its STDIN.&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Mar 2011 11:50:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769549#M657656</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-24T11:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769550#M657657</link>
      <description>&amp;gt;the only shell code is the 'echo' into a pipe for Perl to read from its STDIN.&lt;BR /&gt;&lt;BR /&gt;Of course, this is it. This is a shell code.&lt;BR /&gt;&lt;BR /&gt;My point was that you assumed too much. Maybe Allan really needed a plain perl code. Maybe he does not know at all how to write a script in shell code. &lt;BR /&gt;&lt;BR /&gt;If someone is asking for help, he expects to receive what he asked for.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Horia.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Mar 2011 12:00:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769550#M657657</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2011-03-24T12:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769551#M657658</link>
      <description>Hi (again) Allan:&lt;BR /&gt;&lt;BR /&gt;See if this addresses your need more directly:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my $BV=q("BuildVersion" = "/tmp/maven-build-nHNMkWwtlz/applicationABC-20101029-105300-31abb9224ff046fe84f3914293a8cae0");&lt;BR /&gt;print "BEFORE: $BV\n";&lt;BR /&gt;$BV =~ s{(".*[^"]\s*=\s*")/.*?/(.*)}{$1$2};&lt;BR /&gt;print "AFTER : $BV\n";&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 24 Mar 2011 12:18:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769551#M657658</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-03-24T12:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769552#M657659</link>
      <description>Thank you for understanding, James.&lt;BR /&gt;&lt;BR /&gt;Have a nice day.&lt;BR /&gt;Horia.</description>
      <pubDate>Thu, 24 Mar 2011 12:20:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769552#M657659</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2011-03-24T12:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769553#M657660</link>
      <description>Thanks JRF!&lt;BR /&gt;&lt;BR /&gt;I am able get the BV but only thing is that I want /tmp/ removed...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Allan.</description>
      <pubDate>Thu, 24 Mar 2011 16:57:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769553#M657660</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2011-03-24T16:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769554#M657661</link>
      <description>&amp;gt;I want /tmp/ removed...&lt;BR /&gt;&lt;BR /&gt;Have you tried my piece of script?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Horia.</description>
      <pubDate>Fri, 25 Mar 2011 10:33:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769554#M657661</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2011-03-25T10:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Perl help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769555#M657662</link>
      <description>.. just to be clear: The piece of code JRF provided should work as expected (like mine, /tmp/ should be removed...).&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Horia.</description>
      <pubDate>Fri, 25 Mar 2011 10:36:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-help/m-p/4769555#M657662</guid>
      <dc:creator>Horia Chirculescu</dc:creator>
      <dc:date>2011-03-25T10:36:22Z</dc:date>
    </item>
  </channel>
</rss>

