[26184] in Perl-Users-Digest
Perl-Users Digest, Issue: 8373 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 31 00:05:28 2005
Date: Tue, 30 Aug 2005 21:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 30 Aug 2005 Volume: 10 Number: 8373
Today's topics:
array question (newbie) <tom@staff.showmeisp.net>
Re: array question (newbie) <simon@unisolve.com.au>
Re: array question (newbie) <someone@example.com>
Re: array question (newbie) <1usa@llenroc.ude.invalid>
Re: Jargons of Info Tech industry <markmcintyre@spamcop.net>
Re: What to expect to pay for website development and m <RemoveThisPrefixmatts2nospam@ix.netcom.com>
Re: What to expect to pay for website development and m <SpamBlocked@tbdata.com>
Re: What to expect to pay for website development and m <cwilbur@chromatico.net>
Re: What to expect to pay for website development and m <me@charlessweeney.com>
Re: What to expect to pay for website development and m <SpamBlocked@tbdata.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 31 Aug 2005 03:49:13 GMT
From: "Jerry Cloe" <tom@staff.showmeisp.net>
Subject: array question (newbie)
Message-Id: <ZM9Re.19164$mb4.2853@tornado.rdc-kc.rr.com>
Having an array:
@mylist=("apples", "oranges", "bananas");
And refering to a particular element, which syntax is correct? (or are both
correct)?
print "Item 2 is $mylist[1]\n";
or
print "Item 2 is @mylist[1]\n";
Both seem to work, and looking at other code, I see it done both ways.
------------------------------
Date: Wed, 31 Aug 2005 13:58:48 +1000
From: Simon Taylor <simon@unisolve.com.au>
Subject: Re: array question (newbie)
Message-Id: <df3a4f$1tgs$1@otis.netspace.net.au>
Hello Jerry,
:
> Having an array:
>
> @mylist=("apples", "oranges", "bananas");
>
> And refering to a particular element, which syntax is correct? (or are both
> correct)?
>
> print "Item 2 is $mylist[1]\n";
> or
> print "Item 2 is @mylist[1]\n";
>
> Both seem to work, and looking at other code, I see it done both ways.
The first is a scalar value, the second is an array slice.
This is a frequently asked question. So you can use the "-q" option of
the perldoc command to dig it up:
Run:
perldoc -q array
and look for the section:
"What is the difference between $array[1] and @array[1]?"
Regards,
Simon Taylor
--
www.perlmeme.org
------------------------------
Date: Wed, 31 Aug 2005 04:03:40 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: array question (newbie)
Message-Id: <w_9Re.220438$HI.16647@edtnps84>
Jerry Cloe wrote:
> Having an array:
>
> @mylist=("apples", "oranges", "bananas");
>
> And refering to a particular element, which syntax is correct? (or are both
> correct)?
>
> print "Item 2 is $mylist[1]\n";
> or
> print "Item 2 is @mylist[1]\n";
>
> Both seem to work, and looking at other code, I see it done both ways.
Put the statement:
use warnings;
at the top of your program and perl will tell you which is correct.
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 31 Aug 2005 04:04:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: array question (newbie)
Message-Id: <Xns96C3B95FFB5asu1cornelledu@127.0.0.1>
"Jerry Cloe" <tom@staff.showmeisp.net> wrote in
news:ZM9Re.19164$mb4.2853@tornado.rdc-kc.rr.com:
> Having an array:
>
> @mylist=("apples", "oranges", "bananas");
Easier to type:
my @mylist = qw(apples oranges bananas);
> And refering to a particular element, which syntax is correct? (or
> are both correct)?
>
> print "Item 2 is $mylist[1]\n";
This is correct.
> or
> print "Item 2 is @mylist[1]\n";
That is an array slice, probably not what you intended.
> Both seem to work,
You don't have warnings enabled. Have you read the posting guidelines
for this group yet?
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Tue, 30 Aug 2005 23:40:28 +0100
From: Mark McIntyre <markmcintyre@spamcop.net>
Subject: Re: Jargons of Info Tech industry
Message-Id: <q0o9h19tcaaqgos623qehcaacbfmj4mm6v@4ax.com>
On 30 Aug 2005 18:06:48 GMT, in comp.lang.c , John Bokma
<john@castleamber.com> wrote:
>Mark McIntyre <markmcintyre@spamcop.net> wrote:
>
>>Its a complete mystery. Just as is the reason why you are x-posting
>>complete garbage to comp.lang.c...
>
>A similar mystery as in why Mark clueless n00b II McIntyre thinks it's a
>good idea to cross post to all other groups except comp.lang.c?
I see you felt it appropriate to RE-post this offtopic garbage back
into clc.
You sir, are a troll, and I'd claim my fiver if I could be arsed.
<plonk>
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Tue, 30 Aug 2005 22:22:21 GMT
From: Matt Silberstein <RemoveThisPrefixmatts2nospam@ix.netcom.com>
Subject: Re: What to expect to pay for website development and maintenance?
Message-Id: <1um9h190fbtlqnd0ph9v9vdhq4jdn3jh9s@4ax.com>
On Tue, 30 Aug 2005 14:04:46 -0300, in alt.www.webmaster , "Norman L.
DeForest" <af380@chebucto.ns.ca> in
<Pine.GSO.3.95.iB1.0.1050830135721.5388A-100000@halifax.chebucto.ns.ca>
wrote:
>
>On Tue, 30 Aug 2005, Marc Bissonnette wrote:
>[snip]
>> LOL. Actually, looking back, I rather ambarassed myself by getting all
>> indignant at the "unhelpful" nature of the regulars in comp.lang.perl.misc.
>>
>> Once I got over myself, though, I realized that the guidelines/FAQs, etc
>> really *do* help one become a better programmer. That, and the fact that
>> more often than not, in figuring out the right *question* to ask, one tends
>> to come up with the right answer, before posting to the ng :)
>[snip]
>
>I remember reading about a university support desk for student programmers
>that had a teddy bear in the reception area. An ironclad rule was that
>any student wanting help with his/her program had to describe the problem
>to the teddy bear in complete detail before asking the actual support
>people. Just describing the problem to the bear was often enough for a
>student to realise where he/she was going wrong. Apparently the teddy
>bear was responsible for solving more than half of the support desk
>enquiries.
More than once I have gone to a colleague with a problem, showed the
code and, in explaining the problem, put my finger directly on the
offending line. One of the unfortunate results of this is that I talk
to myself as I work, hoping that I can then solve the problem.
--
Matt Silberstein
Do something today about the Darfur Genocide
Genocide is news | Be A Witness
http://www.beawitness.org
"Darfur: A Genocide We can Stop"
www.darfurgenocide.org
Save Darfur.org :: Violence and Suffering in Sudan's Darfur Region
http://www.savedarfur.org/
------------------------------
Date: Wed, 31 Aug 2005 00:20:43 +0100
From: "William Tasso" <SpamBlocked@tbdata.com>
Subject: Re: What to expect to pay for website development and maintenance?
Message-Id: <op.swcggtmpm9g4qz-wnt@tbdata.com>
Writing in news:alt.www.webmaster,comp.lang.perl.misc
From the safety of the Church of Last Thursday cafeteria
Matt Silberstein <RemoveThisPrefixmatts2nospam@ix.netcom.com> said:
> ...
> One of the unfortunate results of this is that I talk
> to myself as I work, hoping that I can then solve the problem.
which in itself ensures colleagues give your work-space a wide berth
resulting in plenty peace & quiet.
--
William Tasso
** Business as usual
------------------------------
Date: Tue, 30 Aug 2005 19:14:42 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: What to expect to pay for website development and maintenance?
Message-Id: <m21x4bggpp.fsf@ubiquity.chromatico.net>
>>>>> "NLD" == Norman L DeForest <af380@chebucto.ns.ca> writes:
NLD> I remember reading about a university support desk for
NLD> student programmers that had a teddy bear in the reception
NLD> area. An ironclad rule was that any student wanting help
NLD> with his/her program had to describe the problem to the teddy
NLD> bear in complete detail before asking the actual support
NLD> people. Just describing the problem to the bear was often
NLD> enough for a student to realise where he/she was going wrong.
NLD> Apparently the teddy bear was responsible for solving more
NLD> than half of the support desk enquiries.
I have a stuffed tiger currently employed in this capacity, and he's
*very* good. He had no trouble when I started working in Objective-C,
though PHP seemed to baffle him regularly when I was working that
contract.
When I was an undergraduate, I frequently used computer science
professors instead, and while they appreciated being helpful, they had
other things to do than stand there and have a problem explained to
them until I realized what I was doing wrong.
The discipline of producing the shortest program that demonstrates the
problem is also helpful, especially before asking a newsgroup for
help. Even if you don't work out what the problem is in the process,
the people offering help in the newsgroup will be much happier reading
through 20 lines of code than 2000.
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
Date: 30 Aug 2005 23:29:22 GMT
From: Charles Sweeney <me@charlessweeney.com>
Subject: Re: What to expect to pay for website development and maintenance?
Message-Id: <Xns96C350CA587Emecharlessweeneycom@130.133.1.4>
William Tasso wrote
> Writing in news:alt.www.webmaster,comp.lang.perl.misc
> From the safety of the No thank you cafeteria
> Charles Sweeney <me@charlessweeney.com> said:
>> I find that myself. Asking the question (as if you were asking
>> another person) very often produces the answer.
>
> Every good cop needs a side-kick - just so the audience can keep up
> with the plot :)
lol...the reveal...I think that's what they call it.
--
Charles Sweeney
http://CharlesSweeney.com
------------------------------
Date: Wed, 31 Aug 2005 00:31:48 +0100
From: "William Tasso" <SpamBlocked@tbdata.com>
Subject: Re: What to expect to pay for website development and maintenance?
Message-Id: <op.swcgzavjm9g4qz-wnt@tbdata.com>
Writing in news:alt.www.webmaster,comp.lang.perl.misc
From the safety of the Samuel Eells Crisis Management cafeteria
Charlton Wilbur <cwilbur@chromatico.net> said:
> ...
> The discipline of producing the shortest program that demonstrates the
> problem is also helpful, especially before asking a newsgroup for
> help.
<aol />
Please have that framed/stuffed/mounted and placed over the fireplace.
> Even if you don't work out what the problem is in the process,
> the people offering help in the newsgroup will be much happier reading
> through 20 lines of code than 2000.
indeed.
--
William Tasso
** Business as usual
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8373
***************************************