Tuesday, January 15, 2013
11:00 PM

Perl Script: How to use system defined Error message

There are many Perl defined system variables that you can use in your script, one of them is "$!", When used in a numeric context, holds the current value of errno. If used in a string context, will hold the error string associated with errno.

Below is simple Perl script which prints all available system error message and their corresponding error codes.


Source: error_message.pl

#!/usr/bin/perl
for ($! = 1, $i = 1; $! <= 25; $!++, $i++) {
    $errormsg = $!;
    chomp($errormsg);
    print "$i : $! \n";
}
Continue Reading...

0 comments:

Post a Comment

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.