[23634] in Perl-Users-Digest
Perl-Users Digest, Issue: 5841 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 21 14:06:05 2003
Date: Fri, 21 Nov 2003 11:05:14 -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, 21 Nov 2003 Volume: 10 Number: 5841
Today's topics:
Re: AUTOLOAD Question <pinyaj@rpi.edu>
Re: AUTOLOAD Question <uri@stemsystems.com>
Re: AUTOLOAD Question <Paul@Hovnanian.com>
Re: comments on JAPH? <ThomasKratz@REMOVEwebCAPS.de>
Re: comments on JAPH? <bik.mido@tiscalinet.it>
Re: comments on JAPH? <usenet@morrow.me.uk>
Re: comments on JAPH? (Anno Siegel)
Re: comments on JAPH? <ThomasKratz@REMOVEwebCAPS.de>
Re: DBI Question <cpryce@nospam.pryce.net>
first line in each file in a dir <eddhig22@yahoo.com>
Re: fork question <tassilo.parseval@rwth-aachen.de>
Re: How to extract info from a HTML input box <bluecat22@go.com>
Re: How to save state while debugging? (Peter Scott)
Re: How to save state while debugging? <usenet@morrow.me.uk>
LWP & HTTPS problem <parrisa@cgtechs.demon.co.uk>
Re: Need some help... <usenet@dwall.fastmail.fm>
Re: Need some help... (warpman)
Re: Need some help... (warpman)
Need strong Perl developer <info@bandwidth-usa.com>
Re: Need strong Perl developer <no@email.com>
Problems with special characters (I suppose it is 'loca (Francesco Moi)
Re: Problems with special characters (I suppose it is ' <mirod@xmltwig.com>
Re: Program that prints its source code <bik.mido@tiscalinet.it>
Re: Protecting Source code of a perl script (Bill)
Re: Running a CGI/Perl in Activeperl (Aqua)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 21 Nov 2003 09:30:06 -0500
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
Subject: Re: AUTOLOAD Question
Message-Id: <Pine.SGI.3.96.1031121092712.232623A-100000@vcmr-64.server.rpi.edu>
On Fri, 21 Nov 2003, Uri Guttman wrote:
>>>>>> "PHPE" == Paul Hovnanian P E <Paul@Hovnanian.com> writes:
>
> PHPE> sub AUTOLOAD {
> PHPE> my $self = shift;
>
> PHPE> my $method;
> PHPE> ( $method = $AUTOLOAD ) =~ s/^Group:://;
>
>what if this is subclasses and Group:: isn't there? the standard thing
>is to remove all the text up to the last ::
[snip]
> PHPE> or perlbot to work.
>
>what does perlbot have to do with anything here?
He's referring to the perlbot standard docs ("bag of tricks"). The last
trick is to use AUTOLOAD, which is where Paul got his $method code:
# Remove the package name.
$AUTOLOAD =~ s/^Mydbm:://;
--
Jeff Pinyan RPI Acacia Brother #734 2003 Rush Chairman
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: Fri, 21 Nov 2003 16:32:53 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: AUTOLOAD Question
Message-Id: <x7wu9t7kcr.fsf@mail.sysarch.com>
>>>>> "J'P" == Jeff 'japhy' Pinyan <pinyaj@rpi.edu> writes:
J'P> On Fri, 21 Nov 2003, Uri Guttman wrote:
>>>>>>> "PHPE" == Paul Hovnanian P E <Paul@Hovnanian.com> writes:
>>
PHPE> sub AUTOLOAD {
PHPE> my $self = shift;
>>
PHPE> my $method;
PHPE> ( $method = $AUTOLOAD ) =~ s/^Group:://;
>>
>> what if this is subclasses and Group:: isn't there? the standard thing
>> is to remove all the text up to the last ::
J'P> [snip]
PHPE> or perlbot to work.
>>
>> what does perlbot have to do with anything here?
J'P> He's referring to the perlbot standard docs ("bag of tricks"). The last
J'P> trick is to use AUTOLOAD, which is where Paul got his $method code:
J'P> # Remove the package name.
J'P> $AUTOLOAD =~ s/^Mydbm:://;
that is still poor code as i mentioned. if the class was inherited, that
string may not be there. to get the method remove all text to the last
::. or if you can only support that class, check if the s/// succeeded
before continuing.
i have not seen this perlbot bag of tricks and i am wary now that i have
seen this poorly done one.
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: Fri, 21 Nov 2003 10:17:00 -0800
From: "Paul Hovnanian P.E." <Paul@Hovnanian.com>
Subject: Re: AUTOLOAD Question
Message-Id: <3FBE569C.CBF2D6@Hovnanian.com>
Uri Guttman wrote:
>
> >>>>> "J'P" == Jeff 'japhy' Pinyan <pinyaj@rpi.edu> writes:
>
> J'P> On Fri, 21 Nov 2003, Uri Guttman wrote:
> >>>>>>> "PHPE" == Paul Hovnanian P E <Paul@Hovnanian.com> writes:
> >>
> PHPE> sub AUTOLOAD {
> PHPE> my $self = shift;
> >>
> PHPE> my $method;
> PHPE> ( $method = $AUTOLOAD ) =~ s/^Group:://;
> >>
> >> what if this is subclasses and Group:: isn't there? the standard thing
> >> is to remove all the text up to the last ::
> J'P> [snip]
> PHPE> or perlbot to work.
> >>
> >> what does perlbot have to do with anything here?
>
> J'P> He's referring to the perlbot standard docs ("bag of tricks"). The last
> J'P> trick is to use AUTOLOAD, which is where Paul got his $method code:
>
> J'P> # Remove the package name.
> J'P> $AUTOLOAD =~ s/^Mydbm:://;
>
> that is still poor code as i mentioned. if the class was inherited, that
> string may not be there. to get the method remove all text to the last
> ::. or if you can only support that class, check if the s/// succeeded
> before continuing.
Correct. I just threw a quickie example cut and pasted from the
documentation together
to test the AUTOLOAD approach. As such it lacks error trapping and
careful consideration of all possible use cases. But it was small enough
to fit in a reasonable sized post and I got my answer.
--
Paul Hovnanian mailto:Paul@Hovnanian.com
note to spammers: a Washington State resident
------------------------------------------------------------------
Programmers don't die, they just GOSUB without RETURN.
------------------------------
Date: Fri, 21 Nov 2003 15:11:05 +0100
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: comments on JAPH?
Message-Id: <3fbe1dbc.0@juno.wiesbaden.netsurf.de>
Anno Siegel wrote:
>>2. I just realized (never thought about it before), that when you paste
>>the code to the perl interpreter via STDIN, you won't get anything from
>>the DATA filehandle. ...
>
>
> Have you tried it?
Yes, although only with 5.6.0 and 5.8.0 under Win32. Does it behave
differently on other OSes?
I tried it with:
seek DATA,0,0;
print <DATA>;
__END__
prints '>><<' if pasted and
'>>seek DATA,0,0;
print '>>', <DATA>, '<<';
__END__
<<'
if run from a file
Thomas
--
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(seek( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</ #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..
------------------------------
Date: Fri, 21 Nov 2003 16:31:54 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: comments on JAPH?
Message-Id: <n68srv4j1rdht5dcj6dkidnn4oaof8l1lf@4ax.com>
On Thu, 20 Nov 2003 10:46:35 +0100, Thomas Kratz
<ThomasKratz@REMOVEwebCAPS.de> wrote:
>Ok I'll try to be clearer.
>
>1. I am moving through the comment on the right side of the JAPH with
>'seek' and 'getc'. Therefore I need to know how many bytes the line
>endings consist of, to get the right offset. Just pulling everything into
>an array and parsing that would be easier.
>
>2. I just realized (never thought about it before), that when you paste
>the code to the perl interpreter via STDIN, you won't get anything from
>the DATA filehandle. I don't know if and - if yes - how I can get at the
>code when it comes in via STDIN.
>
>Better?
Definitely!
However, in Perl one seldom (say in "everiday's life quick scripts")
*really* needs getc() IMHO. And OTOH Perl's (more) common I/O
operators/functions manage line endings (and not only!) transparently
and platform-independently.
May you consider using something other than getc()? Also, why not
chomp()ing? Note: I deleted your code because I do not even want to be
tempted to try and see if these suggestions are compatible with its
logic! :-) (not much spare time, sorry!)
Michele
--
# This prints: Just another Perl hacker,
seek DATA,15,0 and print q... <DATA>;
__END__
------------------------------
Date: Fri, 21 Nov 2003 15:39:41 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: comments on JAPH?
Message-Id: <bplbjt$h36$2@wisteria.csv.warwick.ac.uk>
Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote:
> Anno Siegel wrote:
> > Have you tried it?
>
> I tried it with:
>
> seek DATA,0,0;
> print <DATA>;
> __END__
>
> prints '>><<' if pasted and
This is because pipes (and ttys, and whatever a command window behaves
as under Win32) are not seekable.
Ben
--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else * ben@morrow.me.uk
------------------------------
Date: 21 Nov 2003 16:07:19 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: comments on JAPH?
Message-Id: <bpld7n$2le$1@mamenchi.zrz.TU-Berlin.DE>
Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
>
> >>2. I just realized (never thought about it before), that when you paste
> >>the code to the perl interpreter via STDIN, you won't get anything from
> >>the DATA filehandle. ...
> >
> >
> > Have you tried it?
>
> Yes, although only with 5.6.0 and 5.8.0 under Win32. Does it behave
> differently on other OSes?
>
> I tried it with:
>
> seek DATA,0,0;
> print <DATA>;
> __END__
Uh, okay, apologies. I thought you were saying the DATA filehandle doesn't
work when STDIN is piped. Of course "seek DATA" must fail when the source
isn't seekable, for whatever reason.
Anno
------------------------------
Date: Fri, 21 Nov 2003 17:25:31 +0100
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: comments on JAPH?
Message-Id: <3fbe3d3d.0@juno.wiesbaden.netsurf.de>
Michele Dondi wrote:
> May you consider using something other than getc()? Also, why not
> chomp()ing? Note: I deleted your code because I do not even want to be
> tempted to try and see if these suggestions are compatible with its
> logic! :-) (not much spare time, sorry!)
As I wrote before: I am considering giving up using getc unless there is a
foolproof method for knowing the actual line length. Shouldn't be too
difficult. I'll play with it as soon as I have the time to.
Thomas
--
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(seek( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</ #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..
------------------------------
Date: Fri, 21 Nov 2003 10:15:24 -0600
From: cp <cpryce@nospam.pryce.net>
Subject: Re: DBI Question
Message-Id: <211120031015241008%cpryce@nospam.pryce.net>
In article <oycvb.30938$oC5.21697@clmboh1-nws5.columbus.rr.com>, kbass
<kbass@midsouth.rr.com> wrote:
> No, I posted a snippet of the code. Here is part of the real code if it will
> help you.
>
> use DBI qw(:sql_types);
> use strict;
> use diagnostics; #debugging purposes
> use CGI qw(:standard);
> use CGI::Carp qw(fatalsToBrowser);
> use VCP::Connect;
[ snip impossibly long list of variables ]
Don't do that. Declare them as you need them, in the smallest possible
scope. If you don't need them until a sub, delcare them inside in the
sub. It's so hard to debug otherwise.
>
> # Autoflush the output buffer
> $| = 1;
>
> # Establish database connections for the CompAlign and Sales databases.
> $dbh = Connect->compalignDB;
In your original post, you gave the clue to what is happening. It ran
from the command line, but not from the Web server. This connection
string looks suspiciously like it gets default values from the user's
environment. The Web server runs as a different user than you do, and
it definitely does not have those same default values. You'd need to
provide them. See perldoc DBI.
At the VERY least, CHECK to see if the connection works:
# one way
die "Unable to connect to compalignDB" unless $dbh;
Better set RaiseError or PrintError in your connection package.
>
> # Check action variable. If this CGI program is accessed without a
> parameter
> # within the URL, the default value of 'view' will be given. This is a work
> # around that for the '... Use of uninitialized value in string' error
> # message.
warning message. Errors cause programs to terminate. Warnings try to
keep you from doing something stupid.
> $territory = param("STerr");
> $table_name = param("table");
> $adjustment = param("anbr");
>
> #$territory = '1-1-1-1-1-2-0';
>
> View_Info();
>
> ##############################
> # Procedure: View_Info #
> ##############################
> sub View_Info {
>
> # IMPORTANT - This function is for debugging purposes only.
> # Make sure this function is comments after use.
> #unlink 'dbtrace.log' if -e 'dbtrace.log';
> #DBI->trace( 4, 'dbtrace.log' );
>
>
> $sql = "select fyear ...
[snip SQL staement ]
> from fy04q1bulletin
> where subdist = ?
> $sth = $dbh->prepare($sql);
> my $territory_quoted = $dbh->quote( $territory);
this is not needed if you are using placeholders.
> $sth->execute($territory_quoted);
>
[ snip rest ]
--
cp
------------------------------
Date: Sat, 22 Nov 2003 06:05:20 +1100
From: Edo <eddhig22@yahoo.com>
Subject: first line in each file in a dir
Message-Id: <3FBE61F0.6000100@yahoo.com>
Hello
I need to do somthing with the first line in each file in a given dir,
this is not working.
thanks
#!/usr/local/bin/perl
use strict;
use warnings;
use Data::Dumper;
opendir(DIR, "/.../");
my @files = readdir(DIR);
closedir(DIR);
foreach my $file (@files) {
open FL, $file or die $!;
print <FL>, "\n";
}
------------------------------
Date: 21 Nov 2003 18:46:38 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: fork question
Message-Id: <bplmie$3va$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Ben Morrow:
> tassilo.parseval@post.rwth-aachen.de wrote:
>> Doubt it, but it's not relevant in your case anyway. fork() creates
>> processes and not threads. Unlike threads, processes do not share
>> anything (save for file-descriptors) and therefore thread-safeness or
>> not is a non-issue for this case.
>
> The OP is on Win2k... fork creates ithreads.
> Of course, if substr is not ithread-safe this is a bug in perl.
Ah, you are right. I missed the bits about the platform used.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Fri, 21 Nov 2003 09:29:41 -0500
From: "Blue Cat" <bluecat22@go.com>
Subject: Re: How to extract info from a HTML input box
Message-Id: <bpljcf0888@enews4.newsguy.com>
This is a script I'm trying to replicate. It is from a paper "Active
Scripting with PERL" from MSDN:
<HTML>
<HEAD>
<TITLE>PerlScript Hello</TITLE>
<SCRIPT LANGUAGE = PerlScript>
sub pressed {
$elements = $form -> {elements};
$text = $elements->item(1);
$text->{value} = "Hello World";
$window->alert("Hi there, World");
}
</SCRIPT>
<BODY BGCOLOR = "#40A080">This is not a working Perl Script<BR>
<FORM NAME = "Form">
<INPUT TYPE = BUTTON VALUE = "Click Me" onclick = "pressed()"
LANGUAGE="PerlScript"><BR>
<INPUT TYPE = TEXT NAME = "boxtext" VALUE = "" SIZE = 25>
</FORM>
</BODY>
</HTML>
When I click the "Click Me" button, I get the message, "Can't call method
'item' on an undefined value at (eval 4) line 4". The script doesn't
execute. Obviously I'm dealing with something in this paper that I do not
understand.
------------------------------
Date: Fri, 21 Nov 2003 15:34:53 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: How to save state while debugging?
Message-Id: <xgqvb.451147$9l5.293143@pd7tw2no>
In article <bpj51e$o5q$1@reader2.panix.com>,
bill <bill_knight2@yahoo.com> writes:
>Sometimes, the bug one is trying to figure out doesn't come up
>until a long time after the start of the program's execution. This
>can make the debugging extremely time-consuming. In such, it would
>be nice to be able to save the program's state shortly before the
>bug appears, so that subsequent debugging cycles can re-start from
>the saved state, without having to go back all the way to the
>beginning. Is there a way to do this in perldb? If not, are there
>any Perl debuggers that have this feature?
For what you describe the best option is to figure out an
appropriate breakpoint or two. After one or two initial runs
through, you get an idea of what might precede the bug and can
set a breakpoint for that spot. The following features of
the debugger are worth learning in this respect: deferred
breakpoints (b postpone), conditional breakpoints, watchpoints,
and actions.
--
Peter Scott
http://www.perldebugged.com/
*** NEW *** http//www.perlmedic.com/
------------------------------
Date: Fri, 21 Nov 2003 15:42:33 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How to save state while debugging?
Message-Id: <bplbp9$h36$3@wisteria.csv.warwick.ac.uk>
Peter@PSDT.com wrote:
> In article <bpj51e$o5q$1@reader2.panix.com>,
> bill <bill_knight2@yahoo.com> writes:
> >Sometimes, the bug one is trying to figure out doesn't come up
> >until a long time after the start of the program's execution. This
> >can make the debugging extremely time-consuming. In such, it would
> >be nice to be able to save the program's state shortly before the
> >bug appears, so that subsequent debugging cycles can re-start from
> >the saved state, without having to go back all the way to the
> >beginning. Is there a way to do this in perldb? If not, are there
> >any Perl debuggers that have this feature?
>
> For what you describe the best option is to figure out an
> appropriate breakpoint or two. After one or two initial runs
> through, you get an idea of what might precede the bug and can
> set a breakpoint for that spot.
The trouble with this approach is that it doesn't help if the program
takes a long time to reach the breakpoint even when running
uninterruptedly.
The usual answer to this is to start breaking your code up into
smaller test-cases, until you isolate the problem.
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
------------------------------
Date: Fri, 21 Nov 2003 15:56:23 +0000
From: Andy Parris <parrisa@cgtechs.demon.co.uk>
Subject: LWP & HTTPS problem
Message-Id: <UoMl3BAnWjv$EyOO@cgtechs.demon.co.uk>
Hi,
I'm trying to use LWP to download a file from the net. The site is
secure so I need to use https.
the script can download http fine, but not https.
I've installed the Crypt-SSLeay module
I've managed to locate and download the SSLeay32.dll and libeay32.dll
modules and I've copied them into \winnt\system32 (I'm on NT4)
The script obviously needs these 2 dll's because if they are not there I
get an error message asking for them. If the are then the script just
returns :unknown error :unknown error
Any ideas anyone? TIA
--
Andy Parris
parrisa@cgtechs.demon.co.uk
------------------------------
Date: Fri, 21 Nov 2003 14:43:53 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: Need some help...
Message-Id: <Xns943A62FE71507dkwwashere@216.168.3.30>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> Desmond Coughlan <pasdespam_desmond@zeouane.org> wrote in
> comp.lang.perl.misc:
>
>> I mean, come on: I _know_ Perl, damnit !!
>
> Few people would claim that without qualification.
Maybe he means it in a Biblical sense. I've screwed around with Perl,
and it has certainly screwed with my head at times.
--
David Wall
------------------------------
Date: 21 Nov 2003 09:30:41 -0800
From: warpman999@netscape.net (warpman)
Subject: Re: Need some help...
Message-Id: <99977611.0311210930.53ae2ba2@posting.google.com>
Hi Uri. Thanks for the info. I couldn't agree more about the code. Thanks again.
Uri Guttman <uri@stemsystems.com> wrote in message news:<x7ekw4dvl8.fsf@mail.sysarch.com>...
> put the subject in the subject of the post.
>
> did you steal/borrow/copy this code or create this mess yourself? it
> looks like typical old cargo cult crap.
>
> this code is so perl4ish and so clunky.
>
> jeez, a y2k bug 3 years later.
>
> rtfm some more on localtime.
>
> no strict
>
> some unseen and probably bad cgi parser is used
>
> quoted scalar variables
>
> it is not worth fixing. dump it all and rewrite it.
>
> you should learn some perl from a better source too.
>
> uri
------------------------------
Date: 21 Nov 2003 09:44:30 -0800
From: warpman999@netscape.net (warpman)
Subject: Re: Need some help...
Message-Id: <99977611.0311210944.33a95487@posting.google.com>
I would like to thank all of you for your recommendations, suggestions
and even criticism. Keep in mind that I'm new to PERL. I'm learning as
I go. I took a look at the documentation and made some changes and
everything seems to be going OK at the moment. Thanks again.
warpman999@netscape.net (warpman) wrote in message news:<99977611.0311191052.3c1f5ff1@posting.google.com>...
> I need some help. I'm new to perl and I have borrow the following
> code. This sub keeps on given me the following date:
>
> November 5, 103 at 10:16:33:
>
> I don't understand why it keeps on given me the year as 1xx instead of
> 2 digits. Any help would be greatly appreciated. Thanks in advanced.
>
>
>
> =====
> sub get_variables {
>
> if ($FORM{'followup'}) {
> $followup = "1";
> @followup_num = split(/,/,$FORM{'followup'});
> $num_followups = @followups = @followup_num;
> $last_message = pop(@followups);
> $origdate = "$FORM{'origdate'}";
> $origname = "$FORM{'origname'}";
> $origsubject = "$FORM{'origsubject'}";
> }
> else {
> $followup = "0";
> }
>
> if ($FORM{'name'}) {
> $name = "$FORM{'name'}";
> $name =~ s/"//g;
> $name =~ s/<//g;
> $name =~ s/>//g;
> $name =~ s/\&//g;
> }
> else {
> &error(no_name);
> }
>
> if ($FORM{'email'} =~ /.*\@.*\..*/) {
> $email = "$FORM{'email'}";
> }
>
> if ($FORM{'subject'}) {
> $subject = "$FORM{'subject'}";
> $subject =~ s/\&/\&\;/g;
> $subject =~ s/"/\"\;/g;
> }
> else {
> &error(no_subject);
> }
>
> if ($FORM{'url'} =~ /.*\:.*\..*/ && $FORM{'url_title'}) {
> $message_url = "$FORM{'url'}";
> $message_url_title = "$FORM{'url_title'}";
> }
>
> if ($FORM{'img'} =~ /.*tp:\/\/.*\..*/) {
> $message_img = "$FORM{'img'}";
> }
>
> if ($FORM{'body'}) {
> $body = "$FORM{'body'}";
> $body =~ s/\cM//g;
> $body =~ s/\n\n/<p>/g;
> $body =~ s/\n/<br>/g;
>
> $body =~ s/</</g;
> $body =~ s/>/>/g;
> $body =~ s/"/"/g;
> }
> else {
> &error(no_body);
> }
>
> if ($quote_text == 1) {
> $hidden_body = "$body";
> $hidden_body =~ s/</</g;
> $hidden_body =~ s/>/>/g;
> $hidden_body =~ s/"/"/g;
> }
>
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
> localtime(time);
>
> if ($sec < 10) {
> $sec = "0$sec";
> }
> if ($min < 10) {
> $min = "0$min";
> }
> if ($hour < 10) {
> $hour = "0$hour";
> }
> if ($mon < 10) {
> $mon = "0$mon";
> }
> if ($mday < 10) {
> $mday = "0$mday";
> }
>
> $month = ($mon + 1);
>
> @months = ("January","February","March","April","May","June","July","August","September","October","November","December");
>
> if ($use_time == 1) {
> $date = "$hour\:$min\:$sec $month/$mday/$year";
> }
> else {
> $date = "$month/$mday/$year";
> }
> chop($date) if ($date =~ /\n$/);
>
> $long_date = "$months[$mon] $mday, $year at $hour\:$min\:$sec";
> # $long_date = "$months[$mon] $mday, 19$year at $hour\:$min\:$sec";
> }
------------------------------
Date: Fri, 21 Nov 2003 10:31:23 -0500
From: "Bandwidth, Inc." <info@bandwidth-usa.com>
Subject: Need strong Perl developer
Message-Id: <bplbcg$nlh$1@bob.news.rcn.net>
We are looking for a strong Perl developer with a telecom industry
background for a Contract to hire position in MD, Washington DC metro area.
No H1. Please send you details asap. Thanks.
Rakesh Malik
Bandwidth, Inc.
18033 Royal Bonnet Circle
Montgomery Village, MD 20886
Tel: (301) 519-0240
Cell: (301) 728-8867
Fax: (270) 721-8470
Sales Office:
15200 Shady Grove Rd. # 350
Rockville MD 20850
Email: rakesh@bandwidth-usa.com
www.bandwidth-usa.com
------------------------------
Date: Fri, 21 Nov 2003 16:12:05 -0000
From: "Brian Wakem" <no@email.com>
Subject: Re: Need strong Perl developer
Message-Id: <bpldgl$1pfqjh$1@ID-112158.news.uni-berlin.de>
"Bandwidth, Inc." <info@bandwidth-usa.com> wrote in message
news:bplbcg$nlh$1@bob.news.rcn.net...
> We are looking for a strong Perl developer
I go to the gym twice a week - am I eligible?
--
Brian Wakem
------------------------------
Date: 21 Nov 2003 08:31:14 -0800
From: francescomoi@europe.com (Francesco Moi)
Subject: Problems with special characters (I suppose it is 'locales')
Message-Id: <5b829932.0311210831.7847a674@posting.google.com>
Hello.
I'm using 'XML::Parser' and when parsing an XML file with special
characters (Spanish), I get some problems with them:
'á' is converted to 'á' (for example)
I don't know if I must change 'locales' on the System (Linux
RedHat). And I do not know how to change it.
I would be extremely obliged if anybody had any experience.
------------------------------
Date: Fri, 21 Nov 2003 19:32:17 +0100
From: Michel Rodriguez <mirod@xmltwig.com>
Subject: Re: Problems with special characters (I suppose it is 'locales')
Message-Id: <bplfgs$l8h$1@news-reader3.wanadoo.fr>
Francesco Moi wrote:
> I'm using 'XML::Parser' and when parsing an XML file with special
> characters (Spanish), I get some problems with them:
> 'á' is converted to 'á' (for example)
>
> I don't know if I must change 'locales' on the System (Linux
> RedHat). And I do not know how to change it.
>
> I would be extremely obliged if anybody had any experience.
XML::Parser, like most other XML parsers, converts all strings to UTF-8,
you need to convert them back to latin-1 (I suppose), using Encode or
Text::Iconv or Unicode::*
See the Perl-XML FAQ: http://perl-xml.sourceforge.net/faq/#encodings
This is part of the documentation of the module BTW:
Handlers
...
Char (Expat, String)
This event is generated when non-markup is recognized. The
non-markup sequence of characters is in String. A single
non-markup sequence of characters may generate multiple calls to
this handler. Whatever the encoding of the string in the original
document, this is given to the handler in UTF-8.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--
Michel Rodriguez
Perl & XML
http://www.xmltwig.com
------------------------------
Date: Fri, 21 Nov 2003 16:31:55 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Program that prints its source code
Message-Id: <8h8srvc7kbed4lo1s838o3qq3tnd37nfsp@4ax.com>
On Thu, 20 Nov 2003 03:02:03 -0000, "David K. Wall"
<usenet@dwall.fastmail.fm> wrote:
>> I think that these would be considered both "illegal" quines for most
>> definitions of quine.
>
>Yeah, well, this wasn't for a contest or anything, just a toy program I
Fine then: I was just repeating something (falling in the category of
"interesting information", of course) I had heard somewhere else.
>wrote that I wanted to make available to other people for them to play with
>or extend if they were interested. It's completely trivial, but fun, so
>here's the program: http://ylatis.com/cgi-bin/tile
I just went there... FWIW, I think it's cool!
Michele
--
# This prints: Just another Perl hacker,
seek DATA,15,0 and print q... <DATA>;
__END__
------------------------------
Date: 21 Nov 2003 09:19:11 -0800
From: wherrera@lynxview.com (Bill)
Subject: Re: Protecting Source code of a perl script
Message-Id: <239ce42f.0311210919.5ac677ad@posting.google.com>
Ben Morrow <usenet@morrow.me.uk> wrote in message news:<bpku88$4q8$1@wisteria.csv.warwick.ac.uk>...
> > Actually this is a very frequent scenario.
> > Or would you trust your personal medical files to the admin of the hospital
> > computer?
>
> I would (implicitly) trust him not to look at them unless it was
> strictly necessary. Or I would trust the hospital to sack him if he
> did.
This is actually a situation where obscurity is useful, not to keep
away truly prying eyes, but to keep from accidental exposure of
confidential data. There is a reason that changing rooms and shower
stalls have doors or curtains, even if they do not lock :). I keep
some data on a public server encrypted, even though a determined
administrator could crack the encryption with only a day's work. (A
non-administrator could not crack it without years of work, we hope.)
------------------------------
Date: 21 Nov 2003 07:00:08 -0800
From: junk@dlink.org (Aqua)
Subject: Re: Running a CGI/Perl in Activeperl
Message-Id: <55d7995c.0311210700.6adab67a@posting.google.com>
> I basically want to reproduce my web site internally on my machine and run all my scripts just as they do on the web
> server.
Like others response installing a web server is the best option.
If you know what variables are passed though your web page you can try like this
Script_Name.pl Name1=value Name2=value2 Name3=value3
Hope this helps
Regards
Dominic
Perl Consulting http://www.dlink.org/perl
------------------------------
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 5841
***************************************