[30601] in Perl-Users-Digest
Perl-Users Digest, Issue: 1844 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 8 09:09:47 2008
Date: Mon, 8 Sep 2008 06:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 8 Sep 2008 Volume: 11 Number: 1844
Today's topics:
Re: "Selling" Perl (i.e. getting the boss to let me ins <john@castleamber.com>
Re: ANNOUNCE: GromPerl persistent Perl interpreter <kkeller-usenet@wombat.san-francisco.ca.us>
Re: ANNOUNCE: GromPerl persistent Perl interpreter <gromnospam@googlemail.com>
Re: ANNOUNCE: GromPerl persistent Perl interpreter <gromnospam@googlemail.com>
Re: Any GUI Toolkit Suggestions? <hal@halblog.com>
Re: Any GUI Toolkit Suggestions? <zentara@highstream.net>
Re: array of arrays to hash of hashes <jeff@simstech.net>
feedback from system() etc. calls? <bugbear@trim_papermule.co.uk_trim>
Re: feedback from system() etc. calls? <joost@zeekat.nl>
new CPAN modules on Mon Sep 8 2008 (Randal Schwartz)
Re: Perl equivalent of unix time command <spamtrap@dot-app.org>
Re: Perl equivalent of unix time command <jurgenex@hotmail.com>
Re: Perl equivalent of unix time command <jurgenex@hotmail.com>
Re: Perl equivalent of unix time command <jurgenex@hotmail.com>
What is wrong in the following script <sajapuram.arun.prakash@gmail.com>
Re: What is wrong in the following script <josef.moellers@fujitsu-siemens.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 8 Sep 2008 01:17:04 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: "Selling" Perl (i.e. getting the boss to let me install it)
Message-Id: <Xns9B12CE58B1988castleamber@130.133.1.4>
Willem <willem@stack.nl> wrote:
> John Bokma wrote:
> ) Another thing a lot of editors share is the ability to redefine the
> ) keyboard shortcuts (Although it's something I try to avoid).
>
> Well okay, I'll concede that. But still you have to use key
> combinations (ctrl-this, alt-that, I imagine ?)
Since most editors are mode-less, yes.
> ) Only thing I can think off that requires the mouse in TextPad is
> moving ) the splitter. But I don't mind to move my hands away from the
> keyboard ) now and then, I have no problems with the mouse, and some
> things I do ) faster with it.
>
> Yes, but you have to use the *whole* keyboard, not just the
> alphanumeric bits. That makes a bit of difference.
I've know idea. I have to press Shift now and then as well. Doesn't
bother me that much. I never needed a high typing speed when coding.
Maybe I am a slow coder. Even when writing documentation I don't type
full speed (like for example while chatting, or posting to Usenet).
> )> Vim, on the other hand, is quite different as mentioned before.
> )
> ) I can't see why, or maybe I am too used to vi/vim :-).
>
> Well, there is still the use of easy macro recording, the ease of
> combining almost any edit command with almost any move command, and
> the ease of adding custom scripts. Of course, emacs has the first
> and the last as well, and probably the second too.
> Downside of emacs is escape-meta-alt-control-shift :-P
Emacs is entirely programmable, so if you don't like that, change it. Or
use vile. From what I understand features first in vile made it back to
vi(m).
> In any case, perhaps I could get to comparable speed with another
> editor, but I very much doubt it would take me only a week to do so,
> even if I were to spend the whole week doing nothing but familiarize
> myself with the editor.
I recently changed from a Latin American keyboard back to an US one (in
our house we have like 4 or even 5 different keyboard layouts), and it
took me about a week to get used to it. The two weeks (I think I
mentioned 2) was a guess, based on what I do when working on code. Maybe
I don't use my editors to the fullest, I don't know. But what I do most
while coding is typing characters part of the code.
> I tend to use *a lot* of more powerful
> functionality of vim, learned from years of working with it. Perhaps
> all of that is also available in other editors (although I actually
> doubt all of it is) but that is *a lot* of stuff to relearn.
I am going to use Emacs full time later this month, so maybe I'll come
back on "two weeks". And later on I want to extend my knowledge of vi as
well (I probably am just going to switch to vim for a few months).
--
John http://johnbokma.com/ - Hacking & Hiking in Mexico
Perl help in exchange for a gift:
http://johnbokma.com/perl/help-in-exchange-for-a-gift.html
------------------------------
Date: Sun, 7 Sep 2008 19:36:53 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: ANNOUNCE: GromPerl persistent Perl interpreter
Message-Id: <6nfep5xbi5.ln2@goaway.wombat.san-francisco.ca.us>
On 2008-09-08, MVC net <gromnospam@googlemail.com> wrote:
>
> Just post a complete page
You mean like this?
Licence
Bauk Web server, included package, libraries and tools are distributed
as free, open-source software for personal or commercial use, without
restrictions and limitations.
Remember rightful authors if using design concepts, parts or components
of Bauk software.
That just seems like a cruel joke. It implies to someone less clueful
that your license means something. If you want to accurately call your
software "open-source" you need to actually use a license that is open
source e.g. http://opensource.org/licenses/category .
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
------------------------------
Date: Mon, 8 Sep 2008 08:55:57 +0200
From: "MVC net" <gromnospam@googlemail.com>
Subject: Re: ANNOUNCE: GromPerl persistent Perl interpreter
Message-Id: <ga2ic8$tph$2@news.eunet.yu>
"John Bokma" <john@castleamber.com> wrote in message
news:Xns9B12CC448E323castleamber@130.133.1.4...
>
>> Just post a complete page
>
> Talking about posting, don't quote sigs.
>
> As for your announcement, it starts to look more an more like an
> advertisement, which might piss off some people after a while.
>
> As for your license, check out the wording of:
> http://www.sqlite.org/copyright.html
>
> To make things easier, you might want to pick a known license and
> use the wording of that one, for example the Artistic License (2.0).
>
> See: http://en.wikipedia.org/wiki/Artistic_License
>
It would be, perhaps, more precisse to say that some users are in good mood
rarely.
Speaking of licenses, Im familiar with couple, and Artistic, which is nice.
You should read these licenses, and you will notice that those created with
legal advice or expertise, say in essence "to help and improve"... nothing
else.
It does not say "with purpose of forcing a restriction".
Any restriction license has, is with main intention to help.
There is not one license that says "you must use this license, or if not,
then you must use another license".
(this is only how some users interpret the concept of license, and that
interpretation is wrong)
Also, if that was true, none of licenses now could exist because it creates
something of a chicken and the egg problem.
A user says- license must be used. It is basically using a tool for
protecting freedom to destroy some other freedom, ie freedom to not use a
license.
To mention, for some designs, concepts, or solutions widely accepted today,
not so long ago many were less than happy to adopt and use, saying "never"..
etc.
Today, these same people say of course yes engrave it on my tomb stone.
Whether it's an os, software, somethin gelse.
Now somebody objected here.. lets see.. Who was it?
regards
------------------------------
Date: Mon, 8 Sep 2008 08:31:11 +0200
From: "MVC net" <gromnospam@googlemail.com>
Subject: Re: ANNOUNCE: GromPerl persistent Perl interpreter
Message-Id: <ga2ic7$tph$1@news.eunet.yu>
"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message
news:6nfep5xbi5.ln2@goaway.wombat.san-francisco.ca.us...
>
> That just seems like a cruel joke. It implies to someone less clueful
> that your license means something. If you want to accurately call your
> software "open-source" you need to actually use a license that is open
> source e.g. http://opensource.org/licenses/category .
>
You probably did not read it.
here is the open source definition:
http://www.opensource.org/docs/definition.php
In that document it does not say anywhere "software need to use a license
that is opensource to be open source.". (??)
That document says software or license is considered "opesource", if
conditions 123.. for this and this reason, etc. are met.
(which is logical, and in this specific case conditions are met)
It brings us back to original proprietary license, where did you see it is
not in sync with above definition.
------------------------------
Date: Mon, 08 Sep 2008 05:41:50 GMT
From: Hal Vaughan <hal@halblog.com>
Subject: Re: Any GUI Toolkit Suggestions?
Message-Id: <yW2xk.697$Dj1.236@trnddc02>
zentara wrote:
> On Sat, 06 Sep 2008 16:25:12 GMT, Hal Vaughan <hal@halblog.com> wrote:
>
>
>>The tough parts is that the user will need to be able to add more panels,
>>like a card layout in Java Swing. There'll be a drop-down or combo list
>>where the user can pick which panel they want to use or to make a new one.
>>Then, on each different panel, they can pick where to add buttons and
>>specify the size and color of the button (or possibly pick from a list of
>>Thanks!
>
> It sounds like the perfect job for the Notebook widget. Both Tk and Gtk2
> have them. Tk is easier to learn, while Gtk2 is a bit more advanced and
> difficult to master.
I guess there's no reason to go with Gtk2 if TK will do what I need. The
notebook widget is basically what I'd be using. There are other
variations, but it'd be just fine.
It occurs to me that I should do the GUI designer part of this app as a
single module, if I could, since I'm sure other people could use an app
that lets the user define buttons then attach functions to those buttons.
Thanks, all, for the help. I went scrounging and got lucky and found a
cheap copy of "Mastering Perl/Tk" so I bought it. I haven't checked how up
to date it was, but it was gently used and dirt cheap so I figured I might
as well get it.
Hal
------------------------------
Date: Mon, 08 Sep 2008 08:22:14 -0400
From: zentara <zentara@highstream.net>
Subject: Re: Any GUI Toolkit Suggestions?
Message-Id: <vv5ac4hcg4ngqf1ofbe7cvurjais270anf@4ax.com>
On Mon, 08 Sep 2008 05:41:50 GMT, Hal Vaughan <hal@halblog.com> wrote:
>zentara wrote:
>
>> It sounds like the perfect job for the Notebook widget. Both Tk and Gtk2
>> have them. Tk is easier to learn, while Gtk2 is a bit more advanced and
>> difficult to master.
>
>I guess there's no reason to go with Gtk2 if TK will do what I need. The
>notebook widget is basically what I'd be using. There are other
>variations, but it'd be just fine.
>
>It occurs to me that I should do the GUI designer part of this app as a
>single module, if I could, since I'm sure other people could use an app
>that lets the user define buttons then attach functions to those buttons.
>
>Thanks, all, for the help. I went scrounging and got lucky and found a
>cheap copy of "Mastering Perl/Tk" so I bought it. I haven't checked how up
>to date it was, but it was gently used and dirt cheap so I figured I might
>as well get it.
>Hal
You also can search groups.google.com for "perl tk notebook" for many
examples. There is also the Tk::DynaTabFrame
http://search.cpan.org/search?query=dynatabframe&mode=all
which is a Notebook with many added features.
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html
------------------------------
Date: Sun, 07 Sep 2008 16:56:36 -1000
From: Jeff <jeff@simstech.net>
Subject: Re: array of arrays to hash of hashes
Message-Id: <S56dnet0Lpn5CVnVnZ2dnUVZ_sHinZ2d@hawaiiantel.net>
Thanks a million..
I learned something here and it's great
Mark Clements wrote:
> Jeff wrote:
>> Hi all,
>>
>> I have a category / subcategory file that looks like this
>>
>> cereal
>> cereal:cold:cheerios
>> cereal:cold:corn flakes
>> cereal:hot:oatmeal
>> cereal:hot:cream of wheat
>> bread
>> bread:dakine sweet bread
>> bread:wheat
>> bread:white
>>
>> ...... Anyway you get the picture
>>
>> I read the file in and place into array of arrays
>>
>> open FILE, "$file";
>> my @file = (<FILE>);
>> close FILE;
>>
>> my @a;
>> foreach (@file){
>> my @line = split ':', $_;
>> push (@a, \@line);
>> }
>>
>> I want to put this into a hash of hashes where the last element would be
>> equal to 1. something like this
>> $cereal->{cold}->{cheerios} =1;
>> or $bread->{wheat} = 1;
>>
>> if later on down the line the file changes so that there is more
>> subcategories, the 1 would be replaced by a new hash like this
>>
>> $cereal->{cold}->{cheerios}->{regular} =1;
>> $cereal->{cold->{cheerios}->{honeynut} = 1;
>>
>> I'm having trouble writing a function to do this.
>> Any help or ideas would be appreciated
> The most obvious way of doing it is to use a recursive function (google
> "recursion") to walk the data structure each time a new item is inserted
> (ie for each new line). You probably want something a bit like this
> (insert_item is the recursive function, if that isn't obvious):
>
> mark@hermes:~$ cat cereal.pl
> #!/usr/bin/perl
> #
> use warnings;
> use strict;
>
> use Data::Dumper;
>
> my $root = {};
>
> while(my $line = <DATA> ){
> chomp $line;
> my @items = split /:/,$line;
>
> insert_item( $root, @items );
> }
>
> print Dumper $root;
>
> sub insert_item {
> my $current = shift;
> my $nextkey = shift;
> my @items = @_;
>
> if(@items){
> my $newsubtree;
> if(ref $current->{$nextkey}){
> $newsubtree = $current->{ $nextkey };
> }else{
> $newsubtree = {};
> $current->{ $nextkey } = $newsubtree;
> }
> insert_item( $newsubtree, @items );
> }else{
> $current->{ $nextkey } = 1;
> }
> }
>
> __END__
> cereal
> cereal:cold:cheerios
> cereal:cold:corn flakes
> cereal:hot:oatmeal
> cereal:hot:cream of wheat
> bread
> bread:dakine sweet bread
> bread:wheat
> bread:white
> mark@hermes:~$ perl cereal.pl
> $VAR1 = {
> 'bread' => {
> 'white' => 1,
> 'wheat' => 1,
> 'dakine sweet bread' => 1
> },
> 'cereal' => {
> 'cold' => {
> 'cheerios' => 1,
> 'corn flakes' => 1
> },
> 'hot' => {
> 'cream of wheat' => 1,
> 'oatmeal' => 1
> }
> }
> };
>
>
> Mark
>
------------------------------
Date: Mon, 08 Sep 2008 10:27:42 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: feedback from system() etc. calls?
Message-Id: <RJednXqx8d-SbVnVnZ2dnUVZ8uqdnZ2d@posted.plusnet>
I use perl quite often as a glue to tie together
command line tools under Linux.
Recently I have been using tools that have substantial
run times.
IN light of this, some of the tools output progress
reports, either as moving bars, or just messages
at key stages.
At the moment, sadly, I only get these
messages when the command has finished,
which is not so pleasant; I would like to
see them as they are generated.
Has anyone got a variant
of system, popen etc that has
worked through the various issues
of buffering, differentiating STDOUT, SDTERR etc?
Security is not an issue for me; these scripts
are running stand alone from the command line.
BugBear
------------------------------
Date: Mon, 08 Sep 2008 12:02:34 +0200
From: Joost Diepenmaat <joost@zeekat.nl>
Subject: Re: feedback from system() etc. calls?
Message-Id: <87od2zdkg5.fsf@zeekat.nl>
bugbear <bugbear@trim_papermule.co.uk_trim> writes:
> Has anyone got a variant
> of system, popen etc that has
> worked through the various issues
> of buffering, differentiating STDOUT, SDTERR etc?
This might be considered overkill, but POE::Wheel::Run does more
or less everything you might want.
http://poe.perl.org/?POE_Cookbook/Child_Processes
--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
------------------------------
Date: Mon, 8 Sep 2008 04:42:21 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Sep 8 2008
Message-Id: <K6v12L.1zBG@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
AUBBC-1.20
http://search.cpan.org/~sflex/AUBBC-1.20/
----
Abstract-Meta-Class-0.11
http://search.cpan.org/~adrianwit/Abstract-Meta-Class-0.11/
Simple meta object protocol implementation.
----
App-CLI-Toolkit-0.01
http://search.cpan.org/~swhitaker/App-CLI-Toolkit-0.01/
a helper module for generating command-line utilities
----
App-CLI-Toolkit-0.02
http://search.cpan.org/~swhitaker/App-CLI-Toolkit-0.02/
a helper module for generating command-line utilities
----
CGI-Carp-Throw-0.01
http://search.cpan.org/~ronaldws/CGI-Carp-Throw-0.01/
CGI::Carp exceptions that don't look like errors.
----
CPAN-Indexer-Mirror-0.02
http://search.cpan.org/~adamk/CPAN-Indexer-Mirror-0.02/
Creates the mirror.yml and mirror.json files
----
CPAN-Mini-Webserver-0.42
http://search.cpan.org/~lbrocard/CPAN-Mini-Webserver-0.42/
Search and browse Mini CPAN
----
Chart-Gnuplot-0.05
http://search.cpan.org/~kwmak/Chart-Gnuplot-0.05/
Plot graph using Gnuplot on the fly
----
DCOP-0.038
http://search.cpan.org/~jcmuller/DCOP-0.038/
Perl extension to speak to the dcop server via system's DCOP client.
----
ExtUtils-MakeMaker-6.45_02
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.45_02/
Create a module Makefile
----
File-Corresponding-0.001
http://search.cpan.org/~johanl/File-Corresponding-0.001/
Find corresponding files in the directory tree
----
File-Fu-v0.0.4
http://search.cpan.org/~ewilhelm/File-Fu-v0.0.4/
file and directory objects
----
Forest-0.04
http://search.cpan.org/~stevan/Forest-0.04/
A collection of n-ary tree related modules
----
Games-Risk-0.5.1
http://search.cpan.org/~jquelin/Games-Risk-0.5.1/
classical 'risk' board game
----
Geo-GoogleMaps-MobileTool-0.0.1
http://search.cpan.org/~kokogiko/Geo-GoogleMaps-MobileTool-0.0.1/
Provide some functions useful for using GoogleMaps Static API on mobile sites
----
Gtk2-GladeXML-1.007
http://search.cpan.org/~tsch/Gtk2-GladeXML-1.007/
Create user interfaces directly from Glade XML files.
----
HTML-DOM-0.019
http://search.cpan.org/~sprout/HTML-DOM-0.019/
A Perl implementation of the HTML Document Object Model
----
HTML-FormFu-ExtJS-0.05
http://search.cpan.org/~perler/HTML-FormFu-ExtJS-0.05/
Render and validate ExtJS forms using HTML::FormFu
----
HTML-LinkList-0.1503
http://search.cpan.org/~rubykat/HTML-LinkList-0.1503/
Create a 'smart' list of HTML links.
----
HTML-SimpleLinkExtor-1.22
http://search.cpan.org/~bdfoy/HTML-SimpleLinkExtor-1.22/
Extract links from HTML
----
IMAP-Admin-1.6.6
http://search.cpan.org/~eestabroo/IMAP-Admin-1.6.6/
Perl module for basic IMAP server administration
----
Image-Pngslimmer-0.30
http://search.cpan.org/~acmcmen/Image-Pngslimmer-0.30/
slims (dynamically created) PNGs
----
Kephra-0.3.10_3
http://search.cpan.org/~lichtkind/Kephra-0.3.10_3/
crossplatform, GUI-Texteditor along perllike Paradigms
----
Module-DevAid-0.2303
http://search.cpan.org/~rubykat/Module-DevAid-0.2303/
tools to aid perl module developers
----
MooseX-Daemonize-0.08
http://search.cpan.org/~stevan/MooseX-Daemonize-0.08/
Role for daemonizing your Moose based application
----
MooseX-TheSchwartz-0.01
http://search.cpan.org/~fayland/MooseX-TheSchwartz-0.01/
TheSchwartz based on Moose!
----
MooseX-TheSchwartz-0.02
http://search.cpan.org/~fayland/MooseX-TheSchwartz-0.02/
TheSchwartz based on Moose!
----
Net-Address-Ethernet-1.113
http://search.cpan.org/~mthurn/Net-Address-Ethernet-1.113/
find hardware ethernet address
----
Net-PingFM-0.2
http://search.cpan.org/~draxil/Net-PingFM-0.2/
Interact with ping.fm from perl
----
Perl-Critic-1.093_001
http://search.cpan.org/~elliotjs/Perl-Critic-1.093_001/
Critique Perl source code for best-practices.
----
Perl-Critic-1.093_01
http://search.cpan.org/~elliotjs/Perl-Critic-1.093_01/
Critique Perl source code for best-practices.
----
Persistence-Entity-0.07
http://search.cpan.org/~adrianwit/Persistence-Entity-0.07/
Persistence API for perl classes.
----
SQL-Entity-0.05
http://search.cpan.org/~adrianwit/SQL-Entity-0.05/
Entity sql abstraction layer.
----
Spreadsheet-ParseExcel-0.33
http://search.cpan.org/~szabgab/Spreadsheet-ParseExcel-0.33/
Get information from Excel file
----
Sys-Filesystem-ID-1.04
http://search.cpan.org/~leocharre/Sys-Filesystem-ID-1.04/
----
Sys-Proctitle-0.03
http://search.cpan.org/~opi/Sys-Proctitle-0.03/
modify proctitle on Linux
----
Template-Refine-0.01
http://search.cpan.org/~jrockway/Template-Refine-0.01/
refine HTML
----
Test-Differences-Color-v0.01
http://search.cpan.org/~alec/Test-Differences-Color-v0.01/
colorize output of Test::Differences
----
Test-Differences-Color-v0.02
http://search.cpan.org/~alec/Test-Differences-Color-v0.02/
colorize output of Test::Differences
----
Text-Template-Simple-0.54_03
http://search.cpan.org/~burak/Text-Template-Simple-0.54_03/
Simple text template engine
----
WWW-Mechanize-Plugin-JavaScript-0.005
http://search.cpan.org/~sprout/WWW-Mechanize-Plugin-JavaScript-0.005/
JavaScript plugin for WWW::Mechanize
----
WWW-NioTV-v0.04
http://search.cpan.org/~alec/WWW-NioTV-v0.04/
retrieve TV information from http://www.niotv.com/
----
WWW-Search-Ebay-2.243
http://search.cpan.org/~mthurn/WWW-Search-Ebay-2.243/
backend for searching www.ebay.com
----
Waft-0.99_02
http://search.cpan.org/~tamashiro/Waft-0.99_02/
A simple web application framework
----
Waft-0.99_03
http://search.cpan.org/~tamashiro/Waft-0.99_03/
A simple web application framework
----
WebService-Eulerian-Analytics-0.4
http://search.cpan.org/~mjondet/WebService-Eulerian-Analytics-0.4/
Eulerian Analytics API
----
autodie-1.992
http://search.cpan.org/~pjf/autodie-1.992/
Replace functions with ones that succeed or die with lexical scope
----
warnings-method-0.01
http://search.cpan.org/~gfuji/warnings-method-0.01/
Produces warnings if methods are called as functions
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Sun, 07 Sep 2008 21:47:35 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Perl equivalent of unix time command
Message-Id: <m1zlmjwgqw.fsf@dot-app.org>
Melroy <melroysoares@hotmail.com> writes:
> my $v = `time -p gzip energylossmc.dat 1>/dev/null 2>&1` ;
> print $v ;
> Nothing seems to get captured in the variable v?
Your shell command redirects both stdout and stderr to /dev/null, so
there's nothing to capture.
sherm--
--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Sun, 07 Sep 2008 20:29:25 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perl equivalent of unix time command
Message-Id: <qn69c4tsusus93p30eif2ebqdcbbbkbauv@4ax.com>
[Please do not top-post. It interrupts the normal flow of reading and
leaves people wondering which part of a message your comments are
referring to.]
Melroy <melroysoares@hotmail.com> wrote:
>> You may want to check 'perldoc -q profile':
>> How do I profile my Perl programs?
>I want to profile a bunch of command line programs using perl. I tried
>to call the unix
Sorry, then I misunderstood your original request.
>time comamnd using backslash as well as the system comamnd but that
>does not seem to capture the output. So i thought to check if there is
>something native to perl.
Backslash? Could you post an actual code sample?
As for system(): it is not supposed to capture any output, please see
third paragraph, third sentence of the documentation of system().
jue
------------------------------
Date: Sun, 07 Sep 2008 20:32:03 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perl equivalent of unix time command
Message-Id: <r179c4p0scdupbmf8ut7s5c46780dogf4g@4ax.com>
Melroy <melroysoares@hotmail.com> wrote:
>my $v = `time -p gzip energylossmc.dat 1>/dev/null 2>&1` ;
>print $v ;
>Nothing seems to get captured in the variable v?
>What am I doing wrong?
My shell skills are somewhat rusty, but I think you are redirecting
stdin as well as stdout to /dev/null.
And aside of those two there simply is nothing else that could possibly
be outputted by the command and captured in $v.
jue
------------------------------
Date: Sun, 07 Sep 2008 20:39:21 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perl equivalent of unix time command
Message-Id: <ii79c4d49vfk1ub3egtnk1helfge5honk1@4ax.com>
Jürgen Exner <jurgenex@hotmail.com> wrote:
>Melroy <melroysoares@hotmail.com> wrote:
>>my $v = `time -p gzip energylossmc.dat 1>/dev/null 2>&1` ;
>>print $v ;
>>Nothing seems to get captured in the variable v?
>>What am I doing wrong?
>
>My shell skills are somewhat rusty, but I think you are redirecting
>stdin as well as stdout to /dev/null.
Daaaah! Make that STDOUT and STDERR, of course.
>And aside of those two there simply is nothing else that could possibly
>be outputted by the command and captured in $v.
>
>jue
------------------------------
Date: Mon, 8 Sep 2008 05:00:38 -0700 (PDT)
From: Arun <sajapuram.arun.prakash@gmail.com>
Subject: What is wrong in the following script
Message-Id: <d5b80c8c-b292-4276-bb52-3ff95bf85690@l43g2000hsh.googlegroups.com>
problem: excecutes only DATA string but nor IO1 and IO0.
script:
#!\usr\bin\perl -w
use IO::Socket;
use diagnostics;
use strict;
use POSIX qw(strftime);
my $remote_host = "";
my $remote_port = "";
my ($handle, $send_data,$send_i1,$send_i0,$count);
$count=0;
$handle= IO::Socket::INET->new( PeerAddr => $remote_host,
PeerPort => $remote_port,
Proto => "tcp",
Type => SOCK_STREAM
)
|| die "Couldn't connect to $remote_host:$remote_port: \n";
print STDERR "[Connected to $remote_host:$remote_port]\n";
DATA: while(<$handle=1>)
{
for($count=0;$count<180;$count++)
{
$send_data = self define string;
$handle-> send($send_data);
$count=0;
sleep(180);
}
}
IO1: while(<$handle=1>)
{
for($count=0;$count<240;$count++)
{
$send_i1 = self defined string
$handle-> send($send_i1);
$count=0;
sleep(240);
}
}
IO0: while(<$handle=1>)
{
for($count=0;$count<360;$count++)
{
$send_i0 = self defined string;
$handle-> send($send_i0);
$count=0;
sleep(360);
}
}
------------------------------
Date: Mon, 08 Sep 2008 14:56:51 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: What is wrong in the following script
Message-Id: <ga37e8$isn$1@nntp.fujitsu-siemens.com>
Arun wrote:
Perhaps you try to explain to us and to yourself, what this line is
supposed to do:
> DATA: while(<$handle=1>)
Josef
--
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 1844
***************************************