Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Oops I did it again.....

by mrbbking (Hermit)
on May 12, 2002 at 17:06 UTC ( #166003=note: print w/ replies, xml ) Need Help??


in reply to Oops I did it again.....

This looks like a great learning experience. So what if there's another way to achieve the same thing? (...as you noted.)
My comments, for what they're worth:

You never use $dest, after declaring it with use vars.

If you're using Perl 5.6+, you might want to use 'our', instead of 'use vars'. With Perl 5.6, 'our' obsoleted 'use vars'.
Then again, you might not. 'use vars' is more compatible. So many Ways To Do It!

You store ARGV[0] in $temp twice. (Did you mean == in the if statement?)

Your 'confirmation' questions are wordy, and there is no default. Convention is to make the less destructive option the default.
Maybe set $read to 'T' when declared (i.e. our $read='T') and only change it to 'C' on user request.

You check the 'mv' system call for success, but you don't check the 'rm' call

You have an 'err' sub, but that sub does not call exit. So, even if something goes wrong, your program exits with '0', indicating success.

Suggestion: Wait for more suggestions from others. Once you've got a few, pick the ones that make sense to you, and re-write it. Save a copy of what you have now so that you can compare them.

Update: Fixed formatting. Also, ++ to Anonymonk for the our pointer.
s!!password!;y?sordid?binger?; y.paw.mrk.;;print chr 0x5b ;;; print;print chr(0x5b+0x2);;;;;


Comment on Re: Oops I did it again.....
Download Code
Re: Re: Oops I did it again.....
by Anonymous Monk on May 12, 2002 at 19:53 UTC
Re: Re: Oops I did it again.....
by defyance (Curate) on May 13, 2002 at 02:02 UTC
    Great suggestions!! ++ to mrbbking This was a simple hack that I posted here for suggestions, and I can't thank you enough for yours. I'll wait on some more and put it all together, and post it at the end..

    -- Yes, I am a criminal. My crime is that of defyance.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://166003]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2014-07-30 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (240 votes), past polls