Solved

Using a URL to return a value

Posted on 2003-11-13
2
203 Views
Last Modified: 2013-12-25
Imagine we have a URL as follows:

www.them.com/cgi-bin/validate.pl?name=alfred

The above URL returns a plain text file, containing the string "true" or "false" based on some internal calculation.

Question: How can I invoke the above URL from within my script to retrieve the return value? (If required, assume my script is at www.me.com/cgi-bin/application.pl)

Ideally, I could write:

$returnValue = www.them.com/cgi-bin/validate.pl?name=alfred

... but of course that's not possible.
0
Comment
Question by:xcab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
kandura earned 100 total points
ID: 9744210
I would do something like this:

use LWP::Simple;
 $content = get("http://www.them.com/cgi-bin/validate.pl?name=alfred");
 die "Couldn't get it!" unless defined $content;

0
 

Author Comment

by:xcab
ID: 9745037
Thanks for your assistance, kandura.

I wouldn't have found that on my own.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Copy items in a folder structure then put them back. 4 31
Permission on folders 6 35
Script to move computer from one domain to another 6 53
Add Log to powershell Script 14 30
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question