The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

perl problem. by colonele 2002-06-07 09:12:11
The version: "This is perl, v5.6.1 built for i386-linux".

The problem:
I'm building a simplistic shell program (bash-frontend) for perl using the system call. The exact line of code where I use it is:

system($_) && warn "Command Not Found \n";

Now I realize that && is not the normal operator, but it seems to work, so that's good. What doesn't seem to work is when I type in a bad command:

Can't exec "dp": No such file or directory at psh.pl line 27, <STDIN> line 2.
Command Not Found

or whatever. Why is the error message not being suppressed? How can I fix that? I'll post the complete program (it's not that long (29 lines) ... yet.) I hope to eventually have perl interrupts and implement the various perl-style expressions, but until then... this is my "dev1" version of the script: that is to say, it's not even 0.0.1 yet. 0.0.1 implies that it actually has functionality at some level.

Any help is appreciated. If this bug has been fixed in more recent versions of perl, that's good too.

On a final note: is it possible to compile perl programs into seperate binaries that don't require perl? Even if it makes it so that perl is included in the binary, that's fine too.
[ Reply ]
  system() by SMcV2002-06-07 09:41:53
  i think by nimdokk2002-06-07 11:44:28
    barring more info by nimdokk2002-06-07 14:47:02
  Compiling Perl by ptkdb2006-11-19 12:55:59

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)