[29849] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1092 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 5 21:09:42 2007

Date: Wed, 5 Dec 2007 18:09:07 -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           Wed, 5 Dec 2007     Volume: 11 Number: 1092

Today's topics:
        .htaccess mistake <visitprakashindia@gmail.com>
    Re: .htaccess mistake <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: .htaccess mistake <cwilbur@chromatico.net>
    Re: Better way to invoke dynamic function? <ben@morrow.me.uk>
    Re: Better way to invoke dynamic function? <uri@stemsystems.com>
    Re: Better way to invoke dynamic function? <stoupa@practisoft.cz>
        find a man at www.SexDatingPoint.com itayka3@gmail.com
    Re: how check new URL of redirected page <ced@blv-sam-01.ca.boeing.com>
    Re: how check new URL of redirected page <stoupa@practisoft.cz>
    Re: How to make thumbnail image from web page? <martina@makniovodanads.com>
    Re: How to make thumbnail image from web page? <hjp-usenet2@hjp.at>
    Re: OT raibow <stoupa@practisoft.cz>
    Re: Play wav or sound file. <timothytmaiden@gmail.com>
    Re: Play wav or sound file. <stoupa@practisoft.cz>
    Re: Problem installing Email-Send package <xxxxxxx@pacbell.net>
    Re: Problem installing Email-Send package <ben@morrow.me.uk>
    Re: Problem installing Email-Send package <xxxxxxx@pacbell.net>
    Re: variable number of arguments to bind_columns <ben@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 5 Dec 2007 11:59:29 -0800 (PST)
From: Praki <visitprakashindia@gmail.com>
Subject: .htaccess mistake
Message-Id: <c94f6866-d59c-4820-a6ca-25f7dd5ea961@d4g2000prg.googlegroups.com>

Greetings All,

This my .WWWaccess file config...

AuthType    Basic
AuthName    Login-Auth
LDAP_Server ldap.abc.com
LDAP_Port   389
Base_DN     "ou=active,ou=employees,ou=people,o=abc.com"
UID_Attr    uid
Require     valid-user

I m getting the error.HTTP 500 - Internal server error is the error.
can u point where i m  doing wrrong .. it would be of great help...

thanks,
Prakas


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

Date: Wed, 5 Dec 2007 12:07:00 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: .htaccess mistake
Message-Id: <40dj25xmr6.ln2@goaway.wombat.san-francisco.ca.us>

On 2007-12-05, Praki <visitprakashindia@gmail.com> wrote:
>
> This my .WWWaccess file config...

[snipped]

> I m getting the error.HTTP 500 - Internal server error is the error.
> can u point where i m  doing wrrong .. it would be of great help...

The first thing you're doing wrong is posting a webserver question in a
Perl group.  If you're running Apache, I believe there are both
newsgroups and mailing lists that would be more appropriate.

If you somehow end up having a Perl question, please read and observe the
Posting Guidelines that are posted frequently.

--keith


-- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information



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

Date: 05 Dec 2007 15:06:51 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: .htaccess mistake
Message-Id: <87abookisk.fsf@mithril.chromatico.net>

>>>>> "P" == Praki  <visitprakashindia@gmail.com> writes:

    P> I m getting the error.HTTP 500 - Internal server error is the
    P> error.  can u point where i m doing wrrong .. it would be of
    P> great help...

Your most recent error is asking an Apache configuration question with
no Perl content in a Perl newsgroup.

You can find Apache documentation at http://httpd.apache.org/docs/ --
odds are good that the answer to your question is somewhere in there.

And a good first step in finding more help for your problem might be
to find an appropriate mailing list from the ones listed at
http://httpd.apache.org/lists.html

Good luck.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Wed, 5 Dec 2007 16:38:00 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Better way to invoke dynamic function?
Message-Id: <8o0j25-bse.ln1@osiris.mauzo.dyndns.org>


Quoth Glenn Jackman <glennj@ncf.ca>:
> At 2007-12-05 10:53AM, "howa" wrote:
> >  On 12, Joost Diepenmaat <jo...@zeekat.nl> wrote:
> > > On Wed, 05 Dec 2007 06:34:42 -0800, howa wrote:
> > > > I have some codes which I want to dynamically select the algorithm at
> > > > runtime, currently can be done via using  eval(), e.g.
> [...]
> > > Use a function reference:
> > >
> > > $function_to_call = \&PI::bar;
> > >
> > > $function_to_call->();
> >  
> >  The function name is unknown at runtime, it is input by user.
> 
> Presumably the user's input is validated against some number of existing
> subroutines ... you want a dispatch table.  See
>     http://www.perlmonks.org/?node_id=456530
> 
> e.g.
>     my %subroutine_refs = (
>         choice1 => \&PI::bar,
>         choice2 => \&ALPHA::beta,
>     );

Note that you can also put the sub definitions directly in the hash,
rather than having to specify the name twice:

    my %subrefs = (
        choice1 => sub { ... },
        choice2 => sub { ... },
    );

Ben



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

Date: Wed, 05 Dec 2007 18:12:35 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Better way to invoke dynamic function?
Message-Id: <x7myspxb70.fsf@mail.sysarch.com>

>>>>> "h" == howa  <howachen@gmail.com> writes:


  h> The function name is unknown at runtime, it is input by user.

that is a VERY bad idea. why do newbies always think allowing users to
input a function name is a good idea?

anyhow the answer you want is a dispatch table. search google groups for
plenty of threads that have discussed them in the past. no reason to
post about them again.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Wed, 5 Dec 2007 16:19:17 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: Better way to invoke dynamic function?
Message-Id: <fj7i25$24la$2@ns.felk.cvut.cz>

Joost Diepenmaat wrote:
> On Wed, 05 Dec 2007 06:34:42 -0800, howa wrote:
> 
>> I have some codes which I want to dynamically select the algorithm at
>> runtime, currently can be done via using  eval(), e.g.
>> #######################
>> package P1;
>> 
>> sub foo {
>> print "foo";
>> }
>> 
>> sub bar {
>> print "bar";
>> }
>> 
>> 1;
>> 
>> $function_to_call = "P1.bar";
>> 
>> eval( $function_to_call );
> 
> Use a function reference:
> 
> $function_to_call = \&PI::bar;
> 
> $function_to_call->();
> 
> Joost.

Yes and is a good idea to test if a function is defined

$func_name = 'bar';
if(defined(&{"P1::" . $func_name})) 
    {
    (\&$func_name)->(parameters);
    }

-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.) 

Please reply to <petr AT practisoft DOT cz>



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

Date: Wed, 5 Dec 2007 11:30:14 -0800 (PST)
From: itayka3@gmail.com
Subject: find a man at www.SexDatingPoint.com
Message-Id: <f6796f93-136a-4676-959a-e9d6a7a4c414@a35g2000prf.googlegroups.com>

find a man at www.SexDatingPoint.com
find a man looking for a woman at www.SexDatingPoint.com
meet adult male at www.SexDatingPoint.com
men seeking women at www.SexDatingPoint.com
women seeking men
www.SexDatingPoint.com
woman seeking man
www.SexDatingPoint.com
woman looking for man
www.SexDatingPoint.com
find a male looking for a female
www.SexDatingPoint.com
female seeking male
www.SexDatingPoint.com
female looking for male
www.SexDatingPoint.com
find a partner
www.SexDatingPoint.com
women searching for men
www.SexDatingPoint.com
woman searching for a man
www.SexDatingPoint.com
woman searching for men
www.SexDatingPoint.com
find a single man
www.SexDatingPoint.com
find single men
www.SexDatingPoint.com
search for single men
www.SexDatingPoint.com
find a groom
www.SexDatingPoint.com
search for a groom
www.SexDatingPoint.com
find a sex partner
www.SexDatingPoint.com
seek single male
www.SexDatingPoint.com
seek single men
www.SexDatingPoint.com
seek for men
www.SexDatingPoint.com


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

Date: Wed, 5 Dec 2007 11:22:36 -0800 (PST)
From: "comp.llang.perl.moderated" <ced@blv-sam-01.ca.boeing.com>
Subject: Re: how check new URL of redirected page
Message-Id: <a65df053-57a4-426d-ae6f-34d45240bf0a@i12g2000prf.googlegroups.com>

On Dec 5, 7:26 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth zawszedamia...@gazeta.pl:
>
>
>
> > I read webpage using HTTP::Response but the page was redirected - how
> > can I read new url?
> > I tried HTTP::Response->base() but it returns orginal url.
>
> If you mean a proper HTTP redirect rather than an HTML meta-refresh or
> something more evil in JavaScript,
>
>     $response->header('Location');
>
> However, LWP::UserAgent will follow redirects by default, so unless
> you've turned it off this won't help :(.
> ...

A possibly more convenient alternative to turning off redirects
entirely is LWP's   simple_request which won't follow redirects:

 my $resp = $ua->simple_request($request);
 if ( $resp->code == 302 ) {
    $uri = URI->new($resp->header('Location'));
    ...

--
Charles DeRykus


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

Date: Wed, 5 Dec 2007 16:13:03 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: how check new URL of redirected page
Message-Id: <fj7i25$24la$1@ns.felk.cvut.cz>

zawszedamian_p@gazeta.pl wrote:
> I read webpage using HTTP::Response but the page was redirected - how
> can I read new url?
> I tried HTTP::Response->base() but it returns orginal url.
>
What URL you can read? I can take a look how this page is redirected and where 
to find new URL.
-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>



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

Date: Wed, 5 Dec 2007 19:28:40 +0100
From: "Martina" <martina@makniovodanads.com>
Subject: Re: How to make thumbnail image from web page?
Message-Id: <fj6qkq$kke$1@localhost.localdomain>

Intersting question?
Try with ImageMagics


"Trenk" <Karon@trenk.hrt> wrote in message 
news:fj5m11$t5$1@ss408.t-com.hr...
> How to make thumbnail image from web page?
> Some thing like networksolutions.com do.
> eg. http://www.networksolutions.com/whois/results.jsp?domain=perl.com
>
> Tnx.
>
> 




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

Date: Thu, 6 Dec 2007 00:38:52 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: How to make thumbnail image from web page?
Message-Id: <slrnfledkc.pua.hjp-usenet2@hrunkner.hjp.at>

On 2007-12-05 09:39, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
> Trenk wrote:
>> How to make thumbnail image from web page?
>> Some thing like networksolutions.com do.
>> eg. http://www.networksolutions.com/whois/results.jsp?domain=perl.com
>> 
>> Tnx.
>> 
>> 
>
> Render, then subsample.
  ^^^^^^
  That's the interesting part. How do you render a web-page into a
pixmap? Subsampling is trivial.

	hp


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

Date: Wed, 5 Dec 2007 16:24:37 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: OT raibow
Message-Id: <fj7i27$24la$4@ns.felk.cvut.cz>

A. Sinan Unur wrote:
> "Petr Vileta" <stoupa@practisoft.cz> wrote in
> news:fj57a0$f6i$2@ns.felk.cvut.cz:
>
>> You are not right. Many times I sent something to www newsgroup but I
>> was be a single man there :-)
>
> I am not sure what the smiley means in this case.
>
> comp.infosystems.www.authoring.html
> comp.infosystems.www.authoring.stylesheets
> comp.infosystems.www.authoring.site-design
>
Thank you, I didn't know about comp.infosystems news server. I'm going to add 
this server to my news reader right now.
-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>



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

Date: Wed, 5 Dec 2007 08:11:03 -0800 (PST)
From: Cehotec - Tim <timothytmaiden@gmail.com>
Subject: Re: Play wav or sound file.
Message-Id: <1b4c04f7-62e1-48a9-bb04-7cf700b3a96c@i12g2000prf.googlegroups.com>

On Dec 5, 12:39 am, Ron Bergin <r...@i.frys.com> wrote:
> On Dec 4, 8:57 pm, Cehotec - Tim <timothytmai...@gmail.com> wrote:
>
>
>
>
>
> > On Dec 4, 1:28 pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> > > Quoth Cehotec - Tim <timothytmai...@gmail.com>:
>
> > > > I use perl script for an application which allows users to include
> > > > their own code to be ran during the application.
>
> > > > How can I go about creating a sub that you play a wav file.  I am not
> > > > looking to open the wav with my default player.. but to actually play
> > > > the wav.
>
> > > Basically: how would you play a wav without Perl? Then get Perl to do
> > > the the same way.
>
> > > You haven't said what OS or desktop system you are using. Most provide
> > > some means of playing a wav from the command-line; under most Unixes you
> > > can use sox(1). Under Win32 I guess you could invoke mplayer2.exe,
> > > though I don't know how you'd go about hiding the window it brings up.
>
> > > A quick search of CPAN for e.g. 'audio' or 'sound' brings up lots of
> > > potentially useful modules, though again you'd need to say what OS you
> > > were using to know which could help you.
>
> > > Ben
>
> > Thanks for the reply.  I am using perl on a windows xp system.  It's
> > not necessary a large file that I want to play.  I just want to play
> > something a little more elaborate then a system beep.  Say for
> > instance a user does something wrong, I would like a sound to play.
> > Thanks again.
>
> I haven't used it myself, but Win32::Sound looks to be a good
> possibility.http://search.cpan.org/~jdb/libwin32-0.28/Sound/Sound.pm- Hide quoted text -
>
> - Show quoted text -

Thanks everyone.

    use Win32::Sound;
    Win32::Sound::Volume('100%');
    Win32::Sound::Play("file.wav");

Worked!


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

Date: Wed, 5 Dec 2007 16:22:05 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: Play wav or sound file.
Message-Id: <fj7i26$24la$3@ns.felk.cvut.cz>

Cehotec - Tim wrote:
> Thanks for the reply.  I am using perl on a windows xp system.  It's
> not necessary a large file that I want to play.  I just want to play
> something a little more elaborate then a system beep.  Say for
> instance a user does something wrong, I would like a sound to play.
> Thanks again.

Look for Win32::Sound module on CPAN.

-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.) 

Please reply to <petr AT practisoft DOT cz>



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

Date: Wed, 05 Dec 2007 16:09:48 GMT
From: "a" <xxxxxxx@pacbell.net>
Subject: Re: Problem installing Email-Send package
Message-Id: <g3A5j.51746$eY.17967@newssvr13.news.prodigy.net>

>
> Since Email::Send is pure-Perl, I'd probably just get ahold of nmake
> (it's a free download from Microsoft: see perldoc perlwin32) and install
> it with CPAN.pm. If any of the dependancies fail, you'll need to install
> them manually with ppm (roll on Strawberry Perl, I say :) ).

Thanks for the info, but to be honest, I'm not knowledgeable in Perl, and 
also all I want to do is install Bugzilla, so I'd rather take the easy way 
if possible - do you know if there is a pre-built version of this module out 
there that would fix this? I'm sure I'm not the only one with this problem 
as it's the result of following the installation instructions to the letter. 
I actually found other posts reporting something similar on the web, but no 
solution.

> OTOH, unless you have something that already depends on the installed
> versions of M::P and D::IP, downgrading them shouldn't cause you any
> problems.

I don't know how to tell if there is another dependency on these, but from 
the names, they sound like very basic packages, so there probably is. 
Bugzilla requires a large number of other modules...

Thanks,

a 




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

Date: Wed, 5 Dec 2007 16:52:14 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Problem installing Email-Send package
Message-Id: <ui1j25-bse.ln1@osiris.mauzo.dyndns.org>

[please attribute quotations]

Quoth "a" <xxxxxxx@pacbell.net>:
> [<ben@morrow.me.uk> wrote:]
> >
> > Since Email::Send is pure-Perl, I'd probably just get ahold of nmake
> > (it's a free download from Microsoft: see perldoc perlwin32) and install
> > it with CPAN.pm. If any of the dependancies fail, you'll need to install
> > them manually with ppm (roll on Strawberry Perl, I say :) ).
> 
> Thanks for the info, but to be honest, I'm not knowledgeable in Perl, and 
> also all I want to do is install Bugzilla,

:) I sympathise. Unfortunately, installing large packages like this is
often not as straightforward as it could be, particularly on Win32. A
lot of open source people consider Win32 to be 'not their problem'.

> so I'd rather take the easy way if possible - do you know if there is
> a pre-built version of this module out there that would fix this? I'm
> sure I'm not the only one with this problem as it's the result of
> following the installation instructions to the letter. I actually
> found other posts reporting something similar on the web, but no
> solution.

This is not actually a problem with Bugzilla, or with Email::Send, but
with ActiveState's ppm repository. They really shouldn't provide
packages with inconsistent dependancies like this. To give them their
due, producing binary packages for essentially the whole of CPAN is not
an easy task, and it's hardly surprising that their automated procedures
sometimes go wrong.

Installing using CPAN should be easy: download nmake from
http://download.microsoft.com/download/vc15/patch/1.52/w95/en-us/nmake15.exe,
run the downloaded exe to extract NMAKE.EXE and NMAKE.ERR, copy both
those files into C:\Perl\bin, and run

    perl -MCPAN -e"install Email::Send"

from a shell. It may ask you several questions if this is the first time
it's been run: the default answers are all fine for ActivePerl.

> > OTOH, unless you have something that already depends on the installed
> > versions of M::P and D::IP, downgrading them shouldn't cause you any
> > problems.
> 
> I don't know how to tell if there is another dependency on these, but from 
> the names, they sound like very basic packages, so there probably is. 
> Bugzilla requires a large number of other modules...

If this copy of perl isn't used for anything else, and ppm doesn't give
you any other warnings, then there aren't any other dependancies.

Ben



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

Date: Wed, 05 Dec 2007 22:40:19 GMT
From: "a" <xxxxxxx@pacbell.net>
Subject: Re: Problem installing Email-Send package
Message-Id: <nNF5j.75904$YL5.24154@newssvr29.news.prodigy.net>

>
> Installing using CPAN should be easy: download nmake from
> http://download.microsoft.com/download/vc15/patch/1.52/w95/en-us/nmake15.exe,
> run the downloaded exe to extract NMAKE.EXE and NMAKE.ERR, copy both
> those files into C:\Perl\bin, and run
>
>    perl -MCPAN -e"install Email::Send"
>

That worked perfectly. I can now go back to installing Bugzilla :)

Thanks a lot!

a 




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

Date: Wed, 5 Dec 2007 16:35:58 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: variable number of arguments to bind_columns
Message-Id: <ek0j25-bse.ln1@osiris.mauzo.dyndns.org>


Quoth Glenn Jackman <glennj@ncf.ca>:
> At 2007-12-05 09:01AM, "alexxx.magni@gmail.com" wrote:
> >  ok, dumb question (I must be tired)
> >  ...
> >  push @bindargs,\$a[1];

Note that using variables called 'a' and 'b' is a bad idea, as $a and $b
are slightly magic and used by sort. The arrays @a and @b are not
affected by this, but using them is a bad habit to get into.

> >  ...
> >  push @bindargs,\$a[2];
> >  ...
> >  $sth->bind_columns(undef,@bindargs);
> 
> A more compact replacement for 'n' push commands is:
>     my @bindargs = map { \$_ } @a;

To expand slightly: a more compact replacement for

    push @bindargs, $x;
    push @bindargs, $y;

is

    push @bindargs, $x, $y;

as push takes a list. A more compact replacement for

    \$a[1], \$a[2]

is

    map { \$_ } @a

or

    map \$_, @a

which is marginally more efficient and (IMHO) clearer; or, since we are
just taking refs,

    \( @a )

where the extra parens make the \ operator apply to a list rather than
an array. Passing a list to \ returns a list of refs to each member. So
the original can be replaced with

    push @bindargs, \( @a );

but if @bindargs starts empty then we can forget the push and simply
initialize it right away

    my @bindargs = \( @a );

more-or-less as you said :).

Ben



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

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


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