于 2012-4-27 20:43, Shawn H Corey 写道:
> On 12-04-27 03:06 AM, Zapp wrote:
>> when I use bash, I can write a file ( a.sh ) like :
>> abc='abc'
>> ddd='aaa'
>> ...
>> then I can load it in other file:
>> source a.sh
>> echo $abc $ddd # it always work!
>>
>> but in perl , how can I do like that ?
>>
>>
On 12-04-27 03:06 AM, Zapp wrote:
> when I use bash, I can write a file ( a.sh ) like :
> abc='abc'
> ddd='aaa'
> ...
> then I can load it in other file:
> source a.sh
> echo $abc $ddd # it always work!
>
> but in perl , how can I do like that ?
>
> I write a file ( my_env.pl ) like:
> #!/usr/bin
Hi zapp,
Please my comments below:
2012/4/27 Zapp
> when I use bash, I can write a file ( a.sh ) like :
> abc='abc'
> ddd='aaa'
> ...
> then I can load it in other file:
> source a.sh
> echo $abc $ddd # it always work!
>
> but in perl , how can I do like that ?
>
> I write a file ( my_env.pl )
于 2012-4-27 15:41, Octavian Rasnita 写道:
> From: "Zapp"
>> when I use bash, I can write a file ( a.sh ) like :
>> abc='abc'
>> ddd='aaa'
>> ...
>> then I can load it in other file:
>> source a.sh
>> echo $abc $ddd # it always work!
>>
>> but in perl , how can I do like that ?
>>
>> I write a file (
From: "Zapp"
> when I use bash, I can write a file ( a.sh ) like :
> abc='abc'
> ddd='aaa'
> ...
> then I can load it in other file:
> source a.sh
> echo $abc $ddd # it always work!
>
> but in perl , how can I do like that ?
>
> I write a file ( my_env.pl ) like:
> #!/usr/bin/perl -w
> my $abc='
On Aug 17, 1:35 am, nora.hac...@stgkk.at ("HACKER Nora") wrote:
> Hi,
>
> Sorry for the late answer, I was kept busy at work and had no time to
> dig in ...
>
> > IIUC, couldn't you just set oraenv directly at runtime:
>
> > $oraenv = "$w_conf/ora$orapat.env"; # coalesce path + filename
> >
On Jul 28, 10:59 pm, nora.hac...@stgkk.at ("HACKER Nora") wrote:
> Hi list,
>
> Maybe one of you has a clue why I get a false error message when using
> Env::Sourced. My (test-)script is as follows:
>
> #!/usr/bin/perl -w
> use strict;
> use warnings;
> require Env::Sourced; # "require" necessary i
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Dec 5, 2008, at 1:20 PM, David Ehresmann wrote:
What is the difference between:
%ENV
%ENV_VARS
%ENV is a special variable in Perl that contains the environment
variables of your current environment. I have never seen %ENV_VARS
and it
"Chas. Owens" <[EMAIL PROTECTED]> wrote:
No, environmental variables are a per-process thing. Child processes
inherit the state of their parent's environment, but that is it. If
you need inter-process communication you have to use IPC*, a file, a
database, or some other external resource. Take
On Dec 28, 2007 2:24 AM, Travis Thornhill <[EMAIL PROTECTED]> wrote:
snip
> Is there a way to do this? In other words, is there a way to
> set env variables that ANY user and ANY application can see?
snip
No, environmental variables are a per-process thing. Child processes
inherit the state o
: Thomas J Hughes
Cc: beginners@perl.org
Subject: Re: Re: ENV(Y)?
Hi!
I got your mail from the Perl-malinglist. You have to unscribe from that
list manually yourself.
Best regards
/G
http://www.varupiraten.se/
- Original Message -
From: "Thomas J Hughes" <[EMAIL PROTECTED]
, 2005 6:19 PM
Subject: Re: Re: ENV(Y)?
Please remove my email address from your list, thanks
Tom
On 10/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi again!
I've been looking around...
And one thing I don't get. You tell me that > SOMEVAR will be available to
you i
AHA!! Ok, thanx! Now I understand it better... :-)
/G
http://www.varupiraten.se/
> Hi Custav -
>
> At 2005-10-14, 02:23:59 you wrote:
>>Hi again!
>>
>>I've been looking around...
>>
>>And one thing I don't get. You tell me that > SOMEVAR will be available
>> to
>>you in your program and any prog
Hi Custav -
At 2005-10-14, 02:23:59 you wrote:
>Hi again!
>
>I've been looking around...
>
>And one thing I don't get. You tell me that > SOMEVAR will be available to
>you in your program and any programs you spawn( with 'system' or
>backtics). But after your perl script ends, SOMEVAR is lost) a
Hi again!
I've been looking around...
And one thing I don't get. You tell me that > SOMEVAR will be available to
you in your program and any programs you spawn( with 'system' or
backtics). But after your perl script ends, SOMEVAR is lost) and this
seems to be correct when I test my program, but I
Hi gustav -
At 2005-10-13, 23:42:22 you wrote:
>Hi!
>
>Just a quick question. Can I set or unset an enviromentvariable through
>this Hash? I just need a yes ... :-)
>If No, please give explanation...
Not really.
If you do something like:
$ENV{SOMEVAR} = 'somevalue';
SOMEVAR will be available
Hi!
Just a quick question. Can I set or unset an enviromentvariable through
this Hash? I just need a yes ... :-)
If No, please give explanation...
/G
http://www.varupiraten.se/
> Hi!
>
> Thanx a LOT!!!
>
> /G
> http://www.varupiraten.se/
>
>
>> Hi Gustav -
>>
>> At 2005-10-13, 23:13:33 you wro
Hi!
Thanx a LOT!!!
/G
http://www.varupiraten.se/
> Hi Gustav -
>
> At 2005-10-13, 23:13:33 you wrote:
>>Hi there!
>>
>>I'd like to get a list of enviromentvariables from the *NIX-system.
>>
>>I'd like it in the format...
>>ENV1=x1
>>ENv2=x2
>>ENV3=x3
>>
>>and so on...
>>
>>I think I have to use
Hi Gustav -
At 2005-10-13, 23:13:33 you wrote:
>Hi there!
>
>I'd like to get a list of enviromentvariables from the *NIX-system.
>
>I'd like it in the format...
>ENV1=x1
>ENv2=x2
>ENV3=x3
>
>and so on...
>
>I think I have to use ENV-command. (http://perldoc.perl.org/Env.html) Is
>that right? I
Please bottom post
Tony Frasketi wrote:
> I've had problems with this in this the past and found your solution to
> work as long as I run my script from the bash command line.
>
> However if the script is run from a web page, I still do not get the
> value of the environment variable that I h
I've had problems with this in this the past and found your solution to
work as long as I run my script from the bash command line.
However if the script is run from a web page, I still do not get the
value of the environment variable that I had set from the bash prompt or
even in the .profile
hi,
I think that it shows only the exported varaibles.
I tried some thing like this
---try this--
1) add one more variable with your own as
prompt$ MY_OWN='name'
2) then run your program your variable MY_OWN will not be in the list
but use suffix export infornt of the above line, th
Gergely Buday wrote:
> Hi there,
>
> why is the script
>
> #!/usr/bin/perl
> foreach $key (sort keys %ENV) {
> print "$key=$ENV{$key}\n";
> }
>
> returns much less variable than
>
> $ set
>
> using bash?
set is a bash built-in command which displays shell variables while the
enviroment i
]>
wrote:
> is there any 'refresh' (in the browser) variable set
> in the ENV hash?
>
> sierrasurf
>
> -Original Message-
> From: Randy W. Sims
> [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 15, 2004 10:56 PM
> To: Mike Ni
> Cc: [EMAIL PRO
Please bottom post and group reply so everyone can help and be helped...
>
> I see what you mean.
> However, where do they get the "key" for the hasing?
>
Generally you will know the key you want because it will be part of the
spec of the design, aka it should be documented. For instance Apach
is there any 'refresh' (in the browser) variable set in the ENV hash?
sierrasurf
-Original Message-
From: Randy W. Sims [mailto:[EMAIL PROTECTED]
Sent: Monday, March 15, 2004 10:56 PM
To: Mike Ni
Cc: [EMAIL PROTECTED]
Subject: Re: %ENV?
On 03/15/04 22:25, Mike Ni wrote:
&
On 03/15/04 22:25, Mike Ni wrote:
Hey Randy,
Am I right to think that each hasing pair are made of
"name of environment variable" such as "PATH"
and the "value" of the env variable?
Yes, the environment variable names are the keys in the hash, and the
value of each hash element is the value of
On 03/15/04 17:37, Mike Ni wrote:
Hey friends,
Could anyone tell me where to
find the man page for the "%ENV"?
I didn't have too muck luck on www.perl.org
nor with CPAN site. Perhaps I got the wrong ideal
about perl's man page. Yet, I just can't seem
to find the man page about "%ENV".
I nee
> Hey friends,
>
> Could anyone tell me where to
> find the man page for the "%ENV"?
>
> I didn't have too muck luck on www.perl.org
> nor with CPAN site. Perhaps I got the wrong ideal
> about perl's man page. Yet, I just can't seem
> to find the man page about "%ENV".
>
> I need to finut w
> Bryan Harris wrote:
>>> # do this. make sure that this line is the
>>> # ONLY thing you print out to the browser.
>>> print "Location: http://rightplace.com/\n\n";;
>>
>>
>> Wow, this is cool! Where is this documented? I'm interested in
>> learning about other things like this..
Bryan Harris wrote:
> > # do this. make sure that this line is the
> > # ONLY thing you print out to the browser.
> > print "Location: http://rightplace.com/\n\n";;
>
>
> Wow, this is cool! Where is this documented? I'm interested in
> learning about other things like this...
This
Bryan Harris wrote:
print "Location: http://rightplace.com/\n\n";;
Wow, this is cool! Where is this documented? I'm interested in learning
about other things like this...
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=Perl+CGI+Apache&btnG=Google+Search
1,720,000 possibilities
Try
> # do this. make sure that this line is the
> # ONLY thing you print out to the browser.
> print "Location: http://rightplace.com/\n\n";;
Wow, this is cool! Where is this documented? I'm interested in learning
about other things like this...
--
To unsubscribe, e-mail: [EMAIL P
>I have a custom 404 error page that uses that shows the URL of the page that
>couldn't be found using var="REDIRECT_URL". Is there a way to take this
>variable, such as "/folder/wrong.html", strip out everything except
>"folder", match "folder" and redirect (launch the web page) to
>"folder/index.
> "Pete" == Pete Emerson <[EMAIL PROTECTED]> writes:
Pete> It's the same way. Here's code that works for me:
Pete> #!/usr/bin/perl -w
Pete> use strict;
Pete> use CGI qw(:standard);
Pete> print header;
Pete> print start_html;
Pete> foreach my $key (sort keys %ENV) {
Pete> print "\$ENV{$
Thanks a lot, thats exactly what I wanted
On Thu, 25 Sep 2003, Pete Emerson wrote:
> Asif Iqbal wrote:
>
> > I can use this to get all the env variables
> ...
> > Now how can I use this trick to get all the web env variables ? I am using
> > apache on unix (solaris 8) ?
>
> It's the same way. Her
Asif Iqbal wrote:
I can use this to get all the env variables
...
Now how can I use this trick to get all the web env variables ? I am using
apache on unix (solaris 8) ?
It's the same way. Here's code that works for me:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
print header;
print st
hi,
setenv is a c shell internal. with bash use
export LC_ALL=C
On Fri, Sep 12, 2003 at 01:12:54PM +0200, Gisle Askestad wrote:
> Hi
> And thank you for replying to my problem.
>
> I tried: setenv LC_ALL=C
> It returned: bash: setenv: command not found
>
> "set env LC_ALL=C" doe
"Gisle Askestad" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
please dont top post. f'ups rearranged.
> >>I'm using RedHat 8.0 and Perl 5.8.0
> >>
> >>I'm trying to install Time:HiRes from CPAN which is needed to
> >>use the File::Tail module. When running "Make" i get the error:
"Gisle Askestad" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> I'm trying to install Time:HiRes from CPAN which is needed to use the
> File::Tail module. When running "Make" i get the error:
>
> Makefile:91: *** missing separator. Stop.
>
> Makefile.PL says:
>
> NOTE: if you get
Hi
And thank you for replying to my problem.
I tried: setenv LC_ALL=C
It returned: bash: setenv: command not found
"set env LC_ALL=C" does not return any error, but printenv
does not show LC_ALL=C in the environment variables.
man setenv and man printenv, even printenv works fine.
My ReaHat build
> Hi
Howdy
>
> I'm using RedHat 8.0 and Perl 5.8.0
>
> I'm trying to install Time:HiRes from CPAN which is needed to
> use the File::Tail module. When running "Make" i get the error:
>
> Makefile:91: *** missing separator. Stop.
>
> Makefile.PL says:
>
> NOTE: if you get an error like thi
Dan Muey wrote:
> Howdy,
>
> I realize that $ENV{'REMOTE_HOST'} and $ENV{'REMOTE_ADDR'} are handled
> differently and can be spoofed so don't worry I'm not basing any
> security on them.
I'm no security expert, but how can these be spoofed? They don't come from
the request headers, but are deriv
Dan Muey wrote:
> > Dan Muey wrote:
> > > Howdy,
> > >
> > > I realize that $ENV{'REMOTE_HOST'} and $ENV{'REMOTE_ADDR'} are
> > > handled differently and can be spoofed so don't worry I'm not
> > > basing any security on them.
> >
> > I'm no security expert, but how can these be spoofed? They
> >
I think what I'll do is just log $ENV{'REMOTE_HOST'} and $ENV{'REMOTE_USER'}
into a mysql database so I can review that info to watch for abusers.
Since they are logging in that will help verify most everybody and if a
user wants to give out his login info to other folks then just watching my li
> Dan Muey wrote:
> > Howdy,
> >
> > I realize that $ENV{'REMOTE_HOST'} and $ENV{'REMOTE_ADDR'}
> are handled
> > differently and can be spoofed so don't worry I'm not basing any
> > security on them.
>
> I'm no security expert, but how can these be spoofed? They
> don't come from the reques
> Dan Muey wrote:
> > > Dan Muey wrote:
> > > > Howdy,
> > > >
> > > > I realize that $ENV{'REMOTE_HOST'} and $ENV{'REMOTE_ADDR'} are
> > > > handled differently and can be spoofed so don't worry I'm not
> > > > basing any security on them.
> > >
> > > I'm no security expert, but how can these
loan tran wrote:
Hello all,
I have a perl script that accesses Sybase Database. It
works fine if I manually run it, but when I set up a
cronjob to run the script, I got the following error.
I suspect this has to do with env, but i just dont
know how fix it?
Could you please help. Thank you.
Well
%ENV hash contains all the environment vars
run this pice of code
foreach $key (sort keys %ENV){
print "$key = $ENV{$key}\n";
}
- Original Message -
From: "Chris Knipe" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 06, 2002 1:12 AM
Subject: env
> Lo eve
They're automatically stored in the %ENV hash. Note that if you are using
NT/2000/XP, you cannot use this hash to PERMANENTLY change environment
variables.
-Original Message-
From: Chris Knipe [mailto:savage@;savage.za.org]
Sent: Tuesday, November 05, 2002 11:13 AM
To: [EMAIL PROTECTED]
On Thu, Feb 21, 2002 at 02:42:31PM -, IT Workflow - Terry
Honeyford wrote:
> but when I use Apache 1.3.22 I don't get as many $ENV's back from
> the server, in particular the one my script is looking for -
> ($ENV{remote_user})
In apache's httpd.conf, you should enable these lines:
Bernd Lach wrote:
>Hi there,
>
>I have a problem in detecting any kind of environment
>variables.
>
>I always get a premature script error , when I launch sth like
>this.
>
>
>#!C:/Perl/bin/perl.exe -w
>use diagnostics;
>use strict;
>
>use CGI;
>
>$browser = $ENV{'HTTP_USER_AGENT'};
>
>if ($
On , Bernd Lach said:
>#!C:/Perl/bin/perl.exe -w
>use diagnostics;
>use strict;
You're using strict and -w, good.
>use CGI;
>
>$browser = $ENV{'HTTP_USER_AGENT'};
Oops. You didn't declare $browser.
my $browser = $ENV{HTTP_USER_AGENT};
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] ht
If you're trying to view your results in a browser, you need to generate
HTTP headers.
-Original Message-
From: Bernd Lach [mailto:[EMAIL PROTECTED]]
Sent: None
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: $ENV{'HTTP_USER_AGENT'
Hi there,
I have a problem in detecting any kind of
He wants to affect the environment of the process he's calling.
Try this:
$frazzle = 'exported string';
$ENV{'FRAZZLE'} = $frazzle;
$output = `ksh -c \'print \$FRAZZLE\'`;
print $output;
On Thu, 4 Oct 2001, Brett W. McCoy wrote:
> On Thu, 4 Oct 2001, Kingsbury, Michael wrote:
>
> > Is there
> -Original Message-
> From: Gary L. Armstrong [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 05, 2001 3:09 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Env for Cmds run in backticks
>
>
> I would guess you are actually asking about exportin
I would guess you are actually asking about exporting system environment
variables?
I'm new to this but here's my idea, setting them on the system directly,
using PATH as an example:
`PATH=$PATH:/usr/bin/perl`
`export $PATH`
or maybe
`export PATH=/usr/bin:/etc:.`
I don't do a lot with env var
On Thu, 4 Oct 2001, Kingsbury, Michael wrote:
> Is there a way to export perl variables for use when run in backticks?
What do you mean? Variables interpolate inside of backticks (unless you
are silly enought to do qx'', and then they won't).
-- Brett
Correct me if I am wrong since I'm just a newbie..
> > $mypath = $ENV(PATH);
> > $myeditor= $ENV{EDITOR};
> > $mytest = 123;
> > $mytest2 = "Perl"
^ Doesn't this require a semicolon?
>
> add "my" at the beginning of the lines:
>
> my $mypath = $ENV(PATH);
On Fri, Jul 20, 2001 at 02:39:04AM +0200, Paul Johnson wrote:
> On Thu, Jul 19, 2001 at 05:28:05PM -0700, Sekhar, Ravi wrote:
> > $mypath = $ENV(PATH);
> my $mypath = $ENV(PATH);
I should read more carefully. You need braces here instead of
parentheses.
my $mypath = $ENV{PATH};
(Or mayb
On Thu, Jul 19, 2001 at 05:28:05PM -0700, Sekhar, Ravi wrote:
> #!/usr/bin/perl -w
> use strict;
Good!
> $mypath = $ENV(PATH);
> $myeditor= $ENV{EDITOR};
> $mytest = 123;
> $mytest2 = "Perl"
add "my" at the beginning of the lines:
my $mypath = $ENV(PATH);
(Actually, I'd get rid of "my"
On Wed, Jun 27, 2001 at 02:37:55AM -0400, Adam Theo wrote:
> i am looking for a way my perl program can automatically get the home
> directory of the user.
There is, of course, the HOME environmental variable. There is also
(getpwuid $>)[7], which gets the home directory from the password datab
Hi Luinrandir,
I had the same problem a while ago. I don't know where I finally got
the information, but I now tend to use a little script that shows me
all available %ENV :))
#!/usr/bin/perl
use CGI
# set flush right away after every write or print
$|=1;
# Get a list
perldoc perlvar
Basically, it holds information about yout current environment.
perl -wle 'print qq{$_ => $ENV{$_}\n} for keys %ENV';
Cheers,
Kevin
On Thu, Jun 07, 2001 at 07:51:50PM -0400, Luinrandir Hernson ([EMAIL PROTECTED])
spew-ed forth:
> I have tried
> perldoc -f env
> perldoc -f htt
On Thu, Jun 07, 2001 at 07:51:50PM -0400, Luinrandir Hernson wrote:
> I have tried
> perldoc -f env
> perldoc -f http
> perldoc -f %env
> perldoc -f $env
>
> to find documentation on %ENV. no luck
> anyone???
perldoc perlvar
-f is for builtin functions
--
Just Another Perl Hacker.
Hi Dianne,
Generally, HTTP_REFERER is the page which got you to the current page (the
page that links to it). REMOTE_ADDR generally contains the IP. Try peeking at
that, or make a CGI with the following which will display your environment
variables for you:
#!/usr/bin/perl -w
use strict;
pri
66 matches
Mail list logo