Hmm, yeah, but I didn't have a loop in my smaller test program.
Did you add a loop to test all three lines?
Also, did you notice in your output that the third line didn't print out the clock value correctly?
User Profile
Collapse
-
KevinADC, why did your output have three copies of the expected output?Leave a comment:
-
Funny stuff huh?
I've tried running this script on two different machines, one Unix box running Solarix9 and perl version 5.6.1, and a Linux box running (unknown) version of Red Hat linux with (unknown) version of perl.
They both responded the same odd way...
Hmm, I AM accessing these machines by running EXCEED on my PC, which is an X windows utility.Leave a comment:
-
Ok, so its obvious that no one would even try running the program to verify the error.
So, how about a smaller test program?
...Code:#! /usr/bin/perl #open input file #open(LISTING, "$ARGV[0]") or die "Can't open $ARGV[0]: $!"; open(LISTING, "$ARGV[0]"); #skip first line of file $line_read = <LISTING>; $line_read = <LISTING>;
Leave a comment:
-
The print statement is:
print "clock: ", $clk, " search value: ", $search_val, "\n";
so I would expect to see something like:
clock: 1 search value: 0
to be printed out. The console output I get is:
% perl extract.pl tst.csv
search value: 1
In Else, search value: 1 clock value: 0
search value: 1
...Leave a comment:
-
No, the file is opening and being processed just fine, and this program is working in that I am extracting the values that I want.
I'd like to understand why that print statement doesn't work correctly. I was adding print statements all over the place last night to try and debug this program, and I found that I had to debug the print statements! Doh!Leave a comment:
-
Problem with print statement
Hello Perl Gurus!
I'm quite a perl neophyte so I'm looking for help understanding why print doesn't print correctly. This may be a totally stupid error....
He is my program. What it is doing is parsing a file of comma seperated values and trying to extract the address field every time the clock field transitions from a zero to a one.
[code=perl]
#! /usr/bin/perl
open(LISTING,...
No activity results to display
Show More
Leave a comment: