Sponsored Content
Top Forums Shell Programming and Scripting perl problem - another 'die' issue. Post 302132086 by mjays on Wednesday 15th of August 2007 08:36:06 AM
Old 08-15-2007
Quote:
Don't you think the perl one you wrote looks a bit more descriptive?
i agree. despite my complaining i think the perl code looks and somehow feels better.

Quote:
Learning a new thing, you cannot always expect your knowledge of another environment can translate well to it.
i think this is the source of my complaint. i've been writing so many unix shell scripts, it's clouded my acceptance of perl and the fact that it's bound to be different.
 

7 More Discussions You Might Find Interesting

1. News, Links, Events and Announcements

Live Free or Die!

Mods: Delete this if you think that this is not appropriate. I found this rather amusing. If you go to www.unix.net now you will see the OpenGroup selling license plates that read "Live Free or Die/Unix/Unix is a trademark of the OpenGroup" (http://www.unix.net/unix_plates.html) I just... (12 Replies)
Discussion started by: auswipe
12 Replies

2. Solaris

what time did my process die ??

Hi there I have a backup script that runs every night and for some reason ive been getting in in the morning and the process has died, Is there any way I can tell when it died? if not .....would anybody recommend some scripting that i could do that would be able to tell me this information ... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

3. UNIX for Dummies Questions & Answers

Python 2.5 must die.

I am using SunOS 5.7 I have installed Python 2.5 via make install Without going into details, I'd like to uninstall it and replace it with an earlier version. Maybe as far back as 2.2.3. Unfortuantely, make uninstall gives me Don't know how to make target 'uninstall'. This is thematically... (2 Replies)
Discussion started by: Dbecker
2 Replies

4. Shell Programming and Scripting

perl problem - why isn't 'die' being called?

last week i started learning perl, so have limited skill and knowledge. why isn't 'die' being called and the script exiting before the 'directory created' line? if (! -d "$logdir") { system "mkdir -p $logdir" || die print "\nERROR: release log directory creation failed - $logdir: $!\n";... (4 Replies)
Discussion started by: mjays
4 Replies

5. Shell Programming and Scripting

Read from a pipe or die in perl

I have a perl program that I want to read from a file passed as an argument or from a pipe. If their is no pipe or arguments, I want it to output a help message. I am stuck on how to prevent perl from reading from the keyboard if it isn't fed any file names or data from a pipe. The only things I... (4 Replies)
Discussion started by: ilikecows
4 Replies

6. Post Here to Contact Site Administrators and Moderators

Tynt Tracer Must Die

First of all, I want to thank everyone who runs this forum for the fine job they've done. While I myself have not yet had any need for help, I have enjoyed and learned while helping others. Due diligence disclaimer: I searched for a discussion on this issue, using "tynt" and "copy paste", but... (11 Replies)
Discussion started by: alister
11 Replies

7. Shell Programming and Scripting

FTP Connection die out

Hi, I will ftp aroung 80 files after connecting to an FTP Server. But after 2 minutes of connection, it is timed out and connection is dying. Server had a 2 minute connection timeout if connection is idle. But my question, Isn't tranfering files not considered as an activity. Is the connection... (7 Replies)
Discussion started by: vasuarjula
7 Replies
Perl::Critic::Policy::ErrorHandling::RequireCarping(3)	User Contributed Perl Documentation Perl::Critic::Policy::ErrorHandling::RequireCarping(3)

NAME
Perl::Critic::Policy::ErrorHandling::RequireCarping - Use functions from Carp instead of "warn" or "die". AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
The "die" and "warn" functions both report the file and line number where the exception occurred. But if someone else is using your subroutine, they usually don't care where your code blew up. Instead, they want to know where their code invoked the subroutine. The Carp module provides alternative methods that report the exception from the caller's file and line number. By default, this policy will not complain about "die" or "warn", if it can determine that the message will always result in a terminal newline. Since perl suppresses file names and line numbers in this situation, it is assumed that no stack traces are desired either and none of the Carp functions are necessary. die "oops" if $explosion; #not ok warn "Where? Where?!" if $tiger; #not ok open my $mouth, '<', 'food' or die 'of starvation'; #not ok if (! $dentist_appointment) { warn "You have bad breath! "; #ok } die "$clock not set. " if $no_time; #ok my $message = "$clock not set. "; die $message if $no_time; #not ok, not obvious CONFIGURATION
By default, this policy allows uses of "die" and "warn" ending in an explicit newline. If you give this policy an "allow_messages_ending_with_newlines" option in your .perlcriticrc with a false value, then this policy will prohibit such uses. [ErrorHandling::RequireCarping] allow_messages_ending_with_newlines = 0 If you give this policy an "allow_in_main_unless_in_subroutine" option in your .perlcriticrc with a true value, then this policy will allow "die" and "warn" in name space main:: unless they appear in a subroutine, even if they do not end in an explicit newline. [ErrorHandling::RequireCarping] allow_in_main_unless_in_subroutine = 1 BUGS
Should allow "die" when it is obvious that the "message" is a reference. SEE ALSO
Carp::Always AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. 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-06-09 Perl::Critic::Policy::ErrorHandling::RequireCarping(3)
All times are GMT -4. The time now is 12:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy