Sponsored Content
Top Forums Shell Programming and Scripting perl problem - another 'die' issue. Post 302131869 by mjays on Tuesday 14th of August 2007 05:38:24 AM
Old 08-14-2007
perl problem - another 'die' issue.

two things.
  1. why doesn't the 'die' message get displayed - "Error: release log directory creation failed..."?
  2. why does the script name and line number get displayed despite the inclusion of a '\n'. apparently adding a newline prevents this from happening.

Code:
if (! -d "$logdir") {
    use File::Path;
    mkpath "$logdir" || die ("ERROR: release log directory creation failed - $logdir: $!\n");
    print "\nINFO: Directory created - $logdir\n";
}

Code:
the result:

mkdir /build/cm_test_sharee: Permission denied at ./crm.prl line 122

 

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
File::CheckTree(3pm)					 Perl Programmers Reference Guide				      File::CheckTree(3pm)

NAME
File::CheckTree - run many filetest checks on a tree SYNOPSIS
use File::CheckTree; $num_warnings = validate( q{ /vmunix -e || die /boot -e || die /bin cd csh -ex csh !-ug sh -ex sh !-ug /usr -d || warn "What happened to $file? " }); DESCRIPTION
The validate() routine takes a single multiline string consisting of directives, each containing a filename plus a file test to try on it. (The file test may also be a "cd", causing subsequent relative filenames to be interpreted relative to that directory.) After the file test you may put "|| die" to make it a fatal error if the file test fails. The default is "|| warn". The file test may optionally have a "!' prepended to test for the opposite condition. If you do a cd and then list some relative filenames, you may want to indent them slightly for readability. If you supply your own die() or warn() message, you can use $file to interpolate the filename. Filetests may be bunched: "-rwx" tests for all of "-r", "-w", and "-x". Only the first failed test of the bunch will produce a warning. The routine returns the number of warnings issued. AUTHOR
File::CheckTree was derived from lib/validate.pl which was written by Larry Wall. Revised by Paul Grassie <grassie@perl.com> in 2002. HISTORY
File::CheckTree used to not display fatal error messages. It used to count only those warnings produced by a generic "|| warn" (and not those in which the user supplied the message). In addition, the validate() routine would leave the user program in whatever directory was last entered through the use of "cd" directives. These bugs were fixed during the development of perl 5.8. The first fixed version of File::CheckTree was 4.2. perl v5.16.2 2012-10-11 File::CheckTree(3pm)
All times are GMT -4. The time now is 12:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy