<?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 Script help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659592#M20316</link>
    <description>Try to change:&lt;BR /&gt;&lt;BR /&gt;for ( my $i=0; $i &amp;lt; $ntuples; $i++) {&lt;BR /&gt;    @row = $sth-&amp;gt;fetchrow;                # Get a row&lt;BR /&gt;    $row[0] = &amp;amp;clip($row[0]);&lt;BR /&gt;    $distList .=  "$row[0]; ";&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;to:&lt;BR /&gt;&lt;BR /&gt;for ( my $i=0; $i &amp;lt; $ntuples; $i++) {&lt;BR /&gt;    @row = $sth-&amp;gt;fetchrow;                # Get a row&lt;BR /&gt;    $row[0] = &amp;amp;clip($row[0]);&lt;BR /&gt;    if ($row[0]=~/Molly/ or $row[0]=~/Kim/) {&lt;BR /&gt;     $distList .=  "$row[0]; ";&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sergejs</description>
    <pubDate>Fri, 28 Oct 2005 07:53:56 GMT</pubDate>
    <dc:creator>Sergejs Svitnevs</dc:creator>
    <dc:date>2005-10-28T07:53:56Z</dc:date>
    <item>
      <title>Perl Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659591#M20315</link>
      <description>Hello, hope I can get some help with this. Attached is a script written in perl which runs a query out of a database and sends a report out ot a number of people. Some of the folks are not around anymore so I need to remove them from the mailing list. My issue is I don't want to delete them out of teh databas table. &lt;BR /&gt;&lt;BR /&gt;The 4 people receiving them currently are Molly, Bruce, Peter. I would like to remove Bruce and Peter from the distribution list and add Tom to the list. &lt;BR /&gt;&lt;BR /&gt;With in the script, in this particular section..&lt;BR /&gt;&lt;BR /&gt;sub getDistList{&lt;BR /&gt;my $C = "select email from rpt_dist where rpt_id = '$_[0]';";&lt;BR /&gt;# die "$rptNam";&lt;BR /&gt; my $sth=$dbh-&amp;gt;prepare($C);&lt;BR /&gt; if ( !defined $sth ) {&lt;BR /&gt; die "DML Error, Cannot prepare Dist List statement: $DBI::errstr";&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; if($sth-&amp;gt;execute){&lt;BR /&gt;  my $ntuples = $sth-&amp;gt;rows;&lt;BR /&gt;  if ($ntuples &amp;gt; 0) {&lt;BR /&gt;   for ( my $i=0; $i &amp;lt; $ntuples; $i++) {&lt;BR /&gt;    @row = $sth-&amp;gt;fetchrow;                # Get a row&lt;BR /&gt;    $row[0] = &amp;amp;clip($row[0]);&lt;BR /&gt;    $distList .=  "$row[0]; ";&lt;BR /&gt;   }&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;within the four loop, how can I add a statement that says to only send mail to Molly, Kim and to not send it to Bruce and Peter.&lt;BR /&gt;&lt;BR /&gt;Tahnks and points will be assigned.</description>
      <pubDate>Thu, 27 Oct 2005 18:07:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659591#M20315</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2005-10-27T18:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659592#M20316</link>
      <description>Try to change:&lt;BR /&gt;&lt;BR /&gt;for ( my $i=0; $i &amp;lt; $ntuples; $i++) {&lt;BR /&gt;    @row = $sth-&amp;gt;fetchrow;                # Get a row&lt;BR /&gt;    $row[0] = &amp;amp;clip($row[0]);&lt;BR /&gt;    $distList .=  "$row[0]; ";&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;to:&lt;BR /&gt;&lt;BR /&gt;for ( my $i=0; $i &amp;lt; $ntuples; $i++) {&lt;BR /&gt;    @row = $sth-&amp;gt;fetchrow;                # Get a row&lt;BR /&gt;    $row[0] = &amp;amp;clip($row[0]);&lt;BR /&gt;    if ($row[0]=~/Molly/ or $row[0]=~/Kim/) {&lt;BR /&gt;     $distList .=  "$row[0]; ";&lt;BR /&gt;    }&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sergejs</description>
      <pubDate>Fri, 28 Oct 2005 07:53:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659592#M20316</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2005-10-28T07:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659593#M20317</link>
      <description>After your recommendation, I have put the following entry as such. Now when I run it, I get the following error. Please help.&lt;BR /&gt;&lt;BR /&gt;sub getDistList{&lt;BR /&gt;    451 my $C = "select email from rpt_dist where rpt_id = '$_[0]';";&lt;BR /&gt;    452 # die "$rptNam";&lt;BR /&gt;    453  my $sth=$dbh-&amp;gt;prepare($C);&lt;BR /&gt;    454  if ( !defined $sth ) {&lt;BR /&gt;    455  die "DML Error, Cannot prepare Dist List statement: $DBI::errstr";&lt;BR /&gt;    456  }&lt;BR /&gt;    457&lt;BR /&gt;    458  if($sth-&amp;gt;execute){&lt;BR /&gt;    459   my $ntuples = $sth-&amp;gt;rows;&lt;BR /&gt;    460   if ($ntuples &amp;gt; 0) {&lt;BR /&gt;    461    for ( my $i=0; $i &amp;lt; $ntuples; $i++) {&lt;BR /&gt;    462     @row = $sth-&amp;gt;fetchrow;                # Get a row&lt;BR /&gt;    463     $row[0] = &amp;amp;clip($row[0]);&lt;BR /&gt;    464     if (row[0]=~/Molly/ or $row[0]=~/Kim/) {&lt;BR /&gt;    465     $distList .=  "$row[0]; ";&lt;BR /&gt;    466    }&lt;BR /&gt;    467    }&lt;BR /&gt;    468    }&lt;BR /&gt;&lt;BR /&gt;When I execute it as such..&lt;BR /&gt;&lt;BR /&gt;perl secdaily.test, I get the following error..&lt;BR /&gt;&lt;BR /&gt;syntax error at secdaily.test line 464, near "row["&lt;BR /&gt;syntax error at secdaily.test line 469, near "}else"&lt;BR /&gt;Execution of secdaily.test aborted due to compilation errors.</description>
      <pubDate>Fri, 28 Oct 2005 14:24:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659593#M20317</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2005-10-28T14:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659594#M20318</link>
      <description>Nevermind, it was a syntax error and I fixed it. Now when I run it tough, I get the following on my screen..&lt;BR /&gt;&lt;BR /&gt;DIST_LIST:**&lt;BR /&gt;&lt;BR /&gt;Before I made the chaange to add  that statement, I was getting the following..&lt;BR /&gt;&lt;BR /&gt;DIST_LIST:*msilva@pacificex.com; parmstrong@pacificex.com; bburke@pacificex.com; msilva@pacificex.com; parmstrong@pacificex.com; bburke@pacificex.com; *&lt;BR /&gt;&lt;BR /&gt;Like I mentioned that what I want to do is be able to remove peter and bruce from the maillist. Also I woul dlike to add Tom to this list. &lt;BR /&gt;&lt;BR /&gt;Thanks for the help.</description>
      <pubDate>Fri, 28 Oct 2005 14:32:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659594#M20318</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2005-10-28T14:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Script help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659595#M20319</link>
      <description>Sanjit:&lt;BR /&gt;&lt;BR /&gt;It appears there is a typo on line 464.  It reads "if (row[0]......" and should be "if ($row[0]..."&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;JL</description>
      <pubDate>Sat, 29 Oct 2005 09:51:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-script-help/m-p/3659595#M20319</guid>
      <dc:creator>Jess Long</dc:creator>
      <dc:date>2005-10-29T09:51:06Z</dc:date>
    </item>
  </channel>
</rss>

