Piercer has asked for the wisdom of the Perl Monks concerning the following question:
What I get is this (I'v formatted it a bit to make it a little more readable.)undef $^E; undef $!; undef $?; print "using system \n"; system("net use v: \\\\SERVERNAME\\SHARENAME"); print "dollar caret E reports $^E \n"; print "dollar Exclamation mark reports $! \n"; print "dollar question mark reports $? \n"; print "using backticks \n"; `net use v: \\\\SERVERNAME\\SHARENAME`; print "dollar caret E reports $^E \n"; print "dollar Exclamation mark reports $! \n"; print "dollar question mark reports $? \n";
What I really want is the english readable message eg System error 85 has occurred.The local device name is already in use. I think this is coded somehow in $? but my brain hurts and I can't figure it out. Has anyone any hints, tricks or a suggestion of where I should be looking for the answer?using system System error 85 has occurred. The local device name is already in use. dollar caret E reports The system cannot find the file specif +ied dollar Exclamation mark reports dollar question mark reports 512 using backticks System error 85 has occurred. The local device name is already in use. dollar caret E reports The pipe has been ended dollar Exclamation mark reports dollar question mark reports 512
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: capturing error messages from backticks or system
by grinder (Bishop) on Aug 28, 2001 at 20:31 UTC | |
|
Re: capturing error messages from backticks or system
by Hofmator (Curate) on Aug 28, 2001 at 19:53 UTC | |
|
Re: capturing error messages from backticks or system
by rchiav (Deacon) on Aug 28, 2001 at 19:42 UTC | |
by tye (Sage) on Aug 28, 2001 at 23:43 UTC |