David Gama Rodríguez wrote:
Tom Phoenix wrote:
On 1/10/06, David Gama Rodríguez <[EMAIL PROTECTED]> wrote:
I made a module that loads when Apache starts, in my module I declare a
hash as a global in order to be accesed in any place in my module,
my $hash;
Not to be picky about t
On 1/10/06, David Gama Rodríguez <[EMAIL PROTECTED]> wrote:
> I made a module that loads when Apache starts, in my module I declare a
> hash as a global in order to be accesed in any place in my module,
>
> my $hash;
Not to be picky about terminology, but a "my" variable is a lexical
variable, n
I think that a fresh new copy of the module is loaded into memory everytime it
is called. That's why your module loses its value. If I want to do something
like that, I'd consider storing the value on the hard drive somewhere.
Vishal
Quoting David Gama Rodríguez <[EMAIL PROTECTED]>:
> Hello ev
"Adam" <[EMAIL PROTECTED]> 在郵件 news:[EMAIL PROTECTED] 中撰寫...
> Expected error message: "Global symbol "$b" requires explicit package name".
> However, I get result: "test".
> I've checked the special variables and it looks like $b is one of these.
>
> use warnings;
> use strict;
> zzz ($b);
> prin
> Expected error message: "Global symbol "$b" requires explicit package
> name".
> However, I get result: "test".
> I've checked the special variables and it looks like $b is one of
> these.
>
> use warnings;
> use strict;
> zzz ($b);
> print "$b\n";
> sub zzz{
> $_[0] = "test";
> }
>
> Does it
Yesterday, Wiggins d'Anconia wrote:
> Yes and no. There are multiple different implementations of threads all
> of which have some good and bad points. You will need to look more into
> them depending on your version of Perl and how complex the task is that
> you wish to accomplish. (There is also
On Mon, 11 Aug 2003 08:11:07 -0500 (CDT), Paul Archer <[EMAIL PROTECTED]> wrote:
> Yesterday, Wiggins d'Anconia wrote:
>
> > Yes and no. There are multiple different implementations of threads all
> > of which have some good and bad points. You wi
Steve Grazzini wrote:
On Sat, Aug 09, 2003 at 01:04:26PM -0700, Ahmed Moustafa wrote:
Does a forked process share the memory locations of the global
variables from the parent process?
Changes made after the fork() won't be visible in the other
process, if that's what you're wondering.
Yes, that
On Sat, Aug 09, 2003 at 01:04:26PM -0700, Ahmed Moustafa wrote:
> Does a forked process share the memory locations of the global
> variables from the parent process?
Changes made after the fork() won't be visible in the other
process, if that's what you're wondering.
--
Steve
--
To unsubscrib
Ahmed Moustafa wrote:
Steve Grazzini wrote:
On Sat, Aug 09, 2003 at 05:14:34PM -0700, Ahmed Moustafa wrote:
Steve Grazzini wrote:
Changes made after the fork() won't be visible in the other
process, if that's what you're wondering.
Yes, that's exactly what I am wondering. So, is there a way to
Steve Grazzini wrote:
On Sat, Aug 09, 2003 at 05:14:34PM -0700, Ahmed Moustafa wrote:
Steve Grazzini wrote:
Changes made after the fork() won't be visible in the other
process, if that's what you're wondering.
Yes, that's exactly what I am wondering. So, is there a way to
assign values to the glo
On Sat, Aug 09, 2003 at 05:14:34PM -0700, Ahmed Moustafa wrote:
> Steve Grazzini wrote:
>> Changes made after the fork() won't be visible in the other
>> process, if that's what you're wondering.
>
> Yes, that's exactly what I am wondering. So, is there a way to
> assign values to the global varia
I learnt something about this for days only, so don't
know if there are bugs here :
# Create a package glob_vars.pm #
package glob_vars;
require Exporter;
our @ISA = qw (Exporter);
our @EXPORT = qw (%VARS)
our %VARS = ();
$VARS{sth_a} = 'sth_a';
$VARS{sth_b} = 'sth_b';
1;
# End of package #
#
use package. example:
name the following DBString.pm:
#!/usr/bin/perl;
package DBString;
@EXPORT = qw($db $user $psw);
$db = 'db';
$user = 'user';
$psw = 'psw';
1;
then in another test script:
#!/usr/bin/perl
use DBString;
print $DBString::db,"\n"; #-- prints db
print $DBString::user,"\n"; #--
On Friday, May 10, 2002, at 09:20 , Chas Owens wrote:
[..]
> In many operating systems fork is implemented using copy-on-write. This
> means that when you fork both processes refer to the same memory
> locations until one of them tries to change the bytes stored there. At
> that time the change
On Fri, 2002-05-10 at 00:12, Ahmed Moustafa wrote:
> Thanks a lot. I understand that.
>
> I was thinking that variable 'x' of a forked process 'p2' would point at
> the same memory location of variable 'x' of a parent process 'p1'. That
> can't be true. If that was true, 'p1' and 'p2' would be
Thanks a lot. I understand that.
I was thinking that variable 'x' of a forked process 'p2' would point at
the same memory location of variable 'x' of a parent process 'p1'. That
can't be true. If that was true, 'p1' and 'p2' would be identitcal (no
need to fork!).
--
Ahmed Moustafa
http://po
On Thu, 2002-03-28 at 14:55, [EMAIL PROTECTED] wrote:
> Hello, All:
>
> I've never been very good at scoping so it it's no surprise that this
> confuses me:
>
> When declaring variables at the beginning of a script, what is the
> difference between 'my' and 'use vars'?
>
> --
> Eric P.
>
In article <001201c144fb$4a1ba3d0$ec00a8c0@boxx>, [EMAIL PROTECTED]
(Sascha Kersken) wrote:
> Perl 5.6 provides the 'our' statement as opposite to 'my': it makes a
> variable global to a file in which it's used.
it declares a package variable, actually. if you aren't in its
package, then you h
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
(Ruth Albocher) wrote:
> I would like to use a global variable in my perl application, but since
> everything in perl is in a package, it will always belong to some
> package. what can I do?
stay away from global variables. :)
what are you tryi
Hi!
Perl 5.6 provides the 'our' statement as opposite to 'my': it makes a
variable global to a file in which it's used.
HTH
Sascha
- Original Message -
From: "Ruth Albocher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 24, 2001 1:01 PM
Subject: global variables
On Wed, 18 Jul 2001, Stephanie Stiavetti wrote:
> I'm writing a script to check for validity of form elements. here's what I
> have so far:
>
> my ($job) = $cgi->param("job");
>
> bla bla bla more script bla bla bla
>
>
> sub fixFailed
> { my (@failedFields);
> my ($validForm)="1";
>
>
--- "Warren D. Johnson" <[EMAIL PROTECTED]> wrote:
>
> Test.pl uses variables (via use vars) from config.pl. These
> variables are defined and given values in config.pl. AFter the first
> usage of test.pl, the variables we are pulling in from config.pl no
> longer have values. So it's som
23 matches
Mail list logo