in reply to modifying records in a delimited text file

open the file ... while(<USERFILE>) { my($A,$B,$C,$D,$E,$F,$G,$H,$I,$J,$K) = split(/\|/); print qq(<TR>); print qq(<TD>$A</TD> <TD>$B</TD> <TD>$C</TD> <TD>$D</TD> <TD>$E</TD> <TD>$F</TD> <TD>$G</TD> <TD>$H</TD> <TD>$I</TD> <TD>$J</TD>); print qq(<TD><INPUT TYPE="radio" NAME="edit" VALUE="$K"> </TD></TR> ); }
In TurnStep's DeleteRecord sub I set $num2delete to the "edit param", which in this case is "edit".

Replies are listed 'Best First'.
RE: Re: modifying records in a delimited text file
by Fastolfe (Vicar) on Oct 19, 2000 at 00:20 UTC
    Yes but what is the script actually printing. The code looks fine, but I'm wondering if $K actually contains a value at this point. I would be interested in seeing the actual HTML generated by this script.
RE: Re: modifying records in a delimited text file
by Fastolfe (Vicar) on Oct 19, 2000 at 01:01 UTC
    jmac says The value of $K is indeed set to the value in the record
    OK, given the following apparently proven assumptions:

    1. That the radio button being printed is named "edit" and that its value when selected is indeed, say, 5, and that the radio button is indeed selected, the script fails.

    2. That a textual input field of name "edit", given a value of "5", permits the script to succeed

    This just makes no sense to me. How are you parsing the "edit" form element? Is it empty when your script is called with the radio button method but set to "5" (or whatever) when called with the text field method? Are you using the stock CGI.pm module or are you rolling your own parsing? And, finally, it would help if we could see the HTML as printed out by your script. I keep asking for this but I never see it. Can't you just "View Source" and cut/paste? You can leave out the non-form-related content if it's going to be a bit much.. I just want to see the <form> tags, the <input> tags and any other form tag that might use "edit" as its name. Something is not right. You keep insisting that things are being printed correctly, but this is inconsistent with the results you're getting. We need more information.