i am working on a script with Net::Telnet and whenever i uncomment my adjustment to the Errmode directive all instances of the object immedately generate errors and go strait into it, but when i use the default the exact same input succeeds.
also, when commented out the logfile is generated, but when it is in (my change to Errmode) the logfile is not written to or generated.
here is the relavent code snippet
telnet_login($username,$password,$host,\$telnet);
......
sub telnet_login
{
use Net::Telnet;
my ($username, $password, $host, $telnet) = @_;
my $error_msg= "Incorrect username or password, please try again";
$$telnet = new Net::Telnet (Timeout=>7,
# Errmode=>\&report_error($error_msg));
####the above line is the one spoken of in my description#############
+#######
$$telnet->dump_log("./Plog.log"); # generate log
$$telnet->open(Host=>$host);
$$telnet->login($username,$password);
}
..........
sub report_error
{
my $thing = shift;
print $thing;
die;
}
jcpunk
by the way thanks for all the help that was, is, and will be
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.