Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://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 ...

./dumpuptime.pl uptime: 21 days, 8:02 Use of uninitialized value in printf at ./dumpuptime.pl 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

Title:
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?
    Username:
    Password:

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

    How do I use this?Last hourOther CB clients
    Other Users?
    Others admiring the Monastery: (1)
    As of 2024-09-10 23:59 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      The PerlMonks site front end has:





      Results (10 votes). Check out past polls.

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.