in reply to "Can't open perl script..." :-(

When I attempt to execute my "program"

The devil is in the details. You need to know:

The easiest thing to do is: 'cd' to the directory that contains your program, then issue the same command again. Better yet, set the default prompt to the directory where you are going to store all your perl programs, then you won't have to do any 'cd'ing.

Always use these two lines at the top of your programs:

use strict; use warnings; use 5.010; #if you are using version 5.10 or higher.

Always declare your variables with 'my', e.g.:

my $count = 1; while (my $line = <STDIN>) { ...

Replies are listed 'Best First'.
Re^2: "Can't open perl script..." :-(
by Erosia (Novice) on Feb 15, 2010 at 18:28 UTC
    @ Anonymous Monk - The commando prompt tells me so. Again, I am new to Perl thus not familiar with the LSP. :-)
    @ JohnGG - Your stab was correct, but the problem seemed to be sorted by installing Padre (thanks Corion for that hint).
    @ Stud - I appreciate suggestions, but would you mind explaining what the addition of these specific lines do?

    Unfortunately, this was not the end of my problems. When I execute it now typing: "perl readwrite.pl 0720-da.txt" the cursor simple moves down a line blinking in all voidness. Don't even know how to return to the directory, so I have to click on command promt cross to shut it down every time. I get no error messages whatsoever, only the cursor moves to a new and empty line doing nothing. Why? :-(

    Really appreciate any help you can provide. And please ask if anything appears unclear. Thanks again.

      First of all, welcome to the Perl community!

      As to your last question,

      <STDIN>

      will read whatever you type at the command line until you hit

      Ctrl-Z <ENTER>(on Windows) or

      Ctrl-D(on *nix)

      Mentioning that you "need to use Perl in school" reminds me of my having to learn it so that I could maintain some Perl code for my job. I started reading Learning Perl and promptly fell in love with the language.

      EDIT: Corrected for use on Windows. Thanks AnomalousMonk!
        ...  <STDIN> will read whatever you type at the command line until you hit Ctrl-D.

        Ctrl-D for *nix. In Windose, it's Ctrl-Z.