Thanks for all the replies. It’s been a very interesting thread.
Frank
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Mon, Apr 3, 2017 at 6:55 PM SSC_perl wrote:
> Reading http://perldoc.perl.org/perlreftut.html I see it’s
> possible to create a scalar reference. What situation would require
> someone to create a reference to a scalar? I thought refs were only useful
> for passing complex data struc
complex data structures. Is it just because Perl lets you, or
> is there a reason I’m not aware of? It seems like it would just be
> redundant.
They can make handy objects, whivh have to be references, but if you're
making an inside-out object which doesn't contain its own attributes, y
On 04/03/2017 06:52 PM, SSC_perl wrote:
Reading http://perldoc.perl.org/perlreftut.html I see it’s possible to
create a scalar reference. What situation would require someone to create a
reference to a scalar? I thought refs were only useful for passing complex
data structures. Is i
Reading http://perldoc.perl.org/perlreftut.html I see it’s possible to
create a scalar reference. What situation would require someone to create a
reference to a scalar? I thought refs were only useful for passing complex
data structures. Is it just because Perl lets you, or is there
On Wed, May 14, 2014 at 1:31 AM, Mike Dunaway wrote:
> What's a good use of references? When is it ideal to use them? Why would you
> want to use them?
>
Maybe a better question is when *not* to use them. I try to keep
things that don't need to be passed around or have multi
On 05/14/2014 12:31 AM, Mike Dunaway wrote:
What's a good use of references? When is it ideal to use them? Why would
you want to use them?
I learned C before I learned perl. I think understanding it in C will
also help:
http://how-to.linuxcareer.com/c-development-on-linux-pointer
Hi Mike,
On Wed, 14 May 2014 00:31:56 -0500
Mike Dunaway wrote:
> What's a good use of references? When is it ideal to use them? Why would
> you want to use them?
>
See the links from http://perl-begin.org/topics/references/ (*Note*:
perl-begin.org is my domain).
Regards,
Dear Mike,
There are many benefits of using references. One such advantage is when you
pass two arrays to a subroutine.
I will illustrate with an example which shows how you can pass two arrays
to a subroutine. The first example explains passing arrays without
references and the second example
Hi,
perldoc perlref has a good description for your questions.
http://perldoc.perl.org/perlref.html
On Wed, May 14, 2014 at 1:31 PM, Mike Dunaway wrote:
> What's a good use of references? When is it ideal to use them? Why would
> you want to use them?
>
> --
> To
What's a good use of references? When is it ideal to use them? Why would
you want to use them?
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
> Date: Mon, 27 Feb 2012 20:02:49 -0500
> From: ekimduna...@gmail.com
> To: beginners@perl.org
> Subject: Introduction and Perl 5 References
>
> While I'm posting, I may as well
> ask a question related to Perl. Would anyone mind explaining references
> to me
Hi Paul,
On Tue, 28 Feb 2012 07:43:10 -0800
Adams Paul wrote:
>
> Sent from my LG phone
>
you've sent three messages to this mailing list that only quote a previous
message in the thread in its entirety, and then consist of no original content
except for a "Sent from my LG phone". Why are the
Sent from my LG phone
Shawn H Corey wrote:
>On 12-02-27 08:02 PM, Mike wrote:
>> I was curious if there were any other members in the 804 area? I'm
>> looking to meet some other programmers in my area as I only know of one
>> other.
>
>You should look for Perl Mongers in your area at http://www
the 804 area? I'm looking to meet some other programmers in
> my area as I only know of one other. While I'm posting, I may as well
> ask a question related to Perl. Would anyone mind explaining references
> to me like I was five years old? I read about them in Beginning Perl,
On 12-02-27 08:02 PM, Mike wrote:
I was curious if there were any other members in the 804 area? I'm
looking to meet some other programmers in my area as I only know of one
other.
You should look for Perl Mongers in your area at http://www.pm.org/
--
Just my 0.0002 million dollars worth,
ea?
Do you mean, phone area code of 804?. See if this helps
http://www.pm.org/groups/united_states_of_america.html
> Would anyone mind explaining references to me like I was five years old?
References are like pointers in C. References can be created to different
data structures like
only know of one other. While I'm posting, I may as well
ask a question related to Perl. Would anyone mind explaining references
to me like I was five years old? I read about them in Beginning Perl,
but I can't quite grasp them very well. Thanks!
--
To unsubscribe, e-mail: beg
On Mon, Jan 23, 2012 at 2:12 AM, David Christensen <
dpchr...@holgerdanske.com> wrote:
> beginners@perl.org:
>
> While coding some tests tonight, I discovered that Scalar::Util::blessed()
> considers Regexp references to be blessed.
>
>
> Is this a bug or a featur
beginners@perl.org:
While coding some tests tonight, I discovered that
Scalar::Util::blessed() considers Regexp references to be blessed.
Is this a bug or a feature?
TIA,
David
2012-01-22 21:07:57 dpchrist@p43400e ~/sandbox/perl
$ cat blessed
#! /usr/bin/perl
# $Id: blessed,v 1.1 2012
On 12/18/2011 08:53 PM, David Christensen wrote:
beginners@perl.org:
I'm working on some classes with attributes that are array and hash
references, and am confused by what happens when I attempt to slice an
array or hash reference. For example:
7. "$ra->[0, 1, 2]" evaluat
On 12/18/2011 06:05 PM, John W. Krahn wrote:
$ra is a scalar that holds a reference to an array. $ra->[0]
dereferences an array element. To dereference an array slice use:
@{ $ra }[ 0, 1, 2 ]
...
@{ $ra }[ 0 .. 2 ]
On 12/18/2011 06:14 PM, Shawn H Corey wrote:
> my @slice = @$ra[ 1, 2, 3 ];
..
On 11-12-18 09:05 PM, John W. Krahn wrote:
David Christensen wrote:
beginners@perl.org:
Hello,
I'm working on some classes with attributes that are array and hash
references, and am confused by what happens when I attempt to slice an
array or hash reference. For example:
7. "$ra
David Christensen wrote:
beginners@perl.org:
Hello,
I'm working on some classes with attributes that are array and hash
references, and am confused by what happens when I attempt to slice an
array or hash reference. For example:
7. "$ra->[0, 1, 2]" evaluates to $ra->[
beginners@perl.org:
I'm working on some classes with attributes that are array and hash
references, and am confused by what happens when I attempt to slice an
array or hash reference. For example:
7. "$ra->[0, 1, 2]" evaluates to $ra->[2].
8. "$ra->[
On 2011-11-25 10:50, timothy adigun wrote:
Mike D wrote:
my @array = (1,2,3,4);
my $array=[qw(1 2 3 4)];
Another ill advice. There is no need to add a dereferencing level here.
A scalar has no inherent type, a construct like \@data has.
('type' in the Perl sense: scalar, arayref, hash
On 2011-11-25 10:50, timothy adigun wrote:
for (@$thing1) # to access the whole array after referencing
for clarity use: for (@{$thing1}){...}
For clarity, I prefer it like this:
for my $t ( @$thing1 ) {
...;
}
So with plenty of cheap white space.
--
Ruud
--
To unsubscribe
On 2011-11-25 10:50, timothy adigun wrote:
Mike D wrote:
# this function expects an array to be passed by reference
sub foo
{
my ($thing1) = @_; # make a lexical variable for the array being passed
Fine, but since you are getting a reference, I don't really think you need
the "()"
aro
Rob Dixon wrote:
On 25/11/2011 09:56, John W. Krahn wrote:
Mike D wrote:
It's pretty confusing, especially since BP uses prototypes during
the example
British Petroleum?
Beginning Perl
Thanks. :-)
John
--
Any intelligent fool can make things bigger and
more complex... It takes a tou
On 11-11-25 09:51 AM, timothy adigun wrote:
Hi Rob,
The first two links are to pirated copies of O'Reilly books.
What is your point?
Shlomi's point is presumably that it is inappropriate to encourage
piracy on this list.
Thanks, I appericiate that and I also support Shlomi's view th
Hi Rob,
The first two links are to pirated copies of O'Reilly books.
>>>
>>
> What is your point?
>
>>Shlomi's point is presumably that it is inappropriate to encourage
>>piracy on this list.
Thanks, I appericiate that and I also support Shlomi's view then!
Hi John aka List Mom,
>> The point i
On 11-11-24 11:28 PM, Mike D wrote:
It's pretty confusing, especially since BP uses prototypes during the
example, which I'm told are bad? Never use them?
Prototypes in Perl are not the same as in C. Don't use them. Using them
is an advance technique that changes the syntax of the language. Yo
On Fri, Nov 25, 2011 at 07:39, timothy adigun <2teezp...@gmail.com> wrote:
>>> The first two links are to pirated copies of O'Reilly books.
> What is your point?
The point is this: Please don't post links to pirated materials on
this list. Doing so again will get you removed from the list.
j
On 25/11/2011 09:56, John W. Krahn wrote:
Mike D wrote:
It's pretty confusing, especially since BP uses prototypes during
the example
British Petroleum?
Beginning Perl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://
On 25/11/2011 12:39, timothy adigun wrote:
==> John,
TIMTOWTDI =>"There Is More Than One Way To Do It" , I know that! I was
stating/showing option(s). Since, the programmer will take resposiblity for
it own coding styles!
I think John's point is that you were simply rewriting code for the sak
Hello,
==> John,
TIMTOWTDI =>"There Is More Than One Way To Do It" , I know that! I was
stating/showing option(s). Since, the programmer will take resposiblity for
it own coding styles!
===> Fish,
>> «my ($thing1) = @_;» is OK. «my $thing1 = @_;» is not OK, as it will >>
take scalar(@_); which is
On Fri, 25 Nov 2011 10:50:01 +0100
timothy adigun <2teezp...@gmail.com> wrote:
> Hi Mike D,
> Some comments on your codes:
> Mike D wrote:
>
> > Considering the following code, are all my comments correct?
> >
> > # this function expects an array to be passed by reference
> > sub foo
> > {
>
Hi Mike,
On Thu, 24 Nov 2011 23:28:39 -0500
Mike D wrote:
> Hi all, just started using Perl today, coming over from a background in
> C#/Java and Python.
Welcome to Perl.
>
> I seem to be grasping Perl rather nicely (I think) until I got up to
> references in Beginning Perl.
&
timothy adigun wrote:
Hi Mike D,
Some comments on your codes:
Mike D wrote:
Considering the following code, are all my comments correct?
# this function expects an array to be passed by reference
sub foo
{
my ($thing1) = @_; # make a lexical variable for the array being passed
Fine,
Mike D wrote:
Hi all,
Hello,
just started using Perl today, coming over from a background in
C#/Java and Python.
I seem to be grasping Perl rather nicely (I think) until I got up to
references in Beginning Perl.
Considering the following code, are all my comments correct?
They appear to
Hi Mike D,
Some comments on your codes:
Mike D wrote:
> Considering the following code, are all my comments correct?
>
> # this function expects an array to be passed by reference
> sub foo
> {
>my ($thing1) = @_; # make a lexical variable for the array being passed
>
Fine, but since you
Hi all, just started using Perl today, coming over from a background in
C#/Java and Python.
I seem to be grasping Perl rather nicely (I think) until I got up to
references in Beginning Perl.
Considering the following code, are all my comments correct?
# this function expects an array to be
>> Unless you really want to change your data, use map().
>>
>
> Ruud didn't say that you shouldn't change the data, only that you should
> use map unless that was what you wanted. Who knows what the OP wants.
>
> Rob
Sorry for the delay.
What Shlomi Fish mentioned was I wanted. Thanks for all
On 20/11/2011 04:14, Chris Charley wrote:
Well, if Dr Ruud is right, and you shouldn't replace the undefs in the
original arrays, then the following program wouldn't be correct. It
changes the original array (data).
On 20/11/2011 00:23, Dr.Ruud wrote:
Unless you really want to change your da
"Mohan L" wrote in message
news:cadihtmt4rqntknjlgsimpgqv9xuc89dryhtx00ctwbknxwd...@mail.gmail.com...
Dear all,
#!/usr/bin/env perl
#dummy.pl
use strict;
use warnings;
use Data::Dumper;
my $ref_to_AoA = [
[ "fred", "barney",undef,"pebbles", "bambam", "dino", ],
[ "homer",und
On 19/11/2011 18:21, Mohan L wrote:
Dear all,
#!/usr/bin/env perl
#dummy.pl
use strict;
use warnings;
use Data::Dumper;
my $ref_to_AoA = [
[ "fred", "barney",undef,"pebbles", "bambam", "dino", ],
[ "homer",undef,"bart",undef, "marge", "maggie", ],
[ "george", "jane",u
On 2011-11-19 19:21, Mohan L wrote:
But What I want is, I want to replace all 'undef' to a string 'foo'.
Unless you really want to change your data, use map().
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://l
Hi Mohan,
On Sat, 19 Nov 2011 23:51:19 +0530
Mohan L wrote:
> Dear all,
>
> #!/usr/bin/env perl
> #dummy.pl
> use strict;
> use warnings;
> use Data::Dumper;
>
> my $ref_to_AoA = [
> [ "fred", "barney",undef,"pebbles", "bambam", "dino", ],
> [ "homer",undef,"bart",undef, "marge
Dear all,
#!/usr/bin/env perl
#dummy.pl
use strict;
use warnings;
use Data::Dumper;
my $ref_to_AoA = [
[ "fred", "barney",undef,"pebbles", "bambam", "dino", ],
[ "homer",undef,"bart",undef, "marge", "maggie", ],
[ "george", "jane",undef, "elroy",undef,"judy", ],
];
On 2010-09-25 13:07, John W. Krahn wrote:
Dr.Ruud wrote:
On 2010-09-25 01:57, Vaishnavi Saba wrote:
My query: In the code shown below, How does *grep* compare a scalar( *
$seen{$_}* ) with an array of hash references ( *...@_* ).
=
@common = inter( \%foo, \%bar, \%joe );
sub inter
Dr.Ruud wrote:
On 2010-09-25 01:57, Vaishnavi Saba wrote:
My query: In the code shown below, How does *grep* compare a scalar( *
$seen{$_}* ) with an array of hash references ( *...@_* ).
=
@common = inter( \%foo, \%bar, \%joe );
sub inter {
my %seen;
for my $href ( @_ ) {
while (my
On 2010-09-25 01:57, Vaishnavi Saba wrote:
My query: In the code shown below, How does *grep* compare a scalar( *
$seen{$_}* ) with an array of hash references ( *...@_* ).
=
@common = inter( \%foo, \%bar, \%joe );
sub inter {
my %seen;
for my $href ( @_ ) {
while
HASH(0x40030354)
> HASH(0x400303d8) HASH(0x40037e98)".
These are the addresses of the hash-references in @_. You should try
using Data::Dumper:
use Data::Dumper;
print Dumper(@_); #or \...@_ rather
to see what is actually in the hashes.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.o
Vaishnavi Saba wrote:
Hi,
Hello,
My query: In the code shown below, How does *grep* compare a scalar( *
$seen{$_}* ) with an array of hash references ( *...@_* ).
An array in scalar context returns the number of elements in the array
and @_ (which is an alias to @common) contains 3
Hi,
My query: In the code shown below, How does *grep* compare a scalar( *
$seen{$_}* ) with an array of hash references ( *...@_* ).
=
@common = inter( \%foo, \%bar, \%joe );
sub inter {
my %seen;
for my $href (@_) {
while (my $k = each %$href ) {
$seen{$k
On Wed, 28 Apr 2010 01:16:16 -0400, Uri Guttman wrote:
>>>>>> "PS" == Peter Scott writes:
>
> PS> On Mon, 26 Apr 2010 22:16:27 +0800, Tim Bowden wrote:
> >> I've just realised I almost never use named arrays or hashes
> >> any
>>>>> "PS" == Peter Scott writes:
PS> On Mon, 26 Apr 2010 22:16:27 +0800, Tim Bowden wrote:
>> I've just realised I almost never use named arrays or hashes anymore.
>> It's almost always anonymous references instead. That lead me to wonde
On Mon, 26 Apr 2010 22:16:27 +0800, Tim Bowden wrote:
> I've just realised I almost never use named arrays or hashes anymore.
> It's almost always anonymous references instead. That lead me to wonder
> what criteria experienced perl hackers have as to when to use a named
> a
On Monday 26 Apr 2010 17:16:27 Tim Bowden wrote:
> I've just realised I almost never use named arrays or hashes anymore.
> It's almost always anonymous references instead. That lead me to wonder
> what criteria experienced perl hackers have as to when to use a named
> arra
I've just realised I almost never use named arrays or hashes anymore.
It's almost always anonymous references instead. That lead me to wonder
what criteria experienced perl hackers have as to when to use a named
array or hash, and when to start with an anonymous ref instead. My ver
On Fri, 2010-04-16 at 12:51 +0300, Shlomi Fish wrote:
> Hi Tim,
>
> On Friday 16 Apr 2010 12:06:31 Tim Bowden wrote:
> > I've got a nested hash data structure, and I want to create tests for
> > many of the attributes within that data structure, but I'm not sure of
> > the best way to do that.
> >
Hi Tim,
On Friday 16 Apr 2010 12:06:31 Tim Bowden wrote:
> I've got a nested hash data structure, and I want to create tests for
> many of the attributes within that data structure, but I'm not sure of
> the best way to do that.
>
> Example:
>
> my $dataStructure = {'GroupA'=>{
> 'element1'=
I've got a nested hash data structure, and I want to create tests for
many of the attributes within that data structure, but I'm not sure of
the best way to do that.
Example:
my $dataStructure = {'GroupA'=>{
'element1'=>{
'attrib1'=>'someValue', 'attrib2'=>'otherValue'},
'element2
Steve Bertrand wrote:
Hi!
Well, working on windows does have its benefits. When something goes
horribly wrong, you can always point the finger to Redmont and your
users will believe you (not matter who's fault it really is)...
I can tell you work in an Enterprise environment already ;)
Yeah
On 2010.04.07 19:19, Rene Schickbauer wrote:
> Shawn H Corey wrote:
>> Rene Schickbauer wrote:
>>> Shawn H Corey wrote:
>>>
Personally, I don't see why anyone would want to run Windows. It's
like trying to run a marathon while dragging a bus.
>>>
>>> For me, its mainly because it pays th
Shawn H Corey wrote:
Rene Schickbauer wrote:
Shawn H Corey wrote:
Personally, I don't see why anyone would want to run Windows. It's
like trying to run a marathon while dragging a bus.
For me, its mainly because it pays the rent.
I did say, "want to" not "have to" :)
Well, working on w
From: Shawn H Corey
>Shlomi Fish wrote:
>> Nevertheless, if you are going to run Perl on UNIX systems
exclusively, you
>> shouldn't use threads. And if you're planning to do such
multi-tasking on
>> Windows using Perl - please reconsider.
>
> Personally, I don't see why anyone would want to run
Rene Schickbauer wrote:
Shawn H Corey wrote:
Personally, I don't see why anyone would want to run Windows. It's
like trying to run a marathon while dragging a bus.
For me, its mainly because it pays the rent.
I did say, "want to" not "have to" :)
--
Just my 0.0002 million dollars wo
Shawn H Corey wrote:
Personally, I don't see why anyone would want to run Windows. It's like
trying to run a marathon while dragging a bus.
For me, its mainly because it pays the rent.
You know, girls sell their body, boys sell their soul. Or something like
that.
LG
Rene
--
To unsubscrib
Shlomi Fish wrote:
Nevertheless, if you are going to run Perl on UNIX systems exclusively, you
shouldn't use threads. And if you're planning to do such multi-tasking on
Windows using Perl - please reconsider.
Personally, I don't see why anyone would want to run Windows. It's like
trying to r
Hi Shawn,
On Wednesday 07 Apr 2010 16:05:24 Shawn H Corey wrote:
> Shlomi Fish wrote:
> > I would really recommend against using threads:
> >
> > * http://perldoc.perl.org/perlthrtut.html
> >
> > * http://www.perlmonks.org/index.pl?node_id=288022
> >
> > They don't work as expected in Perl (tho
Shlomi Fish wrote:
I would really recommend against using threads:
* http://perldoc.perl.org/perlthrtut.html
* http://www.perlmonks.org/index.pl?node_id=288022
They don't work as expected in Perl (though in C/C++, .NET and/or Java, they
may be an option[Thr]), and cause too many problems. If
Hi,
On Wednesday 07 Apr 2010 14:59:08 Frenzel, Joerg (ext) wrote:
> Hello,
>
> I need help by using threads in combination with external packages
> (modules).
I would really recommend against using threads:
* http://perldoc.perl.org/perlthrtut.html
* http://www.perlmonks.org/index.pl?node_id=2
Hello,
I need help by using threads in combination with external packages (modules).
At main script threads were created and within these threads an
database-handler was defined.
My Intention is to use this database-handler within a method of the external
module.
The paramlist of my method c
e presence of the BGFL
stuff from my browsers and computers I would appreciate posting the removal
technology, please!
--- On Wed, 1/6/10, jay taylor wrote:
> From: jay taylor
> Subject: Please remove all references in mail archive
> To: beginners@perl.org
> Date: Wednesday, Jan
jm wrote:
>
> if this person really believes he has any expectation of privacy regarding
> any aspect of the internet, then i have some prime swampland in the sahara
> i'd love to sell him
>
>
> good luck with that
Please don't feed the trolls.
--
Just my 0.0002 million dollars worth,
gt; Please remove all references in beginners.perl.org.
> Back in 2003, I was subscribing to this list and I stopped it.
> I did post many messages. I want them to be removed. Because,
> I did not have idea, you will be posting everything on the internet.
> Google is able to find me.
&g
Hello,
I am reggie kogulan.
Please remove all references in beginners.perl.org.
Back in 2003, I was subscribing to this list and I stopped it.
I did post many messages. I want them to be removed. Because,
I did not have idea, you will be posting everything on the internet.
Google is able to
thank you very much everybody! I appreciate your help.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Why does
$foobar = \("foo", "bar");
print $$foobar;
print "bar" ??
Thank you for any insight. Mark
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
ay literal:
>
>
> $foobar = ['foo', 'bar'];
>
> See http://perldoc.perl.org/perlref.html#Making-References .
>
> John
>
>
> On Sat, Nov 28, 2009 at 5:53 AM, John W. Krahn wrote:
>
>> Mark_Galeck wrote:
>>
>>> Why does
>>&
Just replying to add that you can use square brackets for an array literal:
$foobar = ['foo', 'bar'];
See http://perldoc.perl.org/perlref.html#Making-References .
John
On Sat, Nov 28, 2009 at 5:53 AM, John W. Krahn wrote:
> Mark_Galeck wrote:
>
>> Why do
Mark_Galeck wrote:
Why does
$foobar = \("foo", "bar");
print $$foobar;
print "bar" ??
Thank you for any insight. Mark
Because \("foo", "bar") is really (\"foo", \"bar") and the comma
operator in scalar context will return the last item listed so:
$foobar = \("foo", "bar");
Is just:
$
Why does
$foobar = \("foo", "bar");
print $$foobar;
print "bar" ??
Thank you for any insight. Mark
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
[0]", "${$row}[1]" though both of them gives same result
snip
${$row}[0] is better, but $row->[0] is best.
If you need ammunition to convince others then show them this code and
then run it on a fairly modern Perl interpreter. Perl will throw a
warning like "Scalar value @
Hello all,
Recently I faced one scenario with references and array slice in perl.
I used following program to retrieve the rows from a table in Oracle using
Perl DBI.
As shown in the program, I did following steps to retrieve the rows :-
- used "fetchall_arrayref" to get
On Aug 30, 3:01 am, [EMAIL PROTECTED] (Patrick Dupre) wrote:
.
.
> I do:
> AV* av ;
>
> then av = (AV*) svRV (retval) ;
>
Looks ok to me. Install Inline::C so that you can quickly and easily
test things out:
use warnings;
use strict;
use Inline C => Confi
Calling a sub from perl, if this sub return an address on an array,
it is not a problem, perl seems to manage correctly the memory to
keep allocated, and I can access to the data through the reference
at any time.
Making the same call from a CPP method seems not to work.
If I quit the method and
Patrick Dupre wrote:
>
> Calling a sub from perl, if this sub return an address on an array,
> it is not a problem, perl seems to manage correctly the memory to
> keep allocated, and I can access to the data through the reference
> at any time.
>
> Making the same call from a CPP method seems not
Hello,
Calling a sub from perl, if this sub return an address on an array,
it is not a problem, perl seems to manage correctly the memory to
keep allocated, and I can access to the data through the reference
at any time.
Making the same call from a CPP method seems not to work.
If I quit the met
simple - that did it. of course I removed the "my" when defining
$templateConfiguation in the for loop.
thanks!
Raymond Wan wrote:
Hi Noah,
Would defining $templateConfiguration outside of the for loop be
sufficient for what you need?
i.e.,
my $templateConfiguation;
foreach my $templat
Hi Noah,
Would defining $templateConfiguration outside of the for loop be
sufficient for what you need?
i.e.,
my $templateConfiguation;
foreach my $templateConfigFilename (@templateConfigFilenames) {
$templateConfigFilename = "$TemplateDirectory/$templateConfigFilename";
(my $sortedTem
John W. Krahn wrote:
Noah wrote:
response inline below
John W. Krahn wrote:
Noah wrote:
I have a routine returning a perl reference and I am trying to
figure out how to properly use the hash tables in the main section
of my perl proggie.
--- from the main program
my $templateConfiguati
ation that will take a
list of references and return the corresponding list of referents.
To my knowledge, no such operator exists. Sorry.
You can dereference a single reference to an array. But you can't
dereference a list of references to scalars.
Best you could do would probably be s
Noah wrote:
response inline below
John W. Krahn wrote:
Noah wrote:
I have a routine returning a perl reference and I am trying to figure
out how to properly use the hash tables in the main section of my
perl proggie.
--- from the main program
my $templateConfiguation =
&readConfigTemplat
response inline below
John W. Krahn wrote:
Noah wrote:
Hi there,
Hello,
I have a routine returning a perl reference and I am trying to figure
out how to properly use the hash tables in the main section of my perl
proggie.
--- from the main program
my $templateConfiguation =
&readConfig
reference
> # and we want to assign what it refers to the number 4.
> # i.e. ${$l[0]} = 4;
> # but for the whole list in @l
> ( \( @l ) ) = ( 4, 5, 6 );
>
> print "$a should be 4\n";
It sounds to me like you're looking for the exact opposite of the \
( ... ) behavior.
My friend is trying to do this:
#!/bin/perl
$a = 1;
$b = 2;
$c = 3;
@l = ( \$a, \$b, \$c );
# This is the line we need help with
# Is there a way to tell Perl that @l[0] is a reference
# and we want to assign what it refers to the number 4.
# i.e. ${$l[0]} = 4;
# but for the whole list in @l
(
Noah wrote:
Hi there,
Hello,
I have a routine returning a perl reference and I am trying to figure
out how to properly use the hash tables in the main section of my perl
proggie.
--- from the main program
my $templateConfiguation = &readConfigTemplate($templateConfigFilename,
$sortedTemp
On Mon, 2008-08-18 at 15:10 -0700, Noah wrote:
> print DIFF "d> $key" if !exists
> ($templateConfiguation{$templateType}{$key});
> print MATCH "m> $key" if exists
> ($templateConfiguation{$templateType}{$key});
Try:
print DIFF "d> $key" if !exists
($templateConfigua
1 - 100 of 482 matches
Mail list logo