[26651] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8758 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 12 21:05:16 2005

Date: Mon, 12 Dec 2005 18:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 12 Dec 2005     Volume: 10 Number: 8758

Today's topics:
    Re: Correcting details for a CPAN module. <sdn.girths00869@zoemail.net>
        LWP-problems <ronnyma@math.uio.no>
    Re: LWP-problems <sisyphus1@nomail.afraid.org>
    Re: What is the reason for Perl? <sdn.girths00869@zoemail.net>
    Re: What is the reason for Perl? <sdn.girths00869@zoemail.net>
    Re: What is the reason for Perl? <sdn.girths00869@zoemail.net>
    Re: What is the reason for Perl? <sdn.girths00869@zoemail.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 12 Dec 2005 18:04:16 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: Correcting details for a CPAN module.
Message-Id: <Xns972AC2654749Bsdn.comcast@216.196.97.136>

Ian Stuart <ian.stuart@ed.ac.uk> wrote in news:439e00db$0$63087$ed2e19e4
@ptn-nntp-reader04.plus.net:

> I've recently uploaded a package into CPAN 
> (MathML::Entities::Approximate), and it appears in search.cpan.org - 
> however the details are incomplete:
> 
> There is a link to the pod, and my CPAN ID.
> 
> All the other packages have a short description on the first line, and 
> then a second line with several items: a link to a page detailing the 
> package, then the date of the file and the name of the maintainer 
> (linked to a page of further details)

The description comes from the =head NAME portion.  You have this section 
in your docs already, so you're halfway there.  Use a single hyphen to 
separate the name from the description:

    =head1 NAME

    MathML::Entitites::Approximate - Warps space and time in your region.

I'm not sure how the other fields get populated.  How did you upload the 
module?  Did you include a whole distribution, in a gzipped tarfile?  Or 
did you simply upload the .pm module file?

There are certain conventions to be followed.  I'm not sure where they're 
written down.  Let me know how you uploaded it, though, and we can work 
through what you need to do.

-- 
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`


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

Date: Tue, 13 Dec 2005 02:14:07 +0100
From: Ronny Mandal <ronnyma@math.uio.no>
Subject: LWP-problems
Message-Id: <9v7sp11683qrj055magiphfo0rthsg4jgf@4ax.com>

Hello.

I am running the latest ActivePerl on Win32. I utilize the LWP::Simple
and it's get to fetch images from the web.

However, on UNIX, it fetches binary, but on Windows it seems like the
transfer is ASCII. I cannot find anything about the change of mode in
the doc, anyone knows?


Thanks,

Ronny Mandal


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

Date: Tue, 13 Dec 2005 12:49:31 +1100
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: LWP-problems
Message-Id: <439e2907$0$17704$afc38c87@news.optusnet.com.au>


"Ronny Mandal" <ronnyma@math.uio.no> wrote in message
news:9v7sp11683qrj055magiphfo0rthsg4jgf@4ax.com...
> Hello.
>
> I am running the latest ActivePerl on Win32. I utilize the LWP::Simple
> and it's get to fetch images from the web.
>
> However, on UNIX, it fetches binary, but on Windows it seems like the
> transfer is ASCII. I cannot find anything about the change of mode in
> the doc, anyone knows?
>

Just binmode the filehandle before you write what you get() to file:

use warnings;
use strict;
use LWP::Simple;

my $url = "http://www.kalinabears.com.au/ameliagall.jpg";

my $content = get($url);

open(WR, ">pic.jpg") or die "Can't open file for writing: $!";
binmode(WR);
print WR $content;
close(WR) or die "Can't close file after writing: $!";

__END__

Cheers,
Rob




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

Date: Mon, 12 Dec 2005 17:17:07 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: What is the reason for Perl?
Message-Id: <Xns972ABA5723003sdn.comcast@216.196.97.136>

"Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de> wrote in
news:406dg9F18ka7gU1@news.dfncis.de: 

> Having said the above, I still consider C to be one of the few truely
> perfect languages. It is precisely the lack of certain features that
> makes it so appealing. Naturally, when I need those missing features,
> I'd always chose Perl over C, or any language that has them. But many
> tasks don't require more than its fairly basic set of concepts.

Well said.

-- 
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`


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

Date: Mon, 12 Dec 2005 18:29:00 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: What is the reason for Perl?
Message-Id: <Xns972AC69E81D6Csdn.comcast@216.196.97.136>

John Bokma <john@castleamber.com> wrote in 
news:Xns972AB80451CFCcastleamber@130.133.1.4:

> "Eric J. Roode" <sdn.girths00869@zoemail.net> wrote:
> 
>> John Bokma <john@castleamber.com> wrote in 
>> news:Xns972AA09354FA1castleamber@130.133.1.4:
>  
>>> If it's a string, you could check for \0 now couldn't you? And if you
>>> want to use something else, what's the problem of wrapping it all
>>> nice into a library?
>> 
>>     char buf[80];
>>     strcpy (buf, "hello");
>> 
>> After this call, buf[5] is '\0'.  Before that call, all of the
>> elements of buf are uninitialized; possibly they're all '\0', possibly
>> they're all random garbage.
>> 
>> Checking for '\0' tells you how long the string is (5 characters), but
>> doesn't tell you how long the allocated buffer is (80 bytes).
> 
> Yup, in which case you either are going to use a library that handles 
it 
> for you, or write your own stuff.
> 
> However, if you just want to copy the string, you *know* you need to 
> allocate a buffer of 6 chars.

Right.  And you have to keep track of that.  Over and over, all day long.


>>     char buf[4];
>>     strcpy (buf, "hello");
>> 
>> strcpy() can't tell that you're trying to stuff too much data into the
>> buffer.  There simply is no way.
> 
> Of course there is, silly:
> 
> jbokma:~$ type hello.c
> bash: type: hello.c: not found
> jbokma:~$ cat hello.c
> #include <stdlib.h>
> 
> int main(void) {
> 
>         char buf[20];
>         printf("%d\n", sizeof(buf));
> }
> jbokma:~$ gcc hello.c
> jbokma:~$ ./a.out
> 20

You didn't show me strcpy() finding out how large the buffer is; you 
showed me the calling function finding out.

Here, fill in the blank:

    int main(void) {
        char buf[20];
        size_t len;

        printf ("buf can hold at most %d chars.\n", find_size(buf));
    }

    size_t find_size(const char *buf) {
       ???
    }

-- 
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`


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

Date: Mon, 12 Dec 2005 19:29:41 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: What is the reason for Perl?
Message-Id: <Xns972AD0C21D0B5sdn.comcast@216.196.97.136>

John Bokma <john@castleamber.com> wrote in 
news:Xns972ABB60F31E8castleamber@130.133.1.4:

[paraphrased]
> Library, library, library, library, library.

Can you point to any of these magical libraries?


-- 
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`


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

Date: Mon, 12 Dec 2005 19:33:18 -0600
From: "Eric J. Roode" <sdn.girths00869@zoemail.net>
Subject: Re: What is the reason for Perl?
Message-Id: <Xns972AD15FE66Esdn.comcast@216.196.97.136>

John Bokma <john@castleamber.com> wrote in 
news:Xns972ABB60F31E8castleamber@130.133.1.4:

>>>> C gives no information about the number
>>>
>>> yes it does.
>> 
>> Portably? I doubt it. Specifically, there is no way to write a C
>> function that expects zero or more arguments. At least one argument
>> has to be there for variadic function parameters.
> 
> so, at least one fixed argument. But C does give information about the 
> number.

No, it does _not_.  You seem to have a severe misunderstanding of how 
functions are called in C.

-- 
Eric
`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`


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

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


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