getting array elements

S

sam

Hi,

I spent a while to try to get individul element from an array, but
returned nothing. The code I used is:

($transdate,$vendorname,$salesvol,$netsales,$custname,$custcode,
$basename,$prodcode,$salescode,$transtype,$returnreason) = @data;

It might be wrong.
What is the correct syntax for doing that?

Thanks
Sam
 
G

Gunnar Hjalmarsson

sam said:
I spent a while to try to get individul element from an array, but
returned nothing. The code I used is:

($transdate,$vendorname,$salesvol,$netsales,$custname,$custcode,
$basename,$prodcode,$salescode,$transtype,$returnreason) = @data;

It might be wrong.

No, that code looks correct to me. Assuming that @data includes at least
11 elements, all those scalar variables will be assigned the content of
one element each.

Maybe there is some problem in a part of your program that you didn't
show us?

Please follow the posting guidelines for this group:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
J

Jürgen Exner

sam said:
Hi,

I spent a while to try to get individul element from an array, but
returned nothing. The code I used is:

($transdate,$vendorname,$salesvol,$netsales,$custname,$custcode,
$basename,$prodcode,$salescode,$transtype,$returnreason) =
@data;
It might be wrong.
What is the correct syntax for doing that?

This is one way to do it and it looks correct to me.
Did you confirm that @data actually contains any data?

jue
 
A

Anno Siegel

daniel kaplan said:
i realize now why some people are "stuffy" about making sure you post some
full code-snippet. ...

It is nice to see you arrive at this conclusion. How about an apology
to the people you insulted over this very point?

Anno
 
S

Sherm Pendley

Anno said:
It is nice to see you arrive at this conclusion. How about an apology
to the people you insulted over this very point?

I'm not holding my breath waiting for it...

sherm--
 
S

Sherm Pendley

daniel said:
what i "reacted" to was not the requirements but the delivery...

Really? That's not what Google says.

Here's your first few question to this group:

<http://tinyurl.com/4c7ph>
<http://tinyurl.com/63mek>
<http://tinyurl.com/5rzhu>

After that things start going downhill. You asked a non-sensical
question, and were politely pointed to a site that would help you learn
the basics. You responded by stating that you didn't want a tutorial,
because you're a "dive in" kind of guy:

<http://tinyurl.com/53d57>

I could go on - things went rapidly downhill after that. You can claim
whatever you want, but the facts are right there in the archives for
everyone to see: You didn't start collecting flames until *after* you
started acting like a spoiled brat.

Sorry Daniel, but the record speaks for itself.

sherm--
 
S

Sherm Pendley

daniel said:
go and pull (and analyze) whatever you like sherm

What is there to analyze? Your record here speaks for itself.
it's just for my sake, save your typing

It's not for your sake - as far as I knew you weren't even reading my posts.

There are others here who might learn from your mistakes. What you get
out of this group will reflect what you put into it, and your posting
history is proof of that.

Your first few posts here were quite reasonable, and were responded to
in kind. Then when you started copping an attitude, you got spanked for
it. It's all right there in the archives, so pretending it happened the
other way around is pointless.
so if you want to talk perl, great

We *were* talking Perl, until you made your "I realize now why some
people were stuffy ..." comment. You started the off-topic tangent. Not
Anno, not me, *you*. I didn't just dig up your history for fun - I did
so in response to *your* comment, in a thread that *you* started.

Once again, you're getting precisely what you asked for - and once again
you're whining about it. Won't you ever learn???

sherm--
 
S

Sherm Pendley

daniel said:
i will do exactly as i have said, and not waste my time replying to whatever
shots you wish to take

Shots? I'm not taking shots. You made a claim that was false, and I
countered it and posted evidence to back up my statements. No "shots"
there, no hostility - just a discussion.
i will take back the stuffy tho, i should haev said: now i realize why
people are "insistent" about posting code snippets

In the past, you accused people who were so insistent about that of
attacking you. But they weren't; you were asking vague questions with no
code, and people needed to see some code to have any chance of helping
you. But you got angry when they asked for code - and then they got
angry at you in return.

And so it went... it certainly got personal after that, with insults and
flames flying in all directions. But at the core of it all, at the very
beginning, was your perception of a series of personal attacks where
none were intended. You misunderstood, and because of that you posted
some comments that were wholly inappropriate. You owe a lot of people an
apology.

sherm--
 
S

Sherm Pendley

daniel said:
not even going to bother

You're not going to bother apologizing to the people you've insulted?
How rude! Pretty much what I expected though, in light of your past
behavior.

Ah well - maybe someone else can learn from your mistakes, even if
you're not willing to.

sherm--
 
C

Chris Mattern

daniel said:
[stuff]

not even going to bother

For someone who's not even going to bother, you surely seem
determined to have the last world.
--
Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top