On Thu, Jun 12, 2008 at 10:22 PM, mani kandan <[EMAIL PROTECTED]> wrote:
> Dear gurus
>
> I have to write a program with configuration file *.CFG, i came to know have
> to use pointers
>
> I am new to pointer in perl can i get some tips about pointers in perl, where
> can i get study materials an
On Apr 11, 2005 4:20 AM, Brent Clark <[EMAIL PROTECTED]> wrote:
> Hi all
>
> If anyone has the time and / or the will to help me understand.
>
> I know how to create / use references for perl. But would why would you
> use it.
> And I think more importantly when.
>
> Im busy reading / learning
> I know how to create / use references for perl. But would why would you
> use it.
Perl uses references for multidimensional/complex datastructures. Also
used when doing OO in perl.
> And I think more importantly when.
Whenever appropriate. :) I probably make the greatest use of references
w
Am Montag, 11. April 2005 10.20 schrieb Brent Clark:
> Hi all
Hi Brent
Here's my way to explain it from an "abstract" perspective more or less
"outside" of the world of perl:
[...]
> I know how to create / use references for perl. But would why would you
> use it.
> And I think more importantly
> If anyone has the time and / or the will to help me understand.
>
> I know how to create / use references for perl. But would why would you
> use it.
> And I think more importantly when.
>
> Im busy reading / learning the Oreilly Advanced Perl Programming book.
> But for the likes of me I cant
On Nov 30, 2003, at 6:23 AM, Jason Dusek wrote:
What is a pointer and what is a reference?
How are they different?
As R.Joseph has noted they are different,
and of course the obligatory perldoc tutorials.
( op. cit. )
That having been said, we might want to step back
to the 'older language' of
Jason Dusek wrote:
> Hi Kids,
>
> What is a pointer and what is a reference?
A pointer is a variable which holds a memory address. That is all it
holds, except possibly a classification by type, which can be morphed.
Pointers are a C/C++ topic, really. We use the term casually someimes when
spe
Eric Walker wrote:
wow ok then I will try and use the -> notation. No need to stay behind
the times.
Just a couple of notes, someone already pointed out perlref, there is also:
perldoc perllol
perldoc perlreftut
perldoc perldsc
Which should give you a better handle on references. Depending on
On Thursday, Nov 20, 2003, at 11:51 US/Pacific, Eric Walker wrote:
Well see the key is I am passing a value to a sub this is a pointer and
I am having trouble getting access to the hash with in the subroutine
$Rules is a pointer given to me by a prewritten Database function.
&sub(\$Rules);
do yo
Send the code.
-Original Message-
From: Eric Walker [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 2:52 PM
To: Perl Newbies
Subject: RE: Pointers
Well see the key is I am passing a value to a sub this is a pointer and
I am having trouble getting access to the hash with in
Well see the key is I am passing a value to a sub this is a pointer and
I am having trouble getting access to the hash with in the subroutine
$Rules is a pointer given to me by a prewritten Database function.
&sub(\$Rules);
I am actually passing in 2 hashes and need to compare the keys. so I am
--As off Thursday, November 20, 2003 12:20 PM -0700, Eric Walker is
alleged to have said:
ok why the $$ instead of the %$?
sorry confused.
On Thu, 2003-11-20 at 12:08, Paul Kraus wrote:
$$overdate{key}
Perldoc perlref
--As for the rest, it is mine.
$$ would get you the value of a cert
wow ok then I will try and use the -> notation. No need to stay behind
the times.
On Thu, 2003-11-20 at 12:23, Bakken, Luke wrote:
> ok why the $$ instead of the %$?
>
> sorry confused.
>
> \%overData. Now how do
> I access this hash. %$overData?
Because
uld address the entire hash as %$hashref
Or a single element of that hash as $$hashref{key}
HTH
Paul
-Original Message-
From: Eric Walker [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 2:20 PM
To: Paul Kraus
Cc: 'perlgroup'
ker [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 2:20 PM
To: Paul Kraus
Cc: 'perlgroup'
Subject: RE: Pointers
ok why the $$ instead of the %$?
sorry confused.
On Thu, 2003-11-20 at 12:08, Paul Kraus wrote:
$$overdate{key}
Perldoc perlref
-Ori
> ok why the $$ instead of the %$?
>
> sorry confused.
>
> \%overData. Now how do
> I access this hash. %$overData?
Because you're in essence doing this:
${ $overdata }{$key}
When you access a hash value, you're getting a scalar, which is why you
use a $. Perhaps this notation would be c
ok why the $$ instead of the %$?
sorry confused.
On Thu, 2003-11-20 at 12:08, Paul Kraus wrote:
$$overdate{key}
Perldoc perlref
-Original Message-
From: Eric Walker [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 2:03 PM
To: perlgroup
Su
$$overdate{key}
Perldoc perlref
-Original Message-
From: Eric Walker [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 2:03 PM
To: perlgroup
Subject: Pointers
Hello all, newbie here got a few questions:
I am working with pointers and I sort of understand them and then I
don'
> It's taken me a while to wrap my head around
> references, since I thought they were always
> Perl-specific. (At least, the term 'reference' doesn't
> show up in K&R!)
>
> Anyway, it finally occurred to me that the term
> 'reference' might just be Perlish for what other
> languages (C, I'm thin
I believe the two terms, reference and pointer, are equivalent. By the
way, In Java, they call it reference also, I think.
--Ahmed
[EMAIL PROTECTED] | http://www.photo.net/users/ahmed
Patrick Hall wrote:
> Hi pholks,
>
> It's taken me a while to wrap my head around
> references, since I thoug
> It's taken me a while to wrap my head around
> references, since I thought they were always
> Perl-specific. (At least, the term 'reference' doesn't
> show up in K&R!)
>
> Anyway, it finally occurred to me that the term
> 'reference' might just be Perlish for what other
> languages (C, I'm thin
On Tue, 3 Jul 2001, Jeff 'japhy' Pinyan wrote:
> None, unless 'login' or 'authent' were one of:
>
> q qq qr qw qx s m y tr
>
> Those can't be auto-quoted with => (unless 5.6.1 has changed that).
bash$ perl -v | grep version
This is perl, version 5.004_04 built for i686-linux
bash$ perl -le '
ion.com/~perl/tut
hth,
Jos Boumans
- Original Message -
From: "Brett W. McCoy" <[EMAIL PROTECTED]>
To: "Pozsar Balazs" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, July 03, 2001 7:12 PM
Subject: RE: pointers to subs?
> On Tu
--- Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote:
> On Jul 3, John Edwards said:
>
> >It's messy and relies on you naming you subroutines to match the
> static data
> >stored in %funcs. It will introduce more possible points of failure
> in the
> >code, make it harder to debug and maintain. Unl
On Tue, Jul 03, 2001 at 01:12:34PM -0400, Brett W. McCoy wrote:
> Nothing. If you use the => operator, quotes around the keys are not
> required. Quotes are also not required when using single word keys hwne
> retrieving a value:
With => quotes around the keys are not -always- required. The qu
On Tue, 3 Jul 2001, Pozsar Balazs wrote:
> What's the difference between these two?:
>
> %actions = (
> login => \&welcome,
> authent => \&checkpass,
> );
> and
> %actions = (
> "login" => \&welcome,
> "authent" => \&checkpass,
> );
Nothing. If you use the => operator, q
On Tue, 3 Jul 2001, John Edwards wrote:
> It's messy and relies on you naming you subroutines to match the static data
> stored in %funcs. It will introduce more possible points of failure in the
> code, make it harder to debug and maintain. Unless you've got a really good
> reason why you need t
On Tue, 3 Jul 2001, Pozsar Balazs wrote:
> I would want to use a hash to keep pointers to functions, and then call
> them, but i'm stuck.
> So:
>
> I create:
> my %funcs=(
> "one"=> \&first,
> "two"=> \&second);
>
> Then how can I call 'first'? Obviously, using %funcs,
> The => (fat arrow) auto-quotes the left-hand operand as long as it's a
> bareword.
>
> foo => 'bar'
>
> is the same as
>
> 'foo' => 'bar'
And also my experiences show that this auto-quotation applies for {}'s as
well:
$hash{"element"} is the same as $hash{element} ?.
Balazs Pozsar.
--
On Tue, Jul 03, 2001 at 06:49:29PM +0200, Pozsar Balazs wrote:
> What's the difference between these two?:
>
> %actions = (
> login => \&welcome,
> authent => \&checkpass,
> );
> and
> %actions = (
> "login" => \&welcome,
> "authent" => \&checkpass,
> );
Redundant punctu
On Jul 3, Pozsar Balazs said:
> %actions = (
>login => \&welcome,
>authent => \&checkpass,
> );
>
>and
>
> %actions = (
>"login" => \&welcome,
>"authent" => \&checkpass,
> );
None, unless 'login' or 'authent' were one of:
q qq qr qw qx s m y tr
Those can't be auto-quoted
Hi all, here's my next question :)
What's the difference between these two?:
%actions = (
login => \&welcome,
authent => \&checkpass,
);
and
%actions = (
"login" => \&welcome,
"authent" => \&checkpass,
);
bye
Balazs Pozsar.
--
On Jul 3, John Edwards said:
>It's messy and relies on you naming you subroutines to match the static data
>stored in %funcs. It will introduce more possible points of failure in the
>code, make it harder to debug and maintain. Unless you've got a really good
>reason why you need to do this, I'd
On Jul 3, Pozsar Balazs said:
>my %funcs=(
>"one"=> \&first,
>"two"=> \&second);
>
>Then how can I call 'first'? Obviously, using %funcs, i mean :).
There are two (general) ways to dereference arrays, hashes, and functions:
CREATE REFERENCEARROW SYNTAXSIGIL
Err, why??
Try this
my %funcs=(
"one"=> \&first,
"two"=> \&second,
);
sub first {
print "First";
}
sub second {
print "Second";
}
&{$funcs{'one'}};
It's messy and relies on you naming you subroutines to match the static data
stored in %funcs. It will introduce more p
35 matches
Mail list logo