[30372] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1615 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 6 00:09:49 2008

Date: Thu, 5 Jun 2008 21: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           Thu, 5 Jun 2008     Volume: 11 Number: 1615

Today's topics:
        <<EndOfMessage <xiaoxia2005a@yahoo.com>
    Re: <<EndOfMessage (Ben Bullock)
    Re: Counting lines in big number of files - in parallel <RedGrittyBrick@SpamWeary.foo>
    Re: Counting lines in big number of files - in parallel <someone@example.com>
    Re: Perl grep and Perl 4 <szrRE@szromanMO.comVE>
    Re: perl_parse free some resource. <xydinesh@gmail.com>
    Re: Prevent kill signals to childs <ced@blv-sam-01.ca.boeing.com>
    Re: regex back matching <szrRE@szromanMO.comVE>
    Re: regex back matching <jurgenex@hotmail.com>
    Re: regex back matching <simon.chao@fmr.com>
    Re: regex back matching <1usa@llenroc.ude.invalid>
    Re: regex back matching <ced@blv-sam-01.ca.boeing.com>
    Re: regex back matching <szrRE@szromanMO.comVE>
    Re: regex back matching <simon.chao@gmail.com>
    Re: select and filehandle <3abd05ad-0d59-400f-9882-f700 <someone@example.com>
    Re: select and filehandle <xiaoxia2005a@yahoo.com>
    Re: select and filehandle <xiaoxia2005a@yahoo.com>
    Re: select and filehandle <3abd05ad-0d59-400f-9882-f700 <allergic-to-spam@no-spam-allowed.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 5 Jun 2008 19:14:30 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: <<EndOfMessage
Message-Id: <778ce925-bb20-4e30-bb12-623d0f310bdd@j22g2000hsf.googlegroups.com>

Need help on the following piece ...

$MTo = 'someone@someplace.com';
$MSubject = 'Something';
open(DOMAIL, "| mail -s $Msubject $MTo");
print DOMAIL <<"EndOfMessage";
First half mail body,
Second half mail body.
EndOfMessage

Does this mean the mail body before EndOfMessage will be sent to
filehandle DOMAIL, which inturn will be piped to mail for sending out?

What does << in the print statement mean?  Have seen < read, > write,
and >> append, but couldn't find <<.


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

Date: Fri, 6 Jun 2008 04:00:21 +0000 (UTC)
From: benkasminbullock@gmail.com (Ben Bullock)
Subject: Re: <<EndOfMessage
Message-Id: <g2acol$rqs$1@ml.accsnet.ne.jp>

April <xiaoxia2005a@yahoo.com> wrote:

> What does << in the print statement mean?  Have seen < read, > write,
> and >> append, but couldn't find <<.

It's a "here document". See, for example,

http://www.stonehenge.com/merlyn/UnixReview/col12.html



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

Date: Thu, 05 Jun 2008 23:11:47 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: Counting lines in big number of files - in parallel. <c4857a09-1348-4b5c-8b42-affc273f949d@k37g2000hsf.googlegroups.com> <48452891$0$10631$fa0fcedb@news.zen.co.uk> <75c7fc7a-c0c9-4b39-afb1-5a0e42149446@x35g2000hsb.googlegroups.com> <RLc1k.835$Gn.687@edtnps92>
Message-Id: <EOedneENSJA0-dXVnZ2dnUVZ8uudnZ2d@bt.com>

Jim Cochrane wrote:
> On 2008-06-03, John W. Krahn <someone@example.com> wrote:
>> hadzio@gmail.com wrote:
>>> Hi,
>>>
>>> Thank you for these remarks:
>>>
>>>> 1) Useless use of cat
>>>> "cat $file_to_read | wc -l |" starts two processes (plus shell etc)
>>>> I'd use "wc -l $file_to_be read"
>>> My command returns a value in a format easier to process ;)
>> Still a UUOC.  Instead of "cat $file_to_read | wc -l |" use "wc -l < 
>> $file_to_read |" or just:
>>
>> chomp( my $file_number_of_lines = `wc -l < $file_to_read` );
> 
> You can drop the '<':
> 
> chomp( my $file_number_of_lines = `wc -l $file_to_read` );
> 

It affects the format of the output of wc. IIRC the OP was depending on 
the output consisting solely of the line count.

I dont have a linux/Unix system to hand but I think the difference is

$ wc -l < file
44

$ wc -l file
44 file


-- 
RGB


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

Date: Fri, 06 Jun 2008 01:07:38 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: Counting lines in big number of files - in parallel. <c4857a09-1348-4b5c-8b42-affc273f949d@k37g2000hsf.googlegroups.com> <48452891$0$10631$fa0fcedb@news.zen.co.uk> <75c7fc7a-c0c9-4b39-afb1-5a0e42149446@x35g2000hsb.googlegroups.com> <RLc1k.835$Gn.687@edtnps92>
Message-Id: <u502k.1345$Gn.120@edtnps92>

Jim Cochrane wrote:
> On 2008-06-03, John W. Krahn <someone@example.com> wrote:
>> hadzio@gmail.com wrote:
>>> Hi,
>>>
>>> Thank you for these remarks:
>>>
>>>> 1) Useless use of cat
>>>> "cat $file_to_read | wc -l |" starts two processes (plus shell etc)
>>>> I'd use "wc -l $file_to_be read"
>>> My command returns a value in a format easier to process ;)
>> Still a UUOC.  Instead of "cat $file_to_read | wc -l |" use "wc -l < 
>> $file_to_read |" or just:
>>
>> chomp( my $file_number_of_lines = `wc -l < $file_to_read` );
> 
> You can drop the '<':
> 
> chomp( my $file_number_of_lines = `wc -l $file_to_read` );

Maybe like this you can:

my ( $file_number_of_lines ) = `wc -l $file_to_read` =~ /^\D*(\d+)/;



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Thu, 5 Jun 2008 18:58:07 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Perl grep and Perl 4
Message-Id: <g2a5jf02t0g@news4.newsguy.com>

Charlton Wilbur wrote:
>>>>>> "szr" == szr  <szrRE@szromanMO.comVE> writes:
>
>    >> Oh, right, but there's something pathological here - using Perl
>    4 >> instead of Perl 5, and then, in this day and age, where you
>    have >> to go through extra effort to get Perl 4 in the first
>    place, not >> using the latest version, trivial patch or no.
>
>    szr> That's assuming that he wasn't stuck with a server that had
>    szr> only Perl 4 on it (and insufficient privileges to install a
>    szr> newer one.)
>
> Right, which is a bizarre choice, verging on a pathology, on the part
> of the host.
>
> Perl 4 was superseded by Perl 5 a decade and a half ago.

True. My point is not everyone is has quite grasped the concept of being 
up to date.

-- 
szr 




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

Date: Thu, 5 Jun 2008 13:22:54 -0700 (PDT)
From: Din <xydinesh@gmail.com>
Subject: Re: perl_parse free some resource.
Message-Id: <aa6686ea-77df-4459-9c8e-7dc89d29643c@k37g2000hsf.googlegroups.com>

And my functions are..


static axiom_node_t *
wsf_xml_msg_recv_invoke_other (axis2_msg_recv_t* msg_recv,
                               const axutil_env_t* env,
                               wsf_svc_info_t* svc_info,
                               axis2_msg_ctx_t* in_msg_ctx,
                               axis2_msg_ctx_t* out_msg_ctx,
                               axis2_char_t* function_name,
                               axis2_char_t* class_name)
{
    AXIS2_PARAM_CHECK (env->error, svc_info, NULL);
    AXIS2_PARAM_CHECK (env->error, in_msg_ctx, NULL);
    AXIS2_PARAM_CHECK (env->error, out_msg_ctx, NULL);

    axiom_node_t *node = NULL;
    axiom_node_t *om_node = NULL;
    axiom_soap_envelope_t *envelope = NULL;
	axiom_soap_body_t *body = NULL;
    axis2_char_t *retstr = NULL;

    /* extracting payload from the soap message */
    envelope = axis2_msg_ctx_get_soap_envelope (in_msg_ctx, env);
    body = axiom_soap_envelope_get_body (envelope, env);
    om_node = axiom_soap_body_get_base_node (body, env);
    om_node = axiom_node_get_first_child (om_node, env);

    axis2_char_t *embedding[] = {"", NULL};
    if (!svc_info->script_filename)
    {
        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
                         "perl function invocation failed, script_file
name not found for \
service %s", svc_info->svc_name);
        return NULL;
    }
    /* passing script real path into perl interpreter. */
    embedding[1] = svc_info->script_filename;

    my_perl = perl_alloc();
    perl_construct( my_perl );
    /* loading WSO2::WSF::C and WSO2::WSF::Server using dynamic loader
*/
    eval_pv("use WSO2::WSF::C", FALSE);
    eval_pv("use WSO2::WSF::Server", FALSE);

    if (perl_parse(my_perl, xs_init, 2, embedding, NULL))
    {
        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "perl_parse method
failed");
        return NULL;
    }

    perl_run(my_perl);

    if (SvTRUE(ERRSV))
    {
        AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI, "invoke perl function
failed");
    }

    retstr = invoke_perl_function(env, om_node, function_name, NULL);

    if (retstr)
    {
        node = wsf_util_deserialize_buffer (env, retstr);
    }

    perl_destruct(my_perl);
    perl_free(my_perl);
    return node;
}

static axis2_char_t *
invoke_perl_function(const axutil_env_t *env, axiom_node_t *om_node,
                     axis2_char_t *operation, axis2_char_t
*class_name)
{
    int count = 0;
    axis2_char_t *inmsg = NULL;
    axis2_char_t *ret = NULL;

    if (!operation)
    {
        AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI,
                         "invoking perl function failed, operation not
available");
        return;
    }

    if (om_node)
    {
        inmsg = axiom_node_to_string (om_node, env);
    }

    dSP ;

    ENTER ;
    SAVETMPS ;

    PUSHMARK(SP) ;
    XPUSHs(sv_2mortal(newSVpv(inmsg, 0)));
    PUTBACK;

    /* calling user perl function which returns a scaler value */
    count = perl_call_pv(operation, G_SCALAR);
    SPAGAIN;

    if (count != 1)
    {
        croak("perl function invocation failed") ;
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                        "perl function %s invocation failed",
operation);

    }

    /* we pop string from the stack and doing strdup on it */
    ret = savepv(POPpx);

    PUTBACK;
    FREETMPS ;
    LEAVE ;
    return ret;
}


/* xs_init is for support dynamic loading of modules */
static void
xs_init(pTHX)
{
	char *file = __FILE__;
	dXSUB_SYS;

	/* DynaLoader is a special case */
	newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}





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

Date: Thu, 5 Jun 2008 14:54:29 -0700 (PDT)
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: Prevent kill signals to childs
Message-Id: <a081f120-d8d8-4845-93a0-aa36be7834ad@a9g2000prl.googlegroups.com>

On Jun 4, 10:04 pm, Felipe Alcacibar B <falcaci...@gmail.com> wrote:
> Hi, i have the this problem, i have process opened with open3, and i
> use waitpid in threads to determine if ends, but when i send a SIGINT
> (Control-C) the signal propagates to the childs, i need control this
> signal and prevent the propagation of the signal to childs, how i can
> do that???
>

Can you add a SIGINT handler in the child to block
or ignore the signal...?

If not, you could launch the child via a shell
which ignores the signal, eg, in some Unix
shells at least, this'll work:

open3(...., "trap '' 2;/path/to/child") ..
 ...

Of course, if you don't catch SIGINT in the
parent, the child appears to get disposed of
in spite of the shell's SIGINT trap... Maybe
it gets a SIGTERM from the O/S when the parent
dies unexpectedly... I don't know.

However, if you trap SIGINT in the parent,
you can confirm that the child has ignored
the signal and is still running by examining
ps(1).

--
Charles DeRykus




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

Date: Thu, 5 Jun 2008 13:19:10 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: regex back matching
Message-Id: <g29hnv026re@news4.newsguy.com>

A. Sinan Unur wrote:
> Ray Muforosky <muforo@gmail.com> wrote in
> news:8566add6-1bfc-4231-8242-
> ba9790cf376f@r66g2000hsg.googlegroups.com:
>
>> On Jun 5, 8:14 am, Dan Rumney <danrum...@77617270mail.net> wrote:
>>> Ray Muforosky wrote:
>>>> Hello
>>>
>>>> I need to match on lines where the 4 quadrant of the ip is even
>>>> with one line regex.
>>>
>>> [snip]
>>>
>>> What do you have so far? There are plenty of pages outlinging
>>> regexps for matching IP addresses... that should prove a good start
>>> for you
>>
>> egrep  '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.([stock here])\s*'
>> filename
>
> What is egrep?

It is a tool (the one on my system is from GNU, v2.5.1), which is used 
for finding lines in plain text by a given pattern. egrep is basically a 
shortcut for `grep -e'. One could also use `grep -P` for a Perl style 
RE.

-- 
szr 




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

Date: Thu, 05 Jun 2008 20:31:53 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: regex back matching
Message-Id: <dsig44tf1eabak6ftrs51ltifrci6b3tce@4ax.com>

Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>Yes, they produce the same output when applied to the OP's sample data. 
>But assume that the last digit on the third line is replaced with the 
>digit 4:
>
>192.68.24           INEED             HELP PLEASE
>
>Your regex will print that line, while mine won't, since the IP address 
>does not have any 4:th quadrant.

Oh, indeed! I missed that detail, just assumed that all IPs had all four
elements. Would have been nice if the OP had pointed out that some data
is incomplete and even more important what to do in that case.

If the fourth field was an even number, then he wanted that line to
print. He forgot to mention what he wanted done if there was no fourth
field in the first place. And in cases of unspecified behaviour the
program can choose to do whatever it likes.

jue


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

Date: Thu, 5 Jun 2008 13:35:18 -0700 (PDT)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: regex back matching
Message-Id: <b3b33a7f-1a85-42d7-870c-6f2215bd66a8@c65g2000hsa.googlegroups.com>

On Jun 5, 4:19=A0pm, "szr" <sz...@szromanMO.comVE> wrote:
> A. Sinan Unur wrote:
> > Ray Muforosky <muf...@gmail.com> wrote in
> > news:8566add6-1bfc-4231-8242-
> > ba9790cf3...@r66g2000hsg.googlegroups.com:
>
> >> On Jun 5, 8:14 am, Dan Rumney <danrum...@77617270mail.net> wrote:
> >>> Ray Muforosky wrote:
> >>>> Hello
>
> >>>> I need to match on lines where the 4 quadrant of the ip is even
> >>>> with one line regex.
>
> >>> [snip]
>
> >>> What do you have so far? There are plenty of pages outlinging
> >>> regexps for matching IP addresses... that should prove a good start
> >>> for you
>
> >> egrep =A0'^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.([stock here])\s*'
> >> filename
>
> > What is egrep?
>
> It is a tool (the one on my system is from GNU, v2.5.1), which is used
> for finding lines in plain text by a given pattern. egrep is basically a
> shortcut for `grep -e'. One could also use `grep -P` for a Perl style
> RE.
>

I assumed that Sinan knew what egrep was, but was coyly pointing out
that it had no place in Perl.


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

Date: Thu, 05 Jun 2008 20:46:18 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: regex back matching
Message-Id: <Xns9AB4AA9AF9FE3asu1cornelledu@127.0.0.1>

nolo contendere <simon.chao@fmr.com> wrote in news:b3b33a7f-1a85-42d7-
870c-6f2215bd66a8@c65g2000hsa.googlegroups.com:

> On Jun 5, 4:19 pm, "szr" <sz...@szromanMO.comVE> wrote:
>> A. Sinan Unur wrote:
>> > Ray Muforosky <muf...@gmail.com> wrote in
>> > news:8566add6-1bfc-4231-8242-
>> > ba9790cf3...@r66g2000hsg.googlegroups.com:
 ...
>> >> egrep  '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.([stock here])\s*'
>> >> filename
>>
>> > What is egrep?
>>
>> It is a tool (the one on my system is from GNU, v2.5.1)

 ...

> I assumed that Sinan knew what egrep was, but was coyly pointing out
> that it had no place in Perl.

An astute observation, as usual.

I hate spending time trying to solve someone's problem in Perl only to 
find out that their question was about some other "Perl compatible" 
regex engine.

The OP also had the odd "one line regex" requirement to boot.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Thu, 5 Jun 2008 16:55:25 -0700 (PDT)
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: regex back matching
Message-Id: <cf5011ef-bb51-4d90-9f41-3d8bad53f57f@s21g2000prm.googlegroups.com>

On Jun 5, 1:46 pm, "A. Sinan Unur" <
> ...
> The OP also had the odd "one line regex" requirement to boot.
>


I tend to agree with the OP...

Even if they're well commented,  regex's can
become very obscure if they're  more than one
line :)

--
Charles DeRykus


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

Date: Thu, 5 Jun 2008 18:08:17 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: regex back matching
Message-Id: <g2a2m102qio@news4.newsguy.com>

A. Sinan Unur wrote:
> nolo contendere <simon.chao@fmr.com> wrote in news:b3b33a7f-1a85-42d7-
> 870c-6f2215bd66a8@c65g2000hsa.googlegroups.com:
>
>> On Jun 5, 4:19 pm, "szr" <sz...@szromanMO.comVE> wrote:
>>> A. Sinan Unur wrote:
>>>> Ray Muforosky <muf...@gmail.com> wrote in
>>>> news:8566add6-1bfc-4231-8242-
>>>> ba9790cf3...@r66g2000hsg.googlegroups.com:
> ...
>>>>> egrep '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.([stock here])\s*'
>>>>> filename
>>>
>>>> What is egrep?
>>>
>>> It is a tool (the one on my system is from GNU, v2.5.1)
>
> ...
>
>> I assumed that Sinan knew what egrep was, but was coyly pointing out
>> that it had no place in Perl.
>
> An astute observation, as usual.
>
> I hate spending time trying to solve someone's problem in Perl only to
> find out that their question was about some other "Perl compatible"
> regex engine.
>
> The OP also had the odd "one line regex" requirement to boot.

I fully understand, though I'm not sure pretending not to know about 
something you most certainly do know may not necessarily be the best way 
to convey that meaning. I fully agree the OP was asking in the wrong 
group (probably wants one of the comp.unix.* groups, or even the gnu.* 
heiarchy.

-- 
szr 




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

Date: Thu, 5 Jun 2008 18:47:50 -0700 (PDT)
From: nolo contendere <simon.chao@gmail.com>
Subject: Re: regex back matching
Message-Id: <f647d353-83dc-43ff-b6ff-60030a1e7055@26g2000hsk.googlegroups.com>

On Jun 5, 9:08=A0pm, "szr" <sz...@szromanMO.comVE> wrote:
> A. Sinan Unur wrote:
> > nolo contendere <simon.c...@fmr.com> wrote in news:b3b33a7f-1a85-42d7-
> > 870c-6f2215bd6...@c65g2000hsa.googlegroups.com:
>
> >> On Jun 5, 4:19 pm, "szr" <sz...@szromanMO.comVE> wrote:
> >>> A. Sinan Unur wrote:
> >>>> Ray Muforosky <muf...@gmail.com> wrote in
> >>>> news:8566add6-1bfc-4231-8242-
> >>>> ba9790cf3...@r66g2000hsg.googlegroups.com:
> > ...
> >>>>> egrep '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.([stock here])\s*'
> >>>>> filename
>
> >>>> What is egrep?
>
> >>> It is a tool (the one on my system is from GNU, v2.5.1)
>
> > ...
>
> >> I assumed that Sinan knew what egrep was, but was coyly pointing out
> >> that it had no place in Perl.
>
> > An astute observation, as usual.
>
> > I hate spending time trying to solve someone's problem in Perl only to
> > find out that their question was about some other "Perl compatible"
> > regex engine.
>
> > The OP also had the odd "one line regex" requirement to boot.
>
> I fully understand, though I'm not sure pretending not to know about
> something you most certainly do know may not necessarily be the best way
> to convey that meaning. I fully agree the OP was asking in the wrong
> group (probably wants one of the comp.unix.* groups, or even the gnu.*
> heiarchy.
>

I think you have one too many "not"s in there. And imho there's
nothing wrong with a little sarcasm now and then.


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

Date: Fri, 06 Jun 2008 01:18:26 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: select and filehandle <3abd05ad-0d59-400f-9882-f70061e8f851@m45g2000hsb.googlegroups.com> <16757be3-6f65-4d5e-9042-87e3deeb6441@w7g2000hsa.googlegroups.com>
Message-Id: <Cf02k.1349$Gn.693@edtnps92>

Jim Cochrane wrote:

> Path: edtnps92!newsfeed2.telusplanet.net!newsfeed.telus.net!feeder.erje.net!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.news.tin.it!news.greatnowhere.com!reader.greatnowhere.com!reader.greatnowhere.com!not-for-mail
> Newsgroups: comp.lang.perl.misc
> From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
> Subject: Re: select and filehandle
>  <3abd05ad-0d59-400f-9882-f70061e8f851@m45g2000hsb.googlegroups.com>
>  <16757be3-6f65-4d5e-9042-87e3deeb6441@w7g2000hsa.googlegroups.com>
> User-Agent: slrn/0.9.8.1pl2 (Linux)
> Mime-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> Date: 05 Jun 2008 22:10:51 GMT
> Lines: 42
> Message-ID: <4848646b$0$30637$834e42db@reader.greatnowhere.com>
> NNTP-Posting-Date: 05 Jun 2008 22:10:51 GMT
> NNTP-Posting-Host: 2d0e56d8.reader.greatnowhere.com
> X-Trace: DXC=<@2c2ROl6Yf^\W>5k`DJDb]XKbj2VKD@jn1RJ3gdIg\kJHC[h`LbJ0dZX>l7\V?H4ald0nABodS5a8L7>=DcemW`>FdDI4eX@Nk?]4ICOFI<RgEO^jbP<oi8akVO=P:IFN<nJTfD9cG9=]ko@1MNPR0ZmfgSbL4N4>SGca7e3>I8nLdbQba_0XKK1S`cUHefITeYOeFo^6E5kX=Gn
> X-Complaints-To: usenet@greatnowhere.com
> Bytes: 1946


Jim,

Your "References:" header is missing and your references are showing up 
in the "Subject:" line.



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Thu, 5 Jun 2008 13:22:26 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: Re: select and filehandle
Message-Id: <8c9465d1-5b65-48e4-9920-5b2b6acbd87d@l64g2000hse.googlegroups.com>

Thanks Paul and Xho, now I know my mistake is that I thought select
would take and return the argument value ... thanks again!



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

Date: Thu, 5 Jun 2008 13:27:05 -0700 (PDT)
From: April <xiaoxia2005a@yahoo.com>
Subject: Re: select and filehandle
Message-Id: <4ae6ce98-153d-4ae1-86a6-ae54e456f27c@e39g2000hsf.googlegroups.com>

and another mistake is that I thought line 4 only feeding the
variable, but actually it had done two things, selected the argument
value, and fed the variable with the prior value.



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

Date: 05 Jun 2008 22:10:51 GMT
From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
Subject: Re: select and filehandle <3abd05ad-0d59-400f-9882-f70061e8f851@m45g2000hsb.googlegroups.com> <16757be3-6f65-4d5e-9042-87e3deeb6441@w7g2000hsa.googlegroups.com>
Message-Id: <4848646b$0$30637$834e42db@reader.greatnowhere.com>

On 2008-06-05, Paul Lalli <mritty@gmail.com> wrote:
> On Jun 5, 3:08 pm, April <xiaoxia20...@yahoo.com> wrote:
>> I found the following demo in a book regarding usage of "select" ...
>>
>> 1  select(FH1);
>> 2  print "goes to FH1.\n";
>> 3
>> 4  $TempHandle = select(FH2);
>> 5  print "goes to FH2.\n";
>> 6
>> 7  select ($TempHandle);
>> 8  print "goes to FH1.\n"
>>
>> This is in Perl for Dummies, 4th ed, p182.
>>
>> My questions are:
>>
>> It seems if I need to verify this, would need to add the following in
>> the pl file?
>>
>> open(FH1, '>print1.txt');
>> open(FH2, '>print2.txt');
>
> Yes, but you should get into the habbit of writing open statements
> like this instead:

1) habit
2) hobbit
3) rabbit
4) wabbit 
 ...

(Sorry, couldn't resist.)

> open my $FH1, '>', 'print1.txt' or die "Could not open print1.txt:
> $!";

Or use IO::File.


-- 



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

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


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