Sponsored Content
Full Discussion: Perl Exception - $!,$?,$@
Top Forums Shell Programming and Scripting Perl Exception - $!,$?,$@ Post 302228997 by otheus on Tuesday 26th of August 2008 02:56:36 AM
Old 08-26-2008
man perlvar will help you.

$@ is the error message from the last eval(). Period. It's null if there was no eval.

$! is what went wrong after the last call to the OS -- it's essentially from errno. It gets reset as soon as you do something that succeeds, like the statement "1;".

$? Is only after an external command, pipeline, system(), or wait(), it contains the error the last command returned, shifted left 8 bits.

About the error message, it could be Net::FTP is printing out to stderr. You can instantiate the object with a Debug parameter...

new Net::FTP( $hostname, ( 'Debug'=> 10 ));
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

exception handling

Does exception handling exist in any UNIX enviornment? I develop on Windows MSVC++ land and need to port to UNIX. (1 Reply)
Discussion started by: RichardS
1 Replies

2. UNIX for Advanced & Expert Users

RPC Exception - Help

Hi, I am trying to use swremove to remove some old software packages before an upgrade. I keep getting the same error below. I have restarted swagent, i have killed the swagent process and started it, and I have restarted the entire system. I have now run out of ideas. Anyone know what the problem... (0 Replies)
Discussion started by: ejbrever
0 Replies

3. HP-UX

Help with RPC Exception

Hi, I am trying to use swremove to remove some old software packages before an upgrade. I keep getting the same error below. I have restarted swagent, i have killed the swagent process and started it, and I have restarted the entire system. I have now run out of ideas. Anyone know what the problem... (2 Replies)
Discussion started by: ejbrever
2 Replies

4. UNIX for Dummies Questions & Answers

How to catch the exception

Dear friends, I am transferring some files to a windows system from Unix m/c thru FTP Script given below. echo "open $host quote USER $userid quote PASS $pwd $verbose $type cd $dir bin put $file close quit"|$ftp... (0 Replies)
Discussion started by: Vijayakumarpc
0 Replies

5. Linux

MMU exception

I hope to post in the right forum, otherwise I apologize for this. if a MMU exception is caused by a process which tries to access to other memory segment (out of its own address space) what the kernel does in this case ? maybe kernel kills the "bad" process ? (2 Replies)
Discussion started by: Puntino
2 Replies

6. Shell Programming and Scripting

Exception handling

Sometimes when I try to use curl to upload to an ftp server, I get the message: $curl -T file.wmv ftp.eu.filesonic.com --user user:password curl: (8) Got a 421 ftp-server response when 220 was expected How do I get the script to try again if I get the message curl: (8)? (2 Replies)
Discussion started by: locoroco
2 Replies

7. Programming

Exception Handling C++

Hello All, I have a question ....which I am totally confused about! If I have a fxn foo in a program which returns a logical value. But it has a posssiblity to throw some exception. Now my exception handler returns a value as a string stating why the exception occured. But my... (1 Reply)
Discussion started by: mind@work
1 Replies

8. Solaris

solaris 7 exception

Hi all, An application works well under 2.6 but under 7 it gives TEXT_IO exceptions. (Is_Open, Check_Is_Open, Get_Line procedures). Any idea? Regards (3 Replies)
Discussion started by: endoavour
3 Replies

9. Shell Programming and Scripting

Re: exception using AWK

I have following file: NAME=ora.DG1.svc TYPE=ora.service.type CARDINALITY_ID=1 TARGET=ONLINE STATE=ONLINE NAME=ora.orlene.DG2.svc TYPE=ora.service.type CARDINALITY_ID=1 TARGET=ONLINE STATE=OFFLINE NAME=ora.MN.acfs TYPE=ora.registry.acfs.type TARGET=ONLINE (4 Replies)
Discussion started by: rcc50886
4 Replies

10. Shell Programming and Scripting

Monitor logs for exception and if exception come then sent an email

Hi Folks, please advise , I have logs generated on unix machine at location /ops/opt/aaa/bvg.log , now sometimes there come exception in these logs also, so I want to write such a script such that it should continuously monitor these logs and whenever any exception comes that is it try to find... (3 Replies)
Discussion started by: tuntun27272727
3 Replies
Net::XMPP::Debug(3pm)					User Contributed Perl Documentation				     Net::XMPP::Debug(3pm)

NAME
Net::XMPP::Debug - XMPP Debug Module SYNOPSIS
Net::XMPP::Debug is a module that provides a developer easy access to logging debug information. DESCRIPTION
Debug is a helper module for the Net::XMPP modules. It provides the Net::XMPP modules with an object to control where, how, and what is logged. Basic Functions $Debug = new Net::XMPP::Debug(); $Debug->Init(level=>2, file=>"stdout", header=>"MyScript"); $Debug->Log0("Connection established"); METHODS
Basic Functions new(hash) - creates the Debug object. The hash argument is passed to the Init function. See that function description below for the valid settings. Init(level=>integer, - initializes the debug object. The level file=>string, determines the maximum level of debug header=>string, messages to log: setdefault=>0|1, 0 - Base level Output (default) usedefault=>0|1, 1 - High level API calls time=>0|1) 2 - Low level API calls ... N - Whatever you want.... The file determines where the debug log goes. You can either specify a path to a file, or "stdout" (the default). "stdout" tells Debug to send all of the debug info sent to this object to go to stdout. header is a string that will preappended to the beginning of all log entries. This makes it easier to see what generated the log entry (default is "Debug"). setdefault saves the current filehandle and makes it available for other Debug objects to use. To use the default set usedefault to 1. The time parameter specifies whether or not to add a timestamp to the beginning of each logged line. LogN(array) - Logs the elements of the array at the corresponding debug level N. If you pass in a reference to an array or hash then they are printed in a readable way. (ie... Log0, Log2, Log100, etc...) EXAMPLE
$Debug = new Net::XMPP:Debug(level=>2, header=>"Example"); $Debug->Log0("test"); $Debug->Log2("level 2 test"); $hash{a} = "atest"; $hash{b} = "btest"; $Debug->Log1("hashtest",\%hash); You would get the following log: Example: test Example: level 2 test Example: hashtest { a=>"atest" b=>"btest" } If you had set the level to 1 instead of 2 you would get: Example: test Example: hashtest { a=>"atest" b=>"btest" } AUTHOR
Ryan Eatmon COPYRIGHT
This module is free software, you can redistribute it and/or modify it under the LGPL. perl v5.14.2 2012-11-06 Net::XMPP::Debug(3pm)
All times are GMT -4. The time now is 09:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy