Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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
http:/yourdomain.tld/path/to/your/script?google.com
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.
--Chris
#!/usr/bin/perl -Tw
use perl::always;
my $perl_version = "5.12.4";
print $perl_version;


Comment on Re^4: How to convert an @ARGV to form based input?
Select or Download Code
Re^5: How to convert an @ARGV to form based input?
by Anonymous Monk on Aug 21, 2012 at 07:17 UTC
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?

    CountZero

    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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2014-08-21 15:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (136 votes), past polls