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
In reply to Strawberry perl on Win 7 (64-bit) by scarmalt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |