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

When I use:
$mech->get("http://www.soundclick.com/members/default.cfm?member=$frie +ndID[$i]&content=contact");
The print output displays successful; However, my message outbox has no new items. But, when I change it to:
$mech->get("http://www.soundclick.com/members/default.cfm?member=80deg +reez&content=contact");
I get the same print output display but I also get a new item in my outbox (msg was actually sent).
Am I passing the variable incorrectly?

Replies are listed 'Best First'.
Re: Issues passing array value?
by almut (Canon) on Apr 27, 2007 at 14:38 UTC

    What do you get when you print the URL, i.e.

    print "http://www.soundclick.com/members/default.cfm?member=$friendID[ +$i]&content=contact";

    (immediately before the $mech->get(...))

    Does $friendID[$i] interpolate to the expected value?

      Output with printed URL:
      User 80degreez@gmail.com logged in successfully! http://www.soundclick.com/members/default.cfm?member=80degreez&content +=contact Message to 80degreez : COMPLETE! http://www.soundclick.com/members/default.cfm?member=80degreez&content +=contact Message to 80degreez : COMPLETE! http://www.soundclick.com/members/default.cfm?member=80degreez&content +=contact Message to 80degreez : COMPLETE! Press any key to continue . . .
      Still no new items in outbox/inbox Makes me think that something is misplaced within/outside the loop?

        Can you post the loop? There may be a disconnect between your logging and the actual get.

        -derby
Re: Issues passing array value?
by jettero (Monsignor) on Apr 27, 2007 at 14:28 UTC

    The only really obvious thing that I'm seeing is the possible interpolation of a function &content (by accident of course). You probably want to escape that & character.

    Update: Nope. I'm mistaken. Sorry I mentioned it. It doesn't look like perl interpolates those. I was confused because quotemeta escapes those — which, according to fletch isn't even relevant anyway.

    -Paul

      quotemeta quotes all non-word characters, not just what Perl might interpolate.