User Profile

Collapse

Profile Sidebar

Collapse
jt2
jt2
Last Activity: Feb 21 '08, 08:49 PM
Joined: Feb 13 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • jt2
    replied to Problem with print statement
    in Perl
    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?
    See more | Go to post

    Leave a comment:


  • jt2
    replied to Problem with print statement
    in Perl
    KevinADC, why did your output have three copies of the expected output?
    See more | Go to post

    Leave a comment:


  • jt2
    replied to Problem with print statement
    in Perl
    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.
    See more | Go to post

    Leave a comment:


  • jt2
    replied to Problem with print statement
    in Perl
    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>;
    ...
    See more | Go to post

    Leave a comment:


  • jt2
    replied to Problem with print statement
    in Perl
    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
    ...
    See more | Go to post

    Leave a comment:


  • jt2
    replied to Problem with print statement
    in Perl
    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!
    See more | Go to post

    Leave a comment:


  • jt2
    started a topic Problem with print statement
    in Perl

    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,...
    See more | Go to post
    Last edited by numberwhun; Feb 13 '08, 02:55 PM. Reason: add code tags
No activity results to display
Show More
Working...