Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Excellent tutorial! The only problem is that I've gotten errors from the regex on three different unixes. I've quadruple-checked my syntax, so i don't think it's that.

the program I'm using with the the module is ...

#!/usr/bin/perl -w use strict; use lib("."); use Uptime; $|++; my $uptime; tie $uptime, 'Uptime'; printf("%20s%-20s\n", "uptime:\t", $uptime->uptime); printf("%20s%-20s\n", "users:\t", $uptime->users); printf("%20s%-20s\n", "load(1):\t", $uptime->load('one')); printf("%20s%-20s\n", "load(5):\t", $uptime->load('five')); printf("%20s%-20s\n", "load(15):\t", $uptime->load('fifteen')); printf("%20s%-20s\n", "string:\t", $uptime->as_string);

... and the output I get on an AIX system, a Solaris system, and a Darwin system, is ...

./ uptime: 21 days, 8:02 Use of uninitialized value in printf at ./ line 14. users: load(1): 1 load(5): 0.04 load(15): 0.03 string: 20:39pm up 21 days, 8:02, 1 users, load +average: 0.04, 0.03, 0.04

Do I have something wrong, or is the regex in the tutoral off? Thanks, -s-

In reply to Re: Tie: Creating Special Objects by blueflashlight
in thread Tie: Creating Special Objects by btrott

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (6)
    As of 2020-09-25 18:44 GMT
    Find Nodes?
      Voting Booth?
      If at first I donít succeed, I Ö

      Results (140 votes). Check out past polls.