GetDotted Domains

Viewing Thread:
"Perl: Adding to an Array"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Tue 09/09/03 at 16:18
Regular
Posts: 10,437
I've recently started learning Perl but I'm not sure how to add to an array instead of simply assigning values to it.

Say I have a loop, and each time I want to add an element to an array, I do something like this:

(@array)=$string;

But when i do that it simply returns with the last value I assigned to the array.

Any ideas?
Tue 09/09/03 at 17:28
Regular
"Devil in disguise"
Posts: 3,151
A few ways to add to an array in perl, but I guess you'll want to use:

push(@array,$string);
Tue 09/09/03 at 16:18
Regular
Posts: 10,437
I've recently started learning Perl but I'm not sure how to add to an array instead of simply assigning values to it.

Say I have a loop, and each time I want to add an element to an array, I do something like this:

(@array)=$string;

But when i do that it simply returns with the last value I assigned to the array.

Any ideas?

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!
My website looks tremendous!
Fantastic site, easy to follow, simple guides... impressed with whole package. My website looks tremendous. You don't need to be a rocket scientist to set this up, Freeola helps you step-by-step.
Susan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.