Hi Erez,

> <STDIN> suggest dynamic input from the user during runtime. While
> @ARGV/<ARGV>/<> refers to commandline arguments sent before running
> the program. If you iterate over them using the idiomatic while(<>){}
> loop, you'll have a better way of making sure you only run over the
> values that were given. Also, what Shlomi mentions is a practice, not
> a rule, if you prefer calling for input from <STDIN> rather than a
> command-line argument, that's your prerogative.

Thanks, nice explanation :)

> However, part of the answer is knowing the question. If this doesn't
> do the trick for you, a more thorough description would come in handy.
> For instance, where will "db" come from, how many of these you want to
> use and how to call them, etc.

The question is: How can I enable several users to define a complete
substitution syntax for getting a username from a database name (after a
fixed scheme)? I thought I could resolve that by loading a config file
where the users can specify a substitution syntax after a certain scheme
(one scheme for all databases of one user, but different between various
users). 

E.g. I have a database name "PRODDB"/"TESTDB"/"BUILDDB" --> username is
"prod"/"test"/"build" (s/db$//g)
E.g. I have a database name "STGKK_STP15M3"/"NOEGKK_STP14T2" -->
username is "stp15m3"/"stp14t2" (s/^[a-z*]_//g)
(always after a 'tr [A-Z] [a-z]')


Cheers, 
Nora 


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to