Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: catching output

by vladdrak (Monk)
on Mar 04, 2001 at 14:04 UTC ( #62096=note: print w/replies, xml ) Need Help??


in reply to catching output

I don't know about you guys, but my ifconfig output isn't all that clean.. how about:
#!/usr/bin/perl -w use strict; use LWP::Simple qw(get); my $acct="123"; my $pass="123"; my ($ip,$url); my $ifconfig=`/sbin/ifconfig eth0`; if ($ifconfig=~/inet addr\:((?:\d{1,3}\.){3}\d{1,3})/) { $ip=$1; print "ip: $ip\n" } else { die "Couldn't grab ip from: $ifconfig\n"; } print "Updating.."; if ($got=get("http://www.myip.org/cgi-bin/Update.py?id=$acct&pwd=$pass +&hostname=all&ip=$ip")) { if $got=~/SomeTextFromThePageThatWouldConfirmSuccess/) { print "success.\n"; } else { die "failed: $got\n"; } } else { die "failed: $!\n"; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2022-01-18 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (54 votes). Check out past polls.

    Notices?