Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

ww's scratchpad

by ww (Bishop)
on Aug 25, 2004 at 16:48 UTC ( #385740=scratchpad: print w/ replies, xml ) Need Help??

20140518 for choroba

Re your msg: The question was file: /path/example, dir: /path/example. It's not possible under MSWin, AFAIK.

Is this not what we were discussing (serious question; no sarcasm or irony)?

D:\>mkdir example D:\>; creating file example with a text editor 'creating' is not recognized as an internal or external command, operable program or batch file. # /me forgot how to comment on win3 +2 CLI. D:\>dir example /s/a Volume in drive D is DATA_DRIVE Volume Serial Number is 52E0-8789 Directory of D:\example 05/19/2014 07:48 AM <DIR> . 05/19/2014 07:48 AM <DIR> .. 05/19/2014 07:48 AM 40 example 1 File(s) 40 bytes Total Files Listed: 1 File(s) 40 bytes 2 Dir(s) 1,896,489,615,360 bytes free D:\>

If not, I would be pleased to learn.


20110203 for luis.roca: syntax hiliting now broken. Have not id'ed why. .css in email; just too much to stuff in here. cheers. ww

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:/ +/www.w3.org/TR/html4/loose.dtd"> <head> <title>(ww rev of luis.roca's )Anonymous Monk Design Version 1</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script type="text/javascript" src="http://www.luisroca.com/PerlMo +nks/scripts/scripts/shCore.js"></script> <script type="text/javascript" src="http://www.luisroca.com/PerlMo +nks/scripts/scripts/shBrushPerl.js"></script> <!-- <link type="text/css" rel="stylesheet" href="http://www.luisroca. +com/PerlMonks/scripts/styles/shCoreMidnight.css"/> --> <link type="text/css" rel="stylesheet" href="file://F:\_wo\PMonks\pm_r +evamp_LR_base.css"> <link type="text/css" rel="stylesheet" href="file://f:\_wo\PMonks\pm_r +evamp_LR_detail.css"> <script type="text/javascript">SyntaxHighlighter.all();</script> </head> <body> <div class="header" style="max-width: 62%;"> <!-- otherwise, approx 73 +6-740 px wide; second col is =~ 300 px --> <h1>The Monastery Gates</h1> <p style="position: relative; top: -2.5em; left: 24em;">( #<a href="ht +tp://perlmonks.org/?node_id=131">131</a>=superdoc: <a href="http://pe +rlmonks.org/?displaytype=print;node_id=131">print</a> <a href="http:/ +/perlmonks.org/?displaytype=print;node_id=131;replies=1">w/ replies</ +a>, <a href="http://perlmonks.org/?displaytype=xml;node_id=131">xml</ +a> )</p> <p><a href="">Donations gladly accepted</a><br> If you're new here please read <a href="">PerlMonks FAQ</a> and <a hre +f="">Create a new user</a>. </p> <p>Want Mega XP? Prepare to have your hopes dashed, join in on the:<br +> <a href="">poll ideas quest 2011</a> (Don't worry; you've got plenty +of time.) </p> </div> <!--END_HEADER--> <div class="main_content"> <ul class="posts"> <li> <h3>New Questions</h3> <ol class="new_questions"> <li> <!-- <table class="post_header"> <tr> <td>( by <a href="">mouser13</a>on Jan 04, 2011 at 08:13 ) <a +href="">1 direct reply</a> <a href="">Offer your reply</a></td> </tr> <th><a href="">Perl Tk font</a></th> </table> --> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">mouser13</a>on Jan 04, 2011 at 08:13 ) <a href=""> +1 direct reply</a> <a href="">Offer your reply</a> <br> <a href="">Perl Tk font</a> </div> <p>Hi, just wondering if any knew of a way to add new custom fonts to perl Tk. I'm moving programs off a Unix server on to user desktops and we don't have permission to add to windows font directory. </p> </li> <li> <!-- <table class="post_header"> <tr> <td>( by <a href="">chm</a> on Jan 03, 2011 at 20:14 ) <a href +="">5 direct replies</a> <a href="">Offer your reply</a></td> </tr> <th><a href="">die rather than exit on out-of-memory failure?</a>< +/th> </table> --> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">chm</a>on Jan 03, 2011 at 20:14 ) <a href="">5 dir +ect replies</a> <a href="">Offer your reply</a> <br> <a href="">die rather than exit on out-of-memory failure?</a> </div> <p>The Perl Data Language uses perl SV's to hold the numeric data (as a string). That gives the simplicity of easy allocation/free since it is done transparently by perl but a side-effect of this approach is t +hat a failure to allocate a very large data object (say, 100s of MiB or more) can make the perl interpreter hit an OOM situation and exit() with no chance of recovery. </p> <p>I've read about some emergency memory space that can be built into the perl but that seems to be for small items and static in nature. Not what you would use to guard against failure of a 200M +iB data allocation. Is there any way to allocate a data region onese +lf in the XS code and then use that as the data part of the perl SV? </p> <p>It seems like perl always needs to get its own data. The call +of exit() rather than die() means that, for example, running a Perl REPL interactive shell for PDL can crash without recovery. Other suggestions and thoughts on how to handle the problem are welcome! </p> <p>Thanks much, Chris </p> </li> <li> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">LanX</a> on Jan 03, 2011 at 12:57 ) <a href="">7 d +irect replies</a> <a href="">Offer your reply</a> <br> <a href="">reduce like iterators</a> </div> <p>Hi </p> <p>First I thougt about writing a longer meditation about iterator +s and semipredicate problem, but maybe a simple seek for perl wisdom is a better start. </p> <p>In gnu.emacs.help someone asked </p> <p>How would you code this simple list compression problem in Rub +y: </p> <p>1.08 (**) Eliminate consecutive duplicates of list elements. If a list contains repeated elements they should be replaced with a single copy of the element. The order of the elements should not + be changed. </p> <p>Example: </p> <!-- something wrong between "Example:" and beginning of the code - bl +v it's in 'div class="code_box"... <div class="toolbar"> <span> <a class=toolbar_item command_help help" href="#"> +?</a> <<<<<<<<<<<< HERE! problem is repeated on each pre class --> <div class="code_box"> <pre class="brush: Perl;"> ?- compress(&#91;a,a +,a,a,b,c,c,a,a,d,e,e,e,e&#93;,X). X = &#91;a,b,c,a,d,e&#93; </pre> </div> <p>my first idea to solve it in perl was grep </p> <div class="code_box"> <pre class="brush: Perl;"> DB&lt;1&gt; my $p; +print grep { $p = $_ if $_ ne $l } (a,a,a,a,b,c,c, +a,a,d,e,e,e,e); abcade </pre> </div> <p>but this approach fails for false list elements like e.g "0"! </p> <p>A nice exmaple where a grep like map is better than the plain g +rep </p> <div class="code_box"> <pre class="brush: Perl;"> DB&lt;2&gt; my $p; +print map { $p ne $_ ? $p = $_ : () } (a,a,a,a,b,c,c,a +,a,d,e,e,e,e) abcade </pre> </div> <p>But beside the need to lexicalize $p in the outer scope ... </p> <p>using state wouldn't be more elegant : </p> <div class="code_box"> <pre class="brush: Perl;"> DB&lt;3&gt; use feat +ure &quot;state&quot;; print map { state $p; $p ne $_ ? $p = $_ : + () } (a,a,a,a,b,c,c,a,a,d,e,e,e,e) abcade </pre> </div> <p>... it's still buggy if the compressed list was starting with u +ndef values. </p> <p>Thats a variation of the old Semipredicate problem: </p> <p>"One can't find an initial value which is not also potentially +a part of the iterated list!" </p> <p>So I had a look into List::Util and the only appropriate appro +ach was reduce </p> <p>The first call will be with $a and $b set to the first two elements of the list, subsequent calls will b +e done by setting $a to the result of the previous call and $b to th +e next element in the list. </p> <p>Looks perfect, but reduce {} LIST only returns a scalar and Lis +t::MoreUtils doesn't seem to provide anything better <sup>1.</sup> </p> <p>(Sure I could use $a as an array-ref for accumulation, not very + elegant...) </p> <p>Temporary conclusion: </p> <p>There seem to be a lack of iterators allowing to compare succes +sive elements </p> <p>And now I'm wondering about the best design ... </p> <p>could a special variable like $^PRE generally help augmenting e +xisting iterators, without the need to define and appropiately name a + whole new family of reduce-like iterators? </p> <p>( IMHO too many specialized functions like in LISP are hard to +remember.) </p> <p>something like </p> <div class="code_box"> <pre class="brush: Perl;"> print grep { $_ ne + $^PRE } (a,a,a,a,b,c,c,a,a,d,e,e,e,e); abcade </pre> </div> <p>Thoughts? </p> <p>Cheers Rolf </p> <p><sup>1)</sup> couldn't find much more on CPAN... </p> </li> <li> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">khangol</a> on Jan 03, 2011 at 11:08 ) <a href=""> +3 direct replies</a> <a href="">Offer your reply</a> <br> <a href="">Installing a program on a remote server through a web b +rowser.</a> </div> <p>Okay forgive me if I have bad formatting as it's only my second + post... </p> <p>What I'm trying to do: </p> <p>When I click a link, I want it to run a batch file to install a + program on a server, and return a result upon installation failure o +r success. </p> <p>The Problem: </p> <p>I first wrote this script to be executed through the command li +ne, so when I had to make some changes to make it work through a web +browser. The batch file takes about five minutes to complete, so I h +ad to prevent the browser to time out. </p> <p>Here's my code: </p> <div class="code_box"> <pre class="brush: Perl;"> #!perl -w use CGI; $c = new CGI(); print $c-&gt;header(); $| = 1; ### set up an alarm $timeout = 7*60; # apache normally times out after 5 min print &quot;&lt;!--\n&quot;; # hide output $SIG{ALRM} = sub{ print &quot;.\n&quot;; alarm($timeout); +}; # the timeout will send something to the browser every # now and then to keep it from timing out alarm($timeout); print &quot;Installing Dell Open Manage&quot;; &amp;install_open_manage(); alarm(0); print &quot;--&gt;\n&quot;; # don&#39;t need to hide outp +ut anymore print $result; &lt;---- do other stuff here ----&gt; exit(); sub install_open_manage { $host = &quot;hostA&quot;; print &quot;\n$count: Checking for local RAC configuration +.&lt;br&gt;&quot;; sleep(1); $result = `psexec \\\\$host -u location\\admin -p password + \\\ +\host01\\OpenManage\\setup_sibar.bat 2&gt;&amp;1`; return $result; } </pre> </div> <p>The script runs, and the program is installed, but the results +and the stuff after it is not printed. </p> <p>***EDIT </p> <p>Still no luck. I added start before the psexec and redirecte +d the output to a text file, however nothing gets written to the file +. One thing i noticed is that if I do something other than an install + in the install_open_manage subroutine (such as a sleep(100) and a 'd +ir' command) my script works fine. </p> </li> <li> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">Anonymous Monk</a> on Jan 03, 2011 at 09:49 ) <a h +ref="">4 direct replies</a> <a href="">Offer your reply</a> <br> <a href="">How to use the int-function?</a> </div> <p>Maybe some fellow monk can fill me in on how to use the int-fun +ction, with which perl cuts the decimals of a floating point number. +Let me phrase my specific question as a debugger meditation: (perl - +d -e 1, which explains, why there are no ";" between the commands) </p> <div class="code_box"> <pre class="brush: Perl;"> $i = 1.255 $j = $i * 100 + 0.5 $j = $j * 10000000 &lt;p&gt; print $j &lt;p&gt; -&gt; 1260000000 &lt;p&gt; print int ( $j ) &lt;p&gt; -&gt; 1259999999 </pre> </div> <p>Is there a way to make perl behave as a humble user of arithmet +ics would have expected, without needing additional modules like Math +::Round? </p> </li> <li> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">Anonymous Monk</a> <a href="">on Jan 03, 2011 at 0 +6:53</a> ) <a href="">3 direct replies</a> <a href="">Offer your repl +y</a> <br> <a href="">Most efficient way to print a file?</a> </div> <p>Hi all, What is the most efficient way (performance-wise,memory-wise) to open a file and putting it into a scalar variable for printing? I' +m returning it in a function call so it needs to be in a variable. </p> </li> <li> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">Arijit</a> <a href="">on Jan 03, 2011 at 04:41</a> + ) <a href="">3 direct replies</a> <a href="">Offer your reply</a> <br> <a href="">counting syn+ack. Help!!!</a> </div> <p>hi, am new to perl. am working on counting number of syn+ack packets from a machine. though the source and destination is being displayed correctly, th +e problem lies in counting them. i would be grateful to get some amou +nt of help on this... </p> <p>my code is given below: </p> <div class="code_box"> <pre class="brush: Perl;"> use Net::Pcap; use NetPacket::Ethernet; use NetPacket::IP; use NetPacket::TCP; use strict; my $err; # Use network device passed in program arguments or if n +o # argument is passed, determine an appropriate network # device for packet sniffing using the # Net::Pcap::lookupdev method my $dev = $ARGV&#91;0&#93;; unless (defined $dev) { $dev = Net::Pcap::lookupdev(\$err); if (defined $err) { die &#39;Unable to determine network device for monitoring + - &#39;, $e +rr; } } # Look up network address information about network # device using Net::Pcap::lookupnet - This also acts as +a # check on bogus network device arguments that may be # passed to the program as an argument my ($address, $netmask); if (Net::Pcap::lookupnet($dev, \$address, \$netmask, \$err +)) { die &#39;Unable to look up device information for &#39;, $ +dev, &#39; - &#39;, $err +; } # Create packet capture object on device my $object; $object = Net::Pcap::open_live($dev, 1500, 0, 0, \$err); unless (defined $object) { die &#39;Unable to create packet capture on device &#39;, +$dev, &#39; - &#39;, $er +r; } # Compile and set packet filter for packet capture # object - For the capture of TCP packets with the SYN # header flag set directed at the external interface of # the local host, the packet filter of &#39;(dst IP) &am +p;&amp; (tcp # &#91;13&#93; &amp; 2 != 0)&#39; is used where IP is th +e IP address of # the external interface of the machine. For # illustrative purposes, the IP address of 127.0.0.1 is # used in this example. my $filter; Net::Pcap::compile( $object, \$filter, &#39;(src 192.168.11.248) &amp;&amp; (tcp&#91;13&#93; &amp +; 2 != 0) &amp;&amp; (tcp&#91;14&#93; &amp; 2 != 0)&#39; +, 0, $netmask ) &amp;&amp; die &#39;Unable to compile packet capture fil +ter&#39;; Net::Pcap::setfilter($object, $filter) &amp;&amp; die &#39;Unable to set packet capture filter&#39;; # Set callback function and initiate packet capture loop my $count = 0; Net::Pcap::loop($object, -1, \&amp;syn_packets, &#39;$coun +t++&#39;) || die &#39;Unable to perform packet capture&#39;; print &quot;$count&quot;; Net::Pcap::close($object); sub syn_packets { my ($user_data, $header, $packet) = @_; # Strip ethernet encapsulation of captured packet my $ether_data = NetPacket::Ethernet::strip($packet); # Decode contents of TCP/IP packet contained within # captured ethernet packet my $ip = NetPacket::IP-&gt;decode($ether_data); my $tcp = NetPacket::TCP-&gt;decode($ip-&gt;{&#39;data&#39 +;}); # Print all out where its coming from and where its # going to! print $ip-&gt;{&#39;src_ip&#39;}, &quot;:&quot;, $tcp-&gt;{&#39; +src_port&#39;}, &quot; -&gt; &quot;, $ip-&gt;{&#39;dest_ip&#39;}, &quot;:&quot;, $tcp-&gt;{&#39 +;dest_port&#39;}, &quot;\n&quot;; } </pre> </div> </li> </ol> <!--END_NEW_QUESTIONS--> <li> <h3>New Meditations</h3> <ol class="new_meditations"> <li> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">ait</a> on Jan 04, 2011 at 14:06 ) <a href="">0 di +rect replies</a> <a href="">Offer your reply</a> <br> <a href="">RFC Using Test-Point Callbacks for Automated Diagnostic +s in Testing</a> </div> <p>Note:This RFC obsoletes RFC: Tutorial &quot;Introspecting your Moose code using Test Point Callbacks&quot; </p> <p>This second iteration incorporates changes, ideas and comments +on the first version, as well as further research on the subject to correctly identify the potential value of using this technique. </p> <p>The main idea is to give your testing software the ability to "look" inside subroutines for intermediate results at specific places, namely those problematic spots where you tend to leave debug-level messages to diagnose problems, and especially those places where you would tend to leave a $DB::single=1 to remind yourself and others that this is a place to stop and check a local variable, branching decision, side-effect, etc. The idea is inspir +ed in electronic circuit-board Test-Points and I2C tests and auto-diagnostic circuitry. </p> <p>Benefits of using this technique include: </p> <p>Enhance to your tests with detailed diagnostics: when a test fails, the intermediate results will give much better clues as to why it's failing, without immediately having to dive into the code +. Condition tests based on intermediate results: you may want to run further tests, abort the current test, or flag tests to skip based on the intermediate results of any particular test. </p> <p>Advanced Auto-Diagnostics: when a test fails, you may decide to re-run the test and force certain conditions inside a sub, whether to give better diagnostics, or to verify/assert the failure based +on expertise/experience: "test assertions" </p> <p>The proposed Tutorial follows: Read more... (20 kB) </p> </li> <li> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">ait</a> on Jan 01, 2011 at 13:16 ) <a href="">3 di +rect replies</a> <a href="">Offer your reply</a> <br> <a href="">RFC: Tutorial &quot;Introspecting your Moose code using + Test Point Callbacks&quot;</a> </div> <p>Note:This RFC has been superseded by RFC Using Test-Point Callbacks for Automated Diagnostics in Testing </p> <p>Happy new year fellow Monks! </p> <p>I'd like to start the new year by clearing out my pending list with PM which starts with a Tutorial I've been meaning to write about a technique I've been using to test Moose code (but can be used actually for any library). </p> <p>Anyway, please have a look and see if this makes any sense or have I been re-inventing the wheel here? Maybe there are better or actually more standard "best practice" ways of doing this. Or perhaps this could could make it to a test module of some sort? it +'s been working well for me and hopefully it may be useful for others as well, and worthy of a Tutorial. Your comments very welcome. </p> <p>Update: Moved the RFC here instead of my scratchpad </p> <p>Update: Changed the title, and updated the prose using comments and ideas spawned from the discussion below up to 20110102-1600UTC </p> Read more... (18 kB) </li> </ol> </li> <!--END_NEW_MEDITATIONS--> <li> <h3>New Monk Discussion</h3> <ol class="new_monk_discussion"> <li> <div style="color: #000000; background-color: #eeeeee;"> ( by <a href="">tye</a>on Dec 30, 2010 at 17:02 ) <a href="">3 + direct replies</a> <a href="">Offer your reply</a> <br> <a href="">Requiring old password in order to change your password +</a> </div> <p>As a tiny improvement in security and as a tiny step along the path of much bigger improvements in security, I will be changing t +he site so that you will be required to enter your old password in order to change your password. </p> <p>I didn't want to just spring this change without warning, as there are probably quite a few people who have forgotten their PerlMonks password because their browser cookie is enough. But, i +n reality, this improvement shouldn't present much of a problem even for such people. </p> <p>If you don't remember your password, then just make sure your e-mail address is up-to-date and request a "I forgot my password" e-mail (What&#39;s my password?). Yes, work has already been done to change that to send you a URL that gives you temporary access t +o change your password without knowing your current password rather than just e-mailing your current password, unencrypted, but that work has not yet been deployed (I hope to have it deployed fairly soon). </p> <p>- tye </p> </li> </ol> </li> <!--END_NEW_MEDITATIONS--> </ul> </div> <!--END_MAIN_CONTENT--> <div class="side_bar" style="max-width: 23%; position: absolute; left: + 68%; top: 0px;"> Welcome to the Monastery <h1><strong>Perl</strong>Monks</h1> <ul class="search"> <li class="search_field"><h3>Search: <input name="search" type="pa +ssword"></h3></li> <li><a href="http://perlmonks.org/?node=Super%20Search">Super Sear +ch</a></li> </ul> <ul class="navigation_menu"> <li><a href="http://perlmonks.org/?node_id=109">Log in</a></li> <li><a href="http://perlmonks.org/?node_id=101">Create a new user< +/a></li> <li><a href="http://perlmonks.org/">The Monastery Gates</a></li> <li><a href="http://perlmonks.org/?node=Seekers%20of%20Perl%20Wisd +om">Seekers of Perl Wisdom</a></li> <li><a href="http://perlmonks.org/?node=Meditations">Meditations</ +a></li> <li><a href="http://perlmonks.org/?node=Perl%20Monks%20Discussion" +>PerlMonks Discussion</a></li> <li><a href="http://perlmonks.org/?node=Obfuscated%20Code">Obfusca +tion</a></li> <li><a href="http://perlmonks.org/?node=Reviews">Reviews</a></li> <li><a href="http://perlmonks.org/?node=Cool%20Uses%20for%20Perl"> +Cool Uses For Perl</a></li> <li><a href="http://perlmonks.org/?node=Perl%20News">Perl News</a> +</li> <li><a href="http://perlmonks.org/?node=Categorized%20Questions%20 +and%20Answers">Q&amp;A</a></li> <li><a href="http://perlmonks.org/?node=Tutorials">Tutorials</a></ +li> <li><a href="http://perlmonks.org/?node=Perl%20Poetry">Poetry</a>< +/li> <li><a href="http://perlmonks.org/?node=Recently%20Active%20Thread +s">Recent Threads</a></li> <li><a href="http://perlmonks.org/?node=Newest%20Nodes">Newest Nod +es</a></li> <li><a href="http://perlmonks.org/?node=Offering%20Plate">Donate</ +a></li> <li><a href="http://perlmonks.org/?node=Tidings">What's New</a></l +i> <li><a href="http://perlmonks.org/?node=PerlMonks%20FAQ">Need Help +??</a></li> </ul> <!--END_NAVIGATION_MENU--> <form class="login" action="###############something.pl##############" +> <h3>Log In?</h3> <ul> <li class="input_field">Username: <input name="username" type="pas +sword"> </li> <li class="input_field">Password: &nbsp;<input name="password" typ +e="password"> <br> &nbsp; </li> <li><input name="remember_me" type="checkbox"> remember me</li> <li><input name="login" value="Login" type="submit"></li> <li><a href="">What's my password?</a> <a href="">Create A New Use +r</a></li> </ul> </form> <!--END_LOGIN--> <h3>Chatterbox?</h3> <ol class="chatterbox"> <li>&#91;Your Mother&#93;: Kopi Luwak!!!</li> <li>&#91;Voronich&#93;: Into, not through.</li> <li>&#91;oko1&#93;: Your Mother: &lt;laugh> Well done!</li> <li>&#91;Voronich&#93;: People who drink that crap... </li> <li>&#91;oko1&#93;: Voronich: Ah, that's a happier thought.</li> <li>&#91;Voronich&#93;: Yeah, they eat the veges, assimilate the g +ood stuff so I can just cook and eat them.</li> <li>&#91;oko1&#93;: Oh, dear. Just add an oko1 and watch the tone +of the conversation deteriorate to crap in 3 short steps...</li> <li>&#91;oko1&#93;: &lt;dusting hands> My job here is done. :)</li +> <li>&#91;Your Mother&#93;: ISBN 0916291456</li> <li>Voronich should've been able to guess that link.</li> <li class="input_field"><input name="talk" type="text"> <input nam +e="Talk" id="talk" type="submit" value="Talk"></li> </ol> <p> <a href="">How do I use this?</a> | <a href="">Other CB clien +ts</a></p> <!--END_CHATTERBOX--> <h3>Others examining the Monastery? (17)</h3> As of 2011-01-04 21:40 GMT <ul class="users"> <li><a href="">ikegami</a></li> <li><a href="">GrandFather</a></li> <li><a href="">planetscape</a></li> <li><a href="">jdporter</a></li> <li><a href="">Your Mother</a></li> <li><a href="">derby</a></li> <li><a href="">atcroft</a></li> <li><a href="">kennethk</a></li> <li><a href="">ELISHEVA</a></li> <li><a href="">herveus</a></li> <li><a href="">eff_i_g</a></li> <li><a href="">oko1</a></li> <li><a href="">Anonyrnous Monk</a></li> <li><a href="">Voronich</a></li> <li><a href="">cguevara</a></li> <li><a href="">msalerno</a></li> <li><a href="">im2</a></li> </ul> <!--END_USERS--> <h3>Sections?</h3> <ul class="sections"> <li><a href="">Seekers of Perl Wisdom</a></li> <li><a href="">Cool Uses for Perl</a></li> <li><a href="">Meditations</a></li> <li><a href="">PerlMonks Discussion</a></li> <li><a href="">Categorized Q&amp;A</a></li> <li><a href="">Tutorials</a></li> <li><a href="">Obfuscated Code</a></li> <li><a href="">Perl Poetry</a></li> <li><a href="">Perl News</a></li> <li><a href="">about</a></li> </ul> <!--END_SECTIONS--> <h3>Information?</h3> <ul class="information"> <li><a href="">PerlMonks FAQ</a></li> <li><a href="">Guide to the Monastery</a></li> <li><a href="">What's New at PerlMonks</a></li> <li><a href="">Voting/Experience System</a></li> <li><a href="">Tutorials</a></li> <li><a href="">Reviews</a></li> <li><a href="">Library</a></li> <li><a href="">Perl FAQs</a></li> <li><a href="">Other Info Sources</a></li> </ul> <!--END_INFORMATION--> <h3>Find Nodes?</h3> <ul class="find_nodes"> <li><a href="">Nodes You Wrote</a></li> <li><a href="">Super Search</a></li> <li><a href="">List Nodes By Users</a></li> <li><a href="">Newest Nodes</a></li> <li><a href="">Recently Active Threads</a></li> <li><a href="">Selected Best Nodes</a></li> <li><a href="">Best Nodes</a></li> <li><a href="">Worst Nodes</a></li> <li><a href="">Saints in our Book</a></li> </ul> <!--END_FIND_NODES--> <h3>Leftovers?</h3> <ul class="leftovers"> <li><a href="">The St. Larry Wall Shrine</a></li> <li><a href="">Buy PerlMonks Gear</a></li> <li><a href="">Offering Plate</a></li> <li><a href="">Awards</a></li> <li><a href="">Random Node</a></li> <li><a href="">Quests</a></li> <li><a href="">Craft</a></li> <li><a href="">Snippets</a></li> <li><a href="">Code Catacombs</a></li> <li><a href="">Editor Requests</a></li> <li><a href="">blogs.perl.org</a></li> <li><a href="">Planet Perl</a></li> <li><a href="">Perlsphere</a></li> <li><a href="">Perl Ironman Blog</a></li> <li><a href="">Perl.com</a></li> <li><a href="">Perl 5 Wiki</a></li> <li><a href="">Perl Jobs</a></li> <li><a href="">Perl Mongers</a></li> <li><a href="">Perl Directory</a></li> <li><a href="">Perl documentation</a></li> <li><a href="">CPAN</a></li> </ul> <!--END_LEFTOVERS--> <h3>Voting Booth?</h3> <ul class="voting_booth"> <li style="list-style-type: none; list-style-position: outside; li +ne-height: 2em;"> I'm looking forward to 2011 the way I once looked forward to .. </li> <li><input type="radio"> 1492</li> <li><input type="radio"> 1776</li> <li><input type="radio"> 1941</li> <li><input type="radio"> 1984</li> <li><input type="radio"> 2001</li> <li><input type="radio"> 2010</li> <li><input type="radio"> 2012</li> <li><input type="radio"> 2525</li> <li><input type="radio"> the year I started programming</li> <li><input type="radio"> the year I found Perl Monks</li> <li><input type="radio"> the year I was able to drink legally</li> <li><input type="radio"> the year I stopped drinking</li> <li><input type="radio"> the year I entered college</li> <li><input type="radio"> the year I graduated college</li> <li><input type="radio"> the year I met my Significant Other</li> <li><input type="radio"> the year I married my Significant Other</ +li> <li><input type="radio"> the year I divorced my Significant Other< +/li> <li><input type="radio"> other</li> <li><input name="Vote" value="vote" type="submit"></li> </ul> <p><a href="other">Other Polls</a> <br><a href="results">Results</a> ( +140 votes)</p> <!--END_VOTING_BOOTH--> <!--END_SIDE_BAR--> </div> <div class="footer"> <!-- Content exceeded allowed height --> PerlMonks parthenogenetically spawned by <a href="">Tim Vroom</a>.<br> PerlMonks went on a couple dates, and then decided to shack up with <a + href="">The Perl Foundation</a>.<br> Beefy Boxes and Bandwidth Generously Provided by <a href="">pair Netwo +rks</a>. <p style="position: relative; top: -4em; left: 70%;"> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a> </p> </div> <!--END_FOOTER--> </body> </html>

20111202 for jdporter: Holders of Unholy Powers should display a random rumour about the powers of the group rotating every day

For ambrus re docs: "Certain other shadowy groups co-exist with the Cabal... but the less said about HOUP...BoF... etc, the safer you will be" (or similar... or even not so similar, except for tongue-in-cheek-ness?)"

20090930 for jakobi re your messages:

jakobi says Re^3: MIME::Lite and Multipart... - is there a know trick to control the line break in <c>? Even mixes of <c> and <pre> failed. <pre> is more paste friendly for things like diff -u, as <c> makes a mess by adding it's own red col1 plus signs to the display... final q: I intend to keep the log lines in pre format in this node: no danger of download/use/reuse ever. Is <c> indeed preferrable for e.g. syslog output sample lines as well?

I don't know a good *1 workaround to avoid the red plus, but for several reasons, I believe <c> is better:

  • While the "postfix impression" data renders fine when viewing only the part of the thread beginning with your post, it creates problems for anyone viewing from the OP on through the thread. That's because the indent applied to replies; your <pre> tags and the width of your "postfix impression" stretch the browser window and thus require horizontal scrolling to read the narrative (enclosed in <p>...</p> tags). IOW, the pre tags and the length of the data lines bork the display.
  • While the rendering of long data lines wrapped in code tags may satisfy your criteria for "unsightly", any reader who wishes to see them in their original format can do so by using the "download" link that appears below each code block.

*1 You could, of course, manually reformat the data-lines to 60 or so chars, perhaps indenting each continuation line with multiple spaces pr \t or similar. That would avoid the existing problem -- forcing horizontal scrolling on other posts in the thread -- in some, but not all cases (consider what happens if you're replying to a reply to a reply -- meaning your post will be indented 4x). hth, thanks for your other pre replacements, and cheers. ww

20090901 for tye

#!C:\perl\bin use strict; use warnings; # define the table using one anonymous code-ref and one named code-ref my %dispatch = ( "-h" => sub { print "hello from anonymous sub\n"; }, "-g" => \&say_goodbye, "-?" => \&explain, # added +by ww ); sub say_goodbye { print "goodbye from named sub\n"; } sub explain { # added by + ww print "\tPer Wikipedia post, \"When as 'perl greet -h' will produce +'hello',\n\tand running it as 'perl greet -g' will produce 'goodbye'. +\"\n\tBUT when run (with proper association to perl on W32)\n\t\"C:\\ +F:\\pl_test\\dispatchWikip.pl -h\" returns\n\t 'Use of uninitialized +value in hash element at \"F:\\pl_test\\dispatchWikip.pl line 21.\"\n +\t unknown argument\n\tperl -v: This is perl, v5.8.8 built for MSWin3 +2-x86-multi-thread\n\t\t (with 33 registered patches, see perl -V for + more detail)\n"; } # fetch the code ref from the table, and invoke it my $sub = $dispatch{$ARGV[0]}; print $sub ? $sub->() : "unknown argument\n"; =head dispatch table fr Wikipedia, cf (local) dispatch.pl and (PM) #456530 Running this Perl program as perl greet -h will produce "hello", and r +unning it as perl greet -g will produce "goodbye". BUT RETURNS ERROR WHEN RUN C:\ F:\_wo\pl_test\dispatchWikip.pl -h "Use of uninitialized value in hash element at F:\_wo\pl_test\dispatch +Wikip.pl line 21. unknown argument" =cut

20090210 RFP Acme::Warnings after an idea by moritz

package Warnings; use strict; use warnings; use Exporter; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 0.02; @ISA = qw(Exporter AutoLoader); @EXPORT = qw(Warn); @EXPORT_OK = qw(Warn); sub Warn { print "\n"; my $j = int(rand(0xff)); my @msg = ("\n\t Viruses found :" . $j . "\n\tViruses infestations cle +aned: " . ($j - 13) . "\n\t", "\n\t Delete all files? Y/N\n\t Y\n\n\t All Files Deleted.\n\t +When you exit, your drive will be ready for reformatting.\n\n\t", 'libXMLS not found.', 'Corrupt file: ' . $0, 'NaN on ' . gmtime(), 'Perl 7 syntax not yet supported.', 'CAUTION: this construct may cause your computer to spit fire.' +, 'Syntax at line ' . int(rand(240)), "Use of term\(\) in list context.", 'Deprecated: see Acme::Bleach', "Ouch! That's really ugly.", 'Unspecified error.', '$inStit not in scope at Line ' . int(rand(71)), , 'Your Perl is borked. Recompile.', 'Useless use of a void in constant context at $0 line 7.', 'Did you forget an opening brace?', "I'm baffled.", ' %hash 0xdf31a45 (Bad RAM?)', 'Perhaps you should downgrade to PHP.', "Any idiot can see that won't compile. \#^~!x-`@\$@**9u~8! ", 'Write protect error reading device CON: ', int(rand(42)) . ' ERRORS suppressed by C<no errors> option.', 'An undeclared %hash name here was an unpleasant shock.', 'Huh?', 'The $hashref is not in scope in this block; Auto::Load must ha +ve messed you up or you may have failed to C<bless> it properly. Furt +her, please note carefully that this message renders too wide for you +r window.', 'Use Paranoia::Now; Did you type "/*" instead of "#" as a pref +ace to what looks like a comment?', 'Too many errors on one line. (Make fewer)', 'Symbol table full - fatal heap error; please install additiona +l RAM.', "Trailing comma not permitted in this function.", 'THE PREVIOUS STATEMENT IS REDUNDANT AND HAS BEEN DELETED.', 'If you made a sufficiently large number of errors, you will re +ceive a large portrait of Alfred E. Neumann.', 'Aaaargh!', 'Module ASM::InLine not found in C<@inc>.', 'Your POD is missing or broken. How am I supposed to know what +to do?', 'UNSAFE! Even C<perl -c fn> may trash your machine.', 'Server Error: No errors found! (Error ID 2966713b20938)', 'Universal pointers may not be dereferenced', '"8, 9, or A - F" in octal number', 'Cannot modify a annoymous constant at Line13', 'Bit error rate', '"Chomp" not supported on 8080 or Z80 CPU under zpr3', 'Unsafe HEX value', 'Unable to locate *foo - Program halted!', 'Cannot read. File is Write-Only.', 'Named capture requires requires CP/M 2.0 or newer version.', 'Baud rate cannot be set for this device.', 'LINK-80 atttempted to write a segment into memory already used + by another segment.', ' ', ); my $i = int(rand($#msg)); my $msg= $msg[$i]; if ( $i == (0) or $i == (1) ) { Scare($msg); } my $script_name = reverse($0); my $script_nam; if ( $script_name =~ m!([^-\ \/: _]*)|[^\.]!g ) { $script_nam = $1; } my $name = rand(ord(localtime())) . ' See also: ' . int(rand(hex(ord( +$script_name)))) . '.42' ; my $flag = (rand(3)); if ( $flag < 0.7 ) { print "\t Error: " . $i . " - $msg\n\t Compilation Terminated\n"; exit; } elsif ( ($flag >= 0.7) && ($flag <2.3) ) { print "\t Warning: $msg\n"; } elsif ( ($flag >= 2.3) && ($flag <2.8) ) { print "\t $msg $name\n"; } elsif ( ($flag >= 2.8) && ($flag <2.9) ) { print "\t No syntactical violations found. However, your script wi +ll B<NOT> do what you wanted.\n"; } else { print "\t COMMENT: $name \n"; } unless ( $flag >=2.8 && $flag <2.9 ) { print "\t Too many uncaught exc +eptions. Compilation aborted\n"; } exit; } sub Scare { my $Smsg = $_[0]; print chr(0x07) x 10; print $Smsg; sleep 3; print "$^O not found.\n\t"; sleep 1; system("L:\tests"); sleep 10; exit; } 1; __END__ =head =head1 NAME Acme_warnings =head1 SYNOPSIS Pure Perl: install as usual or simply copy to /Perl/site/lib/ACME/Warn +ings.pm Simple copy assumed here and below at "Example Script". use ACME::warnings; ... (some code here)... Warnings::Warn(); =head1 DESCRIPTION When use(d) as above, prints a ficticious error, warning or 'COMMENT' (and an occasional 'Congratulations'); then exits. =head1 PARAMETERS none =head1 RETURN none =head1 AUTHOR ww (user id at PerlMonks) =head1 VERSION 0.02 2009-02-16 =head1 ACKNOWLEDGEMENTS moritz (user id Perlmonks) for the idea and contributions to C<@msg>. B<Errors in implementation are ww's alone.> =head1 BUGS: None known (yet). =head1 LICENSE The same as Perl itself. =head1 EXAMPLE SCRIPT: C< #!/usr/bin/perl use strict; use warnings; use ACME::Warnings qw (Warn); print "this is a test\n"; Warnings::Warn(); __END__ > =cut


The version of "Markup in the Monastery" which was posted here is no longer current; see Markup in the Monastery, 20080318



post-9/11 Idiocy (Identifying office symbols, names, deleted):

Effective immediately, due to an INFOCON level increase, Outlook Web Access (OWA), Webmail, has been shutdown. We do not expect that it will be back online anytime soon, if at all. Please remember, this is not a XXXX Automation Helpdesk decision and XXXX can not remedy the situation.

To access your email remotely, consider the following choices:

  1. Use AKO Webmail (If you still have an Exchange Account on the xx Domain you will not be able to receive email from other users on the xx Domain unless they email you directly from their AKO to your AKO). Make sure you have removed forwarding on your AKO account. This solution should be used for M-Day personnel or temporary travel situations.
  2. Use VPN Access from your Government Laptop. If you need VPN installed, please open a trouble call with the Automation Helpdesk.
  3. Use a Government owned Blackberry, if you have been issued one.

The HTML capability to send and receive email will also be removed. We are now enforcing plain-text only emails. It will make emails look a little strange and you can not have hyperlinks in the email message. If someone gets all square boxes, instead of text, in an email please open a trouble call with the Automation Helpdesk.

** As a further reminder, all users must register their CAC Cards on our Intranet site. Just click on CCL Registration. Accounts that do not have a CAC registered will be deleted. All workstations need to be upgraded to Windows XP. Computers still running Windows 2000 will be cut off from the network. Computers must be brought into the Automation Helpdesk in xxxxxx to have them upgraded to Windows XP.

xxxxxxxxx, XXX... (name, etc, removed to protect the innocent)

Gaaaaak! my reply....

TO:               (Addressees supressed: identification of individuals and 
                   units compromises security)

SUBJECT:          INFOCON

CLASSIFICATION:   Unclass

DATE:             suppressed, just because we can)

Effective yesterday and for the foreseeable future, email has been suspended. An INFOCON level increase, directed by higher authority, required us to take this step. Higher Authority asserts that this step will not only increase security for all members of the United States Military Forces, but will also enhance efficiency, allowing additional resources to be devoted to The War On Terror.

In the future, and effective immediately, all correspondence, directives, orders and other information previously conveyed by email will be inscribed on "paper" or "vellum" (definitions and explanations, infra., at Note 1.) utilizing any of the following acceptable technologies:

  • a. "Typewriter:" A typewriter is a device similar to a combination of a computer keyboard and printer). See Note 2.
  • b. Pen and ink: Acceptable pens include: goose quill, only. (See Note 3).
  • c. Chisel and stone: Use only for those documents requiring the greatest permanency.

Also per the current INFOCON level SOP, possession or use in any military workplace of computer-related technology (exceptions at Note 4.) may, at the discretion of whomever (Note 6.) is next assigned to the Helpdesk after the violation is reported, may subject military personnel to disciplinary proceedings up to and including General Court Martial. Civilian personnel will be summarily executed.

There is one further additional unrelated note, which we have hidden at the bottom of this memo in the expectation that some of you will fail to read it.


Note 1: "Paper" is a form of material commonly found in the form of sheets and often white in color, and sometimes utilized to disseminate information printed or written thereon. Some Members may have observed or even utilized "paper" in the past. Check with your chain of command for your unit or Directorate Paper-Coordinator. "Vellum" is an obsolete technology whose re-introduction to the military forces will afford our communications contractor the opportunity for vast profit.

Note 2: Manual typewriters only. Electric typewriters generate decodeable and interceptable radio frequency pulses for each character typed. Current technology is known to allow interception of these pulses at distances up to dozens of millimeters. Further, since an on-going study of potential security hazards has identified power lines as a possible source of information compromise, electric appliances may be proscribed in the future.

Note 3: As a field expedient, when necessary, crayons may be utilized. Additionally, in the field, documents are permitted, when required, to be inscribed upon birch bark or slabs of newly hewn wood. However, use of cabbage leaves is deprecated.

Note 4: Qualified Information Technology or Intelligence personnel (cf: oxymoron) are authorized and directed to operate captured Al Quaeda computer technology for the purpose of analysis and tactical data gathering. In addition, use of digital numerical calculators is authorized, when required and on a case-by-case basis, and when specifically approved by appropriate authority (minimum: GS-15 level). Examples of appropriate use include the calculation of artillery aiming and inventory accountability maintenance.

Note 5: This note left deliberately BLANK. (Well, not really, because it says its blank, but you should get the idea.)

Note 6: Since the continued contraction of authorized uses of Information Technology is anticipated to accelerate in compliance with the latest INFOCON level change, most assigned IT personnel will be transferred to alternate duties. However, current projections anticipate that at least one IT staff member will be assigned to help desk duties on the third Thursday of months whose (US English) names include the letter "p" or "x."

Unrelated information: Yesterday has been declared an additional holiday for state and federal personnel who were actually present for and performing duty yesterday. Those individuals are authorized to have taken yesterday off. Employees and Members on a regular day off, pass or leave day or otherwise not present for and performing their customary duties yesterday are NOT authorized an alternate or compensatory day. Additionally, and solely to further obfuscate our intent, here is a second additional bit of information; a key and relevant proviso of the latest INFOCON level SOP: creation or possession of any document, paper, file or other information storage technology utilizing justified type (or, typesetting) will be deemed prima facie evidence of the possession or use of prohibited technology.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-12-29 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls