nick1984 has asked for the wisdom of the Perl Monks concerning the following question:
Hi guys,
I have literally started learning Perl a few days ago (using the Learning Perl O'reilly 4th edition book) and have hit a stumbling block!
I am currently attempting to get the below code to read the text from a text file and print! However I get the following error message: can't open test1.txt No such file or directory.
I have created all my scripts under: C:\Scripts\ and have also placed the test1.txt file there too!------------------ #! /usr/bin/perl -w use strict; @ARGV = ("test1.txt"); while (<>) { chomp; print "It was $_ that I saw in some stooge-like file!\n"; } ------------------------
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Noob Question
by Corion (Patriarch) on Oct 28, 2012 at 18:05 UTC | |
|
Re: Noob Question
by bms (Monk) on Oct 28, 2012 at 20:10 UTC | |
by nick1984 (Novice) on Oct 28, 2012 at 20:51 UTC | |
|
Re: Noob Question
by davido (Cardinal) on Oct 29, 2012 at 01:16 UTC | |
|
Re: Noob Question
by aitap (Curate) on Oct 28, 2012 at 20:46 UTC | |
|
Re: Noob Question
by Laurent_R (Canon) on Oct 28, 2012 at 22:51 UTC | |
by chromatic (Archbishop) on Oct 28, 2012 at 23:11 UTC |