GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: PERL QUESTION
Operating System - HP-UX
1847883
Members
5325
Online
104021
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
01-07-2003 08:13 AM
01-07-2003 08:13 AM
PERL QUESTION
I am stumped and would really appreciate some help from a Perl expert. Any Thoughts?
I am trying to delete not a whole record from a hash but a value in an array inside a hash. I keep getting a "Too Many arguments error"
delete (@{$Expired{$year}->{$lastmon}}, $lastperiod)
I am trying to delete not a whole record from a hash but a value in an array inside a hash. I keep getting a "Too Many arguments error"
delete (@{$Expired{$year}->{$lastmon}}, $lastperiod)
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2003 09:23 AM
01-07-2003 09:23 AM
Re: PERL QUESTION
delete @{$ref->[$x][$y]}{$key1, $key2, @morekeys};
is the example given at:
http://www.perl.com/doc/manual/html/pod/perlfunc/delete.html
so I would try:
delete @{$Expired->[$year][$lastmon]}{$lastperiod};
If that doesn't work try breaking up the expression into smaller parts (and printing them afterwards to verify that they give you what you want). Perhaps a for loop through the array might be easier to handle.
Ron
is the example given at:
http://www.perl.com/doc/manual/html/pod/perlfunc/delete.html
so I would try:
delete @{$Expired->[$year][$lastmon]}{$lastperiod};
If that doesn't work try breaking up the expression into smaller parts (and printing them afterwards to verify that they give you what you want). Perhaps a for loop through the array might be easier to handle.
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2003 09:25 AM
01-07-2003 09:25 AM
Re: PERL QUESTION
Scott,
delete is used to remove hash entries.
You can use "undef" to undefine an array entry.
example-
undef @{$Expired{$year}->{$lastmon}}[$lastperiod]
assuming $lastperiod is an offset into the array.
HTH
-- Rod Hills
delete is used to remove hash entries.
You can use "undef" to undefine an array entry.
example-
undef @{$Expired{$year}->{$lastmon}}[$lastperiod]
assuming $lastperiod is an offset into the array.
HTH
-- Rod Hills
There be dragons...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2003 10:11 AM
01-07-2003 10:11 AM
Re: PERL QUESTION
Thanks a lot. I actually solved the problem before you responded however, both seem like they would work fine.
I actaully sorted the hash and used the pop feature:
pop(@{$Expired{$year}->{$lastmon}});
I actaully sorted the hash and used the pop feature:
pop(@{$Expired{$year}->{$lastmon}});
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP