<?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: Learning PERL in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358107#M684174</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The 'strict' pragma is doing exactly what it should do.&lt;BR /&gt;&lt;BR /&gt;You haven't identified the package in which '$filemaname' occurs, nor for that matter '$filename'.&lt;BR /&gt;&lt;BR /&gt;You have a typographical error.  Change:&lt;BR /&gt;&lt;BR /&gt;$filemaname = shift(@ARGV);&lt;BR /&gt;&lt;BR /&gt;...to:&lt;BR /&gt;&lt;BR /&gt;my $filename = shift(@ARGV);&lt;BR /&gt;&lt;BR /&gt;...and you syntax errors will vanish.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Fri, 13 Feb 2009 13:02:34 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2009-02-13T13:02:34Z</dc:date>
    <item>
      <title>Learning PERL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358105#M684172</link>
      <description>&lt;!--!*#--&gt;I wrote the following perl script but during compiling the error: "Global symbol $filename requires explicit package name" pops up and complation fails.&lt;BR /&gt;The script is to replace a certain pattern by opening given files of a particular type ( here .html files)                               #!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;if ( @ARGV != 3 )&lt;BR /&gt;{&lt;BR /&gt; print("Arguments not sufficient\n");&lt;BR /&gt; exit(1);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;my $oldname = shift(@ARGV);&lt;BR /&gt;my $newname = shift(@ARGV);&lt;BR /&gt;$filemaname = shift(@ARGV);&lt;BR /&gt;my @readlist;&lt;BR /&gt;&lt;BR /&gt;if ( $filename = ~/\*/)&lt;BR /&gt;{&lt;BR /&gt;  my @filelist= &amp;lt;*.html&amp;gt;;&lt;BR /&gt;  foreach my $file (@filelist)&lt;BR /&gt;  {&lt;BR /&gt;     open(my $in, '&amp;lt;',$file )|| die ("Cannot open $file : $!")  ;&lt;BR /&gt;     while (&amp;lt;$in&amp;gt;)&lt;BR /&gt;    {&lt;BR /&gt;     push(@readlist,$_);&lt;BR /&gt;      }&lt;BR /&gt;     close($in);&lt;BR /&gt;  &lt;BR /&gt;  &lt;BR /&gt;   open(my $out,"&amp;gt;",$file);&lt;BR /&gt;   foreach my $change(@readlist)&lt;BR /&gt;    {&lt;BR /&gt;      my $a =~ s/$oldname/$newname/g;&lt;BR /&gt;         print( $out $a);&lt;BR /&gt;    }&lt;BR /&gt;     close($out);&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;exit(0);</description>
      <pubDate>Fri, 13 Feb 2009 09:50:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358105#M684172</guid>
      <dc:creator>hvl_08</dc:creator>
      <dc:date>2009-02-13T09:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Learning PERL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358106#M684173</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;just a my before your line :&lt;BR /&gt;$filemaname = shift(@ARGV);&lt;BR /&gt;&lt;BR /&gt;like this : &lt;BR /&gt;&lt;BR /&gt;my $filemaname = shift(@ARGV);&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;Kenavo.&lt;BR /&gt;Pat.</description>
      <pubDate>Fri, 13 Feb 2009 10:18:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358106#M684173</guid>
      <dc:creator>Patrice Le Guyader</dc:creator>
      <dc:date>2009-02-13T10:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Learning PERL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358107#M684174</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;The 'strict' pragma is doing exactly what it should do.&lt;BR /&gt;&lt;BR /&gt;You haven't identified the package in which '$filemaname' occurs, nor for that matter '$filename'.&lt;BR /&gt;&lt;BR /&gt;You have a typographical error.  Change:&lt;BR /&gt;&lt;BR /&gt;$filemaname = shift(@ARGV);&lt;BR /&gt;&lt;BR /&gt;...to:&lt;BR /&gt;&lt;BR /&gt;my $filename = shift(@ARGV);&lt;BR /&gt;&lt;BR /&gt;...and you syntax errors will vanish.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 13 Feb 2009 13:02:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358107#M684174</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-02-13T13:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Learning PERL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358108#M684175</link>
      <description>The basic problem is covered, but since you indicate you are learning perl, consider&lt;BR /&gt;&lt;BR /&gt;1) Drop the: if ( @ARGV != 3 )... bit&lt;BR /&gt;&lt;BR /&gt;Instead use:&lt;BR /&gt;&lt;BR /&gt;:&lt;BR /&gt;my $filename = shift or die "Missing filename argument";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and uh...  in the output loop you probably mean:&lt;BR /&gt;&lt;BR /&gt;foreach my $change(@readlist)&lt;BR /&gt;    {&lt;BR /&gt;           $change =~    s/$oldname/$newname/g;&lt;BR /&gt;       print( $out $change);&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;Personally I would not bother with the @readlist, unless there is more to do.&lt;BR /&gt;I would just make in and out loop happen at the same time:&lt;BR /&gt;&lt;BR /&gt;open in&lt;BR /&gt;open out&lt;BR /&gt;foreach in&lt;BR /&gt;{&lt;BR /&gt;  substitute&lt;BR /&gt;  print out&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Feb 2009 04:24:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358108#M684175</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-02-16T04:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Learning PERL</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358109#M684176</link>
      <description>also add diagnostics to  your list of modules to use, it will give you more output on errors that already go a long way to get you on the right track regarding the mistake you made.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://perldoc.perl.org/diagnostics.html" target="_blank"&gt;http://perldoc.perl.org/diagnostics.html&lt;/A&gt;</description>
      <pubDate>Mon, 16 Feb 2009 09:31:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/learning-perl/m-p/4358109#M684176</guid>
      <dc:creator>dirk dierickx</dc:creator>
      <dc:date>2009-02-16T09:31:57Z</dc:date>
    </item>
  </channel>
</rss>

