Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] print the lines that match a file name in an array of files

Expand Messages
  • Shlomi Fish
    Hi GoPi, ... Match a filename how? ... 1. This won t compile as you haven t declared %Hash_filenames and you re using strict and warnings . Did you actually
    Message 1 of 2 , Oct 26, 2010
    • 0 Attachment
      Hi GoPi,

      On Tuesday 26 October 2010 08:30:47 GoPi wrote:
      > I am dividing my program into three parts.I need your help in each one of
      > them.Pls help Objective my script is to print the lines that match a file
      > name in an array of files.

      Match a filename how?

      >
      > 1.Getting all the files with .plf extension in a directory
      > #!/usr/bin/perl -w
      > use strict;
      > use warnings;
      > %Hash_filenames={};

      1. This won't compile as you haven't declared %Hash_filenames and you're using
      "strict" and "warnings". Did you actually try running the program?

      2. You should initialise %hash_filenames (please don't use uppercase letter
      unnecessarily) using either "()" (or nothing at all as a hash is empty by
      default) - not "{}" which is the anonymous hash-ref constructor.

      > $file name = "Data";

      Again this won't compile - 1) You don't have a "my". 2) whitespaces are not
      recognised by Perl as part of the variable name (unless you do some ugly
      tricks with package-scope variables).

      There are more problems like that below. Please fix all the compilation
      problems and return to us. See http://perl-begin.org/ for more guidance about
      Perl.

      Regards,

      Shlomi Fish

      --
      -----------------------------------------------------------------
      Shlomi Fish http://www.shlomifish.org/
      My Public Domain Photos - http://www.flickr.com/photos/shlomif/

      <rindolf> She's a hot chick. But she smokes.
      <go|dfish> She can smoke as long as she's smokin'.

      Please reply to list if it's a mailing list post - http://shlom.in/reply .
    Your message has been successfully submitted and would be delivered to recipients shortly.