[7911] in Perl-Users-Digest
Perl-Users Digest, Issue: 1536 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 26 05:08:25 1997
Date: Fri, 26 Dec 97 02:00:27 -0800
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, 26 Dec 1997 Volume: 8 Number: 1536
Today's topics:
Re: Automatically POST (brian d foy)
capturing strings (blacktape)
Re: capturing strings (Tushar Samant)
Re: client server encription decryption <rootbeer@teleport.com>
Re: Date parsing (T Kohl)
Free Software for Engineering Websites (Michael Rocchetti)
Re: Hashes and reverse-lookup <rootbeer@teleport.com>
Re: Help: uniq utility <bholzman@earthlink.net>
Re: How to pad a variable to make the output look prett <adavid@netinfo.com.au>
IO redirection in Perl: possible? <robpang@cs.stanford.edu>
Re: Perl compiler mstan@NOSPAAM.flash.net
Re: Perl editor needed (Gilles Maire)
Re: perl for Win32 question (David Feustel)
Re: server misconfig <rootbeer@teleport.com>
setuid question <pomarede@isty-info.uvsq.fr>
Re: Substitute variables when reading file <rootbeer@teleport.com>
Re: SVD(singular value decomposition) (sean broderick)
Re: Unit/NT Integration Issues (Tad McClellan)
Website Pro 2.0 and perl <SWIFTWR@worldnet.att.net>
Re: Website Pro 2.0 and perl <rootbeer@teleport.com>
What is LWP standing for? <antoniolam@usa.net>
Re: Which language pays most 17457 -- C++ vs. Java? (Kurt Watzka)
Re: Which language pays most 17457 -- C++ vs. Java? (Kurt Watzka)
Re: Works from Telnet, not SSI #Exec... <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 25 Dec 1997 17:10:27 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Automatically POST
Message-Id: <comdog-ya02408000R2512971710270001@news.panix.com>
Keywords: from just another new york perl hacker
In article <Ix1$sFAo9no0Ew7d@worsdall.demon.co.uk>, Mark Worsdall <shadowweb@worsdall.demon.co.uk> wrote:
>In article <67t3e5$o7m$1@postern.mbnet.mb.ca>, Sunny Bhuller
><psx001@autobahn.mb.ca> writes
>>I was in need of whipping together some code in
>>preferably perl which will basically assign values
>>to variables and then automatically posting it to a
>>DLL using <FORM METHOD "POST etc... etc.. to
>>a specific ACTION without having the user manually
>>press a submit button?
>You can't unless SSI or calling script as an image like a gif or jpg,
>ofcourse this will not work if user has images turned off.
"can't" is a rather strong word. perhaps you meant that in the
first person since it is not true in general. :)
--
brian d foy <comdog@computerdog.com>
Institute For the Organically-Challenged
<URL:http://computerdog.com/brian/Institute.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 25 Dec 1997 22:05:22 GMT
From: mocat@NOSPAM.best.com (blacktape)
Subject: capturing strings
Message-Id: <34a2d796.20532630@nntp.best.com>
i'm making a perl script to clean up messy and extrenious html,
everything works how i want it to, i just need help with one thing.
i want to capture <img*> tags and put them into a variable, then have
it read the image name, put that into another variable, then replace
the <img*> text with something like <img alt="image.jpg"
src="image.jpg">.
more simply put, i want the "alt" to reflect the "src" image name.
how would i go about doing this? i haven't the slightest idea.
i'm a newbie, so bear with me... and regexps _aren't_ my stong point
;)
thanks for any help...
-j
the dumber a person is, the longer it will take for them to find out that you're killing them
------------------------------
Date: 25 Dec 1997 21:16:30 -0600
From: scribble@tekka.wwa.com (Tushar Samant)
Subject: Re: capturing strings
Message-Id: <67v7ie$bqr@tekka.wwa.com>
mocat@nospam.best.com writes:
>more simply put, i want the "alt" to reflect the "src" image name.
Use HTML::TreeBuilder. (This one looks gross but at least it's a
one-liner...)
#!/usr/local/bin/perl -MHTML::TreeBuilder
print HTML::TreeBuilder
->new
->parse_file(\*STDIN)
->traverse(
sub {
my($node) = @_;
$node->attr("alt", $node->attr("src"))
if ref($node) and $node->tag eq "img";
1;
}
)
->as_HTML;
------------------------------
Date: Thu, 25 Dec 1997 18:01:33 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Miten S Mehta <mehta@mama.indstate.edu>
Subject: Re: client server encription decryption
Message-Id: <Pine.GSO.3.96.971225175921.18165N-100000@user2.teleport.com>
On Wed, 24 Dec 1997, Miten S Mehta wrote:
> how do I have the perl cgi drop cookies as the applet communicates via
> post with urlconnection object?
It sounds as if you need to accept some input, probably using a protocol,
and then print some output, probably using a similar protocol. If you have
questions on how to implement a particular protocol, you may need to read
its specification. If you have questions on how to do I/O in Perl, and if
you can't find the answers you need in the Perl docs, please post again.
Thanks!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 25 Dec 1997 02:34:01 GMT
From: tkohl@csc.albany.edu (T Kohl)
Subject: Re: Date parsing
Message-Id: <67sgmp$ip7@maenad.csc.albany.edu>
In article <o8nd8ioouj8.fsf@ebony.cray.com>,
Justin Banks <justinb@ebony.cray.com> wrote:
>Hello -
> Does one of the modules enable me to find the number of
>business days between two dates? I've looked at Date::DateCalc,
>and it doesn't appear to do what I want, but before I roll my own,
>I figured I'd make sure someone else hadn't already done so
>(apparently I possess at least one of the programmer's virtues).
>
>-justinb
>
>--
>Justin Banks \ if the answer is the same whether you're programming
>Silicon Graphics \ in Perl, C, or Visual Modula 17++ with JavaBeans and
>Eagan, Minnesota \ Digital Satellite TV Support, it's not a Perl question.
Hello!
I'm not sure if this is exactly what you want but you could
modify it for your purpose. The enclosed script (dategen)
generates all the dates between two dates specified on the command line
in a given year.
BTW I wrote this script yesterday for generating reports from
the access log of an NCSA server. - Hope it helps.
Usage:
dategen 01/Jan/1997 06/Jan/1997
(which returns)
01/Jan/1997
02/Jan/1997
03/Jan/1997
04/Jan/1997
05/Jan/1997
06/Jan/1997
******************************************************************
* Timothy Kohl *
* State University of New York at Albany *
* Assistant Mananging Editor - New York Journal of Mathematics *
* http://nyjm.albany.edu:8000 *
* tkohl@math.albany.edu *
* ------------------------------------------------------------- *
* "If I were to bequeth to every young man one virtue of quality *
* I would give him the spirit of divine discontent, for without *
* it the world would stand still." - Charles P. Steinmetz *
******************************************************************
#!/usr/local/bin/perl
@months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug",
"Sep","Oct","Nov","Dec");
@days = (31,28,31,30,31,30,31,31,30,31,30,31);
$start_date = $ARGV[0];$end_date = $ARGV[1];
($end_day,$end_month,$end_year)=split(/\//,$end_date);
($start_day,$start_month,$start_year)=split(/\//,$start_date);
$year=$start_year;$month=$start_month;$day=$start_day;
$leap = $year % 4;
($leap == 0) && ($days[1]=29);
for($i=0;$i<=11;$i++){
($months[$i] eq $month) && ($mkey=$i);
($months[$i] eq $end_month) && ($end_mkey=$i);
}
for($m=$mkey;$m<=$end_mkey;$m++){
while($day <= $days[$m]){
($day =~ /\b\d\b/) && ($day = "0".$day);
$month = $months[$m];
if($m == $end_mkey){
($day <= $end_day) && (print "$day/$month/$year\n");
}else{
print "$day/$month/$year\n";
}
$day++;
}
$day = 1;
}
#Tue Dec 23 11:53:07 EST 1997
------------------------------
Date: 26 Dec 1997 03:54:54 GMT
From: miker@miracle.net (Michael Rocchetti)
Subject: Free Software for Engineering Websites
Message-Id: <67v9qe$is6@bellboy.ucc.uconn.edu>
I have three programs which I am releasing to the public domain under the GNU
General Public License. They are PERL CGI scripts which are designed for use
on the world wide web. You are free to use these programs for commercial or
non-commercial use as outlined in the GPL.
The programs are:
1. The Fluid Flow Calculator: This program calculates pipe friction losses.
2. The Engineering Units Conversion Calculator: This program converts energy,
pressure, density, specific volume, enthalpy, entropy, etc.
3. The Engineering Economics Calculator: This program calculates loan
payments.
The programs can be downloaded from the following website:
http://www.connel.com/freeware
Merry Christmas to all - and to all a good night!
Mike Rocchetti
25 DEC 97
------------------------------
Date: Thu, 25 Dec 1997 18:21:10 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Josh Kortbein <kortbein@iastate.edu>
Subject: Re: Hashes and reverse-lookup
Message-Id: <Pine.GSO.3.96.971225181517.18165Q-100000@user2.teleport.com>
On 24 Dec 1997, Josh Kortbein wrote:
> I've tried both a normal array and an associative array for my
> dictionary/string table, but neither seems to do what I want. The
> problem I've encountered is that I need to be able to lookup elements
> both by key and by value,
I think your table needs to map small integers to strings - is that right?
In that case, you could probably keep an array for the forward mapping and
a hash for the reverse. Whenever you add an element, you'll want to add it
to both, maybe something like this.
$newstring = 'str';
$rev{$newstring} = @fwd; # add number to hash
push @fwd, $newstring; # add string to array
Now, you can find the index for 'str' by evaluating $rev{'str'}. If you
look under that index in @fwd, you'll get 'foo'.
Of course, if you're doing data compression, you may be able to use a
module. :-) Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 26 Dec 1997 00:46:07 -0500
From: Benjamin Holzman <bholzman@earthlink.net>
To: Tushar Samant <scribble@tekka.wwa.com>
Subject: Re: Help: uniq utility
Message-Id: <34A3449F.C36F8F13@earthlink.net>
Tushar Samant wrote:
>
> bholzman@earthlink.net writes:
> >use strict;
> >
> >my %values;
> >
> >map {$values{$_}++} <>;
> >
> >while (my($val, $cnt) = each %values) {
> > print "$val\n";
> > # You also get the count of each value in $cnt...
> >}
>
> But this is very different from what Unix uniq does.
> uniq is much simpler, something like this:
>
> #input in @data, output in @uniq --
>
> $curr = shift @data;
> @uniq = ($current);
>
> for $line (@data) {
> if ($line ne $curr) {
> push @uniq, $line;
> $curr = $line;
> }
> }
Ah, yes. Thanks for the reminder. Sorry for the confusion.
------------------------------
Date: Fri, 26 Dec 1997 18:21:13 +1100
From: Anthony David <adavid@netinfo.com.au>
Subject: Re: How to pad a variable to make the output look pretty ;p
Message-Id: <Pine.LNX.3.96.971226181251.821B-100000@adavid>
On Wed, 24 Dec 1997, Nihon wrote:
> Here's my question:
>
> How do I read how many characters are in a variable and make sure that I pad
>the variable with spaces at the end to make the total amount of
> characters equal 25 if the amount of characters is less than 25?
> Otherwise, the table in the email looks awful.
>
> I scanned thru the FAQ index, but I didn't see anything that seemed to
> address this problem. Of course, the FAQ is _rather_ large.... ;p
>
> Thanks for the help!
>
The secret is the printf function
e.g.
my $str = "fluff";
printf "%-25s is padded right up to 25 chars\n",$str;
Check out man pages on the C printf function for more info.
Regards Anthony
--
Did you know why Santa can deliver presents even when a
house has no chimney? He now has a teleport device that
uses Christmas trees for homing beacons.
------------------------------
Date: Thu, 25 Dec 1997 19:35:36 -0800
From: "Robert Pang" <robpang@cs.stanford.edu>
Subject: IO redirection in Perl: possible?
Message-Id: <67v8ri$bsh@masters0.InterNex.Net>
Hi folks,
I want to do IO redirection in Perl. This is something that I want to do:
package Redirect;
@ISA = qw(IO::Handle);
sub new {
my $class = shift;
return $class->SUPER::new();
}
sub print {
print STDOUT "Foo: ";
print STDOUT @_;
}
and then in my main package:
$mystdout = Redirect->new();
STDOUT = $mystdout; <-- changing my STDOUT to my own package
so that in everywhere in my program, when I try to print to standard out,
the output will be redirected to my package with "Foo" prepended to
every line. Of course, I am trying to more sophisticated than this
but this is just a simplified case to illustrate what I kind of IO
redirection
I want to do. In Java, you can easily reset System.out to another
PrintStream as long as you have the permission to do so. Is such a thing
possible to do so in Perl? I tried a few cases and I cannot get it to
work. Any idea?
Thanks.
Robert
------------------------------
Date: Fri, 26 Dec 1997 07:07:52 GMT
From: mstan@NOSPAAM.flash.net
Subject: Re: Perl compiler
Message-Id: <34a2bfe5.33702654@209.30.0.7>
On Tue, 23 Dec 1997 15:00:54 GMT,
NightLight@webcity.nl.WEGSPAM!!!!!! (Jeroen Kustermans) wrote:
>Hm, I tested it, and it works perfect (except that
>NON-perl-developer-like message at the bottom of each compiled
>script).
>I looked to the sizes of the compiled versions.
>I compiled 2 scripts with a size of 16KB and 32KB.
>When you look to the sizes of the executables, it seems that the
>executable-size is the sum of standart 570KB and the original
>script-size.
>
>If you look to the original perl-interpreter, you see:
>PERL.DLL is 561KB and PERL.EXE is 8KB = +/- 570KB
>
>So, my opinion is, that this perl-compiler is a simple trick of
a kind
>of C-project with the perl-compiler and the script included.
>
>Can anybody make a same program which is for free?
>
AFAIK, this program simply combines all the header libraries, the
script itself, and any header libraries into a single file and
executes perl.exe internally. Running a quick binary search on
the executable turns up all kinds of interesting strings, such as
"Copyright", "Microsoft",and "Activeware". This particular
program is a start in the right direction (even with a minimum
file size of ~500k), but it does not warrant a commercial
product. A hint to the folks at Demobuilder---Perl has come as
far as it has in large part to the fact that it is FREE. Hacking
someone else's executable and calling it your own seems just a
little on the shady side to me.
------------------------------
Date: Thu, 25 Dec 1997 21:30:50 GMT
From: Gilles.Maire@ungi.com (Gilles Maire)
Subject: Re: Perl editor needed
Message-Id: <34a39aca.30724532@news.imaginet.fr>
On 22 Dec 1997 20:01:07 GMT, scott@softbase.com wrote:
>Perl editors under Windows ...
>
>Multi-edit,
>
>PFE
>Emacs
And don't forget e! that is the best one but unfortunaly not the most
known..
Amicalement
Gilles.Maire@ungi.com
|||||||||||||||||||||||||||||| - UNGI - ||||||||||||||||||||||||||||||
http://www.ungi.com
------------------------------
Date: 25 Dec 1997 22:37:47 GMT
From: feustel@ix.netcom.com (David Feustel)
Subject: Re: perl for Win32 question
Message-Id: <67un7r$pmj@dfw-ixnews8.ix.netcom.com>
Try Snobol4 ( http://www.snobol4.com )
In article <349A3701.158F@mch.sni.de>, Harald.Joerg@mch.sni.de says...
>
>Tim Dudek wrote:
>>
>> You will often need to re-write scripts when porting from win32 to
>> UNIX. There are
>> so many differences between the two versions of perl that cause a great
>> many problems.
>
>I can't agree.
>I did not find any other programming language that was that easily
>portable from Win3.11 (Ilya's OS2 port) to Win95 (Activeware and GSAR)
>to different flavours of UNIX and back. So far I never had to change
>anything in my perl scripts (besides library paths for my own modules).
>I still use some of my scripts which I wrote under MS-DOS/Perl 4.036.
>
--
David Feustel mailto:feustel@ix.netcom.com
tel: 219-483-1857 http://www.netcom.com/~feustel
------------------------------
Date: Thu, 25 Dec 1997 17:50:59 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Barbara Riviezzo <sflower@cyberportal.net>
Subject: Re: server misconfig
Message-Id: <Pine.GSO.3.96.971225175032.18165K-100000@user2.teleport.com>
On Tue, 23 Dec 1997, Barbara Riviezzo wrote:
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN. Hope this helps!
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 26 Dec 1997 10:38:41 +0100
From: Nicolas Pomarede <pomarede@isty-info.uvsq.fr>
Subject: setuid question
Message-Id: <34A37B21.62C3C0CA@isty-info.uvsq.fr>
Hello,
I have a script which is used to connect to some distant
machine using a modem. This script needs to be run as root,
so when you login root and run it, it works perfectly.
But I'd like to make it easier to use for anyone, so I put
a setuid bit. But now, it complains when started :
Insecure dependency in `` while running setuid at
/etc/ppp/nconnect.pl.ttyC1 line 206.
where line 206 looks like :
$res = `nslookup $Dest`;
I tried to set $PATH correctly, but it didn't work.
note that $Dest come from $ARGV[ 1 ], so perhaps it's why it
doesn't work ?
I didn't find any real solution in the perl security man page,
so if you have any clue, please send it to me.
Thanks in advance
----
Nicolas Pomare
pomarede@isty-info.uvsq.fr
------------------------------
Date: Thu, 25 Dec 1997 18:28:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: brian d foy <comdog@computerdog.com>
Subject: Re: Substitute variables when reading file
Message-Id: <Pine.GSO.3.96.971225182637.18165R-100000@user2.teleport.com>
On Thu, 25 Dec 1997, brian d foy wrote:
> In article <883022885.754122753@dejanews.com>, neal@valinet.com wrote:
>
> >I have a Perl program which opens up a text file, and in this text file
> >there are $variables. How can I get Perl to map these
> >$variables without explicity mapping each one.
>
> sounds like you want eval().
>
> #!/usr/bin/perl -w
> use strict;
>
> my $city = q|new york|; #it's not just mine though
> my $text = q|just another $city perl hacker|;
>
> #see the perlfunc man page or the blue camel for details
> eval( "\$text = qq|$text|" );
>
> print "$text\n";
I hate seeing eval used for this sort of thing, especially when there's no
warning about how bad this can be for security and reliability. For
example, this doesn't work right if the $text contains vertical-bar
characters. And if the $text was read in from an unsafe file watch out!
I prefer to use a module like Text::Template, or to make similar,
well-defined, substitutions.
Cheers!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 26 Dec 1997 00:04:33 GMT
From: creepy@!domain.com (sean broderick)
Subject: Re: SVD(singular value decomposition)
Message-Id: <creepy-2512971905090001@10.0.2.15>
mr. yoon:
sorry to waste group bandwidth, but i think <perl.misc> is one of the
least likely places you will find numerical methods programming. that
said...
-- "advanced perl programming" explicitly demonstrates how references are
used to create matrix data structures.
-- or you might prefer to weave existing c routines into a perl program.
(* the above options assume you require a custom application, otherwise,
specialized software such as matlab or mathematica will be a better choice
for getting quick results *)
sincerely,
sean broderick
once an engineer, always...
no spam please: <luser: direwolf & server/domain: world.std.com>
------------------------------
Date: Thu, 25 Dec 1997 18:42:12 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Unit/NT Integration Issues
Message-Id: <4huu76.t22.ln@localhost>
cb101@aolqpdbi1.com wrote:
: Programmers confronting Unix/NT integration issues may receive
: a complimentary White Paper on the subject by replying to
: unixnt-info@freeyellow.com
This is from a bulk emailer and spammer.
Beware volunteering your email address to them...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 26 Dec 1997 00:51:11 GMT
From: "William R. Swift" <SWIFTWR@worldnet.att.net>
Subject: Website Pro 2.0 and perl
Message-Id: <67uv1v$147@bgtnsc03.worldnet.att.net>
I have installed perl 32 ver 5.003 onto my nt server. I installed it into
the directory c:\website\wsdocs\perl5. I have associated the file
correctly .pl to perl.exe in that directory. Perl put the correct paths
into the registery. When I attempt to run a script locally it works with
no problems. When I attempt to access the script through a browser it
gives me the error of file not found or is not executable. If I rename or
remove the file I get an error that the file is not found. There fore I
believe that the error resides in permissions, or something. My nt is
formated in fat32 not NTFS, so i can't set the permissions to individual
files. I would appreciate any help that can be given to me. I don't have
the opportunity to get on the news groups as much as I woul like, so if
anyone has any ideas would you please email them to me? ken@mtns.net
thank you,
Kenneth Swift
ken@mtns.net
------------------------------
Date: Thu, 25 Dec 1997 18:34:05 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "William R. Swift" <SWIFTWR@worldnet.att.net>
Subject: Re: Website Pro 2.0 and perl
Message-Id: <Pine.GSO.3.96.971225183337.18165T-100000@user2.teleport.com>
On 26 Dec 1997, William R. Swift wrote:
> When I attempt to run a script locally it works with
> no problems. When I attempt to access the script through a browser it
> gives me the error of file not found or is not executable.
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN. Hope this helps!
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 26 Dec 1997 05:22:12 +0800
From: "Antonio Lam" <antoniolam@usa.net>
Subject: What is LWP standing for?
Message-Id: <67uj5n$3ck$1@imsp009a.netvigator.com>
As Title
Thank a lot.
------------------------------
Date: 25 Dec 1997 19:35:03 GMT
From: watzka@stat.uni-muenchen.de (Kurt Watzka)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <67uch7$jhu$1@sparcserver.lrz-muenchen.de>
John Porter <jdporter@min.net> writes:
>Lawrence Kirby wrote:
>>
>> Aren't the standard library identifiers with external linkage reserved
>> even in a freestandinhg environment?
>With the possible exception of environments for embedded development,
>the identifiers defined in the standard or any other library are not
>reserved words.
Would you mind telling the ISO about this observation of yours, so
that the language definition can be adapted to your views? They erronously
claim the identifiers of functions defined in the library clause as
reserved words for identifiers with external linkage.
>If I don't include string.h, I am free to use the
>id 'memcpy' for my own purposes.
No, since memcpy is not listed as an identifier with file scope. Only
for identifiers with file scope that do _not_ have external linkage
the reservation is limited to compilation units that include one of
the associated headers.
Even if I do link with a library which
>defines memcpy, my definition overrides it.
No, the behaviour of such a program is undefined. I see no other possible
interpretation of "If the program declares or defines an identifier with
the same name as an identifier reserved in that context (*) the behaviour
is undefined.
(*) denotes a cross reference that says: Provided that a library function
can be declared without reference to any type defined in a header, it is
also permissible to declare the function, either explicitly or implicitly,
and use it without including its associated header.
I'm not sure how you can
>construe this to mean that 'memcpy' is in any way "reserved".
I'm not sure how you can think that it is not reserved after reading this
thread. The question is whether it is reserved in a freestanding environment,
and the answer from the language definition is "no, it is not", as far as
I understand the language definition. In a hosted environment, it is
reserved through rather explicit verbiage in the language definition,
and the behaviour of programs using reserved identifiers in a context
in which they are reserved, is _explicitly declared undefined.
Kurt
--
| Kurt Watzka Phone : +49-89-2178-2781
| watzka@stat.uni-muenchen.de
------------------------------
Date: 25 Dec 1997 19:44:53 GMT
From: watzka@stat.uni-muenchen.de (Kurt Watzka)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <67ud3l$k0c$1@sparcserver.lrz-muenchen.de>
John Porter <jdporter@min.net> writes:
>Lawrence Kirby wrote:
>>
>> Your opinion is wrong because it contradicts fact.
>Ooh, "You have an opinion, by *I* know the *truth*!"
No, he just knows the definition of the C programming language. As
far as discussions about the C programming language are concerned
however, this is as much truth as there can be.
>> The standard library is an integral part of the
>> language *definition*.
>Well, if this is your definition of "language definition".
Well, if you can come up with a better meaning for "language definition
for C" than the specific international standard that defines the C
programming language, let us hear about it.
>I think the more traditional definition is the syntax and grammar
>specifications, along with indications as to the semantics. Thus,
>'if', 'switch', braces and commas are part of the C language definition,
>but 'main' and '#include' are not.
Unfortunately, the language definition (i.e. the international standard
that specifies the form and establishes the interpretation of programs
written in the C programming language, which i will call "language
definition" as long as you don't come up with a more meaningful explanatory
term for "language definition") makes "#include" part of the language,
as well as main() if we are talking about a hosted environment.
Kurt
--
| Kurt Watzka Phone : +49-89-2178-2781
| watzka@stat.uni-muenchen.de
------------------------------
Date: Thu, 25 Dec 1997 17:55:47 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Joel <joel@microworld.com>
Subject: Re: Works from Telnet, not SSI #Exec...
Message-Id: <Pine.GSO.3.96.971225175519.18165M-100000@user2.teleport.com>
On Tue, 23 Dec 1997, Joel wrote:
> It works under Windows 95 from the command line. It also works from the
> server if I telnet in and run it from the command line. If I run it
> from a <!--#exec--> metatag, however, it will read the data file, output
> to STDOUT, but will not output to a log file... Any ideas?
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN. Hope this helps!
http://www.perl.com/CPAN/
http://www.perl.org/CPAN/
http://www.perl.org/CPAN/doc/FAQs/cgi/idiots-guide.html
http://www.perl.org/CPAN/doc/manual/html/pod/
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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 V8 Issue 1536
**************************************