09-04-2001
eval didn't work
hellz.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I just built my first Solaris 8 machine. I start x using this command (assume I'm in the correct directory):
./startx
After I run this command, I receive this extremely frustrating message:
/startx: XAUTHORITY=//.Xauthority: is not an identifier
Can someone tell me what I am doing... (4 Replies)
Discussion started by: rpeteg
4 Replies
2. UNIX for Dummies Questions & Answers
Hello everyone.
I just installed FreeBSD recently and when I type the command startx, I get the following errors:
(EE) failed to load module "fbdev"
(EE) <default pointer> cannot find which device to use
(EE) xf860Open erial: No evice specified
(EE) <default pointer> cannot open input... (3 Replies)
Discussion started by: cosmotron
3 Replies
3. Debian
hello
i have installed xfree86 with debian 2.4, but i have the message when i launch startx:
XIO: fatal IO error 104 (Connection reset by peer) on X server ":0.0"
after 0 requests (0 known processed) with 0 events remaining.
xauth: (argv):1: bad display name "uxdev1000.lobino.fr:0"... (0 Replies)
Discussion started by: pascalbout
0 Replies
4. UNIX for Advanced & Expert Users
When I try to run startx or xterm the window opens fine, however when using keyboard incorrect chars are displayed, e.g pressing return displays 2 (0 Replies)
Discussion started by: gefa
0 Replies
5. UNIX Desktop Questions & Answers
Hello,
Ive installed freeBSD 6.0 - and the prompt part of the system works well. Ive then tried to install KDE for graphic interface to the unix system.
The problem is:
Whenever I run "$ startx" it starts some graphical interface, but its totally swirled, you can sense that in the background... (1 Reply)
Discussion started by: congo
1 Replies
6. Shell Programming and Scripting
I have edited /etc/inittab to auto login as root in level 3
and edited .bash_profile to auto start x window
I would like to auto start a firefox browser after go into x window.
I tried to add "firefox" in /etc/rc.d/rc.local but no effects.
Anyone have suggestion?
Thanks in advance. (1 Reply)
Discussion started by: uativan
1 Replies
7. Shell Programming and Scripting
I want to autorun a shell script which
inculde start two java programs and some shell scripts
I using fedora 9 and I had put in Personal > Sessions
/bin/sh /myscript.sh
but it got a problem when I start firefox from one of the java program, it said "Firefox is already running but not... (3 Replies)
Discussion started by: uativan
3 Replies
8. Debian
Hello :-)!
I installed Debian (I downloaded it on may 2009 so it is new version) from CD. I run it and see only text console. I try to type "kde" or "startx" but it doens't recognize those commands. That's difficult for me to believe that Linux from CD doesn't contain graphical interface so I... (2 Replies)
Discussion started by: johnyjj2
2 Replies
9. Ubuntu
Hi,
I am running Ubuntu 8.04.4 on a Sun Blade 1000 SPARC. I installed both kubuntu and xubuntu in attempt to load a gui onto the machine. Both fail when trying to start them.
When I use startx I get the following error:
(EE) Failed to laod module... (0 Replies)
Discussion started by: swilso
0 Replies
10. UNIX for Dummies Questions & Answers
Have -
HP G4p DL360 SCSI version (*see below of pdf of server basics if needed)
Scientific Linux live-cd.iso
Issue -
When it boots off the LiveCD, all starts swell, but if I install the OS normal it goes to a black monitor....
If I install text only, it works and when done I am at the... (4 Replies)
Discussion started by: sas
4 Replies
LEARN ABOUT CENTOS
perl::critic::policy::errorhandling::requirecheckingreturnvalueo
Perl::Critic::Policy::ErrorHandling::RequireCheckingRetuUserlContributed PPerl::Critic::Policy::ErrorHandling::RequireCheckingReturnValueOfEval(3)
NAME
Perl::Critic::Policy::ErrorHandling::RequireCheckingReturnValueOfEval - You can't depend upon the value of "$@"/"$EVAL_ERROR" to tell
whether an "eval" failed.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
A common idiom in perl for dealing with possible errors is to use "eval" followed by a check of $@/$EVAL_ERROR:
eval {
...
};
if ($EVAL_ERROR) {
...
}
There's a problem with this: the value of $EVAL_ERROR can change between the end of the "eval" and the "if" statement. The issue is object
destructors:
package Foo;
...
sub DESTROY {
...
eval { ... };
...
}
package main;
eval {
my $foo = Foo->new();
...
};
if ($EVAL_ERROR) {
...
}
Assuming there are no other references to $foo created, when the "eval" block in "main" is exited, "Foo::DESTROY()" will be invoked,
regardless of whether the "eval" finished normally or not. If the "eval" in "main" fails, but the "eval" in "Foo::DESTROY()" succeeds,
then $EVAL_ERROR will be empty by the time that the "if" is executed. Additional issues arise if you depend upon the exact contents of
$EVAL_ERROR and both "eval"s fail, because the messages from both will be concatenated.
Even if there isn't an "eval" directly in the "DESTROY()" method code, it may invoke code that does use "eval" or otherwise affects
$EVAL_ERROR.
The solution is to ensure that, upon normal exit, an "eval" returns a true value and to test that value:
# Constructors are no problem.
my $object = eval { Class->new() };
# To cover the possiblity that an operation may correctly return a
# false value, end the block with "1":
if ( eval { something(); 1 } ) {
...
}
eval {
...
1;
}
or do {
# Error handling here
};
Unfortunately, you can't use the "defined" function to test the result; "eval" returns an empty string on failure.
Various modules have been written to take some of the pain out of properly localizing and checking $@/$EVAL_ERROR. For example:
use Try::Tiny;
try {
...
} catch {
# Error handling here;
# The exception is in $_/$ARG, not $@/$EVAL_ERROR.
}; # Note semicolon.
"But we don't use DESTROY() anywhere in our code!" you say. That may be the case, but do any of the third-party modules you use have them?
What about any you may use in the future or updated versions of the ones you already use?
CONFIGURATION
This Policy is not configurable except for the standard options.
SEE ALSO
See thread on perl5-porters starting here: <http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-06/msg00537.html>.
For a nice, easy, non-magical way of properly handling exceptions, see Try::Tiny.
AUTHOR
Elliot Shank "<perl@galumph.com>"
COPYRIGHT
Copyright (c) 2008-2011 Elliot Shank.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.16.3 2014-0Perl::Critic::Policy::ErrorHandling::RequireCheckingReturnValueOfEval(3)