Tech77 has asked for the wisdom of the Perl Monks concerning the following question:
My thinking is that I could use @ARGV to do something like this from the command prompt:use strict; @ARGV == 1 or die "Specify a file path\n"; open(FILE, $ARGV) or die "Cannot open file: $!\n"; while (<>) { /(\S+)\s+\S+\s+(\S+)\s+(.*)/; #testing regex and tags print "$1, $2, $3\n"; #testing printing } close FILE; print "Done!\n";
myperlscript.pl open, "C:/path/to/file/on_windows_pc/file.txt"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using @ARGV
by thundergnat (Deacon) on Dec 03, 2005 at 18:12 UTC | |
by Joost (Canon) on Dec 03, 2005 at 18:29 UTC | |
by merlyn (Sage) on Dec 03, 2005 at 18:50 UTC | |
by revdiablo (Prior) on Dec 03, 2005 at 21:50 UTC | |
by merlyn (Sage) on Dec 04, 2005 at 01:36 UTC | |
by Joost (Canon) on Dec 04, 2005 at 03:56 UTC | |
|
Re: Using @ARGV
by davidrw (Prior) on Dec 03, 2005 at 18:41 UTC | |
|
Re: Using @ARGV
by Tech77 (Novice) on Dec 04, 2005 at 23:20 UTC |