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

[PBML] Re: Checking for lines in a file

Expand Messages
  • ggarri2910@yahoo.com
    Hey Charles- I m running 5.003 on my AIX server.
    Message 1 of 3 , Oct 1, 2001
      Hey Charles-

      I'm running 5.003 on my AIX server.

      --- In perl-beginner@y..., "Charles K. Clarkson" <cclarkson@h...>
      wrote:
      > Greg <ggarri2910@y...> mentioned:
      >
      > : Ooops... I found part of the issue.. (I think!)
      > :
      > : The split variables were left out of your code.
      >
      > No, those variables aren't needed. I'm using version
      > 5.6.0, perhaps your version is older. To check it try
      > added -v on the first line:
      >
      > #!/usr/bin/perl -v
      >
      > Tell me what version comes up.
      >
      > The script I gave tests fine on my system.
      >
      >
      > Charles K. Clarkson
      > Clarkson Energy Homes, Inc.
    • Charles K. Clarkson
      ... From: To: Sent: Monday, October 01, 2001 10:46 AM Subject: [PBML] Re: Checking for lines in a file
      Message 2 of 3 , Oct 1, 2001
        ----- Original Message -----
        From: <ggarri2910@...>
        To: <perl-beginner@yahoogroups.com>
        Sent: Monday, October 01, 2001 10:46 AM
        Subject: [PBML] Re: Checking for lines in a file


        : Hey Charles-
        :
        : I'm running 5.003 on my AIX server.
        :

        Then you'll have to go back to the old open statement:

        #!/usr/bin/perl -w
        use strict;
        use diagnostics;

        my $file_name = 'select.txt';
        open FH, $file_name or die "Can't open $file_name: $!.";

        while (<FH>) {
        print "while loop \n";
        next unless (/^\s*\d{4}-/);
        print "First Blau!\n";
        print " $_ " for split;
        print "\n";
        }

        close FH;

        __END__


        Let me know if it works now.


        HTH,
        Charles K. Clarkson
        Clarkson Energy Homes, Inc.
      Your message has been successfully submitted and would be delivered to recipients shortly.