scarmalt has asked for the wisdom of the Perl Monks concerning the following question:
I've just installed Strawberry Perl (64-bit) on my Win-7 machine. I'm pretty facile with Perl on Linux, but Windows is different.
First program:
use IO::File; my $infile = IO::File->new("c:\\Users\\account\\My Documents\\test.txt + |"); my $nolines while ($instring = $infile->getline() ) { $nolines++; } print '$nolines = ' . $nolines . "\n"; 1;
When I run this in cmd >perl test.pl, it opens my file (test.txt) in Notepad instead of counting the lines.
What have I done wrong?
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strawberry perl on Win 7 (64-bit)
by ikegami (Patriarch) on Nov 03, 2015 at 15:17 UTC | |
|
Re: Strawberry perl on Win 7 (64-bit)
by Discipulus (Canon) on Nov 04, 2015 at 08:07 UTC |