Do you know where your variables are? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi sellinios,
As talexb said, you really need to show some code for us to see where you're having problems. That said, it's a fair bet the first error you've got:
happened because the code was trying to remove all files a bunch of files that didn't exist. You're probably running on Linux because of the /home dir, and the "rm" command. On my Linux system, the same error (and the same exit status, 256) happen with this test script:
If I change that script to use glob and unlink (better because they're Perl builtin functions, hence don't rely on calling the shell which is a more expensive operation):
That way, if there aren't any files, it won't fail due to shell not finding any matches. It's interesting to note that the shell will always do its own globbing before passing results to the command (rm in your case) -- to verify this, you can try "echo *" and see all your files/dirs the way they'd look prior to passing them to any Unix command ("ls" for example). And unlike Perl, the shell will throw an error if a wildcard such as "*" or "?" fails to find any matching files. In reply to Re: Perl script error
by golux
|
|