Hi,
How can I pass an array to a function and get values back in it??? Here
are excerpts from my code.
sub getTimeInfo
{
my $sec = 0;
my $min = 0;
my $hour = 0;
my $day = 0;
my $mon = 0;
my $year = 0;
my $IsDST = 0;
my $week_day = 0;
my @ti
Satya
I'm not sure why you're getting odd results - I ran the text of your post
under Perl (with no changes) and got
Satya - Dec19 20021219 "12/19/2002","Thursday",
Satya1 - Dec19 : 20021219 : "12/19/2002","Thursday",
which looks fine to me.
The proper way to return arrays from a functi
cc:
Subject: Re: Passing array to a
function
12/19/2002 10:45
On Thu, 19 Dec 2002 11:04:27 -0500, [EMAIL PROTECTED] wrote:
>
> Thank you Sir,
>
> But is it not wrong to create an array in a function and send a reference
> to the array back into the main function?
>
> Because the scope of the array is limit
From: [EMAIL PROTECTED]
>
> On Thu, 19 Dec 2002 11:04:27 -0500, [EMAIL PROTECTED]
> wrote:
> > But is it not wrong to create an array in a function and send a
> > reference to the array back into the main function?
> >
> > Because the scope of the a
]
cc: [EMAIL PROTECTED]
12/19/2002 11:20 Subject: Re: Passing array to a
function
AM
On Thu, Dec 19, 2002 at 03:45:56PM -, Rob Dixon wrote:
> The proper way to return arrays from a function is to pass them by
> reference.
I don't know if I would go that far. There is nothing wrong with
returning a list from a function, but if the list gets too big (handwave
here) then you mi
Satya Devarakonda wrote:
>
> Hi,
Hello,
> How can I pass an array to a function and get values back in it??? Here
> are excerpts from my code.
>
> sub getTimeInfo
> {
> my $sec = 0;
> my $min = 0;
> my $hour = 0;
> my $day = 0;
> my $mon
- Original Message -
From: "Paul Johnson" <[EMAIL PROTECTED]>
Newsgroups: perl.beginners
To: "Rob Dixon" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, December 19, 2002 7:19 PM
Subject: Re: Passing array to a function
> On Thu, De
Hi
My sincere thanks go to all those who answered and are answering my
question about - passing array to a function.
This is my first time on a technical mailing list and so had trouble
expressing my questions.
I started PERL recently and am primarily from a C programming background.
My
> - Original Message -
> From: "Rob Richardson" <[EMAIL PROTECTED]>
> To: "Rob Dixon" <[EMAIL PROTECTED]>
> Sent: Friday, December 20, 2002 1:30 PM
> Subject: Re: Passing array to a function
>
>
> > Rob,
> >
> > OK, I se
"Rob Richardson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Rob,
>
> I will take your word that "$a = (3, 2, 1);" returns 1. I think I was
> thinking of "$a = [3, 2, 1];", in which an anonymous array would be
> created and $a would return 3, the number
Rob Richardson wrote:
>
> I will take your word that "$a = (3, 2, 1);" returns 1. I think I was
> thinking of "$a = [3, 2, 1];", in which an anonymous array would be
> created and $a would return 3, the number of elements in the array.
>
> NOT!!!
>
> The above is what I was going to say when I
L PROTECTED] To: [EMAIL PROTECTED]
am.co.uk>cc:
Subje
On Thu, 19 Dec 2002 17:44:22 +0100, "Jenda Krynicky" <[EMAIL PROTECTED]> wrote:
> From: [EMAIL PROTECTED]
> >
> > On Thu, 19 Dec 2002 11:04:27 -0500, [EMAIL PROTECTED]
> > wrote:
> > > But is it not
From: [EMAIL PROTECTED]
>
> On Thu, 19 Dec 2002 17:44:22 +0100, "Jenda Krynicky"
> <[EMAIL PROTECTED]> wrote:
>
> > This is:
> > sub createClosure {
> > my $x = shift;
> > return sub { print $x++,"\n" }
> > }
> >
> >
16 matches
Mail list logo