[16724] in Perl-Users-Digest
Perl-Users Digest, Issue: 4136 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 26 00:05:37 2000
Date: Fri, 25 Aug 2000 21:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967262717-v9-i4136@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 25 Aug 2000 Volume: 9 Number: 4136
Today's topics:
bytecode compiler and "Attempt to free unreferenced sca <wkempfer@lsil.com>
can't seem to open or create a file (Richard)
Re: can't seem to open or create a file <emschwar@rmi.net>
Re: can't seem to open or create a file (Abigail)
Re: CGI script for formatting Email <elephant@squirrelgroup.com>
Re: How to split mailheaders <kjetilskotheim@iname.com>
Re: How to split mailheaders (Keith Calvert Ivey)
Re: Just another silly post. <madings@baladi.bmrb.wisc.edu>
Re: Just another silly post. (Martien Verbruggen)
Re: Just another silly post. <madings@baladi.bmrb.wisc.edu>
Re: Just another silly post. <madings@baladi.bmrb.wisc.edu>
Re: Just another silly post. (Logan Shaw)
Re: Just another silly post. (Martien Verbruggen)
Re: Just another silly post. (Abigail)
Re: Just another silly post. (Abigail)
Re: legal date (Marcel Grunauer)
Re: Newbie - Errors causing download of file! <elephant@squirrelgroup.com>
passing a value into a perl script marxjkj123@my-deja.com
Re: passing a value into a perl script <elephant@squirrelgroup.com>
Re: Perl jobs? <tulit.nospam@nospam-rzsoft.com>
Re: Preserving HTML entities when HTML:: parsed <elephant@squirrelgroup.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Aug 2000 11:05:24 -0700
From: Wes Kempfer <wkempfer@lsil.com>
Subject: bytecode compiler and "Attempt to free unreferenced scalar"
Message-Id: <39A6B564.FD7272B3@lsil.com>
Hi,
I am attempting to use the bytecode compile feature in perl 5.6.0. A
compiled script seems to run fine except that on exit, one or more lines
containing the following error message are printed:
"Attempt to free unreferenced scalar."
The number of times this line is printed is roughly proportional to the
number sub-routine calls. This little test program, if compiled to
bytecode with "perl -b," prints the message 3 times:
#!/usr/local/bin/perl
use TestMod ;
print "hello\n" ;
&print_this ;
print "hello\n" ;
&print_this ;
sleep 5 ;
# end of file here
TestMod is a module containing this simple method:
sub print_this()
{
print "this\n" ;
}
If the second call to "print_this" and the call to sleep are deleted,
the error message prints once. The error message does not print at all
if the script is not pre-compiled to bytecode.
Has anyone experienced this symptom and if so, is there a solution for
it? The platform I am running this on is Solaris 2.6/Sparc. Perl was
compiled using gcc-2.8.1. Other than specifying gcc, the perl
installation was compiled with defaults.
Thanks,
Wes
------------------------------
Date: Fri, 25 Aug 2000 18:49:45 -0500
From: insmov@tiac.net (Richard)
Subject: can't seem to open or create a file
Message-Id: <insmov-ya02408000R2508001849450001@news.tiac.net>
Keywords: sequential files
I can't figure out why I cant get this simple script to create a file when
it is executed. All it supposed to do is retrive a string from a form and
is supposed to either create a text file and write to it or append to a
file already in existance. Upon pressing "Okay"it goes to a script that
retrives the string from the file.
When I run a variant of this script on my desk top using MacPerl it does
what it should but will not in the server. All permissions for the scripts
and the file are set.
I can't get this script or any variation of this to even write to an
existing file. What could I be doing wrong..... HELP
------------------------------
Date: 25 Aug 2000 17:34:45 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: can't seem to open or create a file
Message-Id: <xkfpumwj4oa.fsf@valdemar.cos.agilent.com>
insmov@tiac.net (Richard) writes:
> I can't figure out why I cant get this simple script to create a file when
> it is executed.
Which simple script?
> All it supposed to do is retrive a string from a form and
> is supposed to either create a text file and write to it or append to a
> file already in existance.
What form? What file?
> Upon pressing "Okay"
Okay?
> it goes to a script that retrives the string from the file.
Er, what goes to a script? I just pressed "Okay", and my monitor got a
little greasier, but I soon cleaned that off.
> When I run a variant of this script on my desk top using MacPerl it does
> what it should but will not in the server.
So when you run a different program on a different computer, it behaves
differently? That's not exactly earth-shattering news.
> All permissions for the scripts and the file are set.
What permissions? What scripts? What file? What are they set to?
> I can't get this script or any variation of this to even write to an
> existing file. What could I be doing wrong..... HELP
1) Posting to clpm claiming a problem with your code, but not posting the
code.
2) Opening files without checking to see if the open failed.
3) Checking to see if the open failed, but not using $! in the
error-handling code.
4) Running the program during the wrong phase of the moon.
5) Opening the wrong file.
6) Running the wrong program.
7) Forgetting to jump up and down and scream "potato!" at the top of your
lungs whilst running the program.
That's just off the top of my head.
-=Eric
--
Bloody hell, I've never been sigquoted before. Thus the great moments of one's
life occur between installing the new version of xscreensaver and creating a
mailing list. -- Frossie <frossie@jach.hawaii.edu> in ASR
------------------------------
Date: 26 Aug 2000 02:39:18 GMT
From: abigail@foad.org (Abigail)
Subject: Re: can't seem to open or create a file
Message-Id: <slrn8qebd9.tj3.abigail@alexandra.foad.org>
Richard (insmov@tiac.net) wrote on MMDLI September MCMXCIII in
<URL:news:insmov-ya02408000R2508001849450001@news.tiac.net>:
:} I can't figure out why I cant get this simple script to create a file when
:} it is executed. All it supposed to do is retrive a string from a form and
:} is supposed to either create a text file and write to it or append to a
:} file already in existance. Upon pressing "Okay"it goes to a script that
:} retrives the string from the file.
:} When I run a variant of this script on my desk top using MacPerl it does
:} what it should but will not in the server. All permissions for the scripts
:} and the file are set.
:} I can't get this script or any variation of this to even write to an
:} existing file. What could I be doing wrong..... HELP
I guess you have a bug in line 17.
Abigail
--
BEGIN {my $x = "Knuth heals rare project\n";
$^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
$y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;
------------------------------
Date: Sat, 26 Aug 2000 01:08:19 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: CGI script for formatting Email
Message-Id: <MPG.1411b5f9b47ea6159896f8@localhost>
ssipult@my-deja.com <ssipult@my-deja.com> wrote ..
>I am looking for a good simple script for
>formatting an email into HTML, that is easily
>customizable for form mail. Any suggestions?
#!/usr/bin/perl -w
use strict;
use CGI qw':standard escapeHTML';
undef $/;
# the next line is for testing only .. you will need to change this
# to open the appropriate mail file and read from that
my $mail = <>;
$mail = escapeHTML( $mail );
print header, start_html( 'A test'), pre( $mail ), end_html;
__END__
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 25 Aug 2000 23:50:12 +0200
From: Kjetil Skotheim <kjetilskotheim@iname.com>
To: Keith Calvert Ivey <kcivey@cpcug.org>
Subject: Re: How to split mailheaders
Message-Id: <39A6F824.203F7D5F@iname.com>
Keith Calvert Ivey wrote:
>
> I wrote:
>
> > my @header = split /\n(?=\S|$)/, $header;
>
> This is nicer:
>
> my @header = split /\n(?!\s)/, $header;
>
No, /\n(?!\s)/ will leave a \n at the end in the last header part.
But /\n(?=\S|$)/ will not! Thanks both for answers!
--
Kjetil Skotheim
kjetilskotheim@iname.com
------------------------------
Date: Sat, 26 Aug 2000 02:39:33 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: How to split mailheaders
Message-Id: <39a82645.1223750@news.newsguy.com>
Kjetil Skotheim <kjetilskotheim@iname.com> wrote:
>Keith Calvert Ivey wrote:
>> my @header = split /\n(?!\s)/, $header;
>>
>No, /\n(?!\s)/ will leave a \n at the end in the last header part.
It depends on what your header looks like after you've parsed it
out of the message. I wouldn't necessarily have expected any
newlines at all on the end. Your example had only one, in which
case my solution works fine. If there are two newlines at the
end, then you're right that it will leave one of them.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: 26 Aug 2000 00:46:19 GMT
From: Steve Mading <madings@baladi.bmrb.wisc.edu>
Subject: Re: Just another silly post.
Message-Id: <8o740r$ib8$1@news.doit.wisc.edu>
Martien Verbruggen <mgjv@verbruggen.comdyn.com.au> wrote:
: On Thu, 24 Aug 2000 05:57:38 GMT,
: Joe C. Hecht <joehecht@code4sale.com> wrote:
:> > I have a challenge for you.
:>
:> Is this a homework assignment you need help with?
: Anyone coming up with homework assignments like that shouldn't be
: teaching Perl. Half of those restrictions are arbitrary, silly, and
: contrary to good programming practice.
You've just described Perl's syntax itself ;-)
I like Perl, but it can have clunky syntax sometimes (like the fact
that you can have a single-statement body without squiggly braces
for a conditional *only* if you write the conditional backwards:
stmt if( foo ); # valid perl
if( foo ) stmt; # invalid perl (needs squiggles {})
This makes no sense to me. Plus the grammer is not truly
orthogonal: Nested hashes, for example, are really icky,
because I haven't figured out yet how to just refer to
the subhash at a point in the outer hash. What I want to
do: %outerhash{$outerkey} should refer to the inner hash at
that point, but the syntax won't let me do that. It insists
on $outerhash{$outerkey}, which then isn't interpeted as a
hash. This is kind of icky.
Can you "cast" in Perl? (tell it that what it thinks is scalar
is really a hash).
--
-- ------------------------------------------------------------------
Steven L. Mading at BioMagResBank (BMRB). UW-Madison
Programmer/Analyst/(acting SysAdmin) mailto:madings@bmrb.wisc.edu
B1108C, Biochem Addition / 433 Babcock Dr / Madison, WI 53706-1544
------------------------------
Date: Sat, 26 Aug 2000 10:33:10 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Just another silly post.
Message-Id: <slrn8qe426.5ap.mgjv@martien.heliotrope.home>
On 25 Aug 2000 17:02:47 GMT,
Abigail <abigail@foad.org> wrote:
> Martien Verbruggen (mgjv@tradingpost.com.au) wrote on MMDLI September
> MCMXCIII in <URL:news:slrn8qciud.5ap.mgjv@martien.heliotrope.home>:
> `` On 25 Aug 2000 07:25:16 GMT,
> `` Abigail <abigail@foad.org> wrote:
> `` > Martien Verbruggen (mgjv@verbruggen.comdyn.com.au) wrote on MMDLI
> `` > September MCMXCIII in <URL:news:slrn8qbn6n.ma.mgjv@verbruggen.comdyn.com.au
> `` > -: dirx(grep !m!/\.\.?$!, glob("$_/* $_/.*"))
> `` >
> `` > Eh, no, that will filter out some perfectly legal filenames.
> ``
> `` I hesitate to doubt your word, but, as I see it; all it will filter
> `` out is
> ``
> `` $_/.
> `` $_/..
>
>
> No, it won't. It's a common misconception that $ matches the end of a
> string. It might, but it doesn't have to. $ matches the end of a *line*.
> And it can do so before a newline. Hence, ".\n" and "..\n", which are
> perfectly valid filenames, will be filtered out by the grep.
You are right. Even though it is rare, a newline in a file name is
legal.
m!/\.\.?\z!
Martien
--
Martien Verbruggen |
Interactive Media Division | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: 26 Aug 2000 01:04:31 GMT
From: Steve Mading <madings@baladi.bmrb.wisc.edu>
Subject: Re: Just another silly post.
Message-Id: <8o752v$ipq$2@news.doit.wisc.edu>
Abigail <abigail@foad.org> wrote:
: No, it won't. It's a common misconception that $ matches the end of a
: string. It might, but it doesn't have to. $ matches the end of a *line*.
: And it can do so before a newline. Hence, ".\n" and "..\n", which are
: perfectly valid filenames, will be filtered out by the grep.
This is configurable behaviour that can be fixed trivially. Perl
regex's can be told to match $ to end-of-string with a switch.
------------------------------
Date: 26 Aug 2000 01:01:17 GMT
From: Steve Mading <madings@baladi.bmrb.wisc.edu>
Subject: Re: Just another silly post.
Message-Id: <8o74st$ipq$1@news.doit.wisc.edu>
Policy Man <reljr_2@yahoo.com> wrote:
: -- The code may employ at most a single ';' and then only as the final
: item/character.
This is a trivial restriction to get around. For any chunk of
code, like this for example:
stmt1;
stmt2;
stmt3;
if( cond )
{ stmt4;
stmt5;
}
You can get rid of the semicolons by turning the statments into
useless conditional expressions:
if( stmt1 ){}
if( stmt2 ){}
if( stmt3 ){}
if( cond )
{
if( stmt4 ){}
if( stmt5 ){}
}
With this trick, you can just code up a more "sane"
solution to the problem in the normal way, then go back
and "conditionalize" your code like I show above.
------------------------------
Date: 25 Aug 2000 20:21:30 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Just another silly post.
Message-Id: <8o762q$grl$1@provolone.cs.utexas.edu>
In article <8o740r$ib8$1@news.doit.wisc.edu>,
Steve Mading <madings@baladi.bmrb.wisc.edu> wrote:
>I like Perl, but it can have clunky syntax sometimes (like the fact
>that you can have a single-statement body without squiggly braces
>for a conditional *only* if you write the conditional backwards:
> stmt if( foo ); # valid perl
> if( foo ) stmt; # invalid perl (needs squiggles {})
That's because the former is intended as a short-hand, convenient,
terse form whereas the second one is the full version. Actually,
the two syntaxes are quite different since
statement if expression
is legal as well as
statement if (expression)
actually, in this second case the parentheses ("curvies"?) are simply a
part of the expression.
>Plus the grammer is not truly orthogonal:
That's by design. I haven't personally asked him, but I have assumed
that it was Larry Wall's contention that orthogonal grammars are
unnatural. Human beings are best at dealing with grammars that are not
orthogonal because the irregularity gives them context and cues as to
what's going on.
Imagine if you were walking around downtown in a city where all the
streets were regularly spaced and at right angles, and imagine that all
of the buildings looked alike. If someone asked you which corner you
were standing at, you'd have to look at the street signs because there
wouldn't be much other way to tell. In a real city, you can look
around and say, "Hey, I'm looking at the side of that ugly black glass
box building on the one-way street" and suddenly you know *exactly*
where you are. Yes, it takes a while to learn landmarks, but once you
do, they make navigation much easier.
>Nested hashes, for example, are really icky,
>because I haven't figured out yet how to just refer to
>the subhash at a point in the outer hash.
They're not icky *because* you haven't figured out how they work.
> What I want to
>do: %outerhash{$outerkey} should refer to the inner hash at
>that point, but the syntax won't let me do that. It insists
>on $outerhash{$outerkey}, which then isn't interpeted as a
>hash. This is kind of icky.
Of course it insists on that. This is because there is no such thing
as nested hashes. Nested hashes do not exist in Perl.
Instead, hashes' values are allowed to be references. So, hash values
can refer to other anonymous hashes. They don't really contain them,
though.
Anyway, the point is that $outerhash{$outerkey} is a reference to
another hash. If you want to treat it like a hash and not just a
reference to one, you have to dereference it. Putting a % in front of
a reference will dereference it as a hash. So, you need to do this:
%{ $outerhash{$outerkey} }
The outer squiggly brackets are there for grouping purposes. I'm not
sure what the operator precedence is, so I always just put them in.
If the precedence is right, then you can do this:
%$outerhash{$outerkey}
I'm almost certain you can do this:
$ref = $outerhash{$outerkey};
and have %$ref be the hash.
I will agree that it's a little confusing that
$outerhash{$outerkey}{$innerkey}
means exactly the same thing as
$outerhash{$outerkey}->{$innerkey}
The second one is the one that makes sense given what the data
structures involved actually are. I guess the first is easier enough
to type that maybe it's worth it.
- Logan
------------------------------
Date: Sat, 26 Aug 2000 11:51:51 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Just another silly post.
Message-Id: <slrn8qe8ln.5ap.mgjv@martien.heliotrope.home>
On 26 Aug 2000 00:46:19 GMT,
Steve Mading <madings@baladi.bmrb.wisc.edu> wrote:
> Martien Verbruggen <mgjv@verbruggen.comdyn.com.au> wrote:
> : On Thu, 24 Aug 2000 05:57:38 GMT,
> : Joe C. Hecht <joehecht@code4sale.com> wrote:
> :> > I have a challenge for you.
> :>
> :> Is this a homework assignment you need help with?
>
> : Anyone coming up with homework assignments like that shouldn't be
> : teaching Perl. Half of those restrictions are arbitrary, silly, and
> : contrary to good programming practice.
>
> You've just described Perl's syntax itself ;-)
I know that's only half serioius, but it's not true at all. Perl
_allows_ you to do things in many ways. You can program very clearly and
structured, if you want, or you can make a mess. Perl tries to avoid
putting arbitrary restrictions on any operation. a lot of work has gone
into making Perl unrestricted, not the other way around.
If you program in such a way that your Perl programs are unreadable, or
unnecessarily limited, you do it to yourself. it's not the language that
forced you.
> I like Perl, but it can have clunky syntax sometimes (like the fact
> that you can have a single-statement body without squiggly braces
> for a conditional *only* if you write the conditional backwards:
> stmt if( foo ); # valid perl
> if( foo ) stmt; # invalid perl (needs squiggles {})
Mandatory braces around blocks (that are not files) was a concious
decision a long time ago. The _modifiers_ if, while, for and unless are
not the same thingies as the compound statements using if, while and
for, and if you read perlsyn, you will find that there is a clear
distinction made between them.
The decision to require a block in a compound statement was not just to
make the parser's work easier (it deals with much more complex things
than that), but to avoid ambiguity for programmers who are writing or
reading the code. I've seen some programming errors in C code where the
programmer had lost track of which else went with which if exactly,
especially in deep nests or a list of many switches. Or the error where
quickly adding a line of code suddenly makes a single statement into
two, breaking your if logic.
if ((p = malloc(sizeof(some_struct)) == NULL)
fprintf(stderr, "A Booboo just happened\n");
return NULL;
/* other code */
Even if that malloc succeeds, you won't even reach the /* other code */
bit. Indentation suggests something else. I know that modern compilers
will warn you and stuff, but there are much more complex situations
where you end up with valid code from the compiler's point of view, but
with slightly broken hard to track down logic. I believe that THAT was
the main reason for requiring a block in Perl's compounds. And to make
it possible to do simple error control, the modifiers came in.
> This makes no sense to me. Plus the grammer is not truly
> orthogonal: Nested hashes, for example, are really icky,
> because I haven't figured out yet how to just refer to
> the subhash at a point in the outer hash. What I want to
> do: %outerhash{$outerkey} should refer to the inner hash at
> that point, but the syntax won't let me do that. It insists
> on $outerhash{$outerkey}, which then isn't interpeted as a
> hash. This is kind of icky.
The same thing applies to C for example. You aren't dealing with hashes,
but with _references to hashes_. I think your confusion mainly stems
from not being familiar enough with the concept. Or maybe you are
familiar enough with it, but just don't like the fact that nested
structures in Perl are implemented as references, and you'd rather like
something more magical that did the right thing all the time?
Or are you talking about the fact that a scalar value in Perl always
starts with a $, even if it refers to one in an array or hash? Maybe the
documentation in perldata, perlref, perllol and perldsc can help you out
a bit here.
> Can you "cast" in Perl? (tell it that what it thinks is scalar
> is really a hash).
Yes. Sort of
$hash_ref = { foo => 'bar', baz => 'banana' };
while (($k, $v) = each %$hash_ref)
{
print "$k => $v\n";
}
What I have is a hash ref, and when I use it, I 'transform' it into
a hash, because each wants one there. The perlref documentation explains
all this quite extensively, in the section entitled 'Using References',
and in the perldsc documentation.
Now... For someone who is new to Perl, or to programming in general (C
programmers won't have much problems with references) references can be
confusing. But there isn't really a problem with perl's syntax as far as
I am concerned.
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing
Interactive Media Division | down all the noises the baby makes
Commercial Dynamics Pty. Ltd. | so later I can ask him what he meant
NSW, Australia | - Steven Wright
------------------------------
Date: 26 Aug 2000 02:31:53 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Just another silly post.
Message-Id: <slrn8qeavc.tj3.abigail@alexandra.foad.org>
Steve Mading (madings@baladi.bmrb.wisc.edu) wrote on MMDLII September
MCMXCIII in <URL:news:8o752v$ipq$2@news.doit.wisc.edu>:
:: Abigail <abigail@foad.org> wrote:
::
:: : No, it won't. It's a common misconception that $ matches the end of a
:: : string. It might, but it doesn't have to. $ matches the end of a *line*.
:: : And it can do so before a newline. Hence, ".\n" and "..\n", which are
:: : perfectly valid filenames, will be filtered out by the grep.
::
:: This is configurable behaviour that can be fixed trivially. Perl
:: regex's can be told to match $ to end-of-string with a switch.
You got me there. Can to tell us which switch that is? I can't find
it in man perlrun.
Abigail
--
BEGIN {$^H {q} = sub {pop and pop and print pop}; $^H = 2**4.2**12}
"Just "; "another "; "Perl "; "Hacker\n";
------------------------------
Date: 26 Aug 2000 02:37:06 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Just another silly post.
Message-Id: <slrn8qeb95.tj3.abigail@alexandra.foad.org>
Steve Mading (madings@baladi.bmrb.wisc.edu) wrote on MMDLII September
MCMXCIII in <URL:news:8o74st$ipq$1@news.doit.wisc.edu>:
-: Policy Man <reljr_2@yahoo.com> wrote:
-:
-: : -- The code may employ at most a single ';' and then only as the final
-: : item/character.
-:
-: This is a trivial restriction to get around. For any chunk of
-: code, like this for example:
-:
-: stmt1;
-: stmt2;
-: stmt3;
-: if( cond )
-: { stmt4;
-: stmt5;
-: }
-:
-: You can get rid of the semicolons by turning the statments into
-: useless conditional expressions:
-:
-: if( stmt1 ){}
-: if( stmt2 ){}
-: if( stmt3 ){}
-: if( cond )
-: {
-: if( stmt4 ){}
-: if( stmt5 ){}
-: }
Too much typing.
{stmt1 xor stmt2 xor stmt3}
if (cond) {stmt4 xor stmt5}
Altnatively:
{stmt1}
{stmt2}
{stmt3}
if (cond) {
{stmt4}
{stmt5}
}
(Although you may something have to rearrange things a bit, lest Perl
thinks such blocks are hashrefs.)
Also, the contest forbids the use of "::", but not of "'". system and qx
and `` are forbidden, but not the use of open. IIRC, use and require are
verboten as well, but do isn't.
Abigail
--
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
------------------------------
Date: Sat, 26 Aug 2000 01:33:00 GMT
From: marcel@codewerk.com (Marcel Grunauer)
Subject: Re: legal date
Message-Id: <slrn8qe7h8.2cv.marcel@gandalf.local>
On Fri, 25 Aug 2000 10:07:11 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
>In article <slrn8qcjfh.27o.marcel@gandalf.local> on Fri, 25 Aug 2000
>10:44:59 GMT, Marcel Grunauer <marcel@codewerk.com> says...
>> On Fri, 25 Aug 2000 08:53:33 GMT, eastking@my-deja.com
>> <eastking@my-deja.com> wrote:
>>
>> >I want to get a legal day most close(forward) to the day encrypted by
>> >the three variable '19990931'. In this case it should be '19990930'.
>>
>> If you want the next _forward_ date, shouldn't it be '19991001'?
>
>Not according to the explicit example given.
Well, yes. I _did_ see the explicit example. But I misread his spec
as saying "go forward until you hit a valid date", in which case the
code would have been correct (unless I missed something else... one can
only try.)
--
Marcel Gr\"unauer - Codewerk plc . . . . . . . . . . . <http://www.codewerk.com>
Perl Consulting, Programming, Training, Code review . . . <marcel@codewerk.com>
mod_perl, XML solutions - email for consultancy availability
sub AUTOLOAD{($_=$AUTOLOAD)=~s;^.*::;;;y;_; ;;print} Just_Another_Perl_Hacker();
------------------------------
Date: Sat, 26 Aug 2000 00:52:39 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Newbie - Errors causing download of file!
Message-Id: <MPG.1411b24f8d4f6b449896f7@localhost>
scottfreez@my-deja.com <scottfreez@my-deja.com> wrote ..
>I'm working on a perl app which acts as a middelman between a bunch of
>tables and asp pages.
>
>The problem is this - sometimes when there is an error in the page,
>instead of dieing or displaying a message, the .pl file "conveniently"
>offers to download itself directly to my computer!! This is NOT good, as
>any user would then be able to view the perl source code...
>
>Does anyone know 1) WHY it is doing this, and 2) more importantly, how
>to avoid it?
ok .. let's get something straight first (and this is not just a "hey
you hassled our language" thing .. but it's a conceptual flaw in your
thinking)
the Perl file didn't offer to download itself .. the * WEB SERVER *
offered to send it to the client .. Perl programs execute .. web servers
send files
and as such .. we're done here .. this is a configuration issue with
your web server .. you need to either ask your server administrator - or
ask in a forum dedicated to the flavour of web server you're using
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 25 Aug 2000 23:43:06 GMT
From: marxjkj123@my-deja.com
Subject: passing a value into a perl script
Message-Id: <8o70a7$tn5$1@nnrp1.deja.com>
Hello all, I have an html page and I need to pass a value within the
html page to a perl script.
For example, I need to pass the selected option box value(either Test1
or Test2) to my perlscript called iwswitchias.pl
Here is what I have so far:
print "<FORM METHOD=POST NAME = TEST ACTION=/iw-
bin/iwswitchias.pl>";
print "</table>\n\n\n\n";
print " <select name=serverlist>";
print " <option>--Choose a server--</option>";
print " <option>--TEST1--</option>";
print " <option>--TEST2--</option>";
thanks
mf
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 26 Aug 2000 01:14:50 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: passing a value into a perl script
Message-Id: <MPG.1411b77a734e11cc9896f9@localhost>
marxjkj123@my-deja.com <marxjkj123@my-deja.com> wrote ..
>Hello all, I have an html page and I need to pass a value within the
>html page to a perl script.
>
>For example, I need to pass the selected option box value(either Test1
>or Test2) to my perlscript called iwswitchias.pl
>
>Here is what I have so far:
>
>print "<FORM METHOD=POST NAME = TEST ACTION=/iw-
>bin/iwswitchias.pl>";
>print "</table>\n\n\n\n";
>
>print " <select name=serverlist>";
>print " <option>--Choose a server--</option>";
>print " <option>--TEST1--</option>";
>print " <option>--TEST2--</option>";
right .. they're all print statements - none of them are doing any
passing or receiving of parameters
btw .. what was it about the plethora of other posts covering this topic
at length over the last few weeks that you didn't understand ?
I'm convinced that some university lecturer or tutor sets these
questions and recommends 'online resources' like 'the usenet' as
potential honey pots of answers
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Sat, 26 Aug 2000 03:10:28 GMT
From: "Tarun Tuli" <tulit.nospam@nospam-rzsoft.com>
Subject: Re: Perl jobs?
Message-Id: <EyGp5.18346$T5.304477@news1.rdc1.ab.home.com>
Tonnes of perl programming jobs.
Look through some of the online job posting websites. Ive seen positions
starting in the $70-$100k range!
--
Tarun Tuli
Sales and Development
RZ Soft of Canada - http://www.rzsoft.com/
"JoBlo" <gbrunt@rocketmail.com> wrote in message
news:Vs0o5.171285$Gh.3035877@news20.bellglobal.com...
> Wow you seem to be a step in front of me. I am also teaching myself Perl
and
> shall also be starting a Java course through Athabasca University. How do
> you like it so far is it what you expected, do you easily see some good
> applications in the real world for Java?
>
> peter <peterp100@hotmail.com> wrote in message
> news:kre4os899d2g278fl1i22bfeoj59ipmg0h@4ax.com...
> > I'm teaching myself perl and I'm taking a Java class this fall. But,
> > I'm thinking about dropping the Java class and concentrating on Perl.
> > Are there any jobs out there for perl programmers? When I look in the
> > paper everything says "Java and C ++" ???
>
>
------------------------------
Date: Sat, 26 Aug 2000 00:48:48 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Preserving HTML entities when HTML:: parsed
Message-Id: <MPG.1411b1601110e5849896f6@localhost>
Ian McDonald at No Fuss Websites.com <ianm@nofusswebsites.com> wrote ..
>jason <elephant@squirrelgroup.com> wrote in message
>news:MPG.14112d4020771ed39896f3@localhost...
>> Ian McDonald at No Fuss Websites.com <ianm@nofusswebsites.com> wrote ..
>> >This deletes the HTML entities;
>> >
>> >$tree = HTML::Parse::parse_html( $text );
>> >$text = $tree->as_HTML;
>> >
>> >What can I do to preserve them?
>>
>> for a start - don't use a deprecated module (even if the doco calls it
>> depreciated ;)
>
>It's just a front end for TreeBuilder. Will using HTML::Parser actually
>solve the problem?
>
>Or is it simply a prerequesite for asking for help?
it's not like we're sitting here in the ivory tower of knowledge having
used and investigated every module and Perl construct and seen every
error in existance y'know
there are a lot of people here who will never have used HTML::Parse ..
what would you like us to do ? .. install and test a deprecated module
so that we can tell you the answer ?
or get you to upgrade to a non-deprecated module .. see if you're still
having the same problem (modules are deprecated for a reason) .. and if
you're not then help you with something that we're already familiar with
and have used many times
the choice is entirely yours .. but the sub-text of my post was not
"I could help you but I'm an upgrade nazi and expect you to be using
the latest and greatest"
it was
"I've got no idea about your problem .. perhaps using a non-deprecated
module would help and at least if it doesn't then you'll be using
something that more than 5 people in the world can help you with"
>(Comparable to 'first get the latest version, then we'll offer tech
>support', which is actually pretty standard.)
very standard .. difference here is that it costs you nothing to upgrade
.. so just do it
[ jeopardectomy ]
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4136
**************************************