"wc" is a UNIX/Linux command that gets info on a file (the "-l" says you want a line count), so probably isn't going to work on a Win platform unless you have some sort of UNIX command emulator installed.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
open(FILE, "< $filename#$revChglistTable{$filename}") or die "can't open $filename: $!";
for ($numlines=0; <FILE>; $numlines++) { }
# you shouldn't need a chomp() in this case
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Great, thanks alot, Im glad I invetigated it further because it turns out the tool was producing incorrect data because this wasnt working on windows.
Basically, I want to execture the external command:
Code:
'p4 print $filename#$revChglistTable{$filename}';
in perl and read back the number of lines it produces. For example if I typed in the command
Code:
p4 print //depot/foo#2
the file contents will be output on the command line. I'm not sure how to execture external commands like this in perl, or indeed how to read the contents back into the script (so I can count the number of lines etc)
Bookmarks