[22459] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4680 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 7 11:07:56 2003

Date: Fri, 7 Mar 2003 08:05:10 -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           Fri, 7 Mar 2003     Volume: 10 Number: 4680

Today's topics:
        Can I Get Neater Hyperlinks in Emails (Sean Wilson)
    Re: Can I Get Neater Hyperlinks in Emails <richard@zync.co.uk>
    Re: CGI query string help <newsfeed2@boog.co.uk>
        CGI qw(-unique_headers) ?? (Christopher J. White)
        China Perl fan's can download EasyNNTP (hoowa.sun)
        China Perl fan's can download EasyNNTP (hoowa.sun)
    Re: dynamically define constants (Anno Siegel)
        EasyNNTP come here hoowa@21cn.com
    Re: Help with Inline::CPP.... (Brian Snyder)
    Re: I  want to know the line n umber of the error ! (Helgi Briem)
    Re: I  want to know the line n umber of the error ! (Helgi Briem)
    Re: I  want to know the line n umber of the error ! <ericosman-nospam@rcn.com>
    Re: Lightweight CGI module? (Helgi Briem)
    Re: Lightweight CGI module? (Helgi Briem)
    Re: Lightweight CGI module? <REMOVEsdnCAPS@comcast.net>
    Re: Lightweight CGI module? <REMOVEsdnCAPS@comcast.net>
    Re: Lightweight CGI module? <ubl@schaffhausen.de>
    Re: Non-fatal error, "script not found or unable to sta (Tad McClellan)
    Re: Obfuscated Perl Challenge <BROWNHIK@Syntegra.Bt.Co.Uk>
    Re: Obfuscated Perl Challenge (Tad McClellan)
    Re: Obfuscated Perl Challenge <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: Perl Mysql uploading a image in a database. (niels)
    Re: Perl Mysql uploading a image in a database. (niels)
    Re: POSIX Charcter Classes and tr <ajglist@izzy.net>
    Re: Put perl in old page <newsfeed2@boog.co.uk>
    Re: question about "new" in a module <spamtrap@nowhere.com>
    Re: Regular Expression <REMOVEsdnCAPS@comcast.net>
    Re: Regular Expressions (Anno Siegel)
        Setup user-password in .htaccess (Serg)
    Re: Setup user-password in .htaccess <ian@WINDOZEdigiserv.net>
    Re: Substitution and regex question <barryk2@SPAM-KILLER.mts.net>
    Re: Unix TAIL program <cingram@pjocsNOSPAMORHAM.demon.co.uk>
        what are the *.al file? <webmastr@localhost.localdomain>
    Re: what are the *.al file? <ajglist@izzy.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 7 Mar 2003 07:05:52 -0800
From: sean.wilson@dsdni.gov.uk (Sean Wilson)
Subject: Can I Get Neater Hyperlinks in Emails
Message-Id: <8f31c2cd.0303070025.53040501@posting.google.com>

I tried this two days through Google Groups, but I can't find any
reference to it now. If others have seen the original posting, I
apologise for the duplication. The original question was:-

I have a Perl script which sends an email out. The email includes two
hyperlinks for use by the recipients. I am looking for a neater way to
display these links. An example of one of the scripts is as follows:
------------------------
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<body bgcolor=\"#FFFFD0\">\n";
print "<p align=\"center\">";
print "Sending Confirmation E-mails\n";
print "Please Wait...\n\n";


    $temp=$ENV{'QUERY_STRING'};
    @pairs=split(/&/,$temp);
    foreach $item(@pairs) {
            ($key,$content)=split (/=/,$item,2);
            $content=~tr/+/ /;
            $content=~ s/%(..)/pack("c",hex($1))/ge;
            $fields{$key}=$content;
    }
    print "<body bgcolor=\"#FFFFFF\">\n";
    print "<h2>$fields{'subject'}</h2>\n";
    print "<pre>$fields{'message'}</pre>\n";

# unattended Mail::Sendmail test, sends an email message
# $mail{To} = 'Submitter' .';' .'Grade 7' .';
# $mail{To} = 'sean.wilson@nissa.gov.uk' .';'
 .'peter.stirling@nissa.gov.uk';

$mail{From} = 'SSA Webmaster <ssa.webmaster@nissa.gov.uk>'; 
# $mail{To}   = $fields{'G7Email'} . ';' . $fields{'EmailContact'};
$mail{To}   = $fields{'G7Email'};
$mail{CC}   = $fields{'EmailContact'};
$server = 'nissamail01.nissa.gov.uk';

BEGIN { $| = 1; print "1..2\n"; }
END {print "not ok 1\n" unless $loaded;}

use Mail::Sendmail;
$loaded = 1;


if ($server) {
    $mail{Smtp} = $server;
    }

$mail{Subject} =  "IT Request - Submission :- " . $fields{'ID'} . "
(Do Not Delete)";

$mail{Message} = "A member of your staff has submitted an IT Request
titled '" . $fields{'TitleRITA'} . "', which needs to be approved at
Grade 7 level.\n\n";
$mail{Message} .= "You can authorise (or reject) the request.  This is
done by clicking on the hyperlink below and following the guidance in
the form which will be displayed.\n";
$mail{Message} .= "http://webserver.nissa.gov.uk/dbarea/rita/RAuth.asp?RID=$fields{'ID'}&CW=$fields{'Codeword'}\n\n";
$mail{Message} .= "The form also allows you to amend any information
already submitted, or add any relevant comments. ";
$mail{Message} .= "After you have approved the request, no further
action is required. IT Services will let you know whether the request
will be met.\n\n";
$mail{Message} .= "If you and the submitter retain this e-mail, it
will give you direct access to check on the on-going status of the
request, by clicking on the hyperlink below. It has been given the
reference number :-  " . $fields{'ID'} . "\n";
$mail{Message} .= "http://webserver.nissa.gov.uk/dbarea/rita/RITAstatus1.asp?RitaID=$fields{'ID'}\n";

# Go send it
print "<p align=\"center\">";
if (sendmail %mail) {
    print "E-mails have now been sent\n\n";
    exit();
    if ($Mail::Sendmail::error) {
        print "content of
\$Mail::Sendmail::error:\n$Mail::Sendmail::error\n";
    }
    
}
else {
    print "\n!Error sending e-mails:\n$Mail::Sendmail::error\n";
   
}
print "</p>";
------------------------
One of the lines that I wish to change is the following:

$mail{Message} .= "http://webserver.nissa.gov.uk/dbarea/rita/RAuth.asp?RID=$fields{'ID'}&CW=$fields{'Codeword'}\n\n";

Instead of displaying the http... in the email, I would like to
replace it with something like 'Click Here...'. As well as making the
email neater in appearance; which is the main reason; it might also
sort out a problem we have with some PCs in our organisation which
have a different setup, and which have problems with these links. BTW
The above script was plagiarised from code obtained on the Internet.


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

Date: Fri, 07 Mar 2003 15:46:25 +0000
From: "Richard Gration" <richard@zync.co.uk>
Subject: Re: Can I Get Neater Hyperlinks in Emails
Message-Id: <20030307.154625.1665947468.1022@richg.zync>

To get what you want you need to be sending out HTML emails. Putting aside
for the moment the fact that this is the devil's work, you need to read
the RFCs pertaining to the format of HTML emails and then adjust the code
to compose them. Composing HTML emails is not totally straightforward,
however the perl code to implement the process is, relatively.

Do your emails work?? If so, don't turn them into HTML.

Rich


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Fri, 7 Mar 2003 14:26:49 -0000
From: "Peter Cooper" <newsfeed2@boog.co.uk>
Subject: Re: CGI query string help
Message-Id: <YZ1aa.15910$EN3.128294@newsfep4-glfd.server.ntli.net>

> #!/usr/local/bin/perl
>
> use strict;
> use CGI qw(:standard);
>
> $user_name = $query->param('name');

Perhaps I'm missing something, as this is not mentioned in the other replies..
but shouldn't you actually create an instance of the class with .. << my $query
= new CGI; >> first? Or is $query exported anyway?

Pete




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

Date: Fri, 07 Mar 2003 07:34:19 -0500
From: posts@grierwhite.com (Christopher J. White)
Subject: CGI qw(-unique_headers) ??
Message-Id: <m2of4ns6d0.fsf@bluesteel.grierwhite.com>

I've it documented somewhere that to get only
one set of headers printed, use the following:

  use CGI qw(-unique_headers);

Is this still valid?  I can't find any documentation
on it and no references in the FAQ.  I'm wondering
if this is depecrated and if so, what's the alternative?

 ...cj

-- 
------------------------
-- Christopher J. White                                    
--
-- chris @
--   grierwhite.com
------------------------


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

Date: Fri, 7 Mar 2003 15:09:22 +0000 (UTC)
From: hoowa@21cn.com(hoowa.sun)
Subject: China Perl fan's can download EasyNNTP
Message-Id: <b4aclr$lk3$2@mail.cn99.com>

from www.ilcatperl.org


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

Date: Fri, 7 Mar 2003 15:10:03 +0000 (UTC)
From: hoowa@21cn.com(hoowa.sun)
Subject: China Perl fan's can download EasyNNTP
Message-Id: <b4acob$llr$1@mail.cn99.com>

from www.ilcatperl.org


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

Date: 7 Mar 2003 12:12:59 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: dynamically define constants
Message-Id: <b4a2cb$q1o$2@mamenchi.zrz.TU-Berlin.DE>

Uri Guttman  <uri@stemsystems.com> wrote in comp.lang.perl.misc:
> >>>>> "N" == Nan  <nandagopalj@hotmail.com> writes:
> 
>   N> I need to read a data file containing "event numbers and event names
>   N> and build a list of constants dynamically in my perl program.
> 
> if they are dynamic, then they are not constants. pick one or the other/
> 
> if you use the constants in the program, then you must know their names
> in advance. 
> 
>   N> This following does not work (no surprise):
>   N> use constant "$constant_var_name" = 1000;
> 
> regardless of the wrongness of the above there is no need for the quotes.
> 
>   N> I tried eval() to execute a code block like below:
>   N> This does not work either..
> 
>   N> $eventName = "FILE_READ_ERR";
>   N> $code = <<EOF;
>   N>     use constant $eventName => 1000;
>   N> EOF
>   N> eval ( $code );
> 
> that is happening at run time. constants have to be defined at compile
> time. wrap that code in a BEGIN block and it should work. i still have
> doubts about your needing dynamic constants.

Alternatively, if $eventName is set early enough, constant has no problem
using it as a constant name:

    BEGIN { $eventName = 'FILE_READ_ERR' }
    use constant $eventName => 1000;

Of course, every objection to taking variable names from data applies
to constant names as well.  The OP should rethink the design.

Anno


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

Date: Fri, 7 Mar 2003 15:06:00 +0000 (UTC)
From: hoowa@21cn.com
Subject: EasyNNTP come here
Message-Id: <b4acfj$lio$1@mail.cn99.com>

www.ilcatperl.org


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

Date: 7 Mar 2003 07:29:36 -0800
From: bsnyder030174@yahoo.com (Brian Snyder)
Subject: Re: Help with Inline::CPP....
Message-Id: <668c9529.0303070729.171d63bf@posting.google.com>

Yes, thank you for your replies.. I got it too work though.  I think
it was some sort of permission issue, perhaps related to some sudo
commands I had previously run. I cleaned some stuff up related to that
and all is now well in my world ;)

Thank you,
 ---brian

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<b489pn$gj4$2@mamenchi.zrz.TU-Berlin.DE>...
> Brian Snyder <bsnyder030174@yahoo.com> wrote in comp.lang.perl.misc:
> > (First off, let me say this is a duplicate of a post I made to
> > perl.inline newsgroup -- but that seems to be a dead group, so I
> > thougth I'd try here)
> > 
> > Hi all,
> > 
> > I have successfully installed the latest, Inline, Inline::C, and
> > Parse::RecDescent from CPAN and gone through the C Cookbook --
> > everything is working fine.
> > 
> > Then I tried to install the Inline::CPP module from CPAN, and I
> > thought the install worked fine -- at least the make process showed no
> > errors. I have perl 5.6 on linux RH8.
> 
> [snip]
> 
> > -------------------------------------------------------------------
> > Error. You have specified 'CPP' as an Inline programming language.
> > 
> > I currently only know about the following languages:
> >     C, Foo, foo
> > 
> > If you have installed a support module for this language, try deleting
> > the
> > config file from the following Inline DIRECTORY, and run again:
> > 
> >     /home/bsnyder/inline/_Inline
> > 
> >  at ./gcp.pl line 0
> > INIT failed--call queue aborted.
> > ---------------------------------------------------------------------
> 
> That looks like a pretty clear description of what to do in this case.
> Did you not try it?
> 
> Anno


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

Date: Fri, 07 Mar 2003 11:05:04 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: I  want to know the line n umber of the error !
Message-Id: <3e687c65.2416530637@news.cis.dfn.de>

On Fri, 07 Mar 2003 01:11:24 +0100, "Tore Aursand"
<tore@aursand.no> wrote:

>Funny as it is, though; I myself requested a lightweight 
>CGI replacement earlier today. *g*

There are certainly plenty of those around.

CGI::Simple;
CGI::Minimal;
CGI::Request;

But as pointed out, you'd be *far* better off
with a CGI replacement in the web server itself,
like mod_perl or SpeedyCGI if the execution
speed actually matters.
-- 
Regards, Helgi Briem
helgi AT decode DOT is


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

Date: Fri, 07 Mar 2003 11:08:42 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: I  want to know the line n umber of the error !
Message-Id: <3e687d2e.2416731686@news.cis.dfn.de>

On Thu, 06 Mar 2003 23:30:31 GMT, "Jürgen Exner"
<jurgenex@hotmail.com> wrote:

>If you are some sort of MS Windows then you may be 
>interested in ActiveState's Perl package.

ActivePerl is also available for Linux and Solaris.  It is
my preferred distro for all the Linux machines I
administer.  I only have one Solaris machine and that
also has ActivePerl.

-- 
Regards, Helgi Briem
helgi AT decode DOT is


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

Date: Fri, 07 Mar 2003 08:35:09 -0500
From: Eric Osman <ericosman-nospam@rcn.com>
Subject: Re: I  want to know the line n umber of the error !
Message-Id: <3E68A00D.2020300@rcn.com>



| Of course not.  I haven't seen anyone in this newsgroup calling anyone
| stupid.  But I myself have _almost_ called a certain way to do a thing
| stupid at least a few times. :)

Abigail called me a bonehead.   But I try to let it roll off me and
assume she was having a bad day and is sorry to have taken it out on me.

| Point taken, but I think the problem is that we don't know how to
| distinguish between attempted production solutions, and lab-bench
| student exercises, unless the questioner tells us clearly what they
| have in mind.

As the "questioner", I'll tell you what I have in mind.

I'm a participant in a digest, which is a daily email message
accumulating the approximately 50 emails sent in that day by
participants.

In the raw form, the digest contains a textual table-of-contents showing
the subject of all 50 emails, and then the 50 emails following that.

Because it's just text, for many unsophisticated readers, if they
see an item in the table of contents of interest, they must either
scroll down to the item, or do a search.

I thought it would be convenient to have a web page that shows the
table-of-contents in one frame, allowing the reader to click on a
subject of interest, and then the other frame would jump right to it.

And of course I immediately thought of other easy value-adds to put
on, such as buttons to go to prev-item, next-item, reply-to-digest,
reply-to-author.

If the digest were distributed as a news group, these features would
come for free.  But it's not.

Also, I've recently learned that email clients such as my Eudora have
a "mime digest mode" built in, which if you turn on, presents the
entire digest as a mailbox.  However, not all readers have this
available to them.

Another concern is security.  To secure privacy and prevent spammers
from capturing participant's email addresses, the digest is only
email'ed to "members".

So, with all that in mind, here's what I'm designing with Perl :

One of the articles in the digest will say:

                   To view this digest in a web-clickable presentation,
                   type CTRL-A and CTRL-C and then
                   click here :    < pointer to my Perl-enabled page >

And then my Perl-enabled page has an html text area whose instructions
say

                   Press CTRL-V and click on the SUBMIT button

That sends the entire digest to my Perl program which will generate
the appropriate html.

(The actual instructions to the user will be a bit better than the
above, being sensitive that not all users are on CTRL-A/CTRL-C centric
environments)

Of course, if I find a way to have my Perl-enabled page automatically
read the computer's paste buffer, the user wouldn't have to hit
CTRL-V (and perhaps not even the SUBMIT button either) but that's
probably a security risk so there's probably not a way to do it.

ok, now you tell me, is this a lab exercise or production code ????

/Eric



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

Date: Fri, 07 Mar 2003 11:10:58 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Lightweight CGI module?
Message-Id: <3e687e2c.2416986582@news.cis.dfn.de>

On Fri, 07 Mar 2003 01:11:23 +0100, "Tore Aursand"
<tore@aursand.no> wrote:

>I know.  Bad use of the bottleneck from me.  I _know_ that CGI.pm is
>pretty bloated, and I _know_ that it'll give me better overall performance
>if I had a smaller/lighter one.

You don't know that *at all*.
-- 
Regards, Helgi Briem
helgi AT decode DOT is


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

Date: Fri, 07 Mar 2003 11:12:10 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Lightweight CGI module?
Message-Id: <3e687e56.2417028222@news.cis.dfn.de>

On Thu, 06 Mar 2003 19:42:25 +0100, "Tore Aursand"
<tore@aursand.no> wrote:


>> mod_perl runs on almost any platform that Apache runs on. Why not use
>> mod_perl if the server is Apache?
>
>I'm not in charge of the web server part.  The "customer" is either
>already running a web server (ie. won't switch to anything else), or is
>running Windows (ie. prefers IIS no matter how bad it is).

Most apache web servers in the world run on Windows.
I for example have a Win 2000 machine with apache
on my desktop.
-- 
Regards, Helgi Briem
helgi AT decode DOT is


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

Date: Fri, 07 Mar 2003 06:23:10 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Lightweight CGI module?
Message-Id: <Xns93374B257B21sdn.comcast@216.166.71.239>

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

"Tore Aursand" <tore@aursand.no> wrote in
news:pan.2003.03.07.08.57.13.650141@aursand.no: 

> As long as I'm running for example mod_perl (or PerlEx), I can
cache
> whatever it is in memory.  Nice, and this is being done - also for
> CGI.pm. 
> 
> However, with _most_ of the other modules, I even keep them in
memory
> _after_ they've been created.  I didn't think I could do that with
> CGI.pm, as it then would miss out the query...?

I haven't used mod_perl much, but I do know that when using FastCGI,
there's a slightly different CGI module (CGI::Fast) that gives you a
new query each time one comes in.

I would expect that something similar exists for CGI, or perhaps the
CGI module detects whether it's in a mod_perl environment.  After
all, if CGI.pm had to be loaded and recompiled each time, that would
take away a significant portion of the advantage of mod_perl!  Surely
everyone who
uses mod_perl can't be having this problem.

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

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13

iD8DBQE+aI8vY96i4h5M0egRAgxiAJ9bGWDB7TCKwoKgvLtiy+ZmczVUPwCeLqB5
tq4N6X60FfAi6hoA8DV089A=
=V1w3
-----END PGP SIGNATURE-----


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

Date: Fri, 07 Mar 2003 06:28:24 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Lightweight CGI module?
Message-Id: <Xns93374C083CCF6sdn.comcast@216.166.71.239>

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

"Tore Aursand" <tore@aursand.no> wrote in
news:pan.2003.03.06.23.56.40.898164@aursand.no: 

> On Thu, 06 Mar 2003 14:24:28 -0500, Ben Kennedy wrote:
>> Just because something is slow or could possibly made faster
doesn't
>> mean its a bottleneck.
> 
> I know.  Bad use of the bottleneck from me.  I _know_ that CGI.pm
is
> pretty bloated, and I _know_ that it'll give me better overall
> performance if I had a smaller/lighter one.

Again, I have to ask:  What makes you "_know_" that CGI.pm is slowing
you down?

- -- 
Eric
print scalar reverse sort qw p ekca lre reh 
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13

iD8DBQE+aJBoY96i4h5M0egRAlP1AJ949RUFv7svlwHj371GkYHMu+t3qACgljw+
W0HiZxc0P9yYhnuO0EBlF9g=
=B1P4
-----END PGP SIGNATURE-----


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

Date: Fri, 07 Mar 2003 16:06:25 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Lightweight CGI module?
Message-Id: <b4afo5$5ru$1@news.dtag.de>

Tore Aursand wrote:
> On Fri, 07 Mar 2003 09:46:45 +0100, Malte Ubl wrote:
> 
>>I doubt that one could really improve the instance creation time of the
>>CGI module.
> 
> 
> Hmm.  Well.  Looking at the code, it seems like there's some room for
> improvement, don't you think?

Not really, otherwise:

package My::CGI::OptimizedForMyApp;
use base "CGI";

sub init {
	# do only what needs to be done
}


ready.

-- 
srand 108641088; print chr int rand 256 for qw<J A P H>



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

Date: Fri, 7 Mar 2003 07:20:39 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Non-fatal error, "script not found or unable to stat"
Message-Id: <slrnb6h757.9kt.tadmc@magna.augustmail.com>

Mike <csdude@hotmail.com> wrote:

> so I
> usually leave the -w out


Don't do that.

If you are getting warnings, find out what is causing them
and fix them so that you are not getting warnings.


Turning off warnings is like "fixing" the funny noise your car
is making by turning up the volume on the radio.

Hiding a potential problem is not the same as removing the
potential for a problem.


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


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

Date: Fri, 7 Mar 2003 11:37:34 -0000
From: "programmer" <BROWNHIK@Syntegra.Bt.Co.Uk>
Subject: Re: Obfuscated Perl Challenge
Message-Id: <b4a0mt$e8p$1@pheidippides.axion.bt.co.uk>

"Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
news:3E685F6E.C3E9A517@earthlink.net...
> Can anyone guess/figure out what this code does, without running it?
>
> @1=a..c;$;=4;{push@2,map[$;--,@1[0,2,1]=@1
> ],2..$;x--$|;print"$1[0]=>$1[2]\n";--$;?@1
> =@1[1,0,2]:(($;,@1)=@{pop@2||last});redo}
>
> A large part of the obfuscation is because the flow control is
> significantly different from the way this particular algorithm is
> normally implemented, so even using Deparse won't significantly help
> you.
>
> If you give up on figuring it out, run it.  It should be quite
> recognizable to most programmers as the output of a basic learning
> excercise for ... well, that would be a spoiler :).  If you don't
> recognize it, send me a private email, and I'll tell you.
>
> Hopefully (for the sake of having fun), even once you understand what
> it's producing, it'll be difficult to see *how* it's doing what it's
> doing :)
>
> Have fun, and Good Luck!

It's this type of code that gives programmers a bad name.




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

Date: Fri, 7 Mar 2003 07:29:15 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Obfuscated Perl Challenge
Message-Id: <slrnb6h7lb.9kt.tadmc@magna.augustmail.com>

programmer <BROWNHIK@Syntegra.Bt.Co.Uk> wrote:
> "Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
> news:3E685F6E.C3E9A517@earthlink.net...

>> Can anyone guess/figure out what this code does, without running it?
>>
>> @1=a..c;$;=4;{push@2,map[$;--,@1[0,2,1]=@1
>> ],2..$;x--$|;print"$1[0]=>$1[2]\n";--$;?@1
>> =@1[1,0,2]:(($;,@1)=@{pop@2||last});redo}


> It's this type of code that gives programmers a bad name.


It's confusing "play" with "work" that gives programmers a bad name.


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


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

Date: Fri, 7 Mar 2003 13:39:35 +0000 (UTC)
From: "Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Obfuscated Perl Challenge
Message-Id: <Xns93379465CC83Celhber1lidotechnet@62.89.127.66>

Tad McClellan wrote:

> programmer <BROWNHIK@Syntegra.Bt.Co.Uk> wrote:
>> "Benjamin Goldberg" <goldbb2@earthlink.net> wrote in message
>> news:3E685F6E.C3E9A517@earthlink.net...
> 
>>> Can anyone guess/figure out what this code does, without running it?
>>>
>>> @1=a..c;$;=4;{push@2,map[$;--,@1[0,2,1]=@1
>>> ],2..$;x--$|;print"$1[0]=>$1[2]\n";--$;?@1
>>> =@1[1,0,2]:(($;,@1)=@{pop@2||last});redo}
> 
> 
>> It's this type of code that gives programmers a bad name.
> 
> 
> It's confusing "play" with "work" that gives programmers a bad name.


Couldn't have said it better.


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



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

Date: 7 Mar 2003 07:18:52 -0800
From: niels_bond@hotmail.com (niels)
Subject: Re: Perl Mysql uploading a image in a database.
Message-Id: <6772e388.0303070128.21f66af6@posting.google.com>

he guys,

Sorry for the lack of good information. At first i forgot to mention
that perl and apache, mysql is saved on a win98 system. The computer
is too slow for win2000.

I was in a bit of hurry. But here's a complete description:

Mysql:

CREATE TABLE images (
  img_id int(11) NOT NULL auto_increment,
  image longblob NOT NULL,
  PRIMARY KEY  (img_id)
) 


Perl 
Code om op te slaan:

my($reclame_image)=$query->param("reclame_image");

my($afbeelding);
{
local $/=undef;
$afbeelding=<$reclame_image>;
}
close $reclame_image;

if($afbeelding)
{
$afbeelding=Quote_Chars($afbeelding);
$afbeelding=Escape_Chars($afbeelding);
binmode($afbeelding);

$sql="insert into imgarchief(image)values(\"$afbeelding\")";
$sth=Execute_Query($sql); (Dit is een eigen functie, werkt goed)

#He saves the image, but i don't know if he does it right. Maybe he
saves a part of the image.
} 

Methode om het plaatje te tonen:

print "Content-Type: image/jpeg\n\n";

my $reclamesth=Execute_Query("select image from images where
img_id=$reclame_imgno");

#$sth->execute($reclame_imgno) || die $dbh->errstr(); 
my ($return) = $reclamesth -> fetchrow_array(); 
unless ($return) { 
die "No image returned"; 

#Sometimes it showes a bit of the image

} 


binmode STDOUT; 
$return=Escape_Chars($return);
print $return; 

Thanks in advance.

Niels


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

Date: 7 Mar 2003 07:19:16 -0800
From: niels_bond@hotmail.com (niels)
Subject: Re: Perl Mysql uploading a image in a database.
Message-Id: <6772e388.0303070129.5f925b2c@posting.google.com>

he guys,

Sorry for the lack of good information. At first i forgot to mention
that perl and apache, mysql is saved on a win98 system. The computer
is too slow for win2000.

I was in a bit of hurry. But here's a complete description:

Mysql:

CREATE TABLE images (
  img_id int(11) NOT NULL auto_increment,
  image longblob NOT NULL,
  PRIMARY KEY  (img_id)
) 


Perl 
Code om op te slaan:

my($reclame_image)=$query->param("reclame_image");

my($afbeelding);
{
local $/=undef;
$afbeelding=<$reclame_image>;
}
close $reclame_image;

if($afbeelding)
{
$afbeelding=Quote_Chars($afbeelding);
$afbeelding=Escape_Chars($afbeelding);
binmode($afbeelding);

$sql="insert into imgarchief(image)values(\"$afbeelding\")";
$sth=Execute_Query($sql); (Dit is een eigen functie, werkt goed)

#He saves the image, but i don't know if he does it right. Maybe he
saves a part of the image.
} 

Methode om het plaatje te tonen:

print "Content-Type: image/jpeg\n\n";

my $reclamesth=Execute_Query("select image from images where
img_id=$reclame_imgno");

#$sth->execute($reclame_imgno) || die $dbh->errstr(); 
my ($return) = $reclamesth -> fetchrow_array(); 
unless ($return) { 
die "No image returned"; 

#Sometimes it showes a bit of the image

} 


binmode STDOUT; 
$return=Escape_Chars($return);
print $return; 

Thanks in advance.

Niels


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

Date: Fri, 07 Mar 2003 15:09:20 GMT
From: Alan Gutierrez <ajglist@izzy.net>
Subject: Re: POSIX Charcter Classes and tr
Message-Id: <slrnb6hegp.ifv.ajglist@izzy.net>

In article <slrnb6gmgc.747.mgjv@martien.heliotrope.home>,
Martien Verbruggen wrote:
> On Fri, 07 Mar 2003 08:20:49 GMT,
> 	Alan Gutierrez <ajglist@izzy.net> wrote:
>> 
>> No POSIX character classes with transliteration I take it. True?
> 
> True.
> 
> None of the regexp stuff applies to tr///. What made you think it would?

Faith.

Thanks for your response.

-- 
Alan Gutierrez - ajglist@izzy.net
http://khtml-win32.sourceforge.net/ - KHTML on Windows


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

Date: Fri, 7 Mar 2003 14:21:25 -0000
From: "Peter Cooper" <newsfeed2@boog.co.uk>
Subject: Re: Put perl in old page
Message-Id: <_U1aa.15907$EN3.128247@newsfep4-glfd.server.ntli.net>

> :I have just learned some perl and i would like to put it into my site
> :I already have up (it makes random quotes).  Is there a way to just
> :call the program from HTML or something simialr.
>
> No, HTML itself does not offer any way to call programs.

Quite right, but Javascript kinda does. You could write a script that outputs
the relevant stuff in JavaScript "document.write"s.. then call it with:

<script src="/cgi-bin/whatever.cgi"></script>

Pete




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

Date: Fri, 07 Mar 2003 15:12:58 GMT
From: Andrew Lee <spamtrap@nowhere.com>
Subject: Re: question about "new" in a module
Message-Id: <nldh6v0e4p4enlb91hlor3b6cffvj5euc0@4ax.com>

On Fri, 07 Mar 2003 10:05:50 +0100, "Tore Aursand" <tore@aursand.no>
wrote:

>On Fri, 07 Mar 2003 06:38:13 +0100, Janek Schleicher wrote:
>>> our @EXPORT = qw/new get_dbh getVars DB_Connect getMaxId getMaxRow/;
>
>>                   ^^^
>> 
>> That's why.
>
>Hmm.  Thinking of it; Where did I read that one should _never_ export
>method names?

the Exporter manpage ... I can't believe I've been so cargo cult.

Thanks for the help.



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

Date: Fri, 07 Mar 2003 07:49:50 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Regular Expression
Message-Id: <Xns933759D632B63sdn.comcast@216.166.71.239>

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

Alan Gutierrez <ajglist@izzy.net> wrote in
news:slrnb6gguq.h44.ajglist@izzy.net:

> Trying to assert that an identifier has a certian form which is:
> 
> * starts with alpha.
> * followed by alpha, digit or space.
> * no consecutive spaces.

I'd suggest   /^[[:alpha:]][[:alnum:] ]+/ && !/  /;

- -- 
Eric
print scalar reverse sort qw p ekca lre reh 
ts uJ p, $/.r, map $_.$", qw e p h tona e;
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32) - WinPT 0.5.13

iD8DBQE+aKN9Y96i4h5M0egRAoOwAKCBBAXKoi8ryGif/wvI5c9oYv9qAgCgmTj4
IDHTAoViU1KtKQg2lvlxuwE=
=w0Vo
-----END PGP SIGNATURE-----


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

Date: 7 Mar 2003 11:59:24 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Regular Expressions
Message-Id: <b4a1is$q1o$1@mamenchi.zrz.TU-Berlin.DE>

bach <bach@nospamworld.com> wrote in comp.lang.perl.misc (in reply to
Nobull):

[...]
> P.S. Next time someone makes a mistake, try to be candid in showing them the
> right way instead of evangilizing.  Trust me, you'll feel better, and people
> will want to pay more attention to your gibberish.

The gibberish was in your posting (and could have been easily avoided
by application of some common sense).  The one who has to worry about
attention is you.  You just landed yourself in a number of killfiles
of those who could potentially help you.

Anno


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

Date: 7 Mar 2003 07:18:29 -0800
From: absolute8@sprint.ca (Serg)
Subject: Setup user-password in .htaccess
Message-Id: <70f45cd3.0303070718.373ec204@posting.google.com>

How can I modify .htaccess for Apachi so that it will accept any
username but only one correct password?

E.g. it will allow following users to login
bob - password "banana"
bill - password "banana"
gates - password "banana"
 ...
etc.

Any ideas?


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

Date: Fri, 07 Mar 2003 15:30:36 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: Setup user-password in .htaccess
Message-Id: <tneh6v8qc85jqr4jmni40li39je39bchgr@4ax.com>
Keywords: Remove WINDOZE to reply

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

In a fit of excitement on 7 Mar 2003 07:18:29 -0800,
absolute8@sprint.ca (Serg) managed to scribble:

> How can I modify .htaccess for Apachi so that it will accept any
> username but only one correct password?
> 
> E.g. it will allow following users to login
> bob - password "banana"
> bill - password "banana"
> gates - password "banana"
> ...
> etc.
> 
> Any ideas?


Yes. You take your question to an Apache related newsgroup. This has
sweetFA to do with Perl.



Regards,

  Ian

-----BEGIN xxx SIGNATURE-----
Version: PGP 8.0

iQA/AwUBPmi7Gmfqtj251CDhEQIvqQCg3SJg7bovzLAIDrFJnSpfGHmkTr8An2bD
Rb0nEuluIIjuii//qeo87P2r
=dUs4
-----END PGP SIGNATURE-----

-- 
Ian.H  [Design & Development]
digiServ Network - Web solutions
www.digiserv.net  |  irc.digiserv.net  |  forum.digiserv.net
Scripting, Web design, development & hosting.


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

Date: Fri, 7 Mar 2003 08:40:31 -0600
From: Barry Kimelman <barryk2@SPAM-KILLER.mts.net>
Subject: Re: Substitution and regex question
Message-Id: <MPG.18d26b596fea496e989733@news.mts.net>



In article <698c67f.0303061240.78ce0edf@posting.google.com>, Domenico 
Discepola (joeminga@yahoo.com) says...
> I'm reading a text file (windows)
> 
> Whenever I see four pipes in $_, I want to replace the 4 pipes with a
> single \r\n
> 
> here's my substitution command:
> 
> $_ =~ s/||||/\r\n/g;
> 
> Why doesn't this work (I'm using perl for cygwin)?  It does not find
> the match and my $_ still contains 4 pipes
> 
> sample line:
> 
> field1|field2||field3||||field1b|field2b
> 
> the output should be :
> 
> field1|field2||field3
> field1b|field2b
> 
> but it's not...
> 
> Any thoughts?
> 

 $_ =~ s/\|\|\|\|/\r\n/g;


-- 
---------

Barry Kimelman
Winnipeg, Manitoba, Canada
email : bkimelman@hotmail.com


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

Date: Fri, 7 Mar 2003 12:51:05 -0000
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Re: Unix TAIL program
Message-Id: <b4a4js$ec8$1$8302bc10@news.demon.co.uk>

"Tore Aursand" <tore@aursand.no> wrote in message
news:pan.2003.03.07.10.45.41.554627@aursand.no...
> On Fri, 07 Mar 2003 15:53:17 +0530, Kasp wrote:
> > I am trying to make a simple program i.e. an implementation of "tail"
> > program that is found in Unix-based systems.
>
> Re-inventing the wheel, aren't we? :)  There is already a module named
> 'File::Tail' which you can find at CPAN;
>
>   http://www.cpan.org/
>

There is also the UNIX Reconstruction Project implementation at
http://www.perl.com/language/ppt/src/tail/index.html

Regards,
Clyde




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

Date: Fri, 07 Mar 2003 13:22:22 GMT
From: "none" <webmastr@localhost.localdomain>
Subject: what are the *.al file?
Message-Id: <i21aa.162513$na.2808775@news2.calgary.shaw.ca>

Hello, 

I am getting this error from Apache when using a mod_perl application:

Can't locate auto/Time/Piece/_mktime.al in @INC 
(@INC contains: /usr/local/xims/bin /usr/local/...)
 at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Time/Piece.pm
line 53

Can anyone give some suggestions?

Thanks,
Nagita K.


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

Date: Fri, 07 Mar 2003 15:17:51 GMT
From: Alan Gutierrez <ajglist@izzy.net>
Subject: Re: what are the *.al file?
Message-Id: <slrnb6hf0o.ifv.ajglist@izzy.net>

In article <i21aa.162513$na.2808775@news2.calgary.shaw.ca>, none wrote:
> Hello, 
> 
> I am getting this error from Apache when using a mod_perl application:
> 
> Can't locate auto/Time/Piece/_mktime.al in @INC 
> (@INC contains: /usr/local/xims/bin /usr/local/...)
>  at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Time/Piece.pm
> line 53
> 
> Can anyone give some suggestions?

al is for autoload. Maybe you just copied Time::Piece into place
without running make install?

-- 
Alan Gutierrez - ajglist@izzy.net
http://khtml-win32.sourceforge.net/ - KHTML on Windows


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 4680
***************************************


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