[25095] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7344 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 31 00:14:55 2004

Date: Sat, 30 Oct 2004 21: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           Sat, 30 Oct 2004     Volume: 10 Number: 7344

Today's topics:
        FAQ 3.29: Where can I learn about linking C with Perl?  <comdog@panix.com>
        FAQ 4.19: How do I validate input? <comdog@panix.com>
        FAQ 4.35: How do I find the soundex value of a string? <comdog@panix.com>
    Re: Finding a module's $VERSION programmatically (Anno Siegel)
    Re: Finding a module's $VERSION programmatically <not-for-replies@zombie.org.uk>
    Re: Finding a module's $VERSION programmatically <mritty@gmail.com>
    Re: GD.pm install woes (Anno Siegel)
    Re: GD.pm install woes <usenet@morrow.me.uk>
    Re: how to test the speed of rsync (Anno Siegel)
    Re: how to test the speed of rsync <1usa@llenroc.ude.invalid>
    Re: how to test the speed of rsync <tadmc@augustmail.com>
    Re: Image data parsing <mgjv@tradingpost.com.au>
    Re: localizing %SIG handlers <nospam-abuse@ilyaz.org>
    Re: Parsing 'dirty/corrupt data'. Advice wanted burlo_stumproot@yahoo.se
    Re: Parsing 'dirty/corrupt data'. Advice wanted <ebohlman@omsdev.com>
    Re: Parsing 'dirty/corrupt data'. Advice wanted burlo_stumproot@yahoo.se
        PerlFaq Question <nospam@nospam.com>
    Re: PerlFaq Question <noreply@gunnar.cc>
    Re: PerlFaq Question <nospam@nospam.com>
    Re: PerlFaq Question <comdog@panix.com>
    Re: PerlFaq Question <comdog@panix.com>
    Re: PerlFaq Question <comdog@panix.com>
    Re: print FILE function() <see@sig.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 30 Oct 2004 22:03:00 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 3.29: Where can I learn about linking C with Perl? [h2xs, xsubpp]
Message-Id: <cm132k$cgp$1@reader1.panix.com>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.

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

3.29: Where can I learn about linking C with Perl? [h2xs, xsubpp]

    If you want to call C from Perl, start with perlxstut, moving on to
    perlxs, xsubpp, and perlguts. If you want to call Perl from C, then read
    perlembed, perlcall, and perlguts. Don't forget that you can learn a lot
    from looking at how the authors of existing extension modules wrote
    their code and solved their problems.



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

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-2002 Tom Christiansen and Nathan
    Torkington, and other contributors as noted. All rights 
    reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.


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

Date: Sat, 30 Oct 2004 16:03:02 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 4.19: How do I validate input?
Message-Id: <cm0dvm$6ej$1@reader1.panix.com>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.

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

4.19: How do I validate input?

    The answer to this question is usually a regular expression, perhaps
    with auxiliary logic. See the more specific questions (numbers, mail
    addresses, etc.) for details.



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

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-2002 Tom Christiansen and Nathan
    Torkington, and other contributors as noted. All rights 
    reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.


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

Date: Sun, 31 Oct 2004 04:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 4.35: How do I find the soundex value of a string?
Message-Id: <cm1o5l$hn8$1@reader1.panix.com>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.

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

4.35: How do I find the soundex value of a string?

    Use the standard Text::Soundex module distributed with Perl. Before you
    do so, you may want to determine whether `soundex' is in fact what you
    think it is. Knuth's soundex algorithm compresses words into a small
    space, and so it does not necessarily distinguish between two words
    which you might want to appear separately. For example, the last names
    `Knuth' and `Kant' are both mapped to the soundex code K530. If
    Text::Soundex does not do what you are looking for, you might want to
    consider the String::Approx module available at CPAN.



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

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-2002 Tom Christiansen and Nathan
    Torkington, and other contributors as noted. All rights 
    reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.


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

Date: 30 Oct 2004 15:15:34 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Finding a module's $VERSION programmatically
Message-Id: <cm0b6m$89m$1@mamenchi.zrz.TU-Berlin.DE>

Brian Greenfield  <$news\200101$@zombie.org.uk> wrote in comp.lang.perl.misc:
> I'm trying to find the version number of the CPAN modules I've
> installed so I can keep my modules up to date.

You get this functionality from CPANPLUS (not sure if the predecessor
CPAN already had it).  It compares versions of installed modules with
current versions on CPAN.

>                                                The following script
> shows the technique I've tried:
> 
>     #!/usr/bin/perl
>     
>     use strict;
>     use warnings FATAL=>'all';
>     
>     for (qw/Text::Table Class::DBI::Loader::GraphViz/)
>     {
>         print "$_: /", fetch_installed_version($_), "/\n";
>     }
>     
>     sub fetch_installed_version
>     {
>         my $pkg = shift;
>     
>         eval "require $pkg";
>         my $iver = eval '$'."${pkg}::VERSION";
>         die "VERSION is not defined in $pkg\n"
>             unless $iver;
>         return $iver;
>     }
> 
> The script gets the version for Text::Table but not for
> Class::DBI::Loader::GraphViz:
> 
>     Text::Table: /1.107/
>     VERSION is not defined in Class::DBI::Loader::GraphViz
> 
> This isn't a one off, about a third of the packages produce the same
> error.
> 
> If I try to get the version from the command line, I get:
> 
>     zippy:~/scripts$ perl -MClass::DBI::Loader::GraphViz -we \
>                      'print $Class::DBI::Loader::GraphViz::VERSION'
>     Base class package "GraphViz::DBI" is empty.
>         (Perhaps you need to 'use' the module which defines that 
>         package first.)
>      at /usr/share/perl5/Class/DBI/Loader/GraphViz.pm line 3
>     BEGIN failed--compilation aborted at    
>     /usr/share/perl5/Class/DBI/Loader/GraphViz.pm line 3.
>     Compilation failed in require.
>     BEGIN failed--compilation aborted.
> 
> ISTM that my technique is flawed, so what is the best way to find a
> module's $VERSION programmatically?

There is no formal requirement for a CPAN module to have a version.
Modules that are part of a larger distribution often don't have a
version of their own.  Class::DBI::Loader::GraphViz could be one
of those.

For an alternative (but not fundamentally different) approach to
version reading look at base.pm.

Anno


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

Date: Sat, 30 Oct 2004 19:04:23 GMT
From: Brian Greenfield <not-for-replies@zombie.org.uk>
Subject: Re: Finding a module's $VERSION programmatically
Message-Id: <ubp7o019jbbglebi89g2sjhdbke4abgvqv@4ax.com>

On 30 Oct 2004 15:15:34 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:

>Brian Greenfield  <$news\200101$@zombie.org.uk> wrote in comp.lang.perl.misc:
>> I'm trying to find the version number of the CPAN modules I've
>> installed so I can keep my modules up to date.
>
>You get this functionality from CPANPLUS (not sure if the predecessor
>CPAN already had it).  It compares versions of installed modules with
>current versions on CPAN.

Noted.

[Script snipped]

>> The script gets the version for Text::Table but not for
>> Class::DBI::Loader::GraphViz:
>> 
>>     Text::Table: /1.107/
>>     VERSION is not defined in Class::DBI::Loader::GraphViz
>> 
>> This isn't a one off, about a third of the packages produce the same
>> error.
>> 
>> If I try to get the version from the command line, I get:
>> 
>>     zippy:~/scripts$ perl -MClass::DBI::Loader::GraphViz -we \
>>                      'print $Class::DBI::Loader::GraphViz::VERSION'
>>     Base class package "GraphViz::DBI" is empty.
>>         (Perhaps you need to 'use' the module which defines that 
------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>         package first.)

I should have read the error message more carefully. Doh!

>>      at /usr/share/perl5/Class/DBI/Loader/GraphViz.pm line 3
>>     BEGIN failed--compilation aborted at    
>>     /usr/share/perl5/Class/DBI/Loader/GraphViz.pm line 3.
>>     Compilation failed in require.
>>     BEGIN failed--compilation aborted.
>> 
>> ISTM that my technique is flawed, so what is the best way to find a
>> module's $VERSION programmatically?

ISTM that my brain is flawed:(

After a couple of hours away from the problem, the solution became
clear: make sure I have all the module dependencies installed

>For an alternative (but not fundamentally different) approach to
>version reading look at base.pm.

Will do. Thanks.


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

Date: Sat, 30 Oct 2004 16:45:26 -0400
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Finding a module's $VERSION programmatically
Message-Id: <cm0uh9$fcr$1@misc-cct.server.rpi.edu>

"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:cm0b6m$89m$1@mamenchi.zrz.TU-Berlin.DE...
> Brian Greenfield  <$news\200101$@zombie.org.uk> wrote in
comp.lang.perl.misc:
> > I'm trying to find the version number of the CPAN modules I've
> > installed so I can keep my modules up to date.
>
> You get this functionality from CPANPLUS (not sure if the predecessor
> CPAN already had it).  It compares versions of installed modules with
> current versions on CPAN.
>

CPAN.pm does indeed offer this functionality, with the 'r' command from the
CPAN shell.  It will give a list of your currently installed modules that
are less up-to-date than the versions currently available on the CPAN.
(Note that - I believe unlike CPANPLUS - there is no functionality to
automatically download and install the newer versions based on this list).

Paul Lalli




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

Date: 30 Oct 2004 15:30:14 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: GD.pm install woes
Message-Id: <cm0c26$89m$2@mamenchi.zrz.TU-Berlin.DE>

Xevo <x3v0-usenet@yahoo.com> wrote in comp.lang.perl.misc:
> I've been trying to install GD.pm for a few days now, but to no avail.
> 
> I am using Fedora Core 2 with a P4 system.

I did this recently with GD 2.16 on OS X.

> I have installed libgd 2.0.28, Free Type 2.1.9, libpng 1.2.7, and
> jpeg-6b. All were installed from source. I gave each it's own
> directory under /usr/local/. There were no errors during the install
> of any of them. I can use the scripts that get put into the bin
> directory by libgd (such as webpng) so I know libgd is working.

I had all the auxiliary libs (no Free Type here) installed into
standard locations (/usr/local/lib/).  GD installed smoothly.

[snip symptoms]

Anno


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

Date: Sat, 30 Oct 2004 16:48:55 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: GD.pm install woes
Message-Id: <7opc52-v86.ln1@osiris.mauzo.dyndns.org>


Quoth x3v0-usenet@yahoo.com (Xevo):
> I've been trying to install GD.pm for a few days now, but to no avail.
> 
> I'm not sure exactly what is wrong, but it looks like it can't find
> libgd.so.2. Any ideas on what is going on and how to fix this error?

Try adding /usr/local/gd/lib to your LD_LIBRARY_PATH.

Ben

-- 
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/'                                                 # ben@morrow.me.uk


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

Date: 30 Oct 2004 15:31:07 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to test the speed of rsync
Message-Id: <cm0c3r$89m$3@mamenchi.zrz.TU-Berlin.DE>

xthua  <xthua111@sohu.com> wrote in comp.lang.perl.misc:
> hi everyone.i 'd like to make a mirror of fedora rpms in rsync.and i get 
> a list of rsync sites. what puzzled me is which site to used . i'd like 
> to get the higher speed. any advises? thank you!

What is your Perl question?

Anno


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

Date: 30 Oct 2004 16:23:08 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: how to test the speed of rsync
Message-Id: <Xns95927DFE99FBFasu1cornelledu@132.236.56.8>

xthua <xthua111@sohu.com> wrote in news:clvajl$6om$1@news.yaako.com:

> hi everyone.i 'd like to make a mirror of fedora rpms in rsync.and i get 
> a list of rsync sites. what puzzled me is which site to used . i'd like 
> to get the higher speed. any advises? thank you!

1. You do not have a Perl question.

2. You have posted the exact same message twice under different identities.

Therefore, go away please.

Sinan.


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

Date: Sat, 30 Oct 2004 12:10:54 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: how to test the speed of rsync
Message-Id: <slrnco7iou.3t3.tadmc@magna.augustmail.com>

kenneth <xthua111@zju.edu.cn> wrote:

> any advises?


Yes, I advise against making off-topic posts.

This is the Perl newsgroup. 

Did you want to say something regarding Perl?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Sat, 30 Oct 2004 20:39:32 +1000
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Image data parsing
Message-Id: <slrnco6rr4.kp.mgjv@martien.heliotrope.home>

On 27 Oct 2004 14:36:59 -0700,
	anatolym <anatolym@cox.net> wrote:
> Hello All,
> 
> I have a problem here and I tried a few things, but non worked.
> 
> Any help would be greatly appreciated!
> 
> I'm parsing an XML file, trying to get the image part out and save
> it as an image file. File format (gif, png, jpeg, bmp) is unknown.

You will only be successful in that if you know how the XML is built up.
If you don't know the format of the data, then you have very little
chance to decode it.

[snip XML]

I've done a bit of snooping around, and I found one XML DTD that
actually seems to have all the elements that you have in that XML. If
that DTD is the one used for this, then your image data is probably a
base 64 encoded string representing each pixel's index into the palette.
However, I'm just guessing. I'd ask the people who created the XML file
in the first place.

> I tried to use Imager module to read this in and write to a file:

I doubt very much that it will be able to take random unspecified data
you throw at it, and make sense of it for you. I suspect you'll have to
do the hard work, and try a few things, or find the documentation or
information on this from the source.

Martien
-- 
                        | 
Martien Verbruggen      | The world is complex; sendmail.cf reflects
                        | this.
                        | 


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

Date: Sat, 30 Oct 2004 23:31:46 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: localizing %SIG handlers
Message-Id: <cm1892$16d2$1@agate.berkeley.edu>

I wrote in article <clsefk$2nid$1@agate.berkeley.edu>:

> I can signal at 1000/sec (recent OS/2).  Given reasonable delay on
> Usenet of a day or two, this gives 10^8.  ;-) [If one believes
> back-of-envelopo calculations, then the active code of a small test
> program should be about 10^4 instructions; so n*10^4 signals have a
> good probability to hit at all instruction boundaries.

I missed one log(10^4) in this estimage: with n*10^4 signals, the
probability that *one* particular instruction boundary is hit is about
exp(-n).  So if one wants that *all* instruction boundaries are hit
with high probability, one needs about n*10^4*log(10^4), so about
n*10^5 signals.  (n about 5 should be a reasonable safeguard...)

> However, I have seen Perl signal handling problems which happen much
> more rare than this...]

Thinking about this more: signals happen not on instruction
boundaries, but on clock cycle boundaries.  And with long instruction
pipelines, tentative execution, and branch prediction, one can get
many different states of processor per instruction boundary.  Maybe
this can explain such low-probability events?

Ilya


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

Date: Sat, 30 Oct 2004 13:07:01 GMT
From: burlo_stumproot@yahoo.se
Subject: Re: Parsing 'dirty/corrupt data'. Advice wanted
Message-Id: <u7jp8xsln.fsf@notvalid.se>

James Willmore <jwillmore@adelphia.net> writes:

> burlo_stumproot@yahoo.se wrote:
> <snip>

<snip of example data>

> Know your data.  Know why one line is valid and another isn't.  The
> data may appear to have no "logic" or "pattern" to it, but it's there
> somewhere.

I know how my data looks and the regular expression to find them are
simple. What I was hoping for by asking here was if anyone had a better
strategy than the one I have now. What I do now is extensive lookahead
in the file until I find a line that matches. If I cant find it before
a new "block header"-line is found I report the block as broken.

> what is requires for a valid line.  That's at first glance and without
> having any clue as to what the data is supposed to be/represent.

I wish I knew what it represented too. I have it in the documentation
but have not had the time to read it yet. I have to do that soon since
I plan to do a reasonabilitytest[1] on the data.

And later I have to make pretty pictures of it in excel and powerpoint!
Ooh JOY!!


[1] Hmm cant find a good word for this right now.


/PM
From adress valid but rarly read.



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

Date: 30 Oct 2004 19:13:47 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Parsing 'dirty/corrupt data'. Advice wanted
Message-Id: <Xns959291C489834ebohlmanomsdevcom@130.133.1.4>

burlo_stumproot@yahoo.se wrote in news:u7jp8xsln.fsf@notvalid.se:

> I know how my data looks and the regular expression to find them are
> simple. What I was hoping for by asking here was if anyone had a better
> strategy than the one I have now. What I do now is extensive lookahead
> in the file until I find a line that matches. If I cant find it before
> a new "block header"-line is found I report the block as broken.

Draw a state diagram and implement a state machine.  You might find some of 
the DFA::* modules on CPAN to be helpful (and there's a writeup on them 
somewhere in the archives of perl.com) though from what it sounds like it's 
simple enough to implement in straight code.  That way you should be able 
to deal with only one line at a time without lookahead.


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

Date: Sat, 30 Oct 2004 22:22:49 GMT
From: burlo_stumproot@yahoo.se
Subject: Re: Parsing 'dirty/corrupt data'. Advice wanted
Message-Id: <uy8hnvoaw.fsf@notvalid.se>

Eric Bohlman <ebohlman@omsdev.com> writes:

> burlo_stumproot@yahoo.se wrote in news:u7jp8xsln.fsf@notvalid.se:
> 
> > I know how my data looks and the regular expression to find them are
> > simple. What I was hoping for by asking here was if anyone had a better
> > strategy than the one I have now. What I do now is extensive lookahead
> > in the file until I find a line that matches. If I cant find it before
> > a new "block header"-line is found I report the block as broken.
> 
> Draw a state diagram and implement a state machine.  You might find some of 
> the DFA::* modules on CPAN to be helpful (and there's a writeup on them 
> somewhere in the archives of perl.com) though from what it sounds like it's 
> simple enough to implement in straight code.  That way you should be able 
> to deal with only one line at a time without lookahead.

Looks interesting. I'll have a closer look at this. Thanks for the tip.

/PM

From adress valid but rarly read


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

Date: Sat, 30 Oct 2004 16:34:13 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: PerlFaq Question
Message-Id: <1099168502.900395@nntp.acecape.com>

Is there a site that shows the perlfaqs 1 thru 9 all on one page?

I was merely asking because, well I rarely seem to ask Perldoc the right
words to stuff that's IN the PerlFAQ and I thought, if a person could have
FAQ's 1-9 on the same webpage, a search for the words on the browser, might
actually producer more results.

The other reason I ask is that I noticed that whomever maintains
faq.perl.org is very quick to make changes (less than 24 hours after I
emailed about the deadlinks for IDE's).  So therefore wouldn't doing
searches off of the live PerlFAQ be better because it's always guranteed to
be a fresher version?  Granted the questions woudln't really change that
often, but the answers contained therein?

Just a thought.




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

Date: Sat, 30 Oct 2004 22:43:26 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: PerlFaq Question
Message-Id: <2uicmgF2b53dbU1@uni-berlin.de>

daniel kaplan wrote:
> Is there a site that shows the perlfaqs 1 thru 9 all on one page?

Weren't you just pointed to "perldoc perlfaq"? It's on the web too, btw, 
for instance at http://www.perldoc.com/perl5.8.4/pod/perlfaq.html

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


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

Date: Sat, 30 Oct 2004 17:03:59 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: PerlFaq Question
Message-Id: <1099170288.796109@nntp.acecape.com>

"Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message
news:2uicmgF2b53dbU1@uni-berlin.de...
> daniel kaplan wrote:

> Weren't you just pointed to "perldoc perlfaq"? It's on the web too, btw,
> for instance at http://www.perldoc.com/perl5.8.4/pod/perlfaq.html

seriously, I completely forgot about that link because for two days in a row
(early this week) I could NOT get onto it.  so came to instinctively  rely
on faq.perl.org....but thanks for bringing it back to my head...

but that does bring me to another question, they are BOTH updated, therefore
I assume they both get their data from the same place/source.  Is this
assumption correct?

> Weren't you just pointed to....
thanks for the pleasantness of your reply though.  you might  want to stop
and consider that it's because of attitudes of people like you, that there
are unavoidable barfights, wars in specific regions of the world, and
general nastiness, etc.  try not to be so stiff, unyielding and unforgiving.
even if not for yourself, but because pleasantness spreads easier than
nastiness, and just makes the world a nicer place.  besides, it takes more
energy to be nasty than to be just neutral.

have a terrific day...




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

Date: Sat, 30 Oct 2004 22:58:20 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: PerlFaq Question
Message-Id: <301020042258204300%comdog@panix.com>

In article <1099168502.900395@nntp.acecape.com>, daniel kaplan
<nospam@nospam.com> wrote:

> The other reason I ask is that I noticed that whomever maintains
> faq.perl.org is very quick to make changes (less than 24 hours after I
> emailed about the deadlinks for IDE's).

that's me.

I'm only fast because you happened to mention that at the end of
the week when I was doing all the changes. :)

> So therefore wouldn't doing
> searches off of the live PerlFAQ be better because it's always guranteed to
> be a fresher version? 

The only problem is getting an answer that is beyond your version
of perl.  The repository is really just behind-the-scenes maintenance.

It's not a bad idea though.  I'll have to write a script to create
it (unless someone else wants to).  I'd start with pod2html on
each perlfaq, then remove the header and footer.  Cat the files,
add a header at the top and one at the bottom and Bob's your uncle.

You could also just do what I do when I need to find which document 
has what:

   % cd perlfaq
   % grep delete *.pod

-- 
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com


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

Date: Sat, 30 Oct 2004 22:59:44 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: PerlFaq Question
Message-Id: <301020042259449345%comdog@panix.com>

In article <2uicmgF2b53dbU1@uni-berlin.de>, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:

> daniel kaplan wrote:
> > Is there a site that shows the perlfaqs 1 thru 9 all on one page?

> Weren't you just pointed to "perldoc perlfaq"? It's on the web too, btw, 
> for instance at http://www.perldoc.com/perl5.8.4/pod/perlfaq.html

That's just the table of contents, and it's not the most up-to-date
version of perlfaq.

-- 
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com


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

Date: Sat, 30 Oct 2004 23:04:10 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: PerlFaq Question
Message-Id: <301020042304105323%comdog@panix.com>

In article <1099170288.796109@nntp.acecape.com>, daniel kaplan
<nospam@nospam.com> wrote:

> "Gunnar Hjalmarsson" <noreply@gunnar.cc> wrote in message

> > Weren't you just pointed to "perldoc perlfaq"? It's on the web too, btw,
> > for instance at http://www.perldoc.com/perl5.8.4/pod/perlfaq.html

> but that does bring me to another question, they are BOTH updated, therefore
> I assume they both get their data from the same place/source.  Is this
> assumption correct?

I'm not sure what you mean by "both", but the versions 
at http://faq.perl.org comes directly from the perlfaq CVS
repository, which is usually the most up-to-date version.
Sometimes perl5porters changes a few things, but I merge
those pretty quickly.

I think Carlos only uses the versions distributed with a
particular version, so you can look at the versions of the
documents for many versions if you like.

-- 
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com


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

Date: Sat, 30 Oct 2004 21:27:55 -0400
From: Bob Walton <see@sig.invalid>
Subject: Re: print FILE function()
Message-Id: <41843d65$1_2@127.0.0.1>

Spin wrote:
 ...
> Why is that I can't print a function's output to file?

One can, if one does it correctly.  Your routine "hdump" returns undef 
(the result of the last statement executed in "hdump", which was a 
"foreach" loop).  You are also using "printf" in "hdump", which is why 
you are getting output to STDOUT rather than your FILE filehandle.  If 
you want to call "hdump" as shown, try the three modifications I show 
below [untested]:

> 
> my $path = "/home/atc/scripts/test.txt";
> open (FILE, ">$path") or die "Unable to open file $!";
> print FILE "PC: Status Inquiry ",curr_time(),"\n";
> print FILE hdump($loc);
> close (FILE) or die "Can't close file";
> 
> 
> The first print line prints to file and not to screen (including the 
> curr_time() func).
> The second prints to screen and not to the file.
> 
> Here's the subroutines:
> sub hdump {
>     my $offset = 0;
       my $output='';
>     my(@array,$format);
>     foreach my $data (unpack("a16"x(length($_[0])/16)."a*",$_[0])) {
>         my($len)=length($data);
>         if ($len == 16) {
>             @array = unpack('N4', $data);
>             $format="0x%08x (%05d)   %08x %08x %08x %08x   %s\n";
>         } else {
>             @array = unpack('C*', $data);
>             $_ = sprintf "%2.2x", $_ for @array;
>             push(@array, '  ') while $len++ < 16;
>             $format="0x%08x (%05d)" .
>                "   %s%s%s%s %s%s%s%s %s%s%s%s %s%s%s%s   %s\n";
>         }
>         $data =~ tr/\0-\37\177-\377/./;
          #printf $format,$offset,$offset,@array,$data;
          $output.=sprintf $format,$offset,$offset,@array,$data;
>         $offset += 16;
>     }
       return $output;
> };
 ...
> TIA
You're welcome.
> Caleb
-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.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 V10 Issue 7344
***************************************


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