PerlZealot has asked for the wisdom of the Perl Monks concerning the following question:
I want to expand the script as a cross-platform script; both Linux and Windows. Is there a Perl function, command, structure - or something - I can employ in my script to somehow "detect" what OS it's running on? Is it something plainly obvious that I'm missing?my $dirname=cwd(); my $sys_get_dirs = "ls -l $dirname | egrep \'^d\'"; my @dirlist=`$sys_get_dirs`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: recognizing OS
by ikegami (Patriarch) on May 02, 2008 at 23:31 UTC | |
|
Re: recognizing OS
by FunkyMonk (Bishop) on May 02, 2008 at 23:21 UTC | |
|
Re: recognizing OS
by Anonymous Monk on May 03, 2008 at 05:55 UTC | |
by ikegami (Patriarch) on May 03, 2008 at 06:18 UTC | |
by Anonymous Monk on May 03, 2008 at 08:38 UTC | |
|
Re: recognizing OS
by Khen1950fx (Canon) on May 03, 2008 at 10:50 UTC | |
by doom (Deacon) on May 03, 2008 at 22:46 UTC | |
by mr_mischief (Monsignor) on May 09, 2008 at 15:13 UTC |