Backdraft has asked for the wisdom of the Perl Monks concerning the following question:

Hello all, I have a question or more of a problem with Netscape NN 4.7 I am in the process of writing a script and when I pass $ARGV to it, it works fine in MSIE 5.0 but not in NN 4.7 Here is a Code Snippet: Link : ############# for example if: $salesperson would be: John Doe $MLS would be: 12345 $display .="$salesperson\n"; process input: ############# $salesperson = $ARGV2; $salesperson =~ s/%20/\ /g; $subject = $ARGV3; $subject =~ s/%20/\ /g; $display .="To : $salesperson
\n"; $display .="Subject : $subject
\n"; As display in MSIE 5.0: To : John Doe Subject : Listing 12345 As displayed in NN 4.7: To : John Subject : I can't figure out why it won't display correctly as it does for MSIE. Anybody who can help I appreciate it. Mike Lessar To gain knowledge one must study, To gain wisdom one must observe.

Replies are listed 'Best First'.
RE: Netscape does not process $ARGV
by BigJoe (Curate) on Aug 09, 2000 at 17:53 UTC
    This looks like a very quick MS space problem. IE can handle spaces in the query string but Netscape needs %20 for each space
    $querystring = ~s/ /%20/g;


    --BigJoe

    Learn patience, you must.
    Young PerlMonk, craves Not these things.
(kudra: or you could say IE breaks the standard) RE: Netscape does not process $ARGV
by kudra (Vicar) on Aug 09, 2000 at 18:49 UTC
    I just wanted to add the following from the RFC 2396 list of excluded US-ASCII Characters:
    "The space character is excluded because significant spaces may disappear and insignificant spaces may be introduced when URI are transcribed or typeset or subjected to the treatment of word-processing programs. Whitespace is also used to delimit URI in many contexts."

    So it's a matter of debate whether this is a Netscape problem or an IE problem.

Re: Netscape does not process $ARGV
by ar0n (Priest) on Aug 09, 2000 at 17:58 UTC
    Use <code></code> tags for posting code.

    I normally wouldn't bother, but since i'm bored, here's the code somewhat cleaned up:

    for example if:
    $salesperson would be John Doe, and $MLS would be 12345
    $display .= "<a href="$ENV{SCRIPT_NAME}?mail&nmsg&".$salesperson."&Lis +ting$MLS\">$salesperson</a>\n"; ### process input: $salesperson = $ARGV[2]; $salesperson =~ s/%20/ /g; $salesperson =~ s/\+/ /g $subject = $ARGV[3]; $subject =~ s/%20/ /g; $subject =~ s/\+/ /g $display .= "<b>To: $salesperson<br></b>\n"; $display .= "<b>Subject: $subject<br></b>\n";
    As display in MSIE 5.0:
    To: John Doe Subject: Listing 12345

    As displayed in NN 4.7:
    To: John Subject:

    To gain knowledge one must study,
    Then study this, this and this.

    To gain wisdom one must observe.
    Then do so.

    -- ar0n | Just Another Perl Joe

RE: Netscape does not process $ARGV
by t0mas (Priest) on Aug 09, 2000 at 18:00 UTC
    You'll need to escape all spaces in the $display string before sending it to the browser. NS can't handle spaces in query strings.

    /brother t0mas
Re: Netscape does not process $ARGV
by Backdraft (Initiate) on Aug 09, 2000 at 21:01 UTC
    Thank you my masters, for I will learn in the future.
    
    You humble follower
    Backdraft