Re: Scalar References - oxymoron?

2017-04-04 Thread SSC_perl
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/

Re: Scalar References - oxymoron?

2017-04-04 Thread Chas. Owens
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

Re: Scalar References - oxymoron?

2017-04-04 Thread Peter Scott
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, you wa

Re: Scalar References - oxymoron?

2017-04-03 Thread Uri Guttman
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

Scalar References - oxymoron?

2017-04-03 Thread SSC_perl
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

Re: References

2014-05-14 Thread Ken Peng
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 ekimduna...@gmail.com wrote: What's a good use of references? When is it ideal to use them? Why would you want to use them? -- To unsubscribe

Re: References

2014-05-14 Thread Shaji Kalidasan
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

Re: References

2014-05-14 Thread Shlomi Fish
Hi Mike, On Wed, 14 May 2014 00:31:56 -0500 Mike Dunaway ekimduna...@gmail.com 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

Re: References

2014-05-14 Thread Sam
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-pointers

Re: References

2014-05-14 Thread shawn wilson
On Wed, May 14, 2014 at 1:31 AM, Mike Dunaway ekimduna...@gmail.com 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

References

2014-05-13 Thread Mike Dunaway
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/

RE: Introduction and Perl 5 References

2012-02-29 Thread peter lanting
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 like I was five years old? I read about

Re: Introduction and Perl 5 References

2012-02-28 Thread Adams Paul
Sent from my LG phone Shawn H Corey shawnhco...@gmail.com 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

Re: Introduction and Perl 5 References

2012-02-28 Thread Shlomi Fish
Hi Paul, On Tue, 28 Feb 2012 07:43:10 -0800 Adams Paul adams...@msn.com 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.

Introduction and Perl 5 References

2012-02-27 Thread Mike
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: beginners-unsubscr

Re: Introduction and Perl 5 References

2012-02-27 Thread Parag Kalra
in the 804 area? 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

Re: Introduction and Perl 5 References

2012-02-27 Thread Shawn H Corey
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,

Re: Introduction and Perl 5 References

2012-02-27 Thread Shlomi Fish
in 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, but I can't quite

Re: Scalar::Util::blessed() considers Regexp references to be blessed?

2012-01-23 Thread Brian Fraser
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 feature? Implementation detail. Internally

Scalar::Util::blessed() considers Regexp references to be blessed?

2012-01-22 Thread David Christensen
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

Re: slicing array references

2011-12-19 Thread Uri Guttman
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] evaluates to $ra-[2]. 8. $ra

slicing array references

2011-12-18 Thread David Christensen
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-[0 .. 2] produces two Use of uninitialized

Re: slicing array references

2011-12-18 Thread John W. Krahn
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-[2]. $ra is a scalar

Re: slicing array references

2011-12-18 Thread Shawn H Corey
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-[0, 1, 2

Re: slicing array references

2011-12-18 Thread David Christensen
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 ]; ...

Re: Can someone explain references?

2011-11-27 Thread Dr.Ruud
On 2011-11-25 10:50, timothy adigun wrote: Mike Dekimduna...@gmail.com 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

Re: Can someone explain references?

2011-11-27 Thread Dr.Ruud
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

Re: Can someone explain references?

2011-11-27 Thread Dr.Ruud
On 2011-11-25 10:50, timothy adigun wrote: Mike Dekimduna...@gmail.com 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:

Re: Can someone explain references?

2011-11-25 Thread timothy adigun
Hi Mike D, Some comments on your codes: Mike D ekimduna...@gmail.com 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,

Re: Can someone explain references?

2011-11-25 Thread John W. Krahn
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

Re: Can someone explain references?

2011-11-25 Thread John W. Krahn
timothy adigun wrote: Hi Mike D, Some comments on your codes: Mike Dekimduna...@gmail.com 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

Re: Can someone explain references?

2011-11-25 Thread Shlomi Fish
Hi Mike, On Thu, 24 Nov 2011 23:28:39 -0500 Mike D ekimduna...@gmail.com 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

Re: Can someone explain references?

2011-11-25 Thread Shlomi Fish
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 ekimduna...@gmail.com wrote: Considering the following code, are all my comments correct? # this function expects an array to be passed by reference sub foo

Re: Can someone explain references?

2011-11-25 Thread timothy adigun
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 the

Re: Can someone explain references?

2011-11-25 Thread Rob Dixon
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 sake

Re: Can someone explain references?

2011-11-25 Thread Rob Dixon
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

Re: Can someone explain references?

2011-11-25 Thread John SJ Anderson
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. john,

Re: Can someone explain references?

2011-11-25 Thread Shawn H Corey
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.

Re: Can someone explain references?

2011-11-25 Thread timothy adigun
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 is this:

Re: Can someone explain references?

2011-11-25 Thread Shawn H Corey
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

Re: Can someone explain references?

2011-11-25 Thread John W. Krahn
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

Can someone explain references?

2011-11-24 Thread Mike D
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

Re: Manipulating reference to array of array references

2011-11-21 Thread Rob Dixon
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

Re: Manipulating reference to array of array references

2011-11-21 Thread Mohan L
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 your

Re: Manipulating reference to array of array references

2011-11-20 Thread Rob Dixon
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,undef,

Re: Manipulating reference to array of array references

2011-11-20 Thread Chris Charley
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, ], [

Manipulating reference to array of array references

2011-11-19 Thread Mohan L
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, ], ]; print Dumper

Re: Manipulating reference to array of array references

2011-11-19 Thread Shlomi Fish
Hi Mohan, On Sat, 19 Nov 2011 23:51:19 +0530 Mohan L l.mohan...@gmail.com 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,

Re: Manipulating reference to array of array references

2011-11-19 Thread Dr.Ruud
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

Re: How does grep command compare a hash element with an array ofhash references?

2010-09-26 Thread Dr.Ruud
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

Re: How does grep command compare a hash element with an array of hash references?

2010-09-25 Thread Dr.Ruud
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

Re: How does grep command compare a hash element with an array of hash references?

2010-09-25 Thread John W. Krahn
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

How does grep command compare a hash element with an array of hash references?

2010-09-24 Thread Vaishnavi Saba
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

Re: How does grep command compare a hash element with an array of hash references?

2010-09-24 Thread John W. Krahn
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

Re: How does grep command compare a hash element with an array of hash references?

2010-09-24 Thread Erez Schatz
). 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.org For additional commands, e-mail: beginners-h...@perl.org http

Re: When to use anonymous references

2010-05-01 Thread Peter Scott
On Wed, 28 Apr 2010 01:16:16 -0400, Uri Guttman wrote: PS == Peter Scott pe...@psdt.com 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

Re: When to use anonymous references

2010-04-29 Thread Uri Guttman
PS == Peter Scott pe...@psdt.com 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 wonder what criteria experienced perl hackers have

Re: When to use anonymous references

2010-04-27 Thread Peter Scott
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 array or hash, and when

When to use anonymous references

2010-04-26 Thread Tim Bowden
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 very informal

Re: When to use anonymous references

2010-04-26 Thread Shlomi Fish
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 array or hash, and when to start

references to operators?

2010-04-16 Thread Tim Bowden
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'={

Re: references to operators?

2010-04-16 Thread Shlomi Fish
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'={

Re: references to operators?

2010-04-16 Thread Tim Bowden
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.

Re: Using References in Modules within threads

2010-04-08 Thread Rene Schickbauer
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 ;)

Using References in Modules within threads

2010-04-07 Thread Frenzel, Joerg (ext)
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

Re: Using References in Modules within threads

2010-04-07 Thread Shlomi Fish
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 *

Re: Using References in Modules within threads

2010-04-07 Thread Shawn H Corey
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

Re: Using References in Modules within threads

2010-04-07 Thread Shlomi Fish
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 (though in C/C++,

Re: Using References in Modules within threads

2010-04-07 Thread 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 Windows. It's like trying to

Re: Using References in Modules within threads

2010-04-07 Thread Rene Schickbauer
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

Re: Using References in Modules within threads

2010-04-07 Thread Shawn H Corey
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

RE: Using References in Modules within threads

2010-04-07 Thread Bob McConnell
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

Re: Using References in Modules within threads

2010-04-07 Thread Rene Schickbauer
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

Re: Using References in Modules within threads

2010-04-07 Thread Steve Bertrand
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 the rent. I did say,

Re: Please remove all references in mail archive

2010-01-07 Thread fudmer rieley
of the BGFL stuff from my browsers and computers I would appreciate posting the removal technology, please! --- On Wed, 1/6/10, jay taylor jaytay2...@yahoo.com wrote: From: jay taylor jaytay2...@yahoo.com Subject: Please remove all references in mail archive To: beginners@perl.org Date

Please remove all references in mail archive

2010-01-06 Thread jay taylor
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

Re: Please remove all references in mail archive

2010-01-06 Thread jm
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 find me

Re: Please remove all references in mail archive

2010-01-06 Thread Shawn H Corey
jm wrote: thought 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 end thought good luck with that Please don't feed the trolls. -- Just my 0.0002 million

Re: reference to anonymous array, references last element instead??

2009-11-30 Thread Mark_Galeck
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/

reference to anonymous array, references last element instead??

2009-11-28 Thread Mark_Galeck
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/

Re: reference to anonymous array, references last element instead??

2009-11-28 Thread John W. Krahn
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: $foobar = \bar;

Re: reference to anonymous array, references last element instead??

2009-11-28 Thread John Refior
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 jwkr...@shaw.ca wrote: Mark_Galeck wrote: Why does $foobar = \(foo, bar

Re: reference to anonymous array, references last element instead??

2009-11-28 Thread John Refior
= ['foo', 'bar']; See http://perldoc.perl.org/perlref.html#Making-References . John On Sat, Nov 28, 2009 at 5:53 AM, John W. Krahn jwkr...@shaw.ca wrote: Mark_Galeck wrote: Why does $foobar = \(foo, bar); print $$foobar; print bar ?? Thank you for any insight. Mark Because

reference to anonymous array, references last element instead??

2009-11-28 Thread Mark_Galeck
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/

Issue with references and array slice with one member !

2008-10-31 Thread Amit Saxena
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 the array reference

Re: Issue with references and array slice with one member !

2008-10-31 Thread Chas. Owens
it on a fairly modern Perl interpreter. Perl will throw a warning like Scalar value @a[0] better written as $a[0] at z.pl line 8. It is interesting a warning isn't thrown for references. I shall have to research that. #!/usr/bin/perl use strict; use warnings; my @a = qw/a b c/; print @a[0], \n; All

Re: references and XS

2008-08-31 Thread sisyphus
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 = Config =

references and XS

2008-08-29 Thread Patrick Dupre
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

Re: references and XS

2008-08-29 Thread Rob Dixon
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 to

Re: references and XS

2008-08-29 Thread Patrick Dupre
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

Re: using perl references from subroutine

2008-08-21 Thread Noah
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

Re: using perl references from subroutine

2008-08-20 Thread Raymond Wan
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

Bulk assignment to list of references

2008-08-19 Thread Perry Smith
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

Re: using perl references from subroutine

2008-08-19 Thread Noah
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 =

Re: using perl references from subroutine

2008-08-19 Thread John W. Krahn
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 =

Re: Bulk assignment to list of references

2008-08-19 Thread Perry Smith
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 something involving a postfix

Re: using perl references from subroutine

2008-08-19 Thread Noah
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

Re: using perl references from subroutine

2008-08-18 Thread Mr. Shawn H. Corey
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

Re: code references - how to

2008-06-11 Thread Dermot
2008/6/11 Rob Dixon [EMAIL PROTECTED]: Dermot wrote: Hi All, ..snip So how do you create a code reference in this context, should I create a code reference or use something else and what should I be test the hash values for? Thanx in advance. Dp. #!/usr/bin/perl use strict; use

code references - how to

2008-06-10 Thread Dermot
Hi All, I was have to create a script to search and find files. The files will end in 'a.txt', 'b.txt', 'c.txt', so a record could have 123a.txt, 123b.txt, 123c.txt. There may be lots of ways to achieve my goal but I got curious about how to create a structure that, for each record would store

  1   2   3   4   5   >