VERY basic Perl question

Discussion in 'Software' started by geoffh, Aug 23, 2009.

  1. geoffh

    geoffh

    Joined:
    Aug 23, 2009
    Messages:
    1
    Hi,

    Just trying to get underway with Perl - knocked a couple of straightforward examples up, AOK.

    However, tried to read in a file and get a failure trying to OPEN the file (seems almost as if the environment is wrong, i.e. cannot opick up an external reference to OPEN)

    I am not after a response to WHY this is failing (although that would help) I am more interested in being pointed to a helpful online reference guide that answers this type of (basic) query.

    I seem to have installed okay - and can confirm that "XP's Environment Variables" does indeed contain references to the Perl .bin folders)

    The Code I am running is:


    #
    # Filetest - Play about Reading F
    #

    use warnings;
    #use strict;

    $INPUTWK = " ";

    $NOOFRECS = 0;

    #$IPFILE = "C:\\ZZZ\\OTHER\\QBASIC\\DATESFLE.SRT";
    $GHIPFILE = "C:\\DATESFLE.SRT";

    print $GHIPFILE, "\n\n";

    OPEN (GHFILEIN, $GHIPFILE);

    MAINLOOP:

    $INPUTWK = <GHFILEIN>;

    LET $NOOFRECS = $NOOFRECS + 1;

    PRINT $NOOFRECS;

    PRINT $INPUTWK;

    GOTO MAINLOOP;

    CLOSE GHFILEIN;


    .... and the error messages are....

    Name "main::GHFILEIN used only once: possible typo at line 22

    Undefined subroutine &main::OPEN called at line 18

    ....I do intend to get a decent starter guide & reference manual but would like to nderstand what basic error I am making.

    Many thanks for any assistance.

    Geoff H.
    ~~~~~
     
    geoffh, Aug 23, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. geepeetee

    very basic question

    geepeetee, Oct 10, 2004, in forum: Wireless Networking
    Replies:
    1
    Views:
    474
  2. Thomas Reed

    Quick Book file access very very very slow

    Thomas Reed, Apr 9, 2004, in forum: Computer Support
    Replies:
    7
    Views:
    803
    Palindrome
    Apr 9, 2004
  3. MB_

    Very basic wireless question

    MB_, Dec 23, 2004, in forum: Computer Support
    Replies:
    8
    Views:
    502
    LB@notmine.com
    Dec 25, 2004
  4. w2k3e_install

    Very basic question .. how to install?

    w2k3e_install, Dec 13, 2007, in forum: Windows 64bit
    Replies:
    9
    Views:
    395
  5. business one way

    Is it a Perl program or a Perl script?

    business one way, Jan 5, 2008, in forum: Digital Photography
    Replies:
    0
    Views:
    798
    business one way
    Jan 5, 2008
Loading...

Share This Page