Jeff Pang wrote:

My question:
How do I set the variable in the bash script?
So far I use
VAR="dir1 ... dirn"
export $VAR
but then the content of the variable is interpreted as a single string
and not a a list of
strings as required by lib.
Is it possible to define in bash a list of strings?



Hello,

Do it like this way,you'll get it.

export LIBS=dir0:dir1:dir2
perl -Mstrict -e 'my @libs = split/:/,$ENV{LIBS};use lib @libs'



Thank you for the help.
Both suggestions in the form
"sub lib split /\s+/,$ENV{VAR}" or
"sub lib split /:/,$ENV{VAR}"
achieve the expected result.
--

K. Jantzen


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to