[12959] in Perl-Users-Digest
Perl-Users Digest, Issue: 369 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 4 17:07:18 1999
Date: Wed, 4 Aug 1999 14:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 4 Aug 1999 Volume: 9 Number: 369
Today's topics:
Re: => only in hash initialization? (WAS: mySQL & Perl (Matthew Bafford)
Re: [offtopic]RE:Quot St and the Jeop Gm (llornkcor@earthlink.net)
Re: [offtopic]RE:Quot St and the Jeop Gm <tchrist@mox.perl.com>
Re: Autovivification? <aqumsieh@matrox.com>
Re: Autovivification? <makarand_kulkarni@my-deja.com>
Change User & Export Dipslay <gregory_guerin@hp.com>
chomp not working <jembow@learn2.com>
Re: chomp not working <sariq@texas.net>
embedding C in Perl? jfried@my-deja.com
Re: embedding C in Perl? <alex@kawo2.rwth-aachen.de>
Get Executables path <schmickl@magnet.at>
Re: Help me .........please!! <Mark@Mark.Com>
Re: Help me.....Please!!!!!!!!!!!!!!! <Allan@due.net>
Re: Help me.....Please!!!!!!!!!!!!!!! <callen@boxcar.driver8.org>
Re: HELP: How to program command line args <aqumsieh@matrox.com>
Re: How to access only last field of a split ? <sweather@fastenal.com>
how to substitute strings in a newly created file <tom.kralidis@ccrs.nrcanDOTgc.ca>
Inconsistancy between Perl's @INC and @ISA <schmickl@magnet.at>
Re: Jeoparder's Jest (Larry Rosler)
Re: Jeoparder's Jest <tchrist@mox.perl.com>
Re: Jeoparder's Jest <uri@sysarch.com>
Re: mySQL & Perl -> Something simple <alex@kawo2.rwth-aachen.de>
Re: mySQL & Perl -> Something simple (Larry Rosler)
Re: mySQL & Perl -- Something simple <perlking@hotmail.com>
New Supply and Demand Page <devries-devries@wxs.nl>
Re: New Supply and Demand Page <alex@kawo2.rwth-aachen.de>
Re: perl problem with associative array <founder@pege.org>
Perl vs HTML <ytong@club-internet.fr>
Re: Perl vs HTML <alex@kawo2.rwth-aachen.de>
Perl/SSI hacking mujali@my-deja.com
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 04 Aug 1999 20:08:05 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: => only in hash initialization? (WAS: mySQL & Perl -> Something simple)
Message-Id: <slrn7qh5k2.9nb.*@dragons.duesouth.net>
On Wed, 04 Aug 1999 21:08:18 +0200, Alex Farber <alex@kawo2.rwth-aachen.de>
was attempting to recharge the laptop battery by typing:
: Perl King wrote:
: > ObPerl: Use the => operator only in hash initialization.
:
: why?
There was a recent thread about this.
Newsgroup: comp.lang.perl.moderated
Subject: Stylistic use of '>=' vs comma
Initiator: Larry Rosler <lr@hpl.hp.com>
Don't let the subject line throw you off, it really is about =>.
: Regards
HTH,
: Alex
--Matthew
------------------------------
Date: 04 Aug 1999 13:41:46 -0600
From: llornkcor@earthlink.net (llornkcor@earthlink.net)
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <wku2qf5o5h.fsf@earthlink.net>
I was talking about html docs.... on perl.com. sorry-
------------------------------
Date: 4 Aug 1999 14:34:46 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: [offtopic]RE:Quot St and the Jeop Gm
Message-Id: <37a8a3e6@cs.colorado.edu>
Clueless again, llornkcor@earthlink.net (llornkcor@earthlink.net)
blathers on with:
:I was talking about html docs.... on perl.com. sorry-
1) There are no HTML docs on perl.com that you can access.
2) HTML is the opiate of the masses. Learn to use real tools.
3) Your message was illegal: it was missing a mandatory header.
--tom
--
In English, every word can be verbed. Would that it were so in our
programming languages.
------------------------------
Date: Wed, 4 Aug 1999 13:26:48 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
To: Neal Sanche <neal@nsdev.org>
Subject: Re: Autovivification?
Message-Id: <x3yu2qfcv8n.fsf@tigre.matrox.com>
[Posted and CCed]
Neal Sanche <neal@nsdev.org> writes:
> > Behold:
> >
> > undef $r;
> > defined $r->{fred};
> > print $r;
> >
> > HASH(0x80d3f8c)
>
> Okay, but how is this useful? It seems odd to me that the simple act of
You probably use this feature/bug, but you don't know it! It allows
you to do something like:
my %hash;
$hash{'a'}{'b'}{'c'} = 1;
without forcing you to explicitly define $hash{'a'} as a hashref,
$hash{'a'}{'b'} as another hashref first. Way too many programs
depend on it, which makes "fixing" it a bigger problem.
> checking whether a value is defined causes something else (unintended or
> not) to be defined instead. If there is a good reason for it, that's fine
> with me. It's certainly something to watch out for, because careless
> programmers can sometimes cause these things to happen.
Yes. It's probably a bug, but it's too late to fix it.
You probably need a combination of exists() and defined() to take care
of autovivification. Something like:
undef %hash;
if (exists $hash{fred} && defined $hash{fred}{barney}) {
print "Defined ..\n";
}
print keys %hash;
This prints nothing. Changing the above to:
undef %hash;
if (exists $hash{fred}{barney}) {
print "Defined ..\n";
}
print keys %hash;
outputs:
fred
Note that the last level was not autovivified.
HTH,
Ala
------------------------------
Date: Wed, 04 Aug 1999 19:38:14 GMT
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
Subject: Re: Autovivification?
Message-Id: <7oa4r5$t03$1@nnrp1.deja.com>
[Neal Sanche <neal@nsdev.org> asked in the
article <37A79D89.AA0E396C@nsdev.org>]
>Okay, but how is this useful? It seems odd to me
>that the simple act of checking whether a value is defined
>causes something else (unintended or not) to be defined
>instead ..etc.
-
Let me first say that this thread of discussion made me do my
homework. A search for the term 'autovivification' gave me the
following article at
http://www.mit.edu:8008/bloom-picayune.mit.edu/perl/10193 where
I found Randal Schwartz's comments pertinent to this discussion.
[Randal Schwartz's answer.. not mine.]
It is desirable. It keeps people from starting to talk about
$foo{bar}{quux}
and
$foo{bar}[35]
in the same program, since they cannot both exist. The
autovivification on $foo{$bar} establishes the necessary
ref on the first access, and we'll get a violation on the
second one. If you really wanna see if $foo{bar} exists,
ask that first. Otherwise, don't worry whether it's being
stuffed or not.
[ end of his answer]
- Makarand
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 04 Aug 1999 13:56:17 -0600
From: Greg Guerin <gregory_guerin@hp.com>
Subject: Change User & Export Dipslay
Message-Id: <37A89AE1.B9EF903A@hp.com>
I cannot seem to get my export DISPLAY command to work when running the
code below nor will the following code accept my unix 'su - user'
command. These two snippets are in separte scripts but they should be
enough to show the problem. Is there a module to handle these
environment and user issues? All suggestions are appreciated! Thanks.
Greg
mailto: gregory_guerin@hp.com
$cmd = 'export DISPLAY=machine_name:0';
system("$cmd"); # Doesn't Change the Display
exit 0;
$pid = open2(\*RDR, \*WTR, "/usr/bin/su - user);
die "Open2 failed: $!\n" unless ($pid =~ /^\d+$/);
while (<STDIN>) {
print WTR "password\n"; # Doesn't seem to receive the password being
sent here.
# It just hangs.
$line = <RDR>;
print STDOUT "$line";
}
exit 0;
------------------------------
Date: Wed, 4 Aug 1999 13:09:15 -0700
From: John Embow <jembow@learn2.com>
To: "comp.lang.perl.misc@list.deja.com" <comp.lang.perl.misc@list.deja.com>
Subject: chomp not working
Message-Id: <v0421010ab3ce4e69a13e@[206.169.190.24]>
Just learning Perl, each time i try to use chomp i get the following error:
""chomp" may clash with future reserved word at ./chomp_test line
3syntax error i
n file ./chomp_test at line 3, next 2 tokens "chomp("
Execution of ./chomp_test aborted due to compilation errors."
I'm using perl5.00502 on FreeBSD 2.2.8
Any explainations/ suggestions?
TIA, johnne
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 04 Aug 1999 15:38:08 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: chomp not working
Message-Id: <37A8A4B0.BFEBC8ED@texas.net>
John Embow wrote:
>
> Any explainations/ suggestions?
>
Yeah. Read the replies to your first post on the subject.
- Tom
------------------------------
Date: Wed, 04 Aug 1999 19:20:26 GMT
From: jfried@my-deja.com
Subject: embedding C in Perl?
Message-Id: <7oa3pd$s4q$1@nnrp1.deja.com>
Hi,
I need to find a way to make a C function call from within my
perlscript. Any suggestions would be appreciated.
Thanks,
Jess
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 04 Aug 1999 22:27:14 +0200
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: jfried@my-deja.com
Subject: Re: embedding C in Perl?
Message-Id: <37A8A222.E4757DE8@kawo2.rwth-aachen.de>
Hi Jess,
jfried@my-deja.com wrote:
> I need to find a way to make a C function call from within my
> perlscript. Any suggestions would be appreciated.
perldoc perlxs
Gruss
Alex
--
Ich studiere Elektrotechnik (Technische Informatik) an der RWTH Aachen
und bin ein guter Perl-Programmierer (arbeite seit 4 Jahren als Intranet-
Entwickler). Kann auch C, Java, SQL, JavaScript und HTML, CGI und TCP/IP.
Ich suche eine gut bezahlte Diplomstelle in Koeln, Aachen oder Umgebung.
------------------------------
Date: Wed, 04 Aug 1999 22:57:54 +0200
From: Thomas Schmickl <schmickl@magnet.at>
Subject: Get Executables path
Message-Id: <37A8A952.9D4B3D37@magnet.at>
How can I determine (In the _BEGIN_ of the script-execution)
in which directory the executet perl-script is ?
Ciao, thomas.
------------------------------
Date: Wed, 04 Aug 1999 20:16:29 +0100
From: Mark <Mark@Mark.Com>
Subject: Re: Help me .........please!!
Message-Id: <37A8918D.1B8DC7CC@Mark.Com>
hads6307@my-deja.com wrote:
while (1) snip;
You know, I thought that maybe the posters objecting to the rather terse
response of the perl gods to newbies questions maybe had a point. After
reading the second identical posting, I despair!
Where's me killfile?
------------------------------
Date: Wed, 4 Aug 1999 15:02:22 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: Help me.....Please!!!!!!!!!!!!!!!
Message-Id: <7oa317$vp8$1@nntp9.atl.mindspring.net>
hads6307@my-deja.com wrote in message <7oa0f1$pdm$1@nnrp1.deja.com>...
:Can somebody help me with this problem? I need to take input from a
:single textbox in a form and output the data into another frame.
Mike,
You have posted this question 5 times in the last two days. People
respond and then you just post again. STOP THAT.
You clearly have access to the CGI.pm module. Oddly, it comes with
an example named frameset.cgi that prints the contents of a filled out
form to a second frame. If for some reason you don't have a local copy
the script can be seen at:
http://stein.cshl.org/~lstein/
In the section on using frames with CGI.pm. This same documentation is
included with CGI.pm so reading it might clear up your problem.
Here is an excerpt:
-------
Support for Frames
CGI.pm contains support for HTML frames, a feature of Netscape 2.0 and
higher, and Internet Explorer 3.0 and higher. Frames are supported in
two ways:
You can direct the output of a script into a new window or into a
preexisting named frame by providing the name of the frame as a -target
argument in the header method. For example, the following code will pop
up a new window and display the script's output:
$query = new CGI;
print $query->header(-target=>'_blank');
You can provide the name of a new or preexisting frame in the
startform() and start_multipart_form() methods using the -target
parameter. When the form is submitted, the output will be redirected to
the indicated frame:
print $query->start_form(-target=>'result_frame');
Using frames effectively can be tricky. To create a proper frameset in
which the query and response are displayed side-by-side requires you to
divide the script into three functional sections. The first section
should create the <frameset> declaration and exit. The second section is
responsible for creating the query form and directing it into the one
frame. The third section is responsible for creating the response and
directing it into a different frame.
--------------
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
'Out, out brief candle!
Life's but a walking shadow,
a poor player, that struts and frets his hour upon the stage,
And then is heard no more; It is a tale, told by an idiot,
full of sound and fury, signifying nothing'
- MacBeth
------------------------------
Date: 4 Aug 1999 20:00:20 GMT
From: Christopher Allen <callen@boxcar.driver8.org>
Subject: Re: Help me.....Please!!!!!!!!!!!!!!!
Message-Id: <7oa64l$36d$1@news1.spacestar.net>
hads6307@my-deja.com wrote:
> somebody help with the framework below.
###
## Mike all data can be associated with variable or "name" you named it in the
## html form so if you named it name its going to come in as $name
##
###
#
# eq,ne for string operations, ==,!= for numeric operations
# simplesst case:
if ($name eq "bart") {
#do some stuff
}
#
if ($num != (42 * 16 *$prev_num) ) {
#do other
}
> #else print out ""
-out
------------------------------
Date: Wed, 4 Aug 1999 13:40:32 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: HELP: How to program command line args
Message-Id: <x3ypv13culu.fsf@tigre.matrox.com>
jarral@my-deja.com writes:
> I am fairly new to PERL and quite a competent Shell Scripter and in
> shell scripts you have $1 to $n for positional parameters on the command
> line, how is this done in PERL? I have had a look at the FAQ but to no
> avail and my PERL book (PERL from the Ground Up by Michael McMillan,
> Osbourne) doesn't seem to mention it.
Then throw your book away. The most complete and up-to-date docs (as
far as your version of Perl is concerned) you can find are surely the
ones sitting in your hard-disk somewhere:
% podgrep command line argument
/opt/GNUperl5.004_04/lib/pod/perlsec.pod:command line arguments, environment variables, locale information (see
/opt/GNUperl5.004_04/lib/pod/perlvar.pod:The array @ARGV contains the command line arguments intended for the
% perldoc perlvar
.....
.....
@ARGV The array @ARGV contains the command line arguments
intended for the script. Note that $#ARGV is the
generally number of arguments minus one, because
$ARGV[0] is the first argument, NOT the command
name. See "$0" for the command name.
In case you're wondering, 'podgrep' is an alias of mine:
alias podgrep 'grep "\!*" /opt/GNUperl5.004_04/lib/pod/*.pod'
You're a competent "shell scripter" .. you knew that one already :)
I also suggest you buy "Learning Perl" (aka The Llama book) by
R. Schwartz and T. Christiansen, published by O'Reilly.
HTH,
Ala
------------------------------
Date: Wed, 4 Aug 1999 15:01:57 -0500
From: "Sam Weatherhead" <sweather@fastenal.com>
Subject: Re: How to access only last field of a split ?
Message-Id: <7oa67v$635@enews3.newsguy.com>
Sorry, but I did not see any response underneath the original
post, so I assumed nobody had responded to the question.
Sam Weatherhead
Fastenal
Larry Rosler <lr@hpl.hp.com> wrote in message
news:MPG.12122122cd9a8c43989dbe@nntp.hpl.hp.com...
> In article <7o9sdl$c2@enews3.newsguy.com> on Wed, 4 Aug 1999 12:14:34 -
> 0500, Sam Weatherhead <sweather@fastenal.com> says...
> > If I'm understanding you right, when you do a split the results get
thrown
> > into an array.
> > If you then want to access only the last element of the array, just use
the
> > name of the
> > array but with a $# in front of it as the subscript.
> >
> > Example:
> >
> > $String = "1,2,3,4,5,6,7,8,9,10";
> > @Simple_Array = split( "," , $String );
> > $Last_Field = $Simple_Array[ $#Simple_Array ];
>
> You are about three days behind those who have already pointed out that
> you don't need to save the whole array -- just use the '-1' subscript.
>
> $String = "1,2,3,4,5,6,7,8,9,10";
> $Last_Field = (split /,/, $String)[-1];
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Laboratories
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
------------------------------
Date: Wed, 04 Aug 1999 17:01:26 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: how to substitute strings in a newly created file
Message-Id: <37A8AA26.6C865241@ccrs.nrcanDOTgc.ca>
I'm writing a script to make files of directory listings. However, I'd
like to strip the extensions off all files listed in the new file, but
can't seem to get the syntax correct:
#!/public/bin/perl -w
opendir FLTCOR, "fltcor" or die "can't open directory: $!";
@rsps = grep !/^\.\.?$/, readdir FLTCOR;
closedir FLTCOR;
open(RSP, ">rsp.list");
print RSP "@rsps";
while (<>)
{
s/.*txt.*//g; # extension to be removed is ".txt"
}
The script seems to run into infinity at this point, the file is
created, however.
Any ideas?
Thanks
..Tom
-----------------------------------------------------------------------------------------
Tom Kralidis Geo-Spatial Technologist
Canada Centre for Remote Sensing Tel: (613) 947-1828
588 Booth Street , Room 241 Fax: (613) 947-1408
Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
-----------------------------------------------------------------------------------------
------------------------------
Date: Wed, 04 Aug 1999 22:56:41 +0200
From: Thomas Schmickl <schmickl@magnet.at>
Subject: Inconsistancy between Perl's @INC and @ISA
Message-Id: <37A8A909.5033D465@magnet.at>
Hi
I am working with Perl/Tk where I wanted to derive a Widget
from a Widget that was derived form Tk::Frame. I post this in
this Newsgroup, because I think it's a normal Perl and not a Tk problem.
Say:
Tk resides in ..../perl/site/tk, my widget in .../myprog/class
My derived Wiget is in a module called DerivedWidget.pm, than I have
to specify in a "use" or a "require" statement something like
>use class::BaseWidget<
>use Tk::Frame<
BUT WHEN IT COMES TO DERIVE THE WIDGET FROM THE OTHER,
I have to say:
@ISA = qw/BaseWidget Tk::Frame/
(When I wrote class::BaseWidget, it didnt work.)
So why do I have to specify the subfolder in the use-statement but
I am not allowed to specify it in the @ISA array.
That leads me to the point, that the @INC and the @ISA array
are not implemented consistantly.
------------------------------
Date: Wed, 4 Aug 1999 12:41:46 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Jeoparder's Jest
Message-Id: <MPG.1212375410dcee4d989dc5@nntp.hpl.hp.com>
In article <x7iu6w17hc.fsf@number-two.aus.groogroo.com> on 03 Aug 1999
23:43:11 -0500, Matthew R. Williams <mrw@groogroo.com> says...
> Tom Christiansen <tchrist@mox.perl.com> writes:
>
> > # Now, what's the question? :-)
>
> Am I the only person in this newsgroup who has the distinct impression
> that Tom has snapped? That he's finally crossed into the great beyond
> from whence such concepts as "GNU/Linux" and "Python" originated? The
> land of the truly insane? Should we weave a circle around him thrice?
>
> So sorry...four questions.
>
> (Sidebar for the humor impaired: I'm having a great time watching Tom,
> and long ago created a killfile for Gnus that takes care of 30% of the
> traffic on this newsgroup...but I am worried that he let a prescription
> lapse, and am slightly worried that the Good Name of Perl will be
> tarnished by his harsh but deserved criticism towards...well...anything
> that moves.)
Yeah, yeah. Meanwhile, Tom, what's the question? Uri Guttman's
conjecture didn't quite satisfy me (but then, why would I expect it to?
:-).
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 4 Aug 1999 14:38:50 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Jeoparder's Jest
Message-Id: <37a8a4da@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
:Yeah, yeah. Meanwhile, Tom, what's the question?
Q: What's an interesting and idiosyncratically perlish way of
coping with the multiple possible return values from fork()?
:Uri Guttman's conjecture didn't quite satisfy me (but then, why would
:I expect it to? :-).
Who's that? :-)
--tom
--
If you take Fred Cohen's definition of virus, then Unix itself is
one of the most successful viruses ever written, since it tends to
result in the creation of modified versions of itself on other
computer systems! -- Gene Spafford
------------------------------
Date: 04 Aug 1999 16:43:46 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Jeoparder's Jest
Message-Id: <x7lnbri8e5.fsf@home.sysarch.com>
>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:
TC> [courtesy cc of this posting mailed to cited author]
TC> In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
TC> :Yeah, yeah. Meanwhile, Tom, what's the question?
TC> Q: What's an interesting and idiosyncratically perlish way of
TC> coping with the multiple possible return values from fork()?
TC> :Uri Guttman's conjecture didn't quite satisfy me (but then, why would
TC> :I expect it to? :-).
TC> Who's that? :-)
laugh at me will you! i will send out my minions of newbies and faq you
both to death!
and tom, i hate to inform you but we will have our names in the same
book, OOP due out within weeks. on the same page for all of eternity,
try to bounce that!
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: Wed, 04 Aug 1999 21:08:18 +0200
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: Perl King <perlking@hotmail.com>
Subject: Re: mySQL & Perl -> Something simple
Message-Id: <37A88FA2.1EDC7F2A@kawo2.rwth-aachen.de>
Hi,
Perl King wrote:
> ObPerl: Use the => operator only in hash initialization.
why?
Regards
Alex
--
Ich studiere Elektrotechnik (Technische Informatik) an der RWTH Aachen
und bin ein guter Perl-Programmierer (arbeite seit 4 Jahren als Intranet-
Entwickler). Kann auch C, Java, SQL, JavaScript und HTML, CGI und TCP/IP.
Ich suche eine gut bezahlte Diplomstelle in Koeln, Aachen oder Umgebung.
------------------------------
Date: Wed, 4 Aug 1999 12:31:24 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: mySQL & Perl -> Something simple
Message-Id: <MPG.121234e3993e8dba989dc4@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <19990804183220.21573.qmail@hotmail.com> on Wed, 04 Aug 1999
14:32:20 EDT, Perl King <perlking@hotmail.com> says...
> Larry Rosler wrote:
> >>Steve MacLellan <maclell@col.ca> says...
> >> > On Tue, 3 Aug 1999 18:27:23 -0700, lr@hpl.hp.com (Larry Rosler) wrote:
> >> >
> >> >This is off-topic, but the </TD>, </TH>, and </TR> tags are all
> >> >optional. So the </TD> there is just HTML noise.
> >>
> >>Yes, optional if you only want it to dsiplay in MSIE. If you want it
> >>to display in Netscape you have to close Table elements.
> >
> >Getting further off-topic, so I'll keep it brief.
> >
> >NO!
>
> Netscape advises authors to close the TR and TD containers. Some
> authors have had problems with tables within tables if they fail
> to comply with this advice.
I have never had such a problem, even with nested tables. Often I
transmit huge indivisible tables, and leaving off the closing tags saves
more than 20% in transmission times. (When they get big enough, I
format them with <PRE> and tabs, and save considerably more.) But
'weblint' complains bitterly.
It is amusing to hear that Netscape advises authors to do something that
is explicitly optional in the HTML spec. Just another case of the
browser manufacturers playing fast and loose with the implementation of
the spec to suit their own purposes, whatever they may be.
> Some older browsers (that don't support tables) will give up
> or even crash (with stack overflow) if you don't close those containers. So
> there can be advantages in not omitting those optional tags.
That's a different story. But all my apps require table-supporting
browsers. And my users know how to get free upgrades for older
browsers.
> ObPerl: Use the => operator only in hash initialization.
That must be in reference to a question that I posed in
comp.lang.perl.moderated a couple of weeks ago. Needless to say, I
disagree completely.
> Perl King
Chacun ā son goût. Or, Perl King, as the Burger King says, 'Have It
Your Way!'
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 04 Aug 1999 16:44:28 EDT
From: "Perl King" <perlking@hotmail.com>
Subject: Re: mySQL & Perl -- Something simple
Message-Id: <19990804204428.54651.qmail@hotmail.com>
Alex Farber <alex@kawo2.rwth-aachen.de>
>Hi,
>
>Perl King wrote:
> > ObPerl: Use the => operator only in hash initialization.
>
>why?
=> ist entsprechen-zum Bediener. Es soll nicht als "phantastisches
Komma" verwendet werden und kann Fehler verursachen, wenn Sie auf diese
Weise verwendet werden:
open PW => '/etc/passwd'; # Vorausgehenproblem!
An gängige Praxis und verwenden an passen sich => Bediener nur in
der Durcheinander-initialisierung.
Perl König
_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com
------------------------------
Date: Wed, 04 Aug 1999 21:24:33 +0200
From: "S.L. de Vries" <devries-devries@wxs.nl>
Subject: New Supply and Demand Page
Message-Id: <37A89371.DC5B6E25@wxs.nl>
--------------FE23F0486B751C7471C09662
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
Finally,
The new Supply and Demand Page is done.
You can request your own category.
There aren't much messages now, but please submit your own.
It always begins with nothing, but I hope there will be much soon.
Enjoy the page at:
http://www.mediaport.org/~vtcsd/discus
--------------FE23F0486B751C7471C09662
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<b>Hi,</b><b></b>
<p><b>Finally,</b>
<br><b>The new Supply and Demand Page is done.</b>
<br><b>You can request your own category.</b>
<br><b>There aren't much messages now, but please submit your own.</b>
<br><b>It always begins with nothing, but I hope there will be much soon.</b>
<br><b>Enjoy the page at:</b>
<br><b><A HREF="http://www.mediaport.org/~vtcsd/discus">http://www.mediaport.org/~vtcsd/discus</A></b>
<br><b></b>
<br><b></b>
<br><b></b>
<br><b></b>
<br><b></b> </html>
--------------FE23F0486B751C7471C09662--
------------------------------
Date: Wed, 04 Aug 1999 22:36:57 +0200
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: "S.L. de Vries" <devries-devries@wxs.nl>
Subject: Re: New Supply and Demand Page
Message-Id: <37A8A469.B5FBDEA2@kawo2.rwth-aachen.de>
Hi guys,
"S.L. de Vries" wrote:
> Hi,
> Finally,
> The new Supply and Demand Page is done.
> You can request your own category.
> There aren't much messages now, but please submit your own.
> It always begins with nothing, but I hope there will be much soon.
> Enjoy the page at:
> http://www.mediaport.org/~vtcsd/discus
finally! Here is a seldom opportunity to strike back - let's go to his
crappy message board and fill it with SPAM, as he does with newsgroups.
Regards
Alex
--
Ich studiere Elektrotechnik (Technische Informatik) an der RWTH Aachen
und bin ein guter Perl-Programmierer (arbeite seit 4 Jahren als Intranet-
Entwickler). Kann auch C, Java, SQL, JavaScript und HTML, CGI und TCP/IP.
Ich suche eine gut bezahlte Diplomstelle in Koeln, Aachen oder Umgebung.
------------------------------
Date: Wed, 4 Aug 1999 14:02:33 +0200
From: "Mosl Roland" <founder@pege.org>
Subject: Re: perl problem with associative array
Message-Id: <7oa7mn$943$2@orudios.magnet.at>
<superba77@my-deja.com> wrote in message news:7o67n1$2im$1@nnrp1.deja.com...
> Hi people!
>
> Though I am a newbie in perl I hope someone will help me anyway ;-)
>
> - I've created an associative array:
>
> %thumbswidth =
> ("up1",64,"up88",68,"up87",80,"up85",52,"up79",72,"up75",72,"up63",128,"
> up52",56,"up4",76,"up34",64,"up21",104,"up17",52,"up14",48,"up13",128,"u
> p10",72);
my $element;
foreach $element ( keys %thumbswidth )
{
}
But You will have problems with the sort order :-)
Why to make all the work with this,
why not take a subroutine to actual find out the
size of each picture?
With some 100 pictures, You shure will make failures
with the size.
--
Mosl Roland - http://www.pege.org
clear targets for a confused civilization
------------------------------
Date: Wed, 04 Aug 1999 22:25:04 +0000
From: YANG Tong <ytong@club-internet.fr>
Subject: Perl vs HTML
Message-Id: <37A8BDC0.EC693C6B@club-internet.fr>
Hi,
Just a question: with HTML we can write *crazy* code... And with Perl
I must manipulate all this HTML particularities...
So how can I do, if I want someting like :
$ch=" <A HREF=/toto/titi.html ></A> ";
$ch=~s/(^.*?href\s*=\s*)("|'|)(.*?)(\1|\s|>)(.*$)/$1$2hello.html$4$5/i;
In fact I want to recup the link (/toto/titi.html); treat it and replace
it ! The problem is the symbol " or ' or nothing ...
Thanks.
------------------------------
Date: Wed, 04 Aug 1999 22:30:17 +0200
From: Alex Farber <alex@kawo2.rwth-aachen.de>
To: YANG Tong <ytong@club-internet.fr>
Subject: Re: Perl vs HTML
Message-Id: <37A8A2D9.234B53D0@kawo2.rwth-aachen.de>
Hi Tong,
YANG Tong wrote:
> The problem is the symbol " or ' or nothing ...
["']?
Regards
Alex
--
Ich studiere Elektrotechnik (Technische Informatik) an der RWTH Aachen
und bin ein guter Perl-Programmierer (arbeite seit 4 Jahren als Intranet-
Entwickler). Kann auch C, Java, SQL, JavaScript und HTML, CGI und TCP/IP.
Ich suche eine gut bezahlte Diplomstelle in Koeln, Aachen oder Umgebung.
------------------------------
Date: Wed, 04 Aug 1999 19:57:33 GMT
From: mujali@my-deja.com
Subject: Perl/SSI hacking
Message-Id: <7oa5v6$tts$1@nnrp1.deja.com>
Hello all,
Anyone out there willing to take a shot at this? I would really
appreciate any hints. Here in an index.shtml (SSI-enabled) file:
<HTML>
<HEAD><TITLE></TITLE></HEAD>
<BODY>
<!--#SET VAR="IMAGE_PROTECTION_CODE" VALUE="43@3!ERT" -->
<IMG SRC="/cgi-bin/test.pl">
</BODY>
</HTML>
Here is test.pl:
#!/usr/local/bin/perl
print "Content-type: image/gif\n\n";
# ---- Debug code ----
open (TEMP, ">temp.txt");
while (($key, $val) = each %ENV) {
print TEMP "$key = $val<BR>\n";
}
close TEMP;
# --------------------
if ($ENV{'IMAGE_PROTECTION_CODE'} eq "43\@3!ERT") {
open (IMAGE, "can't_get_me.gif") or die "$!";
}
else {
open (IMAGE, "dummy.gif") or die "$!";
}
print <IMAGE>;
close IMAGE;
Problem is that the Perl script can't access the variable set by the SSI
SET command in the index.shtml file becuase it has a different
environment space (at least that's my thinking). If I had called the
script using an SSI INCLUDE or EXEC command, it would have no problem
seeing $ENV{'IMAGE_PROTECTION_CODE'}. Basically, is there any hack I can
employ to get this variable from mod_include through the Perl script? (I
hope that makes sense.) Or, is there a better way to do this?
The purpose of this setup is of course to implement rudimentary image
"protection". I am just doing this as an exercise. I understand someone
could still get the image from their cache, etc. Thanks for any help.
- Mujtaba Ali
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 369
*************************************