- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Problem with perl command
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
Forums
Discussions
Discussions
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
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
05-31-2005 12:01 AM
05-31-2005 12:01 AM
Problem with perl command
does anybody know why this command works fine on hp-ux 11.11 bur doesn't work on hp-ux 11.00:
--------------------------------------------
perl -e 'print scalar localtime(time-86400)'
--------------------------------------------
on both nodes I have perl 5.8.0_B0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 12:07 AM
05-31-2005 12:07 AM
Re: Problem with perl command
Check to make sure each is running the same perl:
which perl
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 12:14 AM
05-31-2005 12:14 AM
Re: Problem with perl command
------------------------------------------
$ perl -e 'print scalar localtime(time-86400)'
Mon May 30 14:10:12 2005
$
------------------------------------------
and the second one, where function scalar doesn't work:
------------------------------------------
$ perl -e 'print scalar localtime(time-86400)'
$
------------------------------------------
as you see there is no error.
When I am using this commacnd without func. scalar it works fine on both nodes.:
-------------------------------------------
$ perl -e 'print localtime(time-86400)'
35121430410511491
$
-------------------------------------------
both nodes uses the same path:
/usr/contrib/bin/perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 12:20 AM
05-31-2005 12:20 AM
Re: Problem with perl command
a5:/u/usr/merijn 38 > perl -le 'print localtime(time-86400)'
49181430410511491
a5:/u/usr/merijn 39 > perl -le 'print scalar localtime(time-86400)'
Mon May 30 14:18:52 2005
a5:/u/usr/merijn 40 > perl4 -le 'print localtime(time-86400)'
58181430410511491
a5:/u/usr/merijn 41 > perl4 -le 'print scalar localtime(time-86400)'
a5:/u/usr/merijn 42 >
If you'd have used -w, a rather obscure message could have pointed you there
a5:/u/usr/merijn 42 > perl4 -wle 'print scalar localtime(time-86400)'
Use of uninitialized variable at /tmp/perl-ea28878 line 1.
a5:/u/usr/merijn 43 >
Check your version with
# perl -v
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 12:23 AM
05-31-2005 12:23 AM
Re: Problem with perl command
which perl
live free or die
harry d brown jr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 12:27 AM
05-31-2005 12:27 AM
Re: Problem with perl command
localtime function uses strftime and ctime to get time values.
try using Time::Local and see whether it works for you.
Regards,
Gopi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2005 12:57 AM
05-31-2005 12:57 AM
Re: Problem with perl command
the problem was with wrong path to perl - swlist show perl 5.8.0_B0 in /opt/perl/5.8.0
but which perl shows /usr/contrib/bin/perl.
When I used direct path /opt/perl/5.8.0/bin/perl it works fine on both nodes.