Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Call 'lynx' with Perl

0 views
Skip to first unread message

Jun Zhuang

unread,
Jun 26, 1997, 3:00:00 AM6/26/97
to

Hi:
I tried call a 'lynx' command with my Perl script in Unix:
$gb_file = qx{lynx http://www.ncbi.nlm.nih.gov/};
print $gb_file;
I was happy that I saw what I want.
BUT, when I add some query strings, it failed to work.
$gb_file = qx{lynx http://www.ncbi.nlm.nih.gov/htbin-post/Entrez/query?db=n&uid=619931&form=6&Dopt=g};
This works fine if under a netscape browser.
But,I got an error mesage under Unix: www.ncbi.nlm.nih.gov/htbin-post/Entrez:
No such file or directory.
Is that a problem that "lynx" won't work for query string (CGI)?
Any sugestions to solve the problem(by not use web browser)?
Thanks.


Gisle Aas

unread,
Jun 26, 1997, 3:00:00 AM6/26/97
to

jzh...@ringer.cs.utsa.edu (Jun Zhuang) writes:

> Any sugestions to solve the problem(by not use web browser)?

You could try:

use LWP::Simple;
$gb_file = get "http://www.ncbi.nlm.nih.gov/htbin-post/Entrez/query?db=n&uid=619931&form=6&Dopt=g";

--
Gisle Aas <a...@sn.no>

Tom Phoenix

unread,
Jun 26, 1997, 3:00:00 AM6/26/97
to Jun Zhuang

On 26 Jun 1997, Jun Zhuang wrote:

> Is that a problem that "lynx" won't work for query string (CGI)?

Isn't that a Lynx question, instead of a Perl question? As near as I can
see, your Perl code is just fine. If you have a problem with something
other than the Perl code, you may be able to find the answer in a
more-suitable forum. Hope this helps!

--
Tom Phoenix http://www.teleport.com/~rootbeer/
root...@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/


Zenin

unread,
Jun 26, 1997, 3:00:00 AM6/26/97
to

Jun Zhuang <jzh...@ringer.cs.utsa.edu> wrote:
>snip<

> BUT, when I add some query strings, it failed to work.
> $gb_file = qx{lynx http://www.ncbi.nlm.nih.gov/htbin-post/Entrez/query?db=n&uid=619931&form=6&Dopt=g};

You've got shell excape chars in there. Quote the URL:

$gb_file = `lynx 'http://www.ncbi.nlm.nih.gov/htbin-post/Entrez/query?db=n&uid=619931&form=6&Dopt=g'`;

You'll probably also want the -dump or -source options for lynx.
See man lynx for details.

--
-Zenin
ze...@best.com

0 new messages