[30173] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1416 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 2 21:09:47 2008

Date: Wed, 2 Apr 2008 18:09:11 -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, 2 Apr 2008     Volume: 11 Number: 1416

Today's topics:
        binding parameters (timestamp) with DBD::Sybase <mislam@spam.uiuc.edu>
    Re: binding parameters (timestamp) with DBD::Sybase <ben@morrow.me.uk>
    Re: binding parameters (timestamp) with DBD::Sybase <mislam@spam.uiuc.edu>
    Re: Can I iterate through a file on a CGI  page? <jimsgibson@gmail.com>
    Re: CPAN commandline tool is not working <ben@morrow.me.uk>
    Re: CPAN commandline tool is not working <sumonsmailbox@gmail.com>
        Download attachment from email <jqmicro@gmail.com>
    Re: Download attachment from email <ben@morrow.me.uk>
    Re: every combination of Y/N in 5 positions <noreply@gunnar.cc>
    Re: every combination of Y/N in 5 positions <abigail@abigail.be>
    Re: every combination of Y/N in 5 positions <noreply@gunnar.cc>
    Re: every combination of Y/N in 5 positions <ben@morrow.me.uk>
    Re: FYI - How to add CPAN as a search plugin for Firefo <smallpond@juno.com>
    Re: FYI - How to add CPAN as a search plugin for Firefo <1usa@llenroc.ude.invalid>
    Re: FYI - How to add CPAN as a search plugin for Firefo <john@castleamber.com>
    Re: FYI - How to add CPAN as a search plugin for Firefo <szrRE@szromanMO.comVE>
    Re: mismatch between Perl 5.6 and Perl 5.8 in printing  <sisyphus359@gmail.com>
    Re: mismatch between Perl 5.6 and Perl 5.8 in printing  <ben@morrow.me.uk>
    Re: RE Perl Pattern matching <benkasminbullock@gmail.com>
        Recursive Directory Copy (with resource forks) in Mac O <jerry@sheepsystems.com>
    Re: tricky use of print? <szrRE@szromanMO.comVE>
    Re: tricky use of print? <tadmc@seesig.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 02 Apr 2008 15:22:26 -0500
From: Sharif Islam <mislam@spam.uiuc.edu>
Subject: binding parameters (timestamp) with DBD::Sybase
Message-Id: <ft0pu2$hms$1@news.acm.uiuc.edu>

I need to run a stored procedure in the MSSQL 2005 server from my linux 
machine. It takes a parameter which is timestamp datatype. However, when 
I try to use bind_parameter, I get an error:

   my $sp_qry = "EXEC MY_STORED_PROC ?" ;
   my $sth = $dbh->prepare($sp_qry) ;
   $sth->bind_param(1, $row[0], SQL_TIMESTAMP);

Error:

Bareword "SQL_TIMESTAMP" not allowed while "strict subs" in use at 
track_changes.pl line 34.
Execution of track_changes.pl aborted due to compilation errors.

If I take out the strict:
DBI::st=HASH(0x9fe7388)->bind_param(...): attribute parameter 
'SQL_TIMESTAMP' is not a hash ref at myscript.pl line 32.

line 32 is $sth->bind_param(1, $row[0], SQL_TIMESTAMP);

SQL_TIMESTAMP is not the right type? not supported?

--s


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

Date: Wed, 2 Apr 2008 21:38:07 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: binding parameters (timestamp) with DBD::Sybase
Message-Id: <fe7dc5-8q41.ln1@osiris.mauzo.dyndns.org>


Quoth Sharif Islam <mislam@spam.uiuc.edu>:
> I need to run a stored procedure in the MSSQL 2005 server from my linux 
> machine. It takes a parameter which is timestamp datatype. However, when 
> I try to use bind_parameter, I get an error:
> 
>    my $sp_qry = "EXEC MY_STORED_PROC ?" ;
>    my $sth = $dbh->prepare($sp_qry) ;
>    $sth->bind_param(1, $row[0], SQL_TIMESTAMP);
> 
> Error:
> 
> Bareword "SQL_TIMESTAMP" not allowed while "strict subs" in use at 
> track_changes.pl line 34.
> Execution of track_changes.pl aborted due to compilation errors.

The DBI documentation suggests you need

    use DBI qw/:sql_types/;

to import the type constants.

> If I take out the strict:

Don't do that. Unless you already understand what you're doing and why
it is the right thing to do, it never helps.

Ben



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

Date: Wed, 02 Apr 2008 16:29:23 -0500
From: Sharif Islam <mislam@spam.uiuc.edu>
Subject: Re: binding parameters (timestamp) with DBD::Sybase
Message-Id: <ft0trj$iou$1@news.acm.uiuc.edu>

Ben Morrow wrote:
> Quoth Sharif Islam <mislam@spam.uiuc.edu>:
>> I need to run a stored procedure in the MSSQL 2005 server from my linux 
>> machine. It takes a parameter which is timestamp datatype. However, when 
>> I try to use bind_parameter, I get an error:
>>
>>    my $sp_qry = "EXEC MY_STORED_PROC ?" ;
>>    my $sth = $dbh->prepare($sp_qry) ;
>>    $sth->bind_param(1, $row[0], SQL_TIMESTAMP);
>>
>> Error:
>>
>> Bareword "SQL_TIMESTAMP" not allowed while "strict subs" in use at 
>> track_changes.pl line 34.
>> Execution of track_changes.pl aborted due to compilation errors.
> 
> The DBI documentation suggests you need
> 
>     use DBI qw/:sql_types/;
> 
> to import the type constants.

Thanks. But it seems now the datatype is getting set to VARCHAR:

DBD::Sybase::st execute failed: Server message number=257 severity=16 
state=3 line=0 server=MSSQL procedure=MY_STORED_PROC text=Implicit 
conversion from data type char to timestamp is not allowed. Use the 
CONVERT function to run this query. at myscript.pl line 34.


I get the parameter from another query and I save the timestamp value in 
a variable, $row[0]:

$qry = SELECT min_active_rowversion()
 ...
$sth->bind_param(1, $row[0], SQL_TIMESTAMP);


But bind_param suppose set the type to the correct datatype?

--s








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

Date: Wed, 02 Apr 2008 15:53:25 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Can I iterate through a file on a CGI  page?
Message-Id: <020420081553254760%jimsgibson@gmail.com>

In article <pan.2008.04.02.19.52.30.989027@example.net>, Rich Grise
<rich@example.net> wrote:

> 
> So, anybody got a quick and dirty script that will make 38,000 symlinks?

for my $i ( 1..38000 ) {
  symlink( '/path/to/somefile', sprintf("symlink%5.5d",$i));
}

-- 
Jim Gibson

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


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

Date: Wed, 2 Apr 2008 21:32:29 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: CPAN commandline tool is not working
Message-Id: <t37dc5-8q41.ln1@osiris.mauzo.dyndns.org>


Quoth skywriter14 <sumonsmailbox@gmail.com>:
> 
> I am using Perl in my Ubuntu machine where CPAN commandline tool is
> acting very strange. Looks like, it is getting false response form all
> or any CPAN mirror. I reconfigured cpan 'urllist' few times with
> different sets of 7/8 urls. But it always stalls and keeps getting 404
> and 500 status from all the mirrors.

Can you show us a log from an attempt to use CPAN? Just running 'reload
index' in the shell ought to be enough if all fetches are failing. It's
possible you have an invalid proxy set in your environment, though wget
generally honours the same environment vars as LWP. It's also possible
CPAN is using some external command for downloading that is misbehaving.

Ben



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

Date: Wed, 2 Apr 2008 14:05:16 -0700 (PDT)
From: skywriter14 <sumonsmailbox@gmail.com>
Subject: Re: CPAN commandline tool is not working
Message-Id: <018a8683-dafd-4df8-a51b-91dd72446c7e@d45g2000hsc.googlegroups.com>

> Can you show us a log from an attempt to use CPAN? Just running 'reload
> index' in the shell ought to be enough if all fetches are failing. It's
> possible you have an invalid proxy set in your environment, though wget
> generally honours the same environment vars as LWP. It's also possible
> CPAN is using some external command for downloading that is misbehaving.
>
> Ben

Thanks Ben. I fixed the problem by adding main cpan.org in the list.
And sorry, I cannot show the cpan command logs as I did many things on
the same terminal, they are gone. Here is the urllist from CPAN's
MyConfig.pm file.

  'urllist' => [ q[http://search.cpan.org/CPAN/], q[http://
mirror.lums.edu.pk], q[ftp://cpan.hexten.net/], q[ftp://
cpan.hostrack.net/pub/CPAN], q[ftp://cpan.llarian.net/pub/CPAN/],
q[ftp://cpan.mirrors.redwire.net/pub/CPAN/], q[ftp://
cpan.mirrors.tds.net/pub/CPAN], q[ftp://cpan.netnitco.net/pub/mirrors/
CPAN/], q[ftp://cpan.erlbaum.net/CPAN/]],

I added the second url by following search.cpan.org in opera statusbar
(search.cpan.org is redirecting me in opera to http://mirror.lums.edu.pk
all day. But even that did not work). Now I added http://search.cpan.org/CPAN/
in the beginning, and it is working. Not sure why this happened. All
these mirrors work through wget. Do you understand what was the exact
problem? Thanks again, I will use 'reload index' next time I hit
similar problems.


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

Date: Wed, 2 Apr 2008 15:13:03 -0700 (PDT)
From: Macaruchi <jqmicro@gmail.com>
Subject: Download attachment from email
Message-Id: <4effdbcc-bea1-453c-bc36-13c433c98d42@k13g2000hse.googlegroups.com>

Hi!
I wanna know how to download my email from pop3 account and take the
attachment and save it in a folder.
I have been seeing NET::Pop3 to do that but I dont know if it has this
method for attachment.

Is there something way to take the attachment from email.?


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

Date: Wed, 2 Apr 2008 23:35:02 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Download attachment from email
Message-Id: <m9edc5-5ms1.ln1@osiris.mauzo.dyndns.org>


Quoth Macaruchi <jqmicro@gmail.com>:
> I wanna know how to download my email from pop3 account and take the
> attachment and save it in a folder.
> I have been seeing NET::Pop3 to do that but I dont know if it has this

Net::POP3. Case is important.

> method for attachment.
> 
> Is there something way to take the attachment from email.?

Once you have the email, MIME::Parser will let you extract the
attachments; or you could try Email::Folder::POP3 along with the other
Email::* modules.

Ben



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

Date: Wed, 02 Apr 2008 22:20:44 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <65i89bF2dvptrU1@mid.individual.net>

David Harmon wrote:
> On Mon, 31 Mar 2008 23:23:25 +0200 in comp.lang.perl.misc, Gunnar
> Hjalmarsson <noreply@gunnar.cc> wrote,
>> I do, I hope. :)
>>
>>     foreach my $num ( 0 .. 0b11111 ) {
>>         local *_ = \ sprintf '%05b', $num;
> 
> What is *_ ?  It looks like one of those magic perl variables,  but
> I don't find any documentation on it.

Others have told you that it's a typeglob and pointed you to relevant docs.

As regards applicable docs on _the reason_ why I didn't just say

     local $_ = sprintf ...

please see the "Localization of globs" section in "perldoc perlsub".

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


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

Date: 02 Apr 2008 23:07:12 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <slrnfv84d0.nld.abigail@alexandra.abigail.be>

                                                _
Gunnar Hjalmarsson (noreply@gunnar.cc) wrote on VCCCXXVIII September
MCMXCIII in <URL:news:65i7ejF2f3g2iU1@mid.individual.net>:
^^  Abigail wrote:
^^ > David Harmon (source@netcom.com) wrote on VCCCXXVIII September MCMXCIII
^^ > in <URL:news:fb6dnc-9EJLmcm_anZ2dnUVZ_rSrnZ2d@earthlink.com>:
^^ > []  On Mon, 31 Mar 2008 23:23:25 +0200 in comp.lang.perl.misc, Gunnar
^^ > []  Hjalmarsson <noreply@gunnar.cc> wrote,
^^ > [] >I do, I hope. :)
^^ > [] >
^^ > [] >     foreach my $num ( 0 .. 0b11111 ) {
^^ > [] >         local *_ = \ sprintf '%05b', $num;
^^ > []  
^^ > []  What is *_ ?  It looks like one of those magic perl variables,  but
^^ > []  I don't find any documentation on it.
^^ > 
^^ > It's a silly attempt to obfuscate the code.
^^  
^^  I didn't do it for the sake of it; please see the sub-thread starting 
^^  with 
^^  http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/1c6904d6a4774258/e56a5cb3831212df 
^^  and the advice provided there by Ben and Brian.


I read it. I still think it's obfuscated. Why use a package scoped glob
if you can use a lexical variable (even $_)? 




Abigail
-- 
A perl rose:  perl -e '@}>-`-,-`-%-'


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

Date: Thu, 03 Apr 2008 01:21:41 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <65iiscF2f9g0cU1@mid.individual.net>

Abigail wrote:
>                                                 _
> Gunnar Hjalmarsson (noreply@gunnar.cc) wrote on VCCCXXVIII September
> MCMXCIII in <URL:news:65i7ejF2f3g2iU1@mid.individual.net>:
> ^^  Abigail wrote:
> ^^ > David Harmon (source@netcom.com) wrote on VCCCXXVIII September MCMXCIII
> ^^ > in <URL:news:fb6dnc-9EJLmcm_anZ2dnUVZ_rSrnZ2d@earthlink.com>:
> ^^ > []  On Mon, 31 Mar 2008 23:23:25 +0200 in comp.lang.perl.misc, Gunnar
> ^^ > []  Hjalmarsson <noreply@gunnar.cc> wrote,
> ^^ > [] >I do, I hope. :)
> ^^ > [] >
> ^^ > [] >     foreach my $num ( 0 .. 0b11111 ) {
> ^^ > [] >         local *_ = \ sprintf '%05b', $num;
> ^^ > []  
> ^^ > []  What is *_ ?  It looks like one of those magic perl variables,  but
> ^^ > []  I don't find any documentation on it.
> ^^ > 
> ^^ > It's a silly attempt to obfuscate the code.
> ^^  
> ^^  I didn't do it for the sake of it; please see the sub-thread starting 
> ^^  with 
> ^^  http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/1c6904d6a4774258/e56a5cb3831212df 
> ^^  and the advice provided there by Ben and Brian.
> 
> I read it. I still think it's obfuscated. Why use a package scoped glob
> if you can use a lexical variable (even $_)?

Pursuing backwards compatibility justifies the obfuscation. The lexical 
$_ was news in v5.9.1.

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


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

Date: Thu, 3 Apr 2008 01:04:52 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: every combination of Y/N in 5 positions
Message-Id: <4ijdc5-ge12.ln1@osiris.mauzo.dyndns.org>


Quoth abigail@abigail.be:
>                                                 _
> Gunnar Hjalmarsson (noreply@gunnar.cc) wrote on VCCCXXVIII September
> MCMXCIII in <URL:news:65i7ejF2f3g2iU1@mid.individual.net>:
> ^^  Abigail wrote:
> ^^ > David Harmon (source@netcom.com) wrote on VCCCXXVIII September MCMXCIII
> ^^ > in <URL:news:fb6dnc-9EJLmcm_anZ2dnUVZ_rSrnZ2d@earthlink.com>:
> ^^ > []  On Mon, 31 Mar 2008 23:23:25 +0200 in comp.lang.perl.misc, Gunnar
> ^^ > []  Hjalmarsson <noreply@gunnar.cc> wrote,
> ^^ > [] >I do, I hope. :)
> ^^ > [] >
> ^^ > [] >     foreach my $num ( 0 .. 0b11111 ) {
> ^^ > [] >         local *_ = \ sprintf '%05b', $num;
> ^^ > []  
> ^^ > []  What is *_ ?  It looks like one of those magic perl variables,  but
> ^^ > []  I don't find any documentation on it.
> ^^ > 
> ^^ > It's a silly attempt to obfuscate the code.
> ^^  
> ^^  I didn't do it for the sake of it; please see the sub-thread starting 
> ^^  with 
> ^^ 
> http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/1c6904d6a4774258/e56a5cb3831212df 
> ^^  and the advice provided there by Ben and Brian.
> 
> 
> I read it. I still think it's obfuscated. Why use a package scoped glob
> if you can use a lexical variable (even $_)? 

FWIW I entirely agree. For occasions where the convenience of $_ is
useful and 5.10 is not an option, a one-item for loop is a much cleaner
way of safely doing a local assignment than messing around with *_.

Ben


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

Date: Wed, 2 Apr 2008 14:34:16 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: FYI - How to add CPAN as a search plugin for Firefox
Message-Id: <7757e339-61c4-4a7c-a478-2e72d50e4c3f@a22g2000hsc.googlegroups.com>

On Apr 2, 1:42 pm, David Filmer <use...@davidfilmer.com> wrote:
> FWIW, Firefox comes with a several search plugins (Google, Yahoo, etc).
> These plugins are just XML files, and you can write your own.  I wrote
> one to make it just a little bit easier to search CPAN - I figured I'd
> put it out here for anyone that's interested.
>
> Name the file CPAN.xml and put it in your Firefox searchplugins
> directory.  On my OpenSUSE Linux box that is
>     /usr/lib/firefox/searchplugins
> On Windows it should be something like
>     C:\Program Files\Mozilla Firefox\searchplugins
> I dunno about Mac, though there should be a searchplugins directory
> wherever Firefox itself is installed.
>
> The encoded stuff is the little camel favicon.  It should be all on one
> line.
>
> Here is the CPAN search plugin:
>
> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
> xmlns:moz="http://www.mozilla.org/2006/browser/search/">
> <ShortName>CPAN</ShortName>
> <Description>Comprehensive Perl Archive Network</Description>
> <InputEncoding>UTF-8</InputEncoding>
> <Image width="16"
> height="16">data:image/x-icon,%00%00%01%00%01%00%10%10%00%00%00%00%00%00(%01%00%00%16%00%00%00(%00%00%00%10%00%00%00%20%00%00%00%01%00%04%00%00%00%00%00%C0%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%FF%FF%FF%00%7B%00%00%00%00%7B%00%00%7B%7B%00%00%00%00%7B%00%7B%00%7B%00%00%7B%7B%00%BD%BD%BD%00%7B%7B%7B%00%FF%00%00%00%00%FF%00%00%FF%FF%00%00%00%00%FF%00%FF%00%FF%00%00%FF%FF%00%00%00%00%00%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%F0%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF3l%FC%BF%EF%18%E6%D7%EB%F0%F6%DB%00%00%FA%E9%00%02%F8%C3al%FC%03te%F8%02Co%F0%02r%20%E0%01%5C%D0%E0%03%11%00%E6%0F%BF%E6'%1F%00%02%07%FF%00%06%87%FF2%80%E3%FF1%E0</Image>
> <Url type="text/html"
>         method="GET"
> template="http://search.cpan.org/search?mode=all&query={searchTerms}"/>
> <moz:SearchForm>searchFormURL</moz:SearchForm>
> </OpenSearchDescription>
>
> Cheers!


Works great.  Thanks!

Two things:

Make sure that the '&' in the template line includes the 'amp;'
escape.  That
seems to have gotten lost either in your post or my reader.  Check the
XML by
loading the file in your browser.

It can be placed either in the global searchplugins directory or in
your home
directory which on linux is ~/.mozilla/firefox/32rwhuev.default/
searchplugins/




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

Date: Wed, 02 Apr 2008 21:55:02 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: FYI - How to add CPAN as a search plugin for Firefox
Message-Id: <Xns9A74B643A7F2Dasu1cornelledu@127.0.0.1>

David Filmer <usenet@davidfilmer.com> wrote in
news:ys6dnXyLoLbAWG7a4p2dnAA@giganews.com: 

> FWIW, Firefox comes with a several search plugins (Google, Yahoo,
> etc). These plugins are just XML files, and you can write your
> own.  I wrote one to make it just a little bit easier to search
> CPAN - I figured I'd put it out here for anyone that's interested.

As an alternative, I have always preferred search keywords for this 
kind of stuff. Not as sexy, but works.

Go to http://search.cpan.org/ right click in the textfield and 
select add a keyword for this search. I set the search domain to 
Modules and used 'cpan' for the keyword so that I can type

cpan CGI

in the address box and have Firefox search CPAN modules for CGI.

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: 2 Apr 2008 22:28:37 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: FYI - How to add CPAN as a search plugin for Firefox
Message-Id: <Xns9A74A79C05BFBcastleamber@130.133.1.4>

David Filmer <usenet@davidfilmer.com> wrote:

> 
> FWIW, Firefox comes with a several search plugins (Google, Yahoo,
> etc). These plugins are just XML files, and you can write your own.  I
> wrote one to make it just a little bit easier to search CPAN - I
> figured I'd put it out here for anyone that's interested.

I am somewhat adicted to smart keywords for this:
http://johnbokma.com/firefox/keymarks-explained.html

(look, it even mentiones cpan :-D

and I've also a perldoc one: http://search.cpan.org/perldoc?%s

).

-- 
John

http://johnbokma.com/firefox/


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

Date: Wed, 2 Apr 2008 17:06:19 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: FYI - How to add CPAN as a search plugin for Firefox
Message-Id: <ft171r02v1h@news1.newsguy.com>

smallpond wrote:
> On Apr 2, 1:42 pm, David Filmer <use...@davidfilmer.com> wrote:
>> FWIW, Firefox comes with a several search plugins (Google, Yahoo,
>> etc). These plugins are just XML files, and you can write your own.
>> I wrote one to make it just a little bit easier to search CPAN - I
>> figured I'd put it out here for anyone that's interested.
>>
>> Name the file CPAN.xml and put it in your Firefox searchplugins
>> directory.  On my OpenSUSE Linux box that is
>>     /usr/lib/firefox/searchplugins
>> On Windows it should be something like
>>     C:\Program Files\Mozilla Firefox\searchplugins
>> I dunno about Mac, though there should be a searchplugins directory
>> wherever Firefox itself is installed.
>>
>> The encoded stuff is the little camel favicon.  It should be all on
>> one line.
>>
>> Here is the CPAN search plugin:
>>
>> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
>> xmlns:moz="http://www.mozilla.org/2006/browser/search/">
>> <ShortName>CPAN</ShortName>
>> <Description>Comprehensive Perl Archive Network</Description>
>> <InputEncoding>UTF-8</InputEncoding>
>> <Image width="16"
>> height="16">data:image/x-icon,%00%00%01%00%01%00%10%10%00%00%00%00%00%00(%01%00%00%16%00%00%00(%00%00%00%10%00%00%00%20%00%00%00%01%00%04%00%00%00%00%00%C0%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%00%FF%FF%FF%00%7B%00%00%00%00%7B%00%00%7B%7B%00%00%00%00%7B%00%7B%00%7B%00%00%7B%7B%00%BD%BD%BD%00%7B%7B%7B%00%FF%00%00%00%00%FF%00%00%FF%FF%00%00%00%00%FF%00%FF%00%FF%00%00%FF%FF%00%00%00%00%00%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%F0%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF%FF3l%FC%BF%EF%18%E6%D7%EB%F0%F6%DB%00%00%FA%E9%00%02%F8%C3al%FC%03te%F8%02Co%F0%02r%20%E0%01%5C%D0%E0%03%11%00%E6%0F%BF%E6'%1F%00%02%07%FF%00%06%87%FF2%80%E3%FF1%E0</Image>
>> <Url type="text/html"
>>         method="GET"
>> template="http://search.cpan.org/search?mode=all&query={searchTerms}"/>
>> <moz:SearchForm>searchFormURL</moz:SearchForm>
>> </OpenSearchDescription>
>>
>> Cheers!
>
>
> Works great.  Thanks!
>
> Two things:
>
> Make sure that the '&' in the template line includes the 'amp;'
> escape.  That
> seems to have gotten lost either in your post or my reader.  Check the
> XML by
> loading the file in your browser.
>
> It can be placed either in the global searchplugins directory or in
> your home
> directory which on linux is ~/.mozilla/firefox/32rwhuev.default/
> searchplugins/

It's your reader. I see the  & amp ;  in my reader (as well as when 
looking at the raw message source), so you may want ot check your 
setting. It's likely doing some sort of HTML translation somewhere.

-- 
szr 




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

Date: Wed, 2 Apr 2008 16:41:56 -0700 (PDT)
From: sisyphus <sisyphus359@gmail.com>
Subject: Re: mismatch between Perl 5.6 and Perl 5.8 in printing high precision  values.
Message-Id: <9223ba3f-712a-42f6-9a3d-4041582ea604@b5g2000pri.googlegroups.com>

On Apr 3, 6:58=A0am, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrote:
> [A complimentary Cc of this posting was sent to
> sisyphus
> <sisyphus...@gmail.com>], who wrote in article <28eff3d6-c1b4-4679-9838-38=
c295b4d...@i7g2000prf.googlegroups.com>:
>
> > Since 0.99999999976716936 =3D3D=3D3D 9.9999999976716936e-1
>
> Why this would be so? =A0At best, one is 0.99999999976716936, another is
> 9.9999999976716936/10. =A0I know no axiom of FP arithmetic which would
> make them equal...

Oh! ... ok. (I was thinking that perl should see the same mantissa in
both instances, and therefore store the same value.)

The other thing I note is that (with 52 bits of precision, plus the
implicit leading "1.") 0.99999999976716936 is represented in base 2
as:
1.1111111111111111111111111111111000000000000000000000e-1
And that converts back to 0.99999999976716936 (in base 10).

OTOH, 0.99999999976716925 is represented as:
1.1111111111111111111111111111110111111111111111111111e-1
And that converts back to 0.99999999976716925 (in base 10).

For my conversions, I'm using "round to nearest" mode - and I'm using
the mpfr C library (version 2.3.1) - which, according to its homepage
at http://www.mpfr.org/ provides "correct rounding" and "copies the
good ideas from the ANSI/IEEE-754 standard for double-precision
floating-point arithmetic (53-bit mantissa)". I've not yet had any
cause to take issue with those claims.

For me, (the recent versions of)perl are at odds with everything else
on my box in (apparently) insisting that 0.99999999976716936 has the
internal base 2 representation of:
1.1111111111111111111111111111110111111111111111111111e-1

Everything else uses an internal representation of
1.1111111111111111111111111111111000000000000000000000e-1.

Is that still not a perl bug ? (This FP stuff is just so damned
tricky, I never know what to think for sure :-)

Cheers,
Rob


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

Date: Thu, 3 Apr 2008 01:08:59 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: mismatch between Perl 5.6 and Perl 5.8 in printing high precision  values.
Message-Id: <rpjdc5-ge12.ln1@osiris.mauzo.dyndns.org>


Quoth sisyphus <sisyphus359@gmail.com>:
> 
> For me, (the recent versions of)perl are at odds with everything else
> on my box in (apparently) insisting that 0.99999999976716936 has the
> internal base 2 representation of:
> 1.1111111111111111111111111111110111111111111111111111e-1

Do you know how it gets to that? Is it not simply calling your atof?

> Everything else uses an internal representation of
> 1.1111111111111111111111111111111000000000000000000000e-1.
> 
> Is that still not a perl bug ? (This FP stuff is just so damned
> tricky, I never know what to think for sure :-)

I think the stated position is 'perl provides no guarantees about
anything to do with FP'. If you wish to implement, test, and document
something more consistent, please feel free.... :)

Ben



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

Date: Wed, 2 Apr 2008 22:16:09 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: RE Perl Pattern matching
Message-Id: <ft10j8$i7j$1@ml.accsnet.ne.jp>

On Wed, 02 Apr 2008 10:53:34 -0500, Chris Mattern wrote:


> You're trying to parse XML with regular expressions.  Don't do that.
> Perl has a large selection of excellent modules for processing XML. Use
> them.

Chris, do you talk like that to people in real life, or is it just the 
internet?


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

Date: Wed, 2 Apr 2008 17:03:57 -0700 (PDT)
From: Jerry Krinock <jerry@sheepsystems.com>
Subject: Recursive Directory Copy (with resource forks) in Mac OS X
Message-Id: <93ef4e0a-e525-4d2d-bff2-452473f58132@i7g2000prf.googlegroups.com>

At least for me, the module function File::Copy::Recursive::dircopy()
seems to not copy resource forks of descendant files when used in Mac
OS X.

Has anyone else noticed this?  What's a good method for copying
directories in Mac OS X?  Call system() to invoke cp?

Thanks,

Jerry Krinock


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

Date: Wed, 2 Apr 2008 14:28:24 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: tricky use of print?
Message-Id: <ft0vqv0v6@news3.newsguy.com>

David Filmer wrote:
> Ela wrote:
>>> Or a heredoc :-)
>>>
>>> print <<_EOF_;
>>> $foo $bar
>>> _EOF_
>>>
>>
>> There are too few words in your example and I'm unable to
>> follow/Google. I guess maybe you are telling something important? thx
>
> szr is just showing you an example of how to use a heredoc, which
> recognizes the \n at the end of any lines within it (so it's just
> another way of printing newlines).

I should of also said, you can either physically have new lines, like:

print <<_EOF_;
A
B
C
_EOF_


Or you can use \n instead:

print <<_EOF_;
A\nB\nC
_EOF_


Or mix and match:

print <<_EOF_;
A
B\nC
_EOF_


Either way you get:

$ perl -e 'print <<_EOF_;
> A
> B\nC
> _EOF_'
A
B
C

-- 
szr 




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

Date: Wed, 02 Apr 2008 23:09:02 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: tricky use of print?
Message-Id: <slrnfv87gc.g9f.tadmc@tadmc30.sbcglobal.net>

Ela <ela@yantai.org> wrote:
>> Or a heredoc :-)
>>
>> print <<_EOF_;
>> $foo $bar
>> _EOF_
>>
>> -- 
>> szr
>>
>
> There are too few words in your example and I'm unable to follow/Google. I 
> guess maybe you are telling something important? thx 


See the "<<EOF" section in perlop.pod.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

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


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