in reply to Problems with creating a form

Most likely, Tr in $query->Tr shouldn't be uppercase .. all of CGI's functions that I can think of are all lowercase, and this would be an odditiy if just ->Tr was...
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: Re: Problems with creating a form
by mirod (Canon) on Mar 12, 2001 at 19:52 UTC

    Actually tr is already used, it's the built-in tr///, hence the CGI methid/function is Tr, something that trips everyone (and you!) at least once.

    Update: Aaaarrrghhh! merlyn is right (see below) I always use the function version, and I have been bitten (several times, I'm a slow learner ;--( by it, so I got a little too paranoid. All my apologies to masem.

    RE-Update: after further testing, my first version was right, it _is_ Tr, whether using the function or the method. merlyn is wrong there.

    Re-Re-Update: as the rep of this node go down and the one of merlyn's go up I guess I have to prove my point, so try this and then change Tr to tr ;--)

    perl -e 'use CGI; my $q= new CGI; print $q->Tr, "\n";'

    Other upper-cased function/methods are: Select, Link, Delete, Accept and Sub.

      Not quite. If you use the method version, it's tr. If you use the function version (my preferred), it's Tr. The problem is that the code at the head of this thread is using the method version, but the function capitalization.

      -- Randal L. Schwartz, Perl hacker


      update: I'm wrong. I mis-remembered.
Re: Re: Problems with creating a form
by Anonymous Monk on Mar 12, 2001 at 20:30 UTC
    Actually Tr should be uppercase. I just had a typo in one line: I had written $query-Tr instead of $query->Tr. The error message in error.log wonders me though...