Re: References

2014-05-14 Thread shawn wilson
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 dimensions to them (a

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-and-array

Re: References

2014-05-14 Thread Shlomi Fish
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, Shlomi Fis

Re: References

2014-05-13 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 ex

Re: References

2014-05-13 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 wrote: > 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

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: 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 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 => Confi

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: 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

RE: references to complex data structures

2008-01-15 Thread Kevin Viel
> -Original Message- > From: Rob Dixon [mailto:[EMAIL PROTECTED] > Sent: Monday, January 14, 2008 8:59 PM > To: beginners@perl.org > Cc: Kevin Viel > Subject: Re: references to complex data structures > > Kevin Viel wrote: > > Consider the following anony

Re: references to complex data structures

2008-01-14 Thread Rob Dixon
Kevin Viel wrote: Consider the following anonymous array of anonymous arrays: my $a = [ [ 00 , 01 ] , [ 10 , 11 ] ] ; I can print the first element of the first anonymous array: print "$$a[ 0 ][ 0 ]\n" ; or, equivalently, I can explicit use bracers to dereference it: print "$

Re: references to complex data structures

2008-01-14 Thread Gunnar Hjalmarsson
Kevin Viel wrote: Consider the following anonymous array of anonymous arrays: my $a = [ [ 00 , 01 ] , [ 10 , 11 ] ] ; I can print the first element of the first anonymous array: print "$$a[ 0 ][ 0 ]\n" ; or, equivalently, I can explicit use bracers to dereference it: print "$

Re: References inquiry

2007-05-10 Thread Tom Phoenix
On 5/10/07, Steve Finkelstein <[EMAIL PROTECTED]> wrote: I'm looking at some sample code from an opensource software package, and had a question on the the usage of '\' in the following: username => \ &common_name_validator There is an explicit space list between \ and &com

Re: references

2005-11-24 Thread Eric Pretorious
On Thu, 2005-11-24 at 11:18 -0600, The Ghost wrote: > Is there a way I can know if a variable ($hash{someKey}) is an array > or an arrayref or hashref or scalar? > I could use eval, but I thought I remember there was some other > function for doing this. >From the third edition of "Programming

Re: references

2005-11-24 Thread John Doe
The Ghost am Donnerstag, 24. November 2005 18.18: > Is there a way I can know if a variable ($hash{someKey}) is an array > or an arrayref or hashref or scalar? > I could use eval, but I thought I remember there was some other > function for doing this. Yes, perldoc -f ref :-) greetings, joe --

Re: References Question

2005-08-19 Thread Rex Rex
In Perl, my($array, @array, %array); open(ARRAY, ">file.txt"); opendir(ARRAY, "C:/DIR"); are all different. They are not the same. Thanks, Rex On 8/19/05, Dave Adams <[EMAIL PROTECTED]> wrote: > Dan, > > It appears the $apple->[2] and $apple[2] are not the same thing. > > > #!/usr/bin/perl -

Re: References Question

2005-08-19 Thread Jeff 'japhy' Pinyan
On Aug 19, Dave Adams said: In the code below, I thought $array[2] and $array->[2] were different but they give me the same result. Any explaination for this? my @array = (1,2,3); my $array [EMAIL PROTECTED]; print ref($array); print $array[2]; print $array->[2]; The constructs $this[2] and

Re: References Question

2005-08-19 Thread Dave Adams
Dan, It appears the $apple->[2] and $apple[2] are not the same thing. #!/usr/bin/perl -w use strict; my $apple = [4,5,6]; #example of a scalar representing an array print ref($apple) . $apple->[2] . "\n"; print ref($apple) . $apple[2] . "\n"; errror msg: Global symbol "@apple" requires expl

Re: References Question

2005-08-19 Thread Octavian Rasnita
This is because you gave the same name to the array and to the scalar variables. $array[2] means the third element of @array. $array->[2] refers to the element from $array reference. Teddy - Original Message - From: "Dave Adams" <[EMAIL PROTECTED]> To: "beginners perl" Sent: Friday, A

RE: References

2005-06-13 Thread Bob Showalter
radhika wrote: > > You could do it like this: > > > > while (@row = fetchrow_array()) { > >push @$perl, { > > TRADE_DATE => $row[0], > > TRADE_TIME => $row[1], > > FIRSTNAME => $row[2], > > LASTNAME=> $row[3], > >

RE: References

2005-06-13 Thread radhika
> > You could do it like this: > > while (@row = fetchrow_array()) { >push @$perl, { > TRADE_DATE => $row[0], > TRADE_TIME => $row[1], > FIRSTNAME => $row[2], > LASTNAME=> $row[3], > EXCHANGE=> $

RE: References

2005-06-13 Thread Bob Showalter
radhika wrote: > Hi, > > I am trying to create this data structure as below: > > $perl = [ > { > fname => 'Fred', > lname => 'Flintstone', > residence => 'Bedrock' > }, > { > fname => '

RE: References and subroutine ?

2005-04-22 Thread Charles K. Clarkson
Michael Gale wrote: : I am passing the reference of an to the subroutine, which using : (shift) assigns the first scaler to my scaler array_ref. So now : array_ref scaler is equal to the passed scaler allowing me to use : array_ref as a reference. : : Correct ? Ye

Re: References to anon array

2004-10-05 Thread John W. Krahn
Adam wrote: I am expecting in both examples the same result: Example1: the same references Example2: the same references However, I get: Example1: different references Example2: the same references What am I missing? #Example1 my $r1 = [1, 3]; Store a reference to an anonymous array in a scalar. my

RE: references and freeing memory

2004-06-04 Thread Wiggins d Anconia
> >> The perlref docs state "Hard references are smart--they keep track of > >> reference counts for you, automatically freeing the thing referred to > >> when its reference count goes to zero." My interpretation of this is > >> that when a reference goes out of scope the memory used by > >> the

RE: references and freeing memory

2004-06-04 Thread Freimuth,Robert
>> The perlref docs state "Hard references are smart--they keep track of >> reference counts for you, automatically freeing the thing referred to >> when its reference count goes to zero." My interpretation of this is >> that when a reference goes out of scope the memory used by >> the referent i

RE: references and freeing memory

2004-06-04 Thread Tim Johnson
Yes and no. From what I understand (and someone please correct me if I'm wrong), the memory is freed in the sense that it is returned to Perl, but it is not returned to your system. Once there are no references to a variable, the memory can be overwritten by future variables used in your program

Re: references

2004-03-25 Thread Joe Mecklin
On Wed, 2004-03-24 at 15:08, Wiggins d Anconia wrote: > > i know this should be a simple step or two that i'm missing, and i > > haven't been able to figure it out from reading yet... > > > > i have the following code: > > > > $sth = $mysql_dbh->prepare("select subroutine_pointer from > > $da

Re: references

2004-03-24 Thread Wiggins d Anconia
> i know this should be a simple step or two that i'm missing, and i > haven't been able to figure it out from reading yet... > > i have the following code: > > $sth = $mysql_dbh->prepare("select subroutine_pointer from > $database.equipment_manufacturer where > manufacturer=\"$remedy_eqp

RE: references

2004-03-24 Thread Guay Jean-Sébastien
Hello Joe, > i have the following code: > > $sth = $mysql_dbh->prepare("select subroutine_pointer from > $database.equipment_manufacturer where > manufacturer=\"$remedy_eqpt_mfgr\""); > $sth->execute(); > $subroutine_pointer = $sth->fetchrow_array(); > no strict "refs"; >

Re: references and objects

2003-11-16 Thread R. Joseph Newton
angie ahl wrote: > Hi everyone > > I'm failing to find something in the manuals (or at least the bit I'm > missing ;) > > I have an package called "Event" > > in it I have a subroutine called EventList > > sub EventList { > my ($class, %arg) = @_; > # load of code here > return ([EMAIL

Re: references and objects

2003-11-16 Thread Steve Grazzini
On Sun, Nov 16, 2003 at 11:42:48AM -0500, Hacksaw wrote: >> Pettiness says that you mean the package is a /class/ :) > > That's pedantism. ;-) It's "pedantry". :-) -- Steve -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: references and objects

2003-11-16 Thread Hacksaw
>Pettiness says that you mean the package is a /class/ :) That's pedantism. ;-) BTW, mail to [EMAIL PROTECTED] bounced. -- Establish the principle. http://www.hacksaw.org -- http://www.privatecircus.com -- KB1FVD -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: references and objects

2003-11-16 Thread Rob Dixon
Angie Ahl wrote: > > Sorry I forgot to mention that the package IS an object ;) Pettiness says that you mean the package is a /class/ :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: references and objects [Solved]

2003-11-15 Thread drieux
On Friday, Nov 14, 2003, at 07:19 US/Pacific, angie ahl wrote: [..] I changed my code so the variables aren't references; sub EventList { my ($class, %arg) = @_; # load of code here return ([EMAIL PROTECTED], $startdate, $enddate); } And then called it like so: my @tempres = $event->

Re: references and objects

2003-11-14 Thread Jeff 'japhy' Pinyan
On Nov 14, angie ahl said: >I want to return an array and 2 scalars. Well, you're returning an array reference and two scalar references. I don't think the scalars need to be referenced, but I would probably keep the array reference. >sub EventList { >my ($class, %arg) = @_; ># load of

Re: references and objects

2003-11-14 Thread Steve Grazzini
On Fri, Nov 14, 2003 at 11:40:51AM +, angie ahl wrote: > I want to return an array and 2 scalars. > > sub EventList { > my ($class, %arg) = @_; > # load of code here > return ([EMAIL PROTECTED], \$startdate, \$enddate); > } > > So far so good (I think) You're actually returning r

Re: references and objects [Solved]

2003-11-14 Thread angie ahl
I changed my code so the variables aren't references; sub EventList { my ($class, %arg) = @_; # load of code here return ([EMAIL PROTECTED], $startdate, $enddate); } And then called it like so: my @tempres = $event->EventList(skip=>0, max=>10); my $EventList = @tempres[0]; m

Re: references and objects

2003-11-14 Thread angie ahl
Sorry I forgot to mention that the package IS an object ;) on 14/11/03 angie ahl said: >Hi everyone > >I'm failing to find something in the manuals (or at least the bit I'm >missing ;) > >I have an package called "Event" > >in it I have a subroutine called EventList > >I want to return an array a

Re: References...

2003-06-11 Thread R. Joseph Newton
Hamish Whittal wrote: > Thanks Rob, this has been very helpful. I wanted to know why the second > form is an abuse of perl. Since I'm new to perl, it is helpful to kn ow > what is good programming practise. Because it adds characters and notation that serve no purpose, which serves no purpose. T

Re: References...

2003-06-11 Thread Hamish Whittal
Thanks Rob, this has been very helpful. I wanted to know why the second form is an abuse of perl. Since I'm new to perl, it is helpful to kn ow what is good programming practise. Tx. H On Tue, 2003-06-10 at 15:39, Rob Dixon wrote: > Hamish Whittal wrote: > > Hi All, > > > > I'm still a little con

Re: References...

2003-06-10 Thread Saurabh Singhvi
> > .co.uk> cc: > >

Re: References...

2003-06-10 Thread Rob Dixon
Scott E Robinson wrote: > Hey, Rob, thanks! That was really useful. Just from sitting in the > background, reading these posts, I learn a lot. Great. That's the way it's supposed to work! Cheers, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Re: References...

2003-06-10 Thread scott . e . robinson
AIL PROTECTED] .co.uk> cc: Subject:

Re: References...

2003-06-10 Thread Rob Dixon
Hamish Whittal wrote: > Hi All, > > I'm still a little confused... > What is the difference between > %{$config_file->{$key}} Here, $config_file is a hash reference. If you print it it will display something like HASH(0x12345678) The hash it refers to is accessed by the value in $key, so if y

RE: References...

2003-06-10 Thread Rai,Dharmender
They may behave sometimes (depending on the value part of the referenced hash) but still they are different. > -- > From: Rob Anderson[SMTP:[EMAIL PROTECTED] > Sent: Tuesday, June 10, 2003 5:58 PM > To: [EMAIL PROTECTED] > Subject: Re: References...

Re: References...

2003-06-10 Thread Rob Anderson
Hi Hamish, You might well ask, "what's the difference between... print 1 + 2 * 3; ...or... print 1 + (2 * 3); ...?" The answer to this, and to your question is, not a lot. Sometimes you do need to add parenthesis to resolve ambiguities over what's dereferencing waht, but in your case you, m

RE: References

2003-01-29 Thread Brian Ling
Thanks for that Rob, Jenda I hadn't realized you could do that with the hash value, Easy when someone shows you. Brian :-) -Original Message- From: Rob Dixon [mailto:[EMAIL PROTECTED]] Sent: 29 January 2003 16:10 To: [EMAIL PROTECTED] Subject: Re: References Brian Ling wrote:

Re: References

2003-01-29 Thread Rob Dixon
Brian Ling wrote: > Hi list, > > The following code fragment works but has a horrible feel about it, > can anyone suggest ways to improve it. > > The data structure is generated by an XML parser. > > for ( keys %{$parsed_data->{value}->{NetworkServices}->{value}} ) { > if ( > $parsed_data->

Re: References

2003-01-29 Thread Jenda Krynicky
From: "Brian Ling" <[EMAIL PROTECTED]> > The following code fragment works but has a horrible feel about it, > can anyone suggest ways to improve it. > > The data structure is generated by an XML parser. > > for ( keys %{$parsed_data->{value}->{NetworkServices}->{value}} ) { > if ( > $par

Re: References ch 8 programming Perl

2003-01-09 Thread Randal L. Schwartz
> "John" == John W Krahn <[EMAIL PROTECTED]> writes: John> "Randal L. Schwartz" wrote: >> >> (In the past week, I just finished writing this stuff up for my next >> book... see the bookshelves in six months or so.) John> Does it have a title yet? Will there be an animal on the cover? :-)

Re: References ch 8 programming Perl

2003-01-08 Thread david
Randal L. Schwartz wrote: > > (In the past week, I just finished writing this stuff up for my next > book... see the bookshelves in six months or so.) > is the book going to be focus to a certain topics (such as reference, OO, etc) in Perl or is it going to be a general one? david -- To uns

Re: References ch 8 programming Perl

2003-01-08 Thread David Eason
Great explanation as usual, sir. I am looking forward to reading your next book, and good luck with everything. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: References ch 8 programming Perl

2003-01-08 Thread John W. Krahn
"Randal L. Schwartz" wrote: > > (In the past week, I just finished writing this stuff up for my next > book... see the bookshelves in six months or so.) Does it have a title yet? Will there be an animal on the cover? :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMA

Re: References ch 8 programming Perl

2003-01-08 Thread Randal L. Schwartz
> "David" == David Eason <[EMAIL PROTECTED]> writes: David> I am not as knowledgeable about such things as you guys, but.. David> Isn't an anonymous array the same thing as an array literal? No. :-) Well, for one thing, there's no such thing as an array literal. So that's like saying "aren'

Re: References ch 8 programming Perl

2003-01-08 Thread David Eason
I am not as knowledgeable about such things as you guys, but.. Isn't an anonymous array the same thing as an array literal? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: References ch 8 programming Perl

2003-01-06 Thread Dan Muey
ssage- From: Todd Wade [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 04, 2003 4:00 PM To: [EMAIL PROTECTED] Subject: Re: References ch 8 programming Perl "John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... My thoughts on

Re: References ch 8 programming Perl

2003-01-04 Thread Todd Wade
"John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... My thoughts on perl references. This code: > foreach $file(@files) { > > open file... > @$file = ; > close file... > } creates named arrays via symbolic references. [trwww@devel_rh trwww]$ perl $s

Re: References ch 8 programming Perl

2003-01-04 Thread Rob Dixon
Hi John. See in-line. "John W. Krahn" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Paul Johnson wrote: > > > > I am saying that an anonymous array has no name, but it can be accessed > > via a reference to it. > > In that case the reference name is its name

Re: References ch 8 programming Perl

2003-01-04 Thread Paul Johnson
On Sat, Jan 04, 2003 at 04:58:45AM -0800, John W. Krahn wrote: > Paul Johnson wrote: > > I am saying that an anonymous array has no name, but it can be accessed > > via a reference to it. > > In that case the reference name is its name OK. This is where we disagree. I believe that you are mist

Re: References ch 8 programming Perl

2003-01-04 Thread John W. Krahn
Paul Johnson wrote: > > On Fri, Jan 03, 2003 at 06:32:10PM -0800, John W. Krahn wrote: > > > > You are saying that it has no name but it does: arrayref. If it truly > > had "no name" then there would be no way to access it anywhere else in > > the program. > > I am saying that an anonymous array

Re: References ch 8 programming Perl

2003-01-04 Thread Rob Dixon
Hi Dan (again) See in-line. "Dan Muey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Another thing I use a lot is to take form input and build sql queries based on what is input for instance > Say I want to search a table withh twenty columns > If I have a f

Re: References ch 8 programming Perl

2003-01-04 Thread Rob Dixon
Hi Dan, all I want to pull together the two subthreads and reply to them jointly. I can't, so I'm replying to this one and leaving it to you to make the association with the 'what is/isn't an anonynous array' discussion. See in-line. "Dan Muey" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECT

Re: References ch 8 programming Perl

2003-01-04 Thread Paul Johnson
On Fri, Jan 03, 2003 at 06:32:10PM -0800, John W. Krahn wrote: > Paul Johnson wrote: > > > > On Fri, Jan 03, 2003 at 03:33:30PM -0800, John W. Krahn wrote: > > > Paul Kraus wrote: > > > > > > > > Ok a couple questions on Ref from pg 251 programming Perl. > > > > > > > > push @$arrrayref,$filename)

Re: References ch 8 programming Perl

2003-01-03 Thread John W. Krahn
Paul Johnson wrote: > > On Fri, Jan 03, 2003 at 03:33:30PM -0800, John W. Krahn wrote: > > Paul Kraus wrote: > > > > > > Ok a couple questions on Ref from pg 251 programming Perl. > > > > > > push @$arrrayref,$filename); > > > $$arrayref[0]="January"; > > > @$arrayref[4..6]=qw/May June July/; > >

Re: References ch 8 programming Perl

2003-01-03 Thread Paul Johnson
On Fri, Jan 03, 2003 at 03:33:30PM -0800, John W. Krahn wrote: > Paul Kraus wrote: > > > > Ok a couple questions on Ref from pg 251 programming Perl. > > > > push @$arrrayref,$filename); > > $$arrayref[0]="January"; > > @$arrayref[4..6]=qw/May June July/; > > > > So this is actually creating an

Re: References ch 8 programming Perl

2003-01-03 Thread John W. Krahn
Paul Kraus wrote: > > Ok a couple questions on Ref from pg 251 programming Perl. > > push @$arrrayref,$filename); > $$arrayref[0]="January"; > @$arrayref[4..6]=qw/May June July/; > > So this is actually creating an anonymous array that it then references > correct? > so the assignments January e

RE: References ch 8 programming Perl

2003-01-03 Thread wiggins
Surprised no one has mentioned it, but the complete foundation of Object Oriented Perl is based on the ability to bless a referent into a particular namespace. So obviously once/if you get into OOP references play a major role. Along these lines is the ability to pass multiple different types o

RE: References ch 8 programming Perl

2003-01-03 Thread Dan Muey
will creep in and is just big and ugly Anywho hope that helps Dan -Original Message- From: Dan Muey Sent: Friday, January 03, 2003 3:17 PM To: Perl Subject: RE: References ch 8 programming Perl I use anonymouse variables all the time. Basically in dynamic database applications. It ma

RE: References ch 8 programming Perl

2003-01-03 Thread Dan Muey
I use anonymouse variables all the time. Basically in dynamic database applications. It makes very complicated things a bit easier : @files = `ls /home/user`; foreach $file(@files) { open file... @$file = ; close file... } Open fileto contrain contents of all f

RE: References ch 8 programming Perl

2003-01-03 Thread Kipp, James
> push @$arrrayref,$filename); > $$arrayref[0]="January"; > @$arrayref[4..6]=qw/May June July/; > > So this is actually creating an anonymous array that it then > references > correct? > so the assignments January ect are being made to an anonymous array. Yes > > This is cool but maybe I am

Re: references in perl...

2002-12-06 Thread Jeff 'japhy' Pinyan
On Dec 6, christopher j bottaro said: >i'm a c/c++ programmer trying to learn perl. there are just some things that >are much more easily done in a language like perl than in c/c++ i've found >out...=) anyways, i'm reading a short tutorial about references. am i wrong >in thinking they are like

Re: references in perl...

2002-12-06 Thread christopher j bottaro
cool thanks. and yes i'm reading perlreftut but not perlref. perlref looks a bit too exhaustive for my purposes now. perhaps in the future when i become more advanced in the ways of perl. and Timothy, yeah i'm sure there are difference of course, but i guess i was asking very generally if it

RE: references in perl...

2002-12-06 Thread wiggins
On Fri, 6 Dec 2002 13:57:33 -0600, christopher j bottaro <[EMAIL PROTECTED]> wrote: > hello, > i'm a c/c++ programmer trying to learn perl. there are just some things that > are much more easily done in a language like perl than in c/c++ i've fou

RE: references in perl...

2002-12-06 Thread Timothy Johnson
Yes and no. I think that if you understand the concept of pointers, then you will be able to understand references more easily, but from what keep hearing from c/c++ people, there are differences. Perhaps someone else on the list can clarify more. One thing that Perl can do with references that

Re: References

2002-11-27 Thread John W. Krahn
Marija Silajev wrote: > > Hi, Hello, > What I am trying to do is just to understand better why do I get an > error message. > Actually I use Net::Netmask module, and there I simply just do as the > README file says. > > $block =new Net::Netmask ($network_block); > > $table = {}; > > $block ->

Re: References

2002-11-27 Thread Rob Dixon
[EMAIL PROTECTED]> Sent: Wednesday, November 27, 2002 4:37 PM Subject: Re: References > Yikes, see inline. > > > > On Wed, 27 Nov 2002 16:02:49 +0100, Marija Silajev <[EMAIL PROTECTED]> wrote: > > > Hi, > >

Re: References

2002-11-27 Thread wiggins
Yikes, see inline. On Wed, 27 Nov 2002 16:02:49 +0100, Marija Silajev <[EMAIL PROTECTED]> wrote: > Hi, > > > What I am trying to do is just to understand better why do I get an > error message. > Actually I use Net::Netmask module, and there I

Re: References

2002-11-27 Thread Marija Silajev
Hi, What I am trying to do is just to understand better why do I get an error message. Actually I use Net::Netmask module, and there I simply just do as the README file says. $block =new Net::Netmask ($network_block); $table = {}; $block -> storeNetblock([$table]); and than comes an error:

Re: References

2002-11-27 Thread Rob Dixon
Hi Marija. {} and [] create an empty anonymous array and hash, respectively. Their value is a reference to the structure they have created. So: $table = {} Creates an empty hash and stores a reference to it in $table. Thereafter you can access and manipulate it by: $table->{key} = 'valu

RE: References

2002-11-27 Thread Kipp, James
> > > Hi, > > If you write something like : > > $table = {}; > > is that hash reference? what do you actually initialize? yes, that makes an an anonymous hash reference. > > and than: > > somefunction([$table]) > > what is than[$table]? what is it you are trying to do? do you j

RE: References

2002-11-27 Thread wiggins
Mandatory reading ;-)... perldoc perlreftut perldoc perlref See inline. On Wed, 27 Nov 2002 14:30:52 +0100, Marija Silajev <[EMAIL PROTECTED]> wrote: > Hi, > > If you write something like : > > $table = {}; > > is that hash reference? what do

Re: references and printing

2002-11-18 Thread John W. Krahn
Todd W wrote: > > John W. Krahn wrote: > > Paul wrote: > > > >>--- Julien Motch <[EMAIL PROTECTED]> wrote: > >> > >>>#The next line printsd the reference why ? > >>>print("the host which you are connecteed to is $pop->Host()\n"); # > >>>Mail::POP3Client=HASH(0x8153a8c)->Host() > >> > >>Inside the

Re: references and printing

2002-11-18 Thread Todd W
John W. Krahn wrote: Paul wrote: --- Julien Motch <[EMAIL PROTECTED]> wrote: #The next line printsd the reference why ? print("the host which you are connecteed to is $pop->Host()\n"); # Mail::POP3Client=HASH(0x8153a8c)->Host() Inside the quotes, the -> operator is taken as printable chara

Re: references and printing

2002-11-14 Thread John W. Krahn
Paul wrote: > > --- Julien Motch <[EMAIL PROTECTED]> wrote: > > #The next line printsd the reference why ? > > print("the host which you are connecteed to is $pop->Host()\n"); # > > Mail::POP3Client=HASH(0x8153a8c)->Host() > > Inside the quotes, the -> operator is taken as printable characters.

Re: references and printing

2002-11-14 Thread John W. Krahn
Julien Motch wrote: > > Hi , Hello, > There is one thing I could not explain about printing references . > Take this little program : > > #!/usr/bin/perl > use Mail::POP3Client; > > $pop = new Mail::POP3Client(HOST => "pop.skynet.be"); > > print $pop->Host(); #OK print pop.skynet.be >

Re: references and printing

2002-11-14 Thread Paul
--- Julien Motch <[EMAIL PROTECTED]> wrote: > #The next line printsd the reference why ? > print("the host which you are connecteed to is $pop->Host()\n"); # > Mail::POP3Client=HASH(0x8153a8c)->Host() Inside the quotes, the -> operator is taken as printable characters. Just take the method call o

Re: references

2002-09-17 Thread Chas Owens
On Tue, 2002-09-17 at 17:35, Colin wrote: > Hi, > > If you happen to read this, please could you leave the adress of the site where you >learnt perl, or the best site concerning perl that you have seen? > > Thanks a lot > > Colin > > ps. if you can't rember the adress of-hand, don't bother sp

RE: references and dereferencing

2002-06-06 Thread Bryan R Harris
Thanks, Jeff. Now I understand why I thought the Perl compiler was excessively chatty. =) - B __ On Jun 6, Bryan R Harris said: >1. What is a sigil? Consult your nearest dictionary. Sigil == symbol. >2. I like to make little reference pages for myself, do these terms lo

RE: references and dereferencing

2002-06-06 Thread Timothy Johnson
Ok. Tim would have got it, but the Tim interpreter, tim, still has some bugs to work out. -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 12:56 PM To: Timothy Johnson Cc: Bryan R Harris; [EMAIL PROTECTED] Subject: RE: refe

RE: references and dereferencing

2002-06-06 Thread Jeff 'japhy' Pinyan
On Jun 6, Timothy Johnson said: >"If $x = \\"bar", >then $$x returns a reference (to "bar") which is a scalar, but certainly >NOT a string." > >How is "bar" not a string? You've misparsed my use of parentheses here. If $x = \\"bar", then $$x returns a reference which is a scalar, but cert

RE: references and dereferencing

2002-06-06 Thread Timothy Johnson
' Pinyan [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 12:45 PM To: Bryan R Harris Cc: [EMAIL PROTECTED] Subject: RE: references and dereferencing On Jun 6, Bryan R Harris said: >1. What is a sigil? Consult your nearest dictionary. Sigil == symbol. >2. I like to make

RE: references and dereferencing

2002-06-06 Thread Jeff 'japhy' Pinyan
On Jun 6, Bryan R Harris said: >1. What is a sigil? Consult your nearest dictionary. Sigil == symbol. >2. I like to make little reference pages for myself, do these terms look >right? I'd suggest scouring perlreftut and perlref. ># GETTING POINTERS Stop using the word "pointer" right now.

RE: references and dereferencing

2002-06-06 Thread Bryan R Harris
I'm starting to get this... A couple more questions: 1. What is a sigil? 2. I like to make little reference pages for myself, do these terms look right? # pointers are scalars # GETTING POINTERS \$mystring; # returns a pointer to mystring \@myarray;# returns a pointer to myar

RE: references and dereferencing

2002-06-06 Thread Jeff 'japhy' Pinyan
On Jun 6, Nikola Janceski said: >is there a difference between: > >@{ $HASH{$key} } = @array; >$HASH{$key} = \@array; Yes. The first overwrites everything currently contained in the array reference $HASH{$key}; the second merely creates a new array reference, and binds it @array. Watch: my

RE: references and dereferencing

2002-06-06 Thread Nikola Janceski
One last question: is there a difference between: @{ $HASH{$key} } = @array; $HASH{$key} = \@array; ?? I really appreciate the references lesson! 8^) - Nik The views and opinions expressed in th

RE: references and dereferencing

2002-06-06 Thread Jeff 'japhy' Pinyan
On Jun 6, Nikola Janceski said: >$$onediminsional_hash_ref{$key} >@$onediminsional_array_ref[$index] The leading sigil denotes the amount of stuff being returned, NOT the data structure being worked with! It is the {} and [] that determine the data structure. @ARRAY = (1 .. 10); $x = \@ARR

RE: references and dereferencing

2002-06-06 Thread Nikola Janceski
dex] I guess it doens't work with multidimensional data structures? > -Original Message- > From: Jenda Krynicky [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 06, 2002 11:42 AM > To: Beginners (E-mail) > Subject: Re: references and dereferencing > > &

Re: References

2002-04-22 Thread Felix Geerinckx
on Mon, 22 Apr 2002 06:18:01 GMT, [EMAIL PROTECTED] (Hans Holtan) wrote: > Hi folks, > The code shown bellow is supposed to de-reference a hash-reference > of array-references and print everything out nicely. But the array > references do not get de-referenced. I really appreciate the > help. T

  1   2   >