Hi Shlomi, Thanks for your reply.
> From a cursory look at your program, it seems that you can just set up > $mode > as a global variable, and keep it at that instead of just passing it > around. > Alternatively, maybe you'd like to define a class and keep the mode > variable > there as a property of the class' instances. Obviously, my point wasn't clear enough, I'm sorry for that. The variable in the code extract that I'm really bothering about is the $sdb: It is needed in the SWITCH of a sub-function, but this construct only works if I pre-declare the $sdb in the calling function backup(), even if it isn't needed for a $mode eq "b" but only for "r". I still have a (meta) question referring to your advice to set it up as a global variable: I read that "Global variables are bad [...] (http://perldoc.perl.org/perlfaq7.html) - so when is it ok to use global variables and when not? So far, I tried to use as many private variables as reasonable/possible, even if I had to pass them around between (sub-)functions, sometimes even between to "levels". > > my $mode = ARGV[0]; > > That should be "my $mode = $ARGV[0];" or preferably "my $mode = > shift(@ARGV);" > or "my ($mode) = @ARGV;". Sorry, typo - I indeed use $ARGV[0]. Kind regards, Nora -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/