hchana has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to open and print the contents of a text file I've named 'Text1.txt' which is in my perl folder. I'm running the code below using Komodo on my Mac Book Pro but it is not working, I keep getting the message "/bin/sh: open.pl: command not found". I'm new to Perl as they come, so could my error be explained in a simple manner. Thanks in advance.?
#!/user/bin/perl open(FILE, "Text1.txt"); while(<FILE>){ print "I saw $_ in Text1.txt\n"; } close FILE;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: open and read text file
by stevieb (Canon) on Jul 21, 2017 at 20:08 UTC | |
by locked_user sundialsvc4 (Abbot) on Jul 22, 2017 at 00:09 UTC | |
by stevieb (Canon) on Jul 22, 2017 at 01:08 UTC | |
by kcott (Archbishop) on Jul 22, 2017 at 03:54 UTC | |
by karlgoethebier (Abbot) on Jul 22, 2017 at 13:10 UTC | |
| |
| |
Re: open and read text file
by kcott (Archbishop) on Jul 22, 2017 at 03:13 UTC | |
Re: open and read text file
by talexb (Chancellor) on Jul 21, 2017 at 20:18 UTC | |
Re: open and read text file
by thanos1983 (Parson) on Jul 21, 2017 at 20:10 UTC | |
by hchana (Acolyte) on Nov 09, 2017 at 15:27 UTC | |
Re: open and read text file
by soonix (Chancellor) on Jul 23, 2017 at 18:35 UTC | |
by afoken (Chancellor) on Jul 25, 2017 at 06:21 UTC | |
by soonix (Chancellor) on Jul 25, 2017 at 12:56 UTC |