[29360] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 604 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 30 03:09:50 2007

Date: Sat, 30 Jun 2007 00:09:05 -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           Sat, 30 Jun 2007     Volume: 11 Number: 604

Today's topics:
    Re: Assigning another filehandle to STDOUT, using binmo <rvtol+news@isolution.nl>
    Re: FAQ 1.6 What is perl6? <bik.mido@tiscalinet.it>
    Re: hex to ebcdic  roch77@gmail.com
    Re: hex to ebcdic <rvtol+news@isolution.nl>
    Re: hex to ebcdic <noreply@gunnar.cc>
    Re: lurking <invalid@invalid.nyet>
        new CPAN modules on Sat Jun 30 2007 (Randal Schwartz)
    Re: portable /dev/null ? <sisyphus1@nomail.afraid.org>
    Re: Problem with PERL function <mzhao1@gmail.com>
    Re: Problem with PERL function <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: Simple fork examples <bik.mido@tiscalinet.it>
    Re: Simple fork examples <glex_no-spam@qwest-spam-no.invalid>
    Re: Simple fork examples <shmh@bigpond.net.au>
        The $a have any special meanning ? <sonet.all@msa.hinet.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 30 Jun 2007 02:08:25 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Assigning another filehandle to STDOUT, using binmode.
Message-Id: <f64dur.vg.1@news.isolution.nl>

Peter J. Holzer schreef:
> Dr.Ruud:
>> Adam Funk:

>>> I think I get it.  String literals and variables just contain
>>> strings of bytes, and encoding is a consideration only for input
>>> and output --- or is that only for output?
>>
>> A Perl text string contains characters. See perlunitut:
>> http://search.cpan.org/perldoc?perlunitut
>
> True, but not the answer to Adam's question. Not every perl string is
> a perl text string. Strings can be used to store non-textual
> information.

You should read more carefully, I wrote "A Perl *text* string". The
concept is further defined in perlunitut.
Together it is a complete answer to Adam's question.

-- 
Affijn, Ruud

"Gewoon is een tijger."



------------------------------

Date: Fri, 29 Jun 2007 23:07:42 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: FAQ 1.6 What is perl6?
Message-Id: <44ta831u4rifm9tbedlhciuqqbhmblklr1@4ax.com>

On Fri, 29 Jun 2007 10:03:32 -0700, "Clenna Lumina"
<savagebeaste@yahoo.com> wrote:

>And btw, I'm not a female, despite how my name may sound. I don't know of 
>which country it actually comes from, I only know my family was originally 
>of eastern European decent (came to the U.S. 3 generations ago.) Believe me, 
>going through grade school was hard enough with a name like mine :) 

BTW: quite a lot of people thinks I'm MicheLLe too...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Fri, 29 Jun 2007 17:05:50 -0700
From:  roch77@gmail.com
Subject: Re: hex to ebcdic
Message-Id: <1183161950.629924.59680@q75g2000hsh.googlegroups.com>

Thanks a lot.
I have Convert::EBCDIC, but didn't quite figure out how to do it.

Actually the file that I am ftping from the mainframe has packed
numeric (comp.) as well as these display fields.  So thats why I do a
binary mode ftp.

Then I use "unpack "H*", $buf" and all the display fields show up as
hex representation of EBCDIC.
So I will use Gunner's suggestion to convert them..  There maybe other
ways like the convertibm390 module as well I guess..

Thanks very much once again..

>      use Convert::EBCDIC 'ebcdic2ascii';
>      $hex = 'f1f2d7d9f0';
>      ( $ebcdic = $hex ) =~ s/(..)/chr(hex $1)/eg;
>      $ascii = ebcdic2ascii( $ebcdic );
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl




------------------------------

Date: Sat, 30 Jun 2007 02:19:16 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: hex to ebcdic
Message-Id: <f64er2.1jc.1@news.isolution.nl>

Gunnar Hjalmarsson schreef:
> roch77:

>> I have a string of hex that represent ebcdic characters.  Is there a
>> way that I can do the following in perl.
>> 
>> hex string = "f1f2d7d9f0"
>> 
>> the result I want = "12PR0"
>> 
>>> From looking up a ascii/hex/ebcdic table, I was able to arrive at
>>> the 
>> result.  ie: f1 => 1, f2 => 2, d7 =>P etc..
>> 
>> Is there a perl function that will do this?
> 
> There is a module.
> 
>      use Convert::EBCDIC 'ebcdic2ascii';
>      $hex = 'f1f2d7d9f0';
>      ( $ebcdic = $hex ) =~ s/(..)/chr(hex $1)/eg;
>      $ascii = ebcdic2ascii( $ebcdic );

See also Encode. 

-- 
Affijn, Ruud

"Gewoon is een tijger."


------------------------------

Date: Sat, 30 Jun 2007 05:11:25 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: hex to ebcdic
Message-Id: <5em04hF39mqonU1@mid.individual.net>

Dr.Ruud wrote:
> Gunnar Hjalmarsson schreef:
>> roch77:
>>> I have a string of hex that represent ebcdic characters.  Is there a
>>> way that I can do the following in perl.
>>>
>>> hex string = "f1f2d7d9f0"
>>>
>>> the result I want = "12PR0"
>>>
>>> From looking up a ascii/hex/ebcdic table, I was able to arrive at
>>> the result.  ie: f1 => 1, f2 => 2, d7 =>P etc..
>>>
>>> Is there a perl function that will do this?
>>
>> There is a module.
>>
>>      use Convert::EBCDIC 'ebcdic2ascii';
>>      $hex = 'f1f2d7d9f0';
>>      ( $ebcdic = $hex ) =~ s/(..)/chr(hex $1)/eg;
>>      $ascii = ebcdic2ascii( $ebcdic );
> 
> See also Encode.

Right, making use of a standard module is more convenient.

     use Encode 'decode';
     $hex = 'f1f2d7d9f0';
     ( $ebcdic = $hex ) =~ s/(..)/chr(hex $1)/eg;
     $ascii = decode 'posix-bc', $ebcdic;

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Fri, 29 Jun 2007 19:02:15 -0400
From: "Wade Ward" <invalid@invalid.nyet>
Subject: Re: lurking
Message-Id: <pt2dnXoCRJQtEhjbnZ2dnUVZ_oernZ2d@comcast.com>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:hqg983to2bta5n7jo7t6ccj2gkiqrehf94@4ax.com...
> On Fri, 29 Jun 2007 03:24:25 -0400, "Wade Ward" <invalid@invalid.nyet>
> wrote:
>
>>I just wanted to mention that I'm following the standard wisdom in this
>>forum to lurk for 2 weeks before waxing categorical.
>
> Well done, but lurking is generally done in the shadow. So making this
> public one may argue that you're meta-lurking. Or not? :-)
Maybe semi-lurking.

> BTW: due to English not being my native language I can't understand
> the "waxing categorical" expression: care to explain it?
Conversations "wax" on.  When one speaks categorically, he is logical, 
careful.  He tries to account for all cases.

>>Our public library has a half a dozen decent references for perl.
>
> And? Is this meant to be a positive or negative comment? (Too many?
> Too few?)
Our libraries in the states are often glorified homeless shelters.  A 
half-dozen good sources on a computer language is good.  We even have _The 
Art of Computer Programming_.  The language I use most is fortran.  There is 
not a single reference for that.  Tja.
--
WW 




------------------------------

Date: Sat, 30 Jun 2007 04:42:14 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Jun 30 2007
Message-Id: <JKFMEE.H1t@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.

Acme-Roman-v0.0.2
http://search.cpan.org/~ferreira/Acme-Roman-v0.0.2/
Do maths like Romans did 
----
Alien-scriptaculous-1.6.5
http://search.cpan.org/~gtermars/Alien-scriptaculous-1.6.5/
installing and finding script.aculo.us 
----
Alien-scriptaculous-1.65
http://search.cpan.org/~gtermars/Alien-scriptaculous-1.65/
installing and finding script.aculo.us 
----
Alien-scriptaculous-1.7.0
http://search.cpan.org/~gtermars/Alien-scriptaculous-1.7.0/
installing and finding script.aculo.us 
----
Apache-BabyConnect-0.92a
http://search.cpan.org/~maxou/Apache-BabyConnect-0.92a/
uses DBI::BabyConnect to initiate persistent database connections 
----
Apache2-ASP-1.08
http://search.cpan.org/~johnd/Apache2-ASP-1.08/
Perl extension for ASP on mod_perl2. 
----
Apache2-ASP-1.09
http://search.cpan.org/~johnd/Apache2-ASP-1.09/
Perl extension for ASP on mod_perl2. 
----
Apache2-ASP-1.11
http://search.cpan.org/~johnd/Apache2-ASP-1.11/
Perl extension for ASP on mod_perl2. 
----
Apache2-ASP-1.12
http://search.cpan.org/~johnd/Apache2-ASP-1.12/
Perl extension for ASP on mod_perl2. 
----
Apache2-ASP-1.13
http://search.cpan.org/~johnd/Apache2-ASP-1.13/
Perl extension for ASP on mod_perl2. 
----
CGI-Bus-0.61
http://search.cpan.org/~makarow/CGI-Bus-0.61/
Web and DBI Application object 
----
Catalyst-Controller-Rose-0.04
http://search.cpan.org/~karman/Catalyst-Controller-Rose-0.04/
RDBO and RHTMLO base classes for Catalyst 
----
Catalyst-Model-FormFu-0.01000
http://search.cpan.org/~dmaki/Catalyst-Model-FormFu-0.01000/
FormFu In Your Model 
----
Catalyst-Model-RDBO-0.05
http://search.cpan.org/~karman/Catalyst-Model-RDBO-0.05/
base class for Rose::DB::Object model 
----
DBI-BabyConnect-0.92a
http://search.cpan.org/~maxou/DBI-BabyConnect-0.92a/
creates an object that holds a DBI connection to a database 
----
DBIx-Web-0.69
http://search.cpan.org/~makarow/DBIx-Web-0.69/
Active Web Database Layer 
----
Debug-StrDump-1.0.0
http://search.cpan.org/~kscript/Debug-StrDump-1.0.0/
Provides a byte representation of a string. 
----
ExtUtils-MakeMaker-6.33
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.33/
Create a module Makefile 
----
Gearman-1.09
http://search.cpan.org/~bradfitz/Gearman-1.09/
----
HTML-FormFu-0.01000_01
http://search.cpan.org/~cfranks/HTML-FormFu-0.01000_01/
HTML Form Creation, Rendering and Validation Framework 
----
HTML-Menu-TreeView-0.6.7
http://search.cpan.org/~lze/HTML-Menu-TreeView-0.6.7/
----
IO-KQueue-0.32
http://search.cpan.org/~msergeant/IO-KQueue-0.32/
perl interface to the BSD kqueue system call 
----
IO-Socket-SIPC-0.01_04
http://search.cpan.org/~bloonix/IO-Socket-SIPC-0.01_04/
Serialized perl structures for inter process communication. 
----
IO-Socket-SIPC-0.02
http://search.cpan.org/~bloonix/IO-Socket-SIPC-0.02/
Serialize perl structures for inter process communication. 
----
LEOCHARRE-CLI-1.02
http://search.cpan.org/~leocharre/LEOCHARRE-CLI-1.02/
useful subs for coding cli scripts 
----
Muldis-DB-0.0.1
http://search.cpan.org/~duncand/Muldis-DB-0.0.1/
Full-featured truly relational DBMS in Perl 
----
Net-SSH-Expect-0.03
http://search.cpan.org/~bnegrao/Net-SSH-Expect-0.03/
SSH wrapper to execute remote commands 
----
Net-SSH-Expect-0.04
http://search.cpan.org/~bnegrao/Net-SSH-Expect-0.04/
SSH wrapper to execute remote commands 
----
Net-SSH-Expect-0.05
http://search.cpan.org/~bnegrao/Net-SSH-Expect-0.05/
SSH wrapper to execute remote commands 
----
Net-VNC-0.36
http://search.cpan.org/~lbrocard/Net-VNC-0.36/
A simple VNC client 
----
OpenGL-Image-0.00_1
http://search.cpan.org/~bfree/OpenGL-Image-0.00_1/
copyright 2007 Graphcomp - ALL RIGHTS RESERVED Author: Bob "grafman" Free - grafman@graphcomp.com 
----
POE-Component-EasyDBI-1.22
http://search.cpan.org/~xantus/POE-Component-EasyDBI-1.22/
Perl extension for asynchronous non-blocking DBI calls in POE 
----
POE-Component-Server-IRC-1.12
http://search.cpan.org/~bingos/POE-Component-Server-IRC-1.12/
a fully event-driven networkable IRC server daemon module. 
----
Parse-RecDescent-FAQ-5.02
http://search.cpan.org/~tbone/Parse-RecDescent-FAQ-5.02/
the official, authorized FAQ for Parse::RecDescent. 
----
Text-Greeking-zh_TW-0.0.1
http://search.cpan.org/~gugod/Text-Greeking-zh_TW-0.0.1/
A module for generating meaningless Chinese text that creates the illusion of the finished document. 
----
WWW-Facebook-API-v0.3.6
http://search.cpan.org/~unobe/WWW-Facebook-API-v0.3.6/
Facebook API implementation 
----
WWW-FreshBooks-API-v0.0.1
http://search.cpan.org/~mindhack/WWW-FreshBooks-API-v0.0.1/
Perl interface to the FreshBooks API v2.0 
----
WWW-Myspace-0.66
http://search.cpan.org/~grantg/WWW-Myspace-0.66/
Access MySpace.com profile information from Perl 
----
Weed-0.0065
http://search.cpan.org/~hooo/Weed-0.0065/
Don't use it. It's in development. Everything's gonna change. 
----
Win32-Script-0.58
http://search.cpan.org/~makarow/Win32-Script-0.58/
system administrator`s library - for login and application startup scripts, etc 
----
XML-RSS-1.31
http://search.cpan.org/~abh/XML-RSS-1.31/
creates and updates RSS files 


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/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: Sat, 30 Jun 2007 11:19:38 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: portable /dev/null ?
Message-Id: <4685af87$0$7152$afc38c87@news.optusnet.com.au>


"Larry" <larry.grant.dc@gmail.com> wrote in message 
news:1183129074.575021.46410@w5g2000hsg.googlegroups.com...
>I want to run an external command using "system" but discard its
> standard output.  I know under *nix I could do:
>
>    system 'myCmd > /dev/null';
>
> and Windows:
>
>    system 'myCmd > nul';
>
> but is there a more portable way to do that?
>

You could use File::Spec. Then the code becomes (untested):

my $devnull = File::Spec->devnull();
system("myCmd > $devnull"); # should be portable

Cheers,
Rob 



------------------------------

Date: Fri, 29 Jun 2007 15:33:59 -0700
From:  michaelzhao <mzhao1@gmail.com>
Subject: Re: Problem with PERL function
Message-Id: <1183156439.414782.195120@n60g2000hse.googlegroups.com>

On Jun 29, 2:16 pm, use...@DavidFilmer.com wrote:
> On Jun 28, 3:03 pm, michaelzhao <mzh...@gmail.com> wrote:
>
> > jerkoff
>
> Don't it just annoy you when you take the time to read someone's post
> and make a reply, and then this n00b goes off and flames a respected
> group regular who was only trying to be helpful.  It really makes you
> sorry you ever read or responded to the post.
>
> * Ploink *
>
> --
> The best way to get a good answer is to ask a good question.
> David Filmer (http://DavidFilmer.com)

Ha! Lets see... I was grateful for everyone elses suggestions. But
tell me, besides informing me that "PERL" was actually "Perl", he did
not help me at all with my problem besides giving me the response that
I needed the "$" variable.

Other people helped me a good deal giving relevant and educational
discussion and I am grateful to them. So, I don't care if he is a
regular or if hes a Perl god for that matter. The post he made was
neither helpful nor educational... besides me learning the "Perl" of
course. Oh, and next time I'll post a short script.



------------------------------

Date: Fri, 29 Jun 2007 16:27:52 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Problem with PERL function
Message-Id: <p4hgl4x712.ln2@goaway.wombat.san-francisco.ca.us>

On 2007-06-29, michaelzhao <mzhao1@gmail.com> wrote:
>
> Other people helped me a good deal giving relevant and educational
> discussion and I am grateful to them. So, I don't care if he is a
> regular or if hes a Perl god for that matter. The post he made was
> neither helpful nor educational... besides me learning the "Perl" of
> course. Oh, and next time I'll post a short script.

Your post calling him a jerkoff was neither helpful nor educational, and
apparently not only alienated him, but many other regular posters who
might otherwise have helped you in the future.  Your continuing to
defend calling him a jerkoff is likely to alienate even more regular
posters.  Is that really the path you wish to pursue?

--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: Fri, 29 Jun 2007 23:08:50 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Simple fork examples
Message-Id: <t5ta83dj418vpuqvu64ad28v5tt6je255v@4ax.com>

On Fri, 29 Jun 2007 16:02:11 GMT, "Simon" <shmh@bigpond.net.au> wrote:

>Michele!!!
>
>THANK YOU SO MUCH FOR THAT..IT WORKS NOW..
>
>Thanks Michele!

*Please* do not top-post!

>> Just make that
>>
>>  my $num_kids = shift || 5;

Maybe it should have been 42...


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: Fri, 29 Jun 2007 16:22:15 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Simple fork examples
Message-Id: <46857807$0$499$815e3792@news.qwest.net>

Simon wrote:
> Hi Michele!
> 
> Again thank you so much for that.
> 
> The reason is is that Im learning perl from scratch at my place of work.
> 
> I may well have the modules misplaced, but a perl guru at work is running 
> perl scripts such as the following..
[...]
> Id like to be able to do the same thing.
> I have seen in his code either fork, or Spawn process or something similar, 
> but want to learn to do the same thing.

Why not ask your local perl guru for help?  You'd probably learn things
much quicker.


------------------------------

Date: Sat, 30 Jun 2007 03:23:04 GMT
From: "Simon" <shmh@bigpond.net.au>
Subject: Re: Simple fork examples
Message-Id: <s0khi.1121$4A1.559@news-server.bigpond.net.au>

Hi J!

Thanks for your input.

Logically this would be the first step....and yes logically I have tried 
that.

But I dont know if you have, indeed I have, experienced my time in IT, that 
some people are helpful, while others arent?

If you have experienced that scenario, then you would know why I chose to 
come on here, just like everyone else, trying to ask some kind helpful 
people out there to share the great knowledge they have, and indeed, in 
time, to return that favour down the track.

Thanks for your comments.

S


"J. Gleixner" <glex_no-spam@qwest-spam-no.invalid> wrote in message 
news:46857807$0$499$815e3792@news.qwest.net...
> Simon wrote:
>> Hi Michele!
>>
>> Again thank you so much for that.
>>
>> The reason is is that Im learning perl from scratch at my place of work.
>>
>> I may well have the modules misplaced, but a perl guru at work is running 
>> perl scripts such as the following..
> [...]
>> Id like to be able to do the same thing.
>> I have seen in his code either fork, or Spawn process or something 
>> similar, but want to learn to do the same thing.
>
> Why not ask your local perl guru for help?  You'd probably learn things
> much quicker. 




------------------------------

Date: Sat, 30 Jun 2007 12:43:13 +0800
From: "sonet" <sonet.all@msa.hinet.net>
Subject: The $a have any special meanning ?
Message-Id: <f64n0b$d1h$1@netnews.hinet.net>

1.pl
----------------------
use strict;
$a=1;

the perl does not return error (Global symbol "$a" requires explicit package 
name...)

but

2.pl
----------------------
use strict;
$c=1;

the perl return error (Global symbol "$c" requires explicit package name...) 




------------------------------

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 604
**************************************


home help back first fref pref prev next nref lref last post