- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Perl scalar help
Operating System - Linux
1820190
Members
4063
Online
109620
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
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
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
тАО09-20-2006 12:23 AM
тАО09-20-2006 12:23 AM
All,
How do I assign the following to a variable, or print to a file.
print scalar localtime($event->{'TimeGenerated'});
output: Wed Sep 20 08:01:36 2006
What I'm looking to get out of above output is the hour. (08)
Appreciate all help.
How do I assign the following to a variable, or print to a file.
print scalar localtime($event->{'TimeGenerated'});
output: Wed Sep 20 08:01:36 2006
What I'm looking to get out of above output is the hour. (08)
Appreciate all help.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2006 12:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2006 12:50 AM
тАО09-20-2006 12:50 AM
Re: Perl scalar help
OK it's easy:
$tmp=scalar localtime($event->{'TimeGenerated'});
@temp = split(" ",$tmp);
$time = @temp[30];
@temp = split(":",$time);
$hour = @temp[0];
print $hour;
$tmp=scalar localtime($event->{'TimeGenerated'});
@temp = split(" ",$tmp);
$time = @temp[30];
@temp = split(":",$time);
$hour = @temp[0];
print $hour;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2006 12:50 AM
тАО09-20-2006 12:50 AM
Re: Perl scalar help
Thanks, Alexander.
Thread Close
Thread Close
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
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP