For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > May 2007 > overriding posix::uname









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author overriding posix::uname
Ken Foskey

2007-05-19, 3:58 am


sub is_dev
{
my ($server, $host) = POSIX::uname();

if ($host eq "aixmbk10") {
return 1;

I want to test this module in a test script. SO I want to code the
various servers and check that it works.

Is there a way to override the call to POSIX::uname

Thanks
Ken

Jeff Pang

2007-05-19, 3:58 am

Ken Foskey д:
> sub is_dev
> {
> my ($server, $host) = POSIX::uname();
>
> if ($host eq "aixmbk10") {
> return 1;
>
> I want to test this module in a test script. SO I want to code the
> various servers and check that it works.
>
> Is there a way to override the call to POSIX::uname
>


Why not $^O?

$ perl -e 'print $^O'
linux


--
http://home.arcor.de/jeffpang/
David Moreno Garza

2007-05-22, 6:59 pm

Funny thing:

Jeff Pang wrote:
> $ perl -e 'print $^O'
> linux


User-Agent: Thunderbird 2.0.0.0 (Windows/20070326)

Just trolling :-)

--
David Moreno Garza <damog@ciencias.unam.mx> | http://www.damog.net/
Saca tus alas y empieza a volar.

Jeff Pang

2007-05-22, 9:59 pm

David Moreno Garza 写道:
> Funny thing:
>
> Jeff Pang wrote:
>
> User-Agent: Thunderbird 2.0.0.0 (Windows/20070326)
>
> Just trolling :-)
>

I'm ,what do you mean?

--
http://home.arcor.de/jeffpang/
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com