Solved

Is this the same

Posted on 2001-06-16
1
194 Views
Last Modified: 2010-03-05
In:
http://www.perl.com/pub/doc/manual/html/pod/perldata.html
I think I read the following.

Is $row[-1] the same then $#row??

I tried it without success!

Michel
0
Comment
Question by:mmcw
1 Comment
 
LVL 5

Accepted Solution

by:
amandeep earned 50 total points
ID: 6198657
mmcw,

- $row[-1] means the value of the last element in the arrar @row.
- $#row means the last element number of the array @row.

Hence :

print $row[-1];

and

print $row[$#row];

would give the same result.

Hope this helps.
:-)
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl strange behaviour 5 71
Perl troubleshooting error. Base64 bootstrap parameter 5 69
unable to remove invisible characters with perl 2 84
Convert grep lines to perl 6 36
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question