bugsbunny has asked for the wisdom of the Perl Monks concerning the following question:
I have some shell scripts and some perl scripts.. I store some paths and other variables as shell script.. Now I want to be able to import these vars into my perl-scripts.. ex.:
myenv.sh
myshell-script.sh#!/bin/sh blah=/tmp/test balh3=/xyx/zzz
myperl-script.pl#!/bin/sh source myshell-script.sh ...do something...
I need some simpler&shorter solution, not f.e.:#!/usr/bin/perl ..what to do here...
Also what i should do if i decice to put some code..:"), probably not but in any case...open FILE ..; undef $/; $x =<FILE>; %hash = split /=/, (split /\n/, $x); close FILE ..;
thanx
update (broquaint): added <code> tags and fixed formatting
Title edit by tye
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: enviorment
by RMGir (Prior) on Oct 23, 2003 at 12:04 UTC | |
by bugsbunny (Scribe) on Oct 23, 2003 at 12:25 UTC | |
by iburrell (Chaplain) on Oct 23, 2003 at 19:50 UTC | |
Re: enviorment
by Art_XIV (Hermit) on Oct 23, 2003 at 12:58 UTC | |
Re: Importing environment variables from shell script file to Perl
by coreolyn (Parson) on Oct 23, 2003 at 18:19 UTC | |
Re: Importing environment variables from shell script file to Perl
by tbone1 (Monsignor) on Oct 23, 2003 at 15:28 UTC | |
by Roger (Parson) on Oct 24, 2003 at 01:14 UTC | |
Re: enviorment
by bugsbunny (Scribe) on Oct 23, 2003 at 12:07 UTC |