Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
anybody who works on call, or has a pager 24/7 will CRINGE at this.... I set out to learn some perl, get some attention at work, and look busy in between video games.
it turns out, with the help of the mighty monks, i stumbled on LWP! you mean that i can issue an HTTP POST command, and have it read from a file ??!??!!
uhoh...the pager company is see me loitering around!! it also turns out that I have a REALLY lazy co-worker...who gets a way with redrum, and thinks he has too much "crap to deal with all day....(well it just got worse)
well...when I got his pager number, this is what happened...
#!/usr/bin/perl -w $|++; use HTTP::Request::Common; use LWP::UserAgent; my $file = '/home/steven/error-codes'; open(INFO, $file) or die "Couldn't open $file: $!"; while (<INFO>){ chomp; $ua = LWP::UserAgent->new; $ua->request (POST 'http://www.pager-co.hah/cgi-bin/wwwpage.cgi', [PIN => 'xxx5551212', MSSG => "$_", ]); } close(INFO) or die "Error writing $file: $!";
i put some dummy error codes into a file (which look strikingly similar to real error codes), which he gets as a page, but when he gets the page, he has no idea what is happening, because he never RTFM!! PS...this script will be set as a cron job @ 3 am every night!! ...and they thought i was an underachiever



Edit by castaway - restored original content

In reply to fun with your co-workers... by stevenrh

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2023-09-25 09:55 GMT
Find Nodes?
    Voting Booth?

    No recent polls found