- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Array restrictions with set -A
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2003 10:19 PM
тАО10-12-2003 10:19 PM
Array restrictions with set -A
Is my assumption true, and is there any way of increasing the array subscript, or any alternative methods
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2003 10:23 PM
тАО10-12-2003 10:23 PM
Re: Array restrictions with set -A
If you want more, you are either going to handle two arrays (which could get quite nasty) or start again with perl :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2003 10:27 PM
тАО10-12-2003 10:27 PM
Re: Array restrictions with set -A
"
The value of all subscripts must be in the range of 0 through 1023
"
You could try another shell.
/usr/dt/bin/dtksh is pretty high-powered, although I haven't checked it out.
Awk would be ok - it's array subscripts are strings, and so can be anything.
-- Graham
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2003 01:16 AM
тАО10-13-2003 01:16 AM
Re: Array restrictions with set -A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-13-2003 03:02 AM
тАО10-13-2003 03:02 AM
Re: Array restrictions with set -A
However, though it is true that generally, if not told otherwise, Perl will do floating point arithmetics it is safeguarding against insensible input and silently corrects the programmer.
Here an example from the Perl debugger:
main::(-e:1): 0
DB<1> @a=0..9
DB<2> x @a
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
DB<3> p $a[10/4]
2
DB<4> x @a[2.9,3.1]
0 2
1 3
DB<5> p 10/4
2.5
DB<6> ;{use integer; print 10/4,"\n"}
2
DB<7>
Since fractional array indices don't make so much sense we can usually live with this.
As you can see from above you can always tell Perl to do integer arithmetics through the "use integer" pragma.
a "no integer" or end of block should return to floating point arithmetics.
A very nice feature of Perl is its "autovivification" and garbage collection.
A statement like
@a = 1000..4999
will create you a 4000 element array on the fly.
You could als use C-shell like globbing to fill e.g. an array of filenames (provided you have some hundred files ending on log)
@files = ;
The same feature works in list context on file handles if you need to read from a file handle into an array.
Besides this you can build up the most complex Lists of Lists.