[29359] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 603 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 29 16:10:09 2007

Date: Fri, 29 Jun 2007 13:09:08 -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           Fri, 29 Jun 2007     Volume: 11 Number: 603

Today's topics:
    Re: Assigning another filehandle to STDOUT, using binmo <hjp-usenet2@hjp.at>
    Re: best Excel module <bik.mido@tiscalinet.it>
    Re: best Excel module <sigzero@gmail.com>
    Re: FAQ 1.6 What is perl6? <savagebeaste@yahoo.com>
        hex to ebcdic  roch77@gmail.com
    Re: hex to ebcdic <veatchla@yahoo.com>
    Re: hex to ebcdic <noreply@gunnar.cc>
    Re: Kicking off multiple processes at once instead of w <shmh@bigpond.net.au>
    Re: Oh great gurus of the list, I need help with a regu <savagebeaste@yahoo.com>
    Re: portable /dev/null ? <larry.grant.dc@gmail.com>
    Re: portable /dev/null ? <pue@gmx.net>
    Re: portable /dev/null ? <mritty@gmail.com>
    Re: Problem with PERL function <wahab-mail@gmx.de>
    Re: Problem with PERL function  usenet@DavidFilmer.com
    Re: Simple fork examples <shmh@bigpond.net.au>
    Re: Simple fork examples <bik.mido@tiscalinet.it>
    Re: Simple fork examples <bik.mido@tiscalinet.it>
    Re: Simple fork examples <bik.mido@tiscalinet.it>
    Re: Simple fork examples <shmh@bigpond.net.au>
    Re: Simple fork examples <shmh@bigpond.net.au>
    Re: Simple fork examples <noreply@gunnar.cc>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 29 Jun 2007 21:16:57 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Assigning another filehandle to STDOUT, using binmode.
Message-Id: <slrnf8aml9.j1f.hjp-usenet2@zeno.hjp.at>

On 2007-06-26 18:06, Dr.Ruud <rvtol+news@isolution.nl> wrote:
> Adam Funk schreef:
>> 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.

	hp


-- 
   _  | Peter J. Holzer    | I know I'd be respectful of a pirate 
|_|_) | Sysadmin WSR       | with an emu on his shoulder.
| |   | hjp@hjp.at         |
__/   | http://www.hjp.at/ |	-- Sam in "Freefall"


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

Date: Fri, 29 Jun 2007 17:37:08 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: best Excel module
Message-Id: <bn9a839lkof7laejl4j93nmid7184ik466@4ax.com>

On Fri, 29 Jun 2007 06:48:50 -0700, cartercc@gmail.com wrote:

>Subject: best Excel module

use Excel::Best;  # :-)

>several that might do what I need, such as Spreadsheet::WriteExcel,

*Completely* unknowledgeable myself, but I seem to have seen mentioned
that quite often.


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 11:01:00 -0700
From:  Robert Hicks <sigzero@gmail.com>
Subject: Re: best Excel module
Message-Id: <1183140060.967500.316430@g4g2000hsf.googlegroups.com>

On Jun 29, 9:48 am, carte...@gmail.com wrote:
> A couple of years ago, I converted our database output from wide
> formfeed paper printed on obselete line printers and delivered
> manually to printing them as PDF files delievered electronically. I am
> now converting our database output into CSV or XML files that can be
> opened with Excel, which is the user desiderata. Some of these files
> have hundreds of records, and PDF files can't be sorted or filtered,
> although they are a lot better than the old line printed variety.
>
> However, I am getting user complaints that the Excel files are ugly,
> without all the nice formatting that Excel supports. I have just
> looked at CPAN and discovered 149 modules for use with Excel, and see
> several that might do what I need, such as Spreadsheet::WriteExcel,
> Querylet::Output::Excel::OLE, Querylet::Output::Excel::XLS,
> Spreadsheet::SimpleExcel, etc.
>
> Are there maybe two or three that I can test that focus on cosmetics?
> I need something that can create colored backgrounds with bolded text,
> etc.
>
> Thanks, CC.

I have great usage of Spreadsheet::WriteExcel and the author is very
helpful.

Robert



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

Date: Fri, 29 Jun 2007 10:03:32 -0700
From: "Clenna Lumina" <savagebeaste@yahoo.com>
Subject: Re: FAQ 1.6 What is perl6?
Message-Id: <5eksbeF37vmfeU1@mid.individual.net>


"Art VanDelay" <art@xiotek.com> wrote in message 
news:Iz0hi.18561$RX.4399@newssvr11.news.prodigy.net...
> "Tad McClellan" <tadmc@seesig.invalid> wrote in message 
> news:slrnf88ggd.o52.tadmc@tadmc30.sbcglobal.net...
>> Art VanDelay <art@xiotek.com> wrote:
>> > Tad McClellan wrote:
>> > > Jim Carlock <anonymous@127.0.0.1> wrote:
>> > > > "Tad McClellan" wrote:
>
>
>> > > > Acceptable grammar? "would have been" or "would of been"?
>> >
>> > > Yes, I know. You missed the joke.
>> > >
>> > > I was mocking the troll by repeating his characteristic foibles
>> > > from earlier appearances here.
>> >
>> >
>> > Unlike someone who attacks without any provocation
>>
>>
>> It provoked us plenty when it was here last.
>
> 1) YOU are the one who keep provoking, not Clenna.
>
> 2) YOU don't know it's the same person. Since Clenna started posting here, 
> as far as I can see, he or she has done nothing wrong, so what is your 
> true rationale for jumping on his or her back? Boredom?

Thanks but I wouldn't waste me time arguing with people like this. They 
obviously have their own agenda and prefer to hide behind thier status and 
use it as an excuse to break their own rules (ie, trollish stalking.)

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 :) 




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

Date: Fri, 29 Jun 2007 10:30:54 -0700
From:  roch77@gmail.com
Subject: hex to ebcdic
Message-Id: <1183138254.916653.259000@g4g2000hsf.googlegroups.com>

hi,
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?
(I don't want to code the entire lookup table if I don't have to).

I am doing this in linux if that matters.

thanks



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

Date: Fri, 29 Jun 2007 13:35:14 -0500
From: l v <veatchla@yahoo.com>
Subject: Re: hex to ebcdic
Message-Id: <138ak4pudrao75@news.supernews.com>

roch77@gmail.com wrote:
> hi,
> 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?
> (I don't want to code the entire lookup table if I don't have to).
> 
> I am doing this in linux if that matters.
> 
> thanks
> 

Why do you have an ebcdic file on your linux computer?  I make ftp 
convert from ebcdic to ascii during the transfer.

-- 

Len


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

Date: Fri, 29 Jun 2007 21:47:25 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: hex to ebcdic
Message-Id: <5el640F38ecirU1@mid.individual.net>

roch77@gmail.com wrote:
> 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 );

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


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

Date: Fri, 29 Jun 2007 15:11:57 GMT
From: "Simon" <shmh@bigpond.net.au>
Subject: Re: Kicking off multiple processes at once instead of waiting....
Message-Id: <1j9hi.1004$4A1.64@news-server.bigpond.net.au>

Thanks QoS...appreciate it mate.

<QoS@domain.invalid> wrote in message news:k29hi.11$4e5.4@trndny07...
>
> "Simon" <shmh@bigpond.net.au> wrote in message-id: 
> <Dh5hi.933$4A1.42@news-server.bigpond.net.au>
>
>>
>> Hi QoS,
>>
>> Thanks for your input.
>>
>> Do you mean the module Threads?
>>
>>
>> <QoS@domain.invalid> wrote in message news:qr%gi.5424$ss5.76@trndny03...
>> >
>> > "Simon" <shmh@bigpond.net.au> wrote in message-id:
>> > <zY_gi.458$4A1.369@news-server.bigpond.net.au>
>> >
>> >>
> [snip]
>> >> Connect to, say 10 machines all at the same time, then return data 
>> >> back
>> >> to
>> >> the one main console (where I executed the script in the first place),
>> >> instead of waiting for 1 machine to end, then move on to the next.
>> >>
>> >> Any help greatly appreciated. Here is the script.
>> >>
> [snip]
>> >> Any help greatly appreciated guys, thank you.
>> >>
>> >> S
>> >
>> > Just use Threads
>> >
>
> Yeah have a look at:
> perldoc perlthrtut
>     and
> perldoc Threads
>     and
> perldoc Threads::Shared
>
> HtH
>
> J
> 




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

Date: Fri, 29 Jun 2007 09:57:48 -0700
From: "Clenna Lumina" <savagebeaste@yahoo.com>
Subject: Re: Oh great gurus of the list, I need help with a regular expression please
Message-Id: <5eks0nF36fc36U1@mid.individual.net>

"Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net> wrote in message 
news:0rWgi.1912$tj6.1863@newsread4.news.pas.earthlink.net...
> On 06/28/2007 11:24 AM, Clenna Lumina wrote:
>> Tad McClellan wrote:
>>> Clenna Lumina <savagebeaste@yahoo.com> wrote:
>>>
[...]
>> And you're called me a troll in another thread? You're the one who KEEPS 
>> "flame-baiting" and quite frankly [...]
>
> Now I'm beginning to think you're a troll. Clenna, I advise you do just 
> drop it.

Excuse me? Care to explain your logic here? Tad started both sub threads so 
far, for no for seeable reason, yet I'm the one who is being told to drop 
it. Why don't you ask Tad to stop this, as he is the one who started it on 
both times.

> (My spidey sense tells me that you're a morph of PG, but my killfile won't 
> care.)

Can't speak to that, as I am not familiar with the complete history of this 
group. I've only read it from time to time along with many other groups. 
There is only one group I've really been involved in and it relates to DNS.

I don't care if you don't understand that you're wrong, or even have the 
decency to admit you *could* be wrong or so much as backup any of your 
claims. I've wasted enough time trying to defend myself from people who make 
it their mission to make others feel miserable and unwelcome.

I do want to pose one question, however. I am familiar with one piece of 
history here, from a thread I once reason in the Google groups archives some 
time ago, regarding one kira/Purl Gurl/Godzilla. In that thread, as I 
recall, this person referred to the greater whole of this group who was 
after her as "Frank". Now tell me, Tad, are you not doing the same thing, 
lumping everyone who comes along who fits your criteria (ie, making typos 
like "jsut" ?) as this infamous "troll" did? Do you really want to say that 
your stalking tactics are not the least bit trollish, by any definition most 
news group denizens might give?

-- 
CL 




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

Date: Fri, 29 Jun 2007 16:06:46 -0000
From:  Larry <larry.grant.dc@gmail.com>
Subject: Re: portable /dev/null ?
Message-Id: <1183133206.873470.263790@q69g2000hsb.googlegroups.com>

On Jun 29, 11:03 am, "J=FCrgen Exner" <jurge...@hotmail.com> wrote:
> Larry wrote:
> > 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?
>
> If you would drop your requirement of using system(), then you could use
> backticks and capture (and then discard) the output in your Perl program.
>
> jue

I thought of the backticks method, but I remember that being a problem
in Windows the last time i tried it.  Also, even if backticks works, I
would prefer an option that discarded the output immediately, so that
memory is not wasted if the output is large.



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

Date: Fri, 29 Jun 2007 20:04:59 +0200
From: =?ISO-8859-1?Q?Andreas_P=FCrzer?= <pue@gmx.net>
Subject: Re: portable /dev/null ?
Message-Id: <5ekvo9F352te1U1@mid.individual.net>

Larry schrieb:

> On Jun 29, 11:03 am, "Jürgen Exner" <jurge...@hotmail.com> wrote:
> 
>>Larry wrote:
>>
>>>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?

Maybe you're looking for File::Spec->devnull() ?

>>
>>If you would drop your requirement of using system(), then you could use
>>backticks and capture (and then discard) the output in your Perl program.
>>
>>jue
> 
> 
> I thought of the backticks method, but I remember that being a problem
> in Windows the last time i tried it.

perl -e "print `echo foo > nul`"
works fine here.

HTH,
Andreas Pürzer
-- 
Have Fun,
and if you can't have fun,
have someone else's fun.
		The Beautiful South


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

Date: Fri, 29 Jun 2007 11:06:40 -0700
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: portable /dev/null ?
Message-Id: <1183140400.455434.182560@q69g2000hsb.googlegroups.com>

On Jun 29, 10:57 am, Larry <larry.grant...@gmail.com> wrote:
> 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?

IIRC, the IO::All module has a devnull() method.  You might want to
look into it.  The module is available on the CPAN.

Paul Lalli



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

Date: Fri, 29 Jun 2007 19:06:05 +0200
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: Problem with PERL function
Message-Id: <f63ei6$jo4$1@mlucom4.urz.uni-halle.de>

bugbear wrote:
> bugbear wrote:
>> $A[i2] - $A[i1],
>>
>> and so on for the other bases.
> 
> Dang - just thought of something else
> 
> For a 25% storage saving (since
> each of my suggested arrays has as many entries as the sequence is
> long), you only need 3 arrays, since the fourth
> count is length-of-sequence - (sum of other 3 counts)

Hi bugbear, IMHO one shouldn't do to much with arrays in the
case of real genome files. A "good" fasta file may have dozens
of millions of nucleobases, one example here:
http://www.sanger.ac.uk/Software/analysis/projector/projector_test_set.fasta

Regards

M.




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

Date: Fri, 29 Jun 2007 18:16:35 -0000
From:  usenet@DavidFilmer.com
Subject: Re: Problem with PERL function
Message-Id: <1183140995.766509.48930@d30g2000prg.googlegroups.com>

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)



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

Date: Fri, 29 Jun 2007 15:11:22 GMT
From: "Simon" <shmh@bigpond.net.au>
Subject: Re: Simple fork examples
Message-Id: <ui9hi.1003$4A1.336@news-server.bigpond.net.au>

Thank you Gunnar...will do...thanks so much mate.

"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message 
news:5ekkiqF37fngrU1@mid.individual.net...
> Simon wrote:
>> I want to get my hands on some really basic example scripts of using 
>> fork, and what it is used for.
>
> Check out the CPAN module Parallel::ForkManager. It's a useful tool, and 
> by reading its docs, including the examples, you may get a better 
> understanding of the concept as well.
>
> -- 
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl 




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

Date: Fri, 29 Jun 2007 17:43:05 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Simple fork examples
Message-Id: <0q9a83d8kdsno9jv5bmk7618u2epmbfmot@4ax.com>

On Fri, 29 Jun 2007 14:13:12 GMT, "Simon" <shmh@bigpond.net.au> wrote:

>I want to get my hands on some really basic example scripts of using fork, 
>and what it is used for.

It is used to fork() additional processes, which could be completely
different programs from your own, in which cases there are probably
easier means to do so, or "specialized versions" of the same program.
But seriously it's strange that you want to use this particular
function without knowing in advance what it is for. For example, I see
in

  perldoc perlfunc

that there exists a shmctl function, but I do not wonder whether I
need it. In case I have a task for which someone will suggest the use
of it, I'll check it... but this has not happened yet...

>Any information and/or scripts so I can start playing with this stuff and 
>learn it, instead of reading obscure doco would be great just to get a start 
>on it.

  perl -e '{fork,redo}'

NO SERIOUSLY: DON'T DO IT!!

But then again, if you find the docs to be obscure you should ask
about why and where they are, because they seem rather clear to me.


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:44:35 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Simple fork examples
Message-Id: <66aa83dgtjpc795sql6gvm61nok7q8cv45@4ax.com>

On Fri, 29 Jun 2007 14:28:07 GMT, "Simon" <shmh@bigpond.net.au> wrote:

>C:\>ballsonforehead.pl
>Use of uninitialized value in foreach loop entry at C:\ballsonforehead.pl 
>line 9
[...]
>> my $num_kids = shift;

Just make that

  my $num_kids = shift || 5;


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:45:40 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Simple fork examples
Message-Id: <f7aa839ph82snbs1vukn7bdtf8mpdh7dv8@4ax.com>

On Fri, 29 Jun 2007 16:48:06 +0200, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:

>> I want to get my hands on some really basic example scripts of using fork, 
>> and what it is used for.
>
>Check out the CPAN module Parallel::ForkManager. It's a useful tool, and 
>by reading its docs, including the examples, you may get a better 
>understanding of the concept as well.

I'm not really sure... if he wants to understand the basic usage of
fork()... how a tool that hides and actually makes it more friendly
could help him. But worth mentioning, anyway.


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:02:11 GMT
From: "Simon" <shmh@bigpond.net.au>
Subject: Re: Simple fork examples
Message-Id: <72ahi.1010$4A1.191@news-server.bigpond.net.au>

Michele!!!

THANK YOU SO MUCH FOR THAT..IT WORKS NOW..

Thanks Michele!

Simon

"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:66aa83dgtjpc795sql6gvm61nok7q8cv45@4ax.com...
> On Fri, 29 Jun 2007 14:28:07 GMT, "Simon" <shmh@bigpond.net.au> wrote:
>
>>C:\>ballsonforehead.pl
>>Use of uninitialized value in foreach loop entry at C:\ballsonforehead.pl
>>line 9
> [...]
>>> my $num_kids = shift;
>
> Just make that
>
>  my $num_kids = shift || 5;
>
>
> 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:06:52 GMT
From: "Simon" <shmh@bigpond.net.au>
Subject: Re: Simple fork examples
Message-Id: <w6ahi.1012$4A1.760@news-server.bigpond.net.au>

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..

He kicks of a script that reads a text file containing 100s of machines.
The script might do the following...
Connect to each machine
Retrieve information about each machine
The script connects to around 20 machines at a time, so he has on his screen 
20 command dos windows open simultaneously.
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.

Really appreciate your help.

:)

"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message 
news:0q9a83d8kdsno9jv5bmk7618u2epmbfmot@4ax.com...
> On Fri, 29 Jun 2007 14:13:12 GMT, "Simon" <shmh@bigpond.net.au> wrote:
>
>>I want to get my hands on some really basic example scripts of using fork,
>>and what it is used for.
>
> It is used to fork() additional processes, which could be completely
> different programs from your own, in which cases there are probably
> easier means to do so, or "specialized versions" of the same program.
> But seriously it's strange that you want to use this particular
> function without knowing in advance what it is for. For example, I see
> in
>
>  perldoc perlfunc
>
> that there exists a shmctl function, but I do not wonder whether I
> need it. In case I have a task for which someone will suggest the use
> of it, I'll check it... but this has not happened yet...
>
>>Any information and/or scripts so I can start playing with this stuff and
>>learn it, instead of reading obscure doco would be great just to get a 
>>start
>>on it.
>
>  perl -e '{fork,redo}'
>
> NO SERIOUSLY: DON'T DO IT!!
>
> But then again, if you find the docs to be obscure you should ask
> about why and where they are, because they seem rather clear to me.
>
>
> 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 18:37:20 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Simple fork examples
Message-Id: <5ekqvkF372vquU1@mid.individual.net>

Michele Dondi wrote:
> On Fri, 29 Jun 2007 16:48:06 +0200, Gunnar Hjalmarsson
> <noreply@gunnar.cc> wrote:
> 
>>> I want to get my hands on some really basic example scripts of using fork, 
>>> and what it is used for.
>> Check out the CPAN module Parallel::ForkManager. It's a useful tool, and 
>> by reading its docs, including the examples, you may get a better 
>> understanding of the concept as well.
> 
> I'm not really sure... if he wants to understand the basic usage of
> fork()... how a tool that hides and actually makes it more friendly
> could help him.

Even if the code is 'hidden', sort of, the examples illustrate the use 
of fork() in a context.

> But worth mentioning, anyway.

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


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

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


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