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:
Cross platform perl module

 



anamika
Deleted

Jul 18, 2000, 12:52 PM

Post #1 of 7 (1334 views)
Cross platform perl module Can't Post

Any existing module to resolve operating
system issues for unix & NT


dws
Deleted

Jul 20, 2000, 2:30 PM

Post #2 of 7 (1334 views)
Re: Cross platform perl module [In reply to] Can't Post

What issues to you need to resolve?



anamika
Deleted

Jul 21, 2000, 4:45 AM

Post #3 of 7 (1334 views)
Re: Cross platform perl module [In reply to] Can't Post

Simple differences like the (/ and \) and
to do operating system file operations.


japhy
Enthusiast

Jul 21, 2000, 4:58 AM

Post #4 of 7 (1334 views)
Re: Cross platform perl module [In reply to] Can't Post

The basic idea is to make your program as portable as possible. Windows can handle forward slashes in file paths (try it).

And don't call the system if you can survive without it. Don't call 'rm' or 'del', use Perl's unlink() function. That's why it's there. Don't call 'ls' or 'dir', use opendir and readdir and closedir. That's why they're there.

And if you have to call the system, wrap it with a $^O test:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


if ($^O =~ /win/i) {
windows_system_call();
}
elsif ($^O =~ /mac/i) {
mac_system_call();
}
...
</pre><HR></BLOCKQUOTE>

------------------
Jeff "japhy" Pinyan -- accomplished author, consultant, hacker, and teacher



anamika
Deleted

Jul 21, 2000, 6:17 AM

Post #5 of 7 (1334 views)
Re: Cross platform perl module [In reply to] Can't Post

hi japhy,

i have used all the perl functions to make it as portable and s i have used the $^O to
determine but the question is i want to find
status of process running and stuff like
that for that i wanted to know if any
preexisting module is there.



dws
Deleted

Jul 21, 2000, 11:30 AM

Post #6 of 7 (1334 views)
Re: Cross platform perl module [In reply to] Can't Post

"stuff like that" covers a lot of ground. The more specific you can be up front, the greater your chance of getting your questions answered.


anamika
Deleted

Jul 21, 2000, 12:30 PM

Post #7 of 7 (1334 views)
Re: Cross platform perl module [In reply to] Can't Post

ok - stuff like that is - knowing the
status of the process, and their process id
. the equivalent is services in NT - there is module Win32::services but i am not getting the result.


 
 


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

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