[21734] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3938 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 9 06:06:34 2002

Date: Wed, 9 Oct 2002 03:05:09 -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           Wed, 9 Oct 2002     Volume: 10 Number: 3938

Today's topics:
        > 2GB Berkeley DB files from Perl / PHP on RH 7.3 ? (Sam Iam)
    Re: effect of "use <version>" on forward-compatibility? <mgjv@tradingpost.com.au>
    Re: Flag processing (tî'pô)
    Re: Freeware/shareware perl IDE <mike_constant@yahoo.com>
    Re: Not so simple RE problem... <skuo@mtwhitney.nsc.com>
    Re: Not so simple RE problem... <REMOVEsdnCAPS@comcast.net>
    Re: Not so simple RE problem... <goldbb2@earthlink.net>
        pod and perldoc on own local modules ? <jim.bloggs@eudoramail.com>
    Re: pod and perldoc on own local modules ? <wksmith@optonline.net>
    Re: pod and perldoc on own local modules ? <s_grazzini@hotmail.com>
    Re: pod and perldoc on own local modules ? <jeff@vpservices.com>
    Re: pod and perldoc on own local modules ? <jim.bloggs@eudoramail.com>
    Re: pod and perldoc on own local modules ? <comdog@panix.com>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <jeff@vpservices.com>
    Re: Sending HTML email in Perl <mark_eve@agilent.comp>
        serial port problem <rozman@fri.uni-lj.si>
    Re: Sharing a program? <bongie@gmx.net>
    Re: Split a string <bongie@gmx.net>
    Re: Split a string <dav.1@bigfoot.com>
    Re: Split a string <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: synonymous subroutines (Jay Tilton)
    Re: udp (deita)
        what about   do{} while (<>) <pef@trasig.noXX>
    Re: what about   do{} while (<>) <bernard.el-hagin@DODGE_THISlido-tech.net>
        XML::RSS bug <swen@news.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 8 Oct 2002 18:05:09 -0700
From: thatsamiam@yahoo.com (Sam Iam)
Subject: > 2GB Berkeley DB files from Perl / PHP on RH 7.3 ?
Message-Id: <fe7db0d0.0210081705.2cda784@posting.google.com>

I know that Berkeley DB can handle > 2GB files but can it do so from
Perl / PHP on Redhat 7.3 ?


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

Date: Wed, 09 Oct 2002 02:55:54 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: effect of "use <version>" on forward-compatibility?
Message-Id: <slrnaq76ob.1qr.mgjv@verbruggen.comdyn.com.au>

On Tue, 8 Oct 2002 17:56:43 -0500,
	Tad McClellan <tadmc@augustmail.com> wrote:
> Vaughn Gardner <vhg@byu.edu> wrote:
> 
>> (we have versions as old as 
>> 4.0.1.8 with code running against them).
> 
> 
> That is not a Perl version number. I think you mean v4.036.

However, there was a perl 4.018, which was not even a stable release
(late 1991, some 11 years old).

> Are they so conservative that they are still running Windows 3.1
> on their PeeCees too?   :-)

More like an early beta release of 3.1 then :)

Martien
-- 
                        | 
Martien Verbruggen      | 
Trading Post Australia  | In a world without fences, who needs Gates?
                        | 


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

Date: Wed, 09 Oct 2002 11:07:39 +0200
From: "Teh (tî'pô)" <teh@mindless.com>
Subject: Re: Flag processing
Message-Id: <3as7quouaaanfj53a42i2klsdbj9elqu2j@4ax.com>

John W. Krahn bravely attempted to attach 35 electrodes of knowledge
to the nipples of comp.lang.perl.misc by saying:
>the /o modifier isn't
>going to help as there are no variables in the regular expression.  Of
>course, it depends on how the data is stored.  :-)

Oops looks like I should re-read the documentation, I thought a
regular expression was compiled even when it doesn't contain a
variable.


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

Date: Tue, 8 Oct 2002 19:44:01 -0700
From: "Newbie" <mike_constant@yahoo.com>
Subject: Re: Freeware/shareware perl IDE
Message-Id: <ao055v$hmqdn$1@ID-161864.news.dfncis.de>


"Naran Hirani" <N.Hirani@hgmp.mrc.ac.uk> wrote in message
news:3DA33C71.FE650EC3@hgmp.mrc.ac.uk...
> Hi,
>
> I'm looking for a nice freeware/shareware perl IDE that runs on a Sun
> Solaris platform.
> Does such a thing exist?
> if so does any body have any recommendations, please.
>
> I am aware of one or two nice offerings for the windows platform, but I
> am really after something
> equivalent for the unix (Sun flavour) platform.
>
> Please CC your response to me if possible.
>
> TIA.
> Naran
>

I used to be crazy about IDEs too, but I find x/emacs just as good.




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

Date: Tue, 8 Oct 2002 18:47:06 -0700
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: Not so simple RE problem...
Message-Id: <Pine.GSO.4.21.0210081845010.19198-100000@mtwhitney.nsc.com>

On Tue, 8 Oct 2002, Domizio Demichelis wrote:

> I have a problem that I thought was simple to solve, until I tried :-)
> 
> I have this string:
> 
> $string = << '__EOS__';
> aaa {a} bbb {a} ccc {a} XXX {b} XXX {/a} ddd
> aaa {b} bbb {b} ccc {a} XXX {/a} ddd
> aaa {a}{/a} bbb {a} ccc {a} ddd
> __EOS__
> 
> I need to replace the  "{a}.*?{/a}" and the "{a}" (without the end {/a})
> with a "#", so - after the search and replace operation - the $string should
> contain this:
> 
> "aaa # bbb # ccc # ddd
> aaa {b} bbb {b} ccc # ddd
> aaa # bbb # ccc # ddd"
< snipped >





It's easier if you reverse the string:


#! /usr/local/bin/perl

use strict;
use warnings;
my $string = << '__EOS__';
aaa {a} bbb {a} ccc {a} XXX {b} XXX {/a} ddd
aaa {b} bbb {b} ccc {a} XXX {/a} ddd
aaa {a}{/a} bbb {a} ccc {a} ddd
__EOS__


(my $temp = scalar reverse $string) =~ s,}a/{.*?}a{,#,g;
($string = scalar reverse $temp) =~ s,{a},#,g;
print $string;

-- 
Regards,
Steven



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

Date: Tue, 08 Oct 2002 21:28:09 CDT
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Not so simple RE problem...
Message-Id: <Xns92A1E478B9F0sdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

"Domizio Demichelis" <dd@4pro.net> wrote in
news:anvuuo$hu4d1$1@ID-159100.news.dfncis.de: 

> I have a problem that I thought was simple to solve, until I tried :-)

Are you trying to parse HTML or XML?  Because that's what it looks like 
you're doing, and that wheel has already been invented.  There are modules 
that will do it much more efficiently and bug-free than any program you or 
I could write.

- -- 
Eric
print scalar reverse sort qw p ekca lre reh 
ts uJ p, $/.r, map $_.$", qw e p h tona e;

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPaOUFGPeouIeTNHoEQIgiwCdFMKk9ezmhH7XM3ao8voGv25kHTsAoPBk
/fB9LDImLfr58ka2thBUHq8I
=dwCQ
-----END PGP SIGNATURE-----


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

Date: Wed, 09 Oct 2002 00:04:13 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Not so simple RE problem...
Message-Id: <3DA3AABD.3FDB1A70@earthlink.net>

Steven Kuo wrote:
> Domizio Demichelis wrote:
[snip]
> > $string = << '__EOS__';
> > aaa {a} bbb {a} ccc {a} XXX {b} XXX {/a} ddd
> > aaa {b} bbb {b} ccc {a} XXX {/a} ddd
> > aaa {a}{/a} bbb {a} ccc {a} ddd
> > __EOS__
> >
> > I need to replace the  "{a}.*?{/a}" and the "{a}" (without the end
> > {/a}) with a "#", so - after the search and replace operation - the
> > $string should contain this:
> >
> > "aaa # bbb # ccc # ddd
> > aaa {b} bbb {b} ccc # ddd
> > aaa # bbb # ccc # ddd"
> [snipped]
> 
> It's easier if you reverse the string:
[snip]
> (my $temp = scalar reverse $string) =~ s,}a/{.*?}a{,#,g;
> ($string = scalar reverse $temp) =~ s,{a},#,g;
> print $string;

It seems to me (I haven't tried) that you could do both substitutions in
one step:
   (my $temp = reverse << '__EOS__') =~ s,(?:}a/{.*?)?}a{,#,g;
aaa {a} bbb {a} ccc {a} XXX {b} XXX {/a} ddd
aaa {b} bbb {b} ccc {a} XXX {/a} ddd
aaa {a}{/a} bbb {a} ccc {a} ddd
__EOS__
   print $string = reverse $temp;

-- 
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
 ."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]


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

Date: Wed, 9 Oct 2002 03:23:12 +0100
From: "doofus" <jim.bloggs@eudoramail.com>
Subject: pod and perldoc on own local modules ?
Message-Id: <ao03uj$ha6t1$1@ID-150435.news.dfncis.de>

Hi,

I love this groups and all the excellent advice its contributors give. =
I'm sorry about my last post which was completely irrelevant. Think this =
one is a little better.

I have been working on object oriented style perl and i now have a whole =
bunch of modules in my current directory which comprise a whole system. =
Now I gots to thinking about documentation, on account of I can't =
remember what half of them do. Sheez.

I read about pod in my O'Reilly, and I know about perldoc from this =
group. My understanding is the pod is what is printed by perldoc. But my =
question is, Is there any way of putting pod in my modules so that I can =
do a perldoc on them? I tried, but it seems I need to have my modules in =
the perl\lib directory. Is that correct? Am I asking the wrong question? =
I'll be grateful for any answer.

All I really want to know is whether I'm barking up the wrong tree =
altogether. Otherwise, I'll RTFM a bit more and work this thing out.

I want my modules to all remain in the directory belonging to this one =
application. Is that a sensible thing to do?

--=20
I very much hope that someone can be of assistance..
Best Wishes,
Lord Doofus ( aka Deputy Dawg )

:-)



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

Date: Wed, 9 Oct 2002 00:14:31 -0400
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: pod and perldoc on own local modules ?
Message-Id: <33Oo9.47667$GF5.2840038@news4.srv.hcvlny.cv.net>


"doofus" <jim.bloggs@eudoramail.com> wrote in message
news:ao03uj$ha6t1$1@ID-150435.news.dfncis.de...
-snip

I read about pod in my O'Reilly, and I know about perldoc from this group.
My understanding is the pod is what is printed by perldoc. But my question
is, Is there any way of putting pod in my modules so that I can do a perldoc
on them? I tried, but it seems I need to have my modules in the perl\lib
directory. Is that correct? Am I asking the wrong question? I'll be grateful
for any answer.

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

Like perl, perldoc will process any file in the current (working) directory.
I have never tried, but the -X option may provide what you need (perldoc
perldoc).

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



All I really want to know is whether I'm barking up the wrong tree
altogether. Otherwise, I'll RTFM a bit more and work this thing out.

I want my modules to all remain in the directory belonging to this one
application. Is that a sensible thing to do?

-------------------------------------------------
Works for me, but also see FAQ perldoc -q library.

I recommend perldoc pod2man for the specification of manpage content and
perldoc perlpod for specification of the pod syntax.  Pod requires  many
blank lines.  Just over do it rather than try to figure out the exact rules.
(The key involves the exact definition of the word "paragraph".)

Good Luck,
Bill








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

Date: Wed, 09 Oct 2002 04:23:14 GMT
From: Steve Grazzini <s_grazzini@hotmail.com>
Subject: Re: pod and perldoc on own local modules ?
Message-Id: <SaOo9.9$2W3.64739@twister.nyc.rr.com>

doofus <jim.bloggs@eudoramail.com> wrote:
[ snipped sunshine - lines wrapped ]

> My understanding is the pod is what is printed by perldoc. 
> But my question is, Is there any way of putting pod in my 
> modules so that I can do a perldoc on them? I tried, but 
> it seems I need to have my modules in the perl\lib directory. 
> Is that correct? 

perldoc searches @INC, so generally speaking, if perl can
find the module, perldoc can find it as well.

This breaks down sometimes when the perldoc in your $PATH
has the wrong perl interpreter in its shebang line.

It also breaks down if you've installed the module into a
local directory and are finding it with 'use lib';  perldoc is
just another script, and it doesn't know about the 'use lib'.
 
In this case, you can: 
  - install the module under site_perl/
  - set the PERL5LIB environment variable
  - edit perldoc (add the 'use lib')

HTH
-- 
Steve

perldoc -qa.j | perl -lpe '($_)=m("(.*)")'


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

Date: Tue, 08 Oct 2002 21:37:52 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: pod and perldoc on own local modules ?
Message-Id: <3DA3B2A0.8000501@vpservices.com>

Steve Grazzini wrote:


> In this case, you can: 
>   - install the module under site_perl/
>   - set the PERL5LIB environment variable
>   - edit perldoc (add the 'use lib')


To the OP, those are combined with OR not AND :-)

Another option is to use this which will find it regardless of what is 
or isn't in @INC:

   perldoc /path/to/MyMod.pm

Also don't forget about pod2html, you can create nicely formatted web 
pages from your pods and just access them with a browser rather than 
messing around looking for them.  (you can read about it with perldoc 
pod2html, of course)

-- 
Jeff





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

Date: Wed, 9 Oct 2002 06:19:43 +0100
From: "doofus" <jim.bloggs@eudoramail.com>
Subject: Re: pod and perldoc on own local modules ?
Message-Id: <ao0e9h$i7skr$1@ID-150435.news.dfncis.de>

Jeff Zucker wrote:
> Steve Grazzini wrote:
>=20
>=20
>> In this case, you can:
>>   - install the module under site_perl/
>>   - set the PERL5LIB environment variable
>>   - edit perldoc (add the 'use lib')
>=20
>=20
> To the OP, those are combined with OR not AND :-)
>=20
> Another option is to use this which will find it regardless of what is
> or isn't in @INC:
>=20
>    perldoc /path/to/MyMod.pm
>=20
> Also don't forget about pod2html, you can create nicely formatted web
> pages from your pods and just access them with a browser rather than
> messing around looking for them.  (you can read about it with perldoc
> pod2html, of course)

You guys are just great. Thanks to all, and anyone else who wants to add =
some further contribution. I'm off to do some experimenting...

:-)

--
doofus



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

Date: Wed, 09 Oct 2002 02:58:51 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: pod and perldoc on own local modules ?
Message-Id: <091020020258511383%comdog@panix.com>

In article <3DA3B2A0.8000501@vpservices.com>, Jeff Zucker <jeff@vpservices.com> wrote:

> Also don't forget about pod2html, you can create nicely formatted web 
> pages from your pods ...

forget about that ancient stuff - let Apache::Pod do it :)

-- 
brian d foy <comdog@panix.com> - Perl services for hire
The Perl Review - a new magazine devoted to Perl 
<http://www.theperlreview.com>


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

Date: Tue, 08 Oct 2002 18:48:26 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.2 $)
Message-Id: <3DA38AEA.3050406@vpservices.com>

Tom Beer wrote:

> tadmc@augustmail.com wrote in message
> <5LOcnT6UYuup5D6gXTWcpQ@News.GigaNews.Com>...
> 
> 
>>     Social faux pas to avoid
>>      - Sending a "stealth" Cc copy
>>
> 
> What is a "stealth" cc copy


It is when you send a copy (i.e. a cc) of a Usenet posting to someone 
without telling them (i.e. stealthily) that the message is a copy of a 
Usenet posting

 > and why should I avoid it?

Because when the person gets it, they will think they are corresponding 
only with you, when, in fact, they should be corresponding with the 
entire audience of the newsgroup.  If I post something and you post a 
message that misunderstands what I say and send me a stealth cc, I am 
will, thinking it is a plain email, reply to you personally and try to 
help you understand.  But then when I later go onto the newsgroup and 
see that you have posted the misunderstanding there, I need to correct 
it there also, otherwise other newsgroup readers will be confused.  So, 
by sending me a stealth cc, you have caused me to have to send two 
different messages.  If, instead you put "[posted and mailed]" at the 
top of your email to me, I would know that I am getting a cc from Usenet 
and I can reply to you individually and the newsgroup at the same time 
in one message.  Of course, maybe you didn't misunderstand me at all and 
I was the one who was befuddled.  In that case, it's even more important 
that the unbefuddlement occurs on the newsgroup so all can learn from it.

But please use cc's sparingly, even if non-stealth.  The newsgroup is a 
conversation and side conversations are only rarely appropriate.  The 
rest of the newsgroup readers (and future readers who search the 
archives) will be left out.

-- 
Jeff



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

Date: Wed, 9 Oct 2002 10:42:31 +0200
From: "Mark Eve" <mark_eve@agilent.comp>
Subject: Re: Sending HTML email in Perl
Message-Id: <1034152878.372414@cswreg.cos.agilent.com>

Before you send your tags, put something along the lines of:

print MAIL "Content-type: text/html\n\n";

then send your HTML content.

> In article <2481ff4b.0210070936.399fdbe2@posting.google.com>,
>  pulsar10@email.com (Serge) wrote:
>
> >  I have a Perl (CGI) script that sends out an email with a form.
> > However, when I use sendmail and do stuff like print sendmail "<html
> > tags>", all I get in the email are the actual tags. How do I make my
> > HTML actually decode? It is only simple HTML, no frames or anything!
> > Thanks in advance for your help.




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

Date: Wed, 9 Oct 2002 11:07:02 +0200
From: "Robert Rozman" <rozman@fri.uni-lj.si>
Subject: serial port problem
Message-Id: <ao0rjq$95o$1@planja.arnes.si>

Hello,

I've problem with rs 232 communication with Siemens GSM modem device (it
requires hardware flow control and ANSI emulation according to spec.).

When I try my attached code I get "framing error detected" on fresh boot up.
If I run Hyperterminal with default parameters (9600 8-N-1 + HW control) GSM
device responds, and then after this my code also works.

I've checked things with "mode com5" and settings actually change only after
Hyperterminal. If I run my code on fresh values, they don't change after my
script. So obviously I must be doing something wrong in code.

When my code doesn't work I get "framing error detected" message so it
probably runs on default baudrate - like my code didn't change settings
appropriately...

Please give me some advice or help,

regards,

Robert Rozman


------------------my code-----------------------------
BEGIN {
        $OS_win = ($^O eq "MSWin32") ? 1 : 0;
        if ($OS_win) {
     eval "use lib '../lib', '../lib/site'"; # Use BEGIN eval to keep
perl2exe happy
            eval "use Win32::SerialPort";
     die "$@\n" if ($@);
        }
        else {
            eval "use Device::SerialPort";
     die "$@\n" if ($@);
        }

} # End BEGIN


if ($OS_win) {
    $port = 'COM5';
    $ob = Win32::SerialPort->new ($port);
}
else {
    $port = '/dev/modem';
    $ob = Device::SerialPort->new ($port);
}
die "Can't open serial port $port: $^E\n" unless ($ob);

$ob->user_msg(1); # misc. warnings
$ob->error_msg(1); # hardware and data errors

$ob->baudrate(9600);
$ob->parity("none");
## $ob->parity_enable(1);   # for any parity except "none"
$ob->databits(8);
$ob->stopbits(1);
$ob->handshake("rts");

$ob->read_interval(0) if ($OS_win);
$ob->read_const_time(10000);


#---------------------START----------------------------------------------


$result='';
my $temp_result=0;
until ($result eq "AT\r\n\r\nOK\r\n") {
 $ob->write("AT\r\n");
 print "Sending: AT \n";
 sleep 3;
 $result = $ob->input;
 print "Got something back: $result \n" if ($result);

 if ($result eq "AT\r\n\r\nOK\r\n") {
  &printx ($result);
  print "Got Acknowledge: $result \n";
  $temp_result=1;
 } else {
  sleep 10;
 };
};





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

Date: Wed, 09 Oct 2002 03:50:59 +0200
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: Sharing a program?
Message-Id: <3874105.uI2dkTsVKv@nyoga.dubu.de>

Joe Creaney wrote:
> My next project is to figure out how to pick up items and use them.  I
> hope this is agood start for a fun game.  I am glad I posted it
> because I just lost my HD.

Well, you're in good company. ;-)

"Only wimps use tape backup: _real_ men just upload their important 
stuff on FTP, and let the rest of the world mirror it ;)"
                -- Linus Torvalds

Hoping you didn't loose too much valuable data,
        Harald
-- 
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Expert, n.:
        Someone who comes from out of town and shows slides.


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

Date: Wed, 09 Oct 2002 04:34:45 +0200
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: Split a string
Message-Id: <4652775.RSr6lGnDqi@nyoga.dubu.de>

Eric J. Roode wrote:
> Dmitry_Babich@icomverse.com (Dmitry) wrote in
> news:f21990ff.0210072219.6b8295f@posting.google.com:
>> The question is not just theoretical.
>> Consider utility that receives a string and should display it
>> on the screen with 5 columns. We don't want the utility
>> to split words, hence thus 2 condition. First condition is obvious.
> 
> How about the fine Text::Wrap module?

This was also my first thought. 

But if it's about formatting for screen output, one could also consider 
Perl's format feature. (After all, creating reports is one of the 
things Perl was designed for :)).


#!/usr/bin/perl -w

use strict;
my $fulltxt = "This is a short text\nwith\nsome whitespace in it.";
my $line;

format =
^<<<<<<<<<<
$line
 .

for $line (split /\n/, $fulltxt) {
        write while $line;
}


Ciao,
        Harald
-- 
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
The biggest improvement in performance is the non-working-to-working
transition.                     -- John Ousterhout


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

Date: Wed, 9 Oct 2002 08:44:19 +0200
From: "Al" <dav.1@bigfoot.com>
Subject: Re: Split a string
Message-Id: <ao0j83$e17$1@sunnews.cern.ch>


"John W. Krahn" <krahnj@acm.org> wrote in message
news:3DA330CA.FFCB17CD@acm.org...

> No strictures.
^^^^^

john it is only an example of how it can be done it is up to him to expand
on

> What if (as in the OP's example) there is whitespace in the string?


well his spec only said newline or 5 chars so that is what he got

 ......I have a string that should be split to array of lines according to
the following:
 ......   (1) newline donates end of the current line
 ......   (2) each line should be not longer than 5 characters and line can
 ...       split a word


> Why are you using a file glob to iterate over the array?  If there are
> any special glob characters in the data this will return unexpected
> results.

Its only to see what is there, I guess he will be creating some sort of
fancy output probably.
so i just stuck it at the bottom so i could see the output ......... no big
deal

this is only a snap shot of code that we have no idea really what it will be
used for. I am sure the user will be able to expand on it to fit is needs or
totally change it as the case may be .


dav...




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

Date: Wed, 9 Oct 2002 07:17:08 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Split a string
Message-Id: <slrnaq7lsa.7v3.bernard.el-hagin@gdndev25.lido-tech>

In article <ao0j83$e17$1@sunnews.cern.ch>, Al wrote:
> 
> "John W. Krahn" <krahnj@acm.org> wrote in message
> news:3DA330CA.FFCB17CD@acm.org...
> 
>> No strictures.
> ^^^^^
> 
> john it is only an example of how it can be done it is up to him to expand
> on


"strict" should just about always be used. *Especially* in explanatory code.


Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'


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

Date: Wed, 09 Oct 2002 01:09:06 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: synonymous subroutines
Message-Id: <3da3808d.94500585@news.erols.com>

 =?UTF-8?B?Sm9oYW5uZXMgRsO8cm5rcmFueg==?=
<johannes.fuernkranz@t-online.de> wrote:

| I want to have two subroutines in a package that do exactly the same 
| thing. It's just that there are two names for the thing.
| 
| So, my first thought was to define a and simply set the type glob of b 
| to a, like this:
| 
| *b = *a;
| 
| That works, but it has the effect that it will also treat $b and $a as 
| synonymous which makes me feel a bit uncomfortable.

Others have already suggested

  *b = \&a;

but you could do

  sub b{ goto &a }

if you know what that form of 'goto' does, that is.
I kind of prefer it to the hieroglyphical typeglob assignment.

| This also works, but gives a warning:
| 
| $ perl -e 'sub a { print "a"; }; &b = &a; b();'
| Can't modify non-lvalue subroutine call at -e line 1.
| a

That's not a warning.  It's a fatal error.

The output is deceiving.  It doesn't work at all.
The 'a' output happens when a() is called at "&b = &a".
The last statement, "b();" , never gets executed.



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

Date: 9 Oct 2002 01:23:20 -0700
From: deita@inbox.lv (deita)
Subject: Re: udp
Message-Id: <9899055d.0210090023.25997382@posting.google.com>

Hello Benjamin,

first of all, thanx for your reply.

> Your posted code only shows recieving data, not sending.
> Show your real code, and what you want it to do, and perhaps we can
> help.

as i already wrote in the previous post "sending" app is a copy of the first
one, only:
$recv = 2901;
$send = 2801;

> Furthermore, you have a busy loop that's stopped by an alarm.  That's
> wasteful and resource-innefficient.

alarm is used only for the demostration of the problem.
so, the problem seems to be that sending udp message to the not existing server
will not be resumed when the server will be started.

print $client "data\n";
after this command system should receive icmp message "port is unreachable";
($client is still defined, no errors such as "premature of writing to socket").

when server is started, the same command should send message successfuly, but
it wont, maybe because $client stores what kind of state that server not exists.

so, i think that problem maybe solved by setting special options to udp socket??
what is the meaning of the "Reuse" and "Timeout" values in the udp socket??

thank u.


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

Date: Wed, 9 Oct 2002 11:25:26 +0200
From: "Brutus" <pef@trasig.noXX>
Subject: what about   do{} while (<>)
Message-Id: <ao0sn6$7gc$1@oslo-nntp.eunet.no>

Hi - a brief question from a c-programmer:

I'm reading text from stdin with   while (<>){} .

So how do I do the    do{}while (<>){}     ??

i.e. execute the loop first, and increment (next line)
and conditional test at the end.

( don't find much bout this in perldoc or perl book).


Thanx for a hint
Brit Uthus









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

Date: Wed, 9 Oct 2002 09:38:54 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: what about   do{} while (<>)
Message-Id: <slrnaq7u63.7v3.bernard.el-hagin@gdndev25.lido-tech>

In article <ao0sn6$7gc$1@oslo-nntp.eunet.no>, Brutus wrote:
> Hi - a brief question from a c-programmer:
> 
> I'm reading text from stdin with   while (<>){} .
> 
> So how do I do the    do{}while (<>){}     ??
> 
> i.e. execute the loop first, and increment (next line)
> and conditional test at the end.
> 
> ( don't find much bout this in perldoc or perl book).


Did you try perldoc perlsyn?


Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'


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

Date: Tue, 08 Oct 2002 20:11:09 -0700
From: swen <swen@news.com>
Subject: XML::RSS bug
Message-Id: <3DA39E4D.C0DED3D8@news.com>

I notice that when I parse an rss file with XML::RSS, the parser
converts all entity references (e.g., '&amp;') into the enitities they
represent (e.g. '&')within the XML::RSS object. The problem is that, if
I then write this XML::RSS object back to disk (via 'save()') the entity
reference is not restored. Instead the entity it represents is written
back the file. For entities like '&', it then becomes an unparseable
file. Is it just me or is this a bug? Or is there a way to change this
behavior within the module.



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

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.  

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 V10 Issue 3938
***************************************


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