Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

spliting (CGI)
could someone tell me what this line means?

$year = (split /:/)[3];

I know
$year = (split /:/); and
$year = (split /:/,$_);
is the same but what is [3] doing there?

Thx...



Report this thread to moderator Post Follow-up to this message
Old Post
Ben Wan
03-19-04 06:25 PM


Re: spliting (CGI)
"Ben Wan" <bwan0425@rogers.com> wrote in message
news:fJ3nb.82132$h61.68549@news01.bloor.is.net.cable.rogers.com...
> could someone tell me what this line means?
>
> $year = (split /:/)[3];
>
> I know
> $year = (split /:/); and
> $year = (split /:/,$_);
> is the same but what is [3] doing there?

Why not try it and find out for free.  Not too difficult to do, and
certainly quicker than waiting for a sarcastic answer.



Report this thread to moderator Post Follow-up to this message
Old Post
Tintin
03-19-04 06:25 PM


Re: spliting (CGI)
In article <bnikhh$11grc4$1@ID-172104.news.uni-berlin.de>, Tintin wrote:
>
>"Ben Wan" <bwan0425@rogers.com> wrote in message
>news:fJ3nb.82132$h61.68549@news01.bloor.is.net.cable.rogers.com... 
>
>Why not try it and find out for free.  Not too difficult to do, and
>certainly quicker than waiting for a sarcastic answer.

Hmmm.  I've never seen that notation before, offhand.  But it's obvious to
me what it does.  It populates $year with the third element of the
resultant array generated by split().

As for the book you got, it's obviously not helping.  Or you're not reading
it.  If you want a good perl book that's comprehensive, I told you, get the
O'Reilley copy of "Programming Perl".  www.oreilley.com/catalog/pperl3/

As for perl web sites...try starting at www.perl.org.  :)

And as for CGI...God, when I learned CGI it was 1994, and I was using
resources off of http://hoohoo.ncsa.uiuc.edu from the Forms Tutorial, along
with demo C source from the NCSA httpd server that predated Apache.

When I learned CGI in perl, I first started with cgi-lib.pl originally, and
then I moved to CGI.pm.  The latter is the way to go, definitely.
`perldoc CGI` and start reading.

And as for perldoc, check in your \perl\bin\ directory.  And yes (sort of),
'man' is generally a unix command.  It's hardly linux-specific.  Hell, you
can have man for windows if you install cygwin.  :)  As it is, you can get
all the man pages out of perldoc, since they're all created from the POD
anyway.  `perldoc perl`  I just use `man` for the main pages because it's
less typing and I'm used to that command for all other unix docs.

--
Vorxion - Member of The Vortexa Elite

Report this thread to moderator Post Follow-up to this message
Old Post
Vorxion
03-19-04 06:25 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL CGI Freelance archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 11:30 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.