Matt wrote:
> I have a perl script but I want to exit it if the uptime on the
server
> is less then say an hour. Any idea how I would get uptime with
perl?
Hi,
You could use the distribution: Unix::Uptime
(http://search.cpan.org/perldoc?Unix::Uptime)
Example:
use strict;
use warnings;
us
于 2010-12-17 11:29, Shawn H Corey 写道:
Every "file" in it is a pipe that can be read using regular file
handles. And I believe only Linux does this.
Yep.Also the OP is asking exactly about linux.
--
Jeff Peng
jeffp...@gmx.net
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For addit
On 10-12-16 10:21 PM, Katie T wrote:
/proc/uptime is a linux innovation I believe, other *nix variant may
not have it (I don't think Solaris does).
The /proc directory is a pseudo-directory that the kernel maintains.
Every "file" in it is a pipe that can be read using regular file
handles. A
On Fri, Dec 17, 2010 at 3:21 AM, Katie T wrote:
> On Fri, Dec 17, 2010 at 2:25 AM, Jeff Peng wrote:
>> 于 2010-12-17 9:32, Matt 写道:
>>>
>>> I have a perl script but I want to exit it if the uptime on the server
>>> is less then say an hour. Any idea how I would get uptime with perl?
>>
>> $ cat /
On Fri, Dec 17, 2010 at 2:25 AM, Jeff Peng wrote:
> 于 2010-12-17 9:32, Matt 写道:
>>
>> I have a perl script but I want to exit it if the uptime on the server
>> is less then say an hour. Any idea how I would get uptime with perl?
>
> $ cat /proc/uptime
> 4205976.64 4017280.59
>
> The first column
At 7:32 PM -0600 12/16/10, Matt wrote:
I have a perl script but I want to exit it if the uptime on the server
is less then say an hour. Any idea how I would get uptime with perl?
On Unix:
my $uptime = qx(uptime);
Then parse $uptime with a regular expression, which may depend upon
what your
于 2010-12-17 9:32, Matt 写道:
I have a perl script but I want to exit it if the uptime on the server
is less then say an hour. Any idea how I would get uptime with perl?
$ cat /proc/uptime
4205976.64 4017280.59
The first column is the host's uptime seconds.
Jeff.
--
To unsubscribe, e-mail: be
http://search.cpan.org/~burak/Sys-Info-Base-0.73/lib/Sys/Info/OS.pm#uptime
Sys::Info::OS has an uptime() method.
On Thu, Dec 16, 2010 at 8:32 PM, Matt wrote:
> I have a perl script but I want to exit it if the uptime on the server
> is less then say an hour. Any idea how I would get uptime wit
I have a perl script but I want to exit it if the uptime on the server
is less then say an hour. Any idea how I would get uptime with perl?
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On 16/12/2010 13:57, practicalperl wrote:
On Thu, Dec 16, 2010 at 9:47 PM, C.DeRykus wrote:
There weren't any matches with files and no wildcards
in the glob pattern so the pattern itself is returned *. If
there had been a wildcard in the pattern, then nothing
would have been returned.
Th
On Thu, Dec 16, 2010 at 9:47 PM, C.DeRykus wrote:
> There weren't any matches with files and no wildcards
> in the glob pattern so the pattern itself is returned *. If
> there had been a wildcard in the pattern, then nothing
> would have been returned.
>
Thanks. But still being confused about
On Dec 16, 2:56 am, practicalp...@gmail.com (practicalperl) wrote:
> This has been confused me:
>
> [an...@localhost tmp]$ ls
> [an...@localhost tmp]$ perl -le'print glob("foo.3")'
> foo.3
>
> there is nothing in the tmp directory.
> but why glob("foo.3") returns the string?
>
> $ perl -v
>
> This
This has been confused me:
[an...@localhost tmp]$ ls
[an...@localhost tmp]$ perl -le'print glob("foo.3")'
foo.3
there is nothing in the tmp directory.
but why glob("foo.3") returns the string?
$ perl -v
This is perl, v5.8.8 built for i686-linux
Thanks.
--
To unsubscribe, e-mail: beginners-u
Hi Gary,
On Wednesday 15 December 2010 14:42:56 Gary Stainburn wrote:
> HI Shlomi,
>
> On Wednesday 15 December 2010 11:57:25 Shlomi Fish wrote:
> [snip]
>
> > > while () {
> > >
> > > my $line=$_;
> >
> > Why are you doing this instead of:
> >
> > [code]
> > while (my $line = )
> > {
> >
14 matches
Mail list logo