<?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/3326139#M877771</link>
    <description>I'm not sure what you mean by the following file ot be processed?&lt;BR /&gt;&lt;BR /&gt;#!/bin/contrib/bin/perl -w&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;   $foo = "jube_04070806";&lt;BR /&gt;   $foo = s/jube_.*/jube_......../;&lt;BR /&gt;   print "$foo \n"l&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Produces &lt;BR /&gt;&lt;BR /&gt;   jube_......&lt;BR /&gt;&lt;BR /&gt;Or do you mean you want to read a directory and process all files like&lt;BR /&gt;&lt;BR /&gt;jube_05070806&lt;BR /&gt;jube_04070808&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then you might&lt;BR /&gt;&lt;BR /&gt;#!/usr/contrib/bin/perl -w&lt;BR /&gt;{&lt;BR /&gt;  opendir (DIRECTORY,$myDirectory) or &lt;BR /&gt;    die "cannot open $myDirectory;&lt;BR /&gt;&lt;BR /&gt;  @myFiles = readdir(DIRECTORY);&lt;BR /&gt;&lt;BR /&gt;  foreach $file(@myFiles){&lt;BR /&gt;&lt;BR /&gt;## You might want to anchor to the first &lt;BR /&gt;## position with the ^ so that you get &lt;BR /&gt;## jube_stuff and not stuff_jube_morestuff&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    if ($file =~ /^jube_.*/) {&lt;BR /&gt;############################################&lt;BR /&gt;# Your File Processing Logic Here ############################################&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  closedir DIRECTORY;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;-Good Luck</description>
    <pubDate>Fri, 09 Jul 2004 08:05:28 GMT</pubDate>
    <dc:creator>R. Allan Hicks</dc:creator>
    <dc:date>2004-07-09T08:05:28Z</dc:date>
    <item>
      <title>Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3326138#M877770</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;I have the following file to be processed :-&lt;BR /&gt;&lt;BR /&gt;jube99_04070806&lt;BR /&gt;&lt;BR /&gt;I need to process the file for pattern recognition so that I am left with the following :-&lt;BR /&gt;&lt;BR /&gt;jube99_........&lt;BR /&gt;&lt;BR /&gt;i.e substitute everything after the _ with dots. The dots should be substituted as a partial string with th ~= notation.&lt;BR /&gt;&lt;BR /&gt;I just cannot seem to be able to get the right substitution.&lt;BR /&gt;&lt;BR /&gt;Thanks for any help&lt;BR /&gt;&lt;BR /&gt;Jeff&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 08 Jul 2004 04:21:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3326138#M877770</guid>
      <dc:creator>Jeff Picton</dc:creator>
      <dc:date>2004-07-08T04:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: Perl question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3326139#M877771</link>
      <description>I'm not sure what you mean by the following file ot be processed?&lt;BR /&gt;&lt;BR /&gt;#!/bin/contrib/bin/perl -w&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;   $foo = "jube_04070806";&lt;BR /&gt;   $foo = s/jube_.*/jube_......../;&lt;BR /&gt;   print "$foo \n"l&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Produces &lt;BR /&gt;&lt;BR /&gt;   jube_......&lt;BR /&gt;&lt;BR /&gt;Or do you mean you want to read a directory and process all files like&lt;BR /&gt;&lt;BR /&gt;jube_05070806&lt;BR /&gt;jube_04070808&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then you might&lt;BR /&gt;&lt;BR /&gt;#!/usr/contrib/bin/perl -w&lt;BR /&gt;{&lt;BR /&gt;  opendir (DIRECTORY,$myDirectory) or &lt;BR /&gt;    die "cannot open $myDirectory;&lt;BR /&gt;&lt;BR /&gt;  @myFiles = readdir(DIRECTORY);&lt;BR /&gt;&lt;BR /&gt;  foreach $file(@myFiles){&lt;BR /&gt;&lt;BR /&gt;## You might want to anchor to the first &lt;BR /&gt;## position with the ^ so that you get &lt;BR /&gt;## jube_stuff and not stuff_jube_morestuff&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    if ($file =~ /^jube_.*/) {&lt;BR /&gt;############################################&lt;BR /&gt;# Your File Processing Logic Here ############################################&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;  closedir DIRECTORY;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;-Good Luck</description>
      <pubDate>Fri, 09 Jul 2004 08:05:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-question/m-p/3326139#M877771</guid>
      <dc:creator>R. Allan Hicks</dc:creator>
      <dc:date>2004-07-09T08:05:28Z</dc:date>
    </item>
  </channel>
</rss>

