CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
changing system date using perl through web server on QNX

 



sravanthy
Novice

Feb 17, 2010, 6:41 AM

Post #1 of 6 (995 views)
changing system date using perl through web server on QNX Can't Post

Hi All,

I need to change system date using perl script through web browser on QNX system ( it has slinger as web server).

Following Perl script from command works

system('date 22 02 02');

system('rtc -s hw');

Same script when used through web browser does not work

Kindly suggest on this issue

Thanks

Sravanthy


FishMonger
Veteran / Moderator

Feb 17, 2010, 7:19 AM

Post #2 of 6 (994 views)
Re: [sravanthy] changing system date using perl through web server on QNX [In reply to] Can't Post

1) Add proper error handling.

2) Specify the full path to the system commands


sravanthy
Novice

Feb 17, 2010, 9:02 PM

Post #3 of 6 (986 views)
Re: [FishMonger] changing system date using perl through web server on QNX [In reply to] Can't Post

Hi,

I have also mentioned the full path but it did not work.

Any other suggestion on this

Thank you


FishMonger
Veteran / Moderator

Feb 18, 2010, 5:11 AM

Post #4 of 6 (975 views)
Re: [sravanthy] changing system date using perl through web server on QNX [In reply to] Can't Post

Did you add any error handling that could help point to the problem?

If it works from the command line but not the browser, then that indicates that the problem is related to the differences in the environments (typically permissions).

Things you can try:
From the command line, su into the user that owns/runs the web service then run the script. Does it still work, or do you receive an error?

Instead if the system call, open a pipe to the command. If opening the pipe fails, then $! should hold the reason.

Or, use one of the IPC:: modules, such as IPC::Run, IPC::Open3


sravanthy
Novice

Feb 18, 2010, 9:04 AM

Post #5 of 6 (971 views)
Re: [FishMonger] changing system date using perl through web server on QNX [In reply to] Can't Post

Thank you FishMonger.

Could you pl tell me whether perl supports IPC::SharedMem for ftok(), shmget() ....

I was trying to use ftok, shmget but perl is returning saying this machine do not support ftok...

Also in README file of IPC::SysV-2.01 is it mentioned as not supported. .xs file do not show export of these functions.

Could you Pl suggest me alternate solution for this.

I need to access shared memory created by non-perl process(i.e, opening/creating, maping, reading and writing to shared memory).

Thank you in advance

Sravanthy


FishMonger
Veteran / Moderator

Feb 18, 2010, 9:27 AM

Post #6 of 6 (970 views)
Re: [sravanthy] changing system date using perl through web server on QNX [In reply to] Can't Post

I've never used that module or those functions, so I won't be of much help in that area.

I'd suggest asking that on http://perlmonks.org/

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives