Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^4: How to convert an @ARGV to form based input?

by taint (Chaplain)
on Aug 21, 2012 at 07:04 UTC ( #988609=note: print w/replies, xml ) Need Help??

in reply to Re^3: How to convert an @ARGV to form based input?
in thread How to convert an @ARGV to form based input?

Greetings, and thanks for your reply. That is a fully working piece of code:
#!/usr/bin/perl -w use strict; use Net::DNS; my $dns = new Net::DNS::Resolver; for my $domain( @ARGV ) { my $mx = $dns->query( $domain, 'MX' ); print "content-type:text/html; charset=utf-8\n\n"; print "$domain:\n\n"; foreach my $rr ($mx->answer) { print "<br />", $rr->exchange, ' [<b>', $rr->preference, "</b> +]\n"; } }
Go ahead, stuff it into a cgi script, and put it into a cgi enabled folder. Then enter
In that form, it works just fine.
But that is not my intended final implementation. I had hoped to replace the (@ARGV) with a form input field -- hence the title of this post.
#!/usr/bin/perl -Tw
use perl::always;
my $perl_version = "5.12.4";
print $perl_version;

Replies are listed 'Best First'.
Re^5: How to convert an @ARGV to form based input?
by CountZero (Bishop) on Aug 21, 2012 at 10:08 UTC
    It is of course the not working script we are interested in. :)

    So how does your error-producing script look like?


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re^5: How to convert an @ARGV to form based input?
by Anonymous Monk on Aug 21, 2012 at 07:17 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988609]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2016-10-01 07:27 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (575 votes). Check out past polls.