[6720] in Perl-Users-Digest
Perl-Users Digest, Issue: 346 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 22 17:18:18 1997
Date: Tue, 22 Apr 97 14:01:37 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 22 Apr 1997 Volume: 8 Number: 346
Today's topics:
SECURITY ALERT: Patch for Perl 5.003 root access bug (Chip Salzenberg)
Re: Shadow password probleme with Perl 5.003 on Solaris <rootbeer@teleport.com>
Re: sorting hashes on values (Tad McClellan)
Split and IF / ELSE statements (Dico Reyers)
Re: Substitute (David Alan Black)
Re: Who will win? Borland or Microsoft or Programmers? hbaecker@island.net
Why perl/TK hardly mentioned in Camel Book? (Dave Ripberger)
Re: Why perl/TK hardly mentioned in Camel Book? (Nathan V. Patwardhan)
win32 perl <emperor@jhu.edu>
Re: win32 perl (Nathan V. Patwardhan)
Windows Programming <fxrsg@Camelot.acf-lab.alaska.edu>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Apr 1997 20:33:12 GMT
From: chip@rio.atlantic.net (Chip Salzenberg)
Subject: SECURITY ALERT: Patch for Perl 5.003 root access bug
Message-Id: <5jj7a8$rkh$1@nadine.teleport.com>
This is an URGENT SECURITY WARNING AND PATCH for Perl 5.003.
If you have Perl 5.003 installed with the setuid-script emulation
feature, your system is vulnerable to an attack that can yield
superuser access to the attacker. Any user with an account on the
system can take advantage of this vulnerability.
To determine if your system is vulnerable, look for a program named
"sperl5.003" that is setuid root, probably installed in /usr/bin or
/usr/local/bin. If you have that program:
Disable setuid Perl scripts by turning off the setuid bit on
"sperl5.003". This action closes the security hole.
If you would like to keep using setuid Perl scripts with Perl 5.003,
then you must get fixed Perl binaries from your vendor, or else fix
Perl yourself by following these steps:
1. Go to your Perl 5.003 source directory, or else obtain a fresh
Perl 5.003 distribution from:
http://www.perl.com/CPAN/src/5.0/perl5.003.tar.gz
This file is approximately 1.5 megabytes in size.
2. Using the "patch" program, apply the patch that is enclosed below.
3. Build and install the patched Perl 5.003. (If you have never
built Perl before, be sure to read the "INSTALL" file first.)
Perl 5.003 binaries that have had this patch applied, and which are
therefore safe from all known attacks, can be identified by the output
of the "perl -v" command: the "locally applied patches" list will
include "SUIDBUF - Buffer overflow fixes for suidperl security".
Patch follows.
--------------------------------------------------------------------------
Index: patchlevel.h
***************
*** 41,42 ****
--- 41,43 ----
+ ,"SUIDBUF - Buffer overflow fixes for suidperl security"
,NULL
};
Index: perl.c
*************** char *s;
*** 1212,1216 ****
# endif
#endif
! fputs("\n\t+ suidperl security patch", stdout);
fputs("\n\nCopyright 1987-1996, Larry Wall\n",stdout);
#ifdef MSDOS
--- 1212,1216 ----
# endif
#endif
! fputs("\n\t+ two suidperl security patches", stdout);
fputs("\n\nCopyright 1987-1996, Larry Wall\n",stdout);
#ifdef MSDOS
Index: gv.c
*************** gv_fetchfile(name)
*** 59,67 ****
char *name;
{
! char tmpbuf[1200];
GV *gv;
! sprintf(tmpbuf,"::_<%s", name);
gv = gv_fetchpv(tmpbuf, TRUE, SVt_PVGV);
sv_setpv(GvSV(gv), name);
if (*name == '/' && (instr(name,"/lib/") || instr(name,".pm")))
--- 59,78 ----
char *name;
{
! char smallbuf[256];
! char *tmpbuf;
! STRLEN tmplen;
GV *gv;
! tmplen = strlen(name) + 2;
! if (tmplen < sizeof smallbuf)
! tmpbuf = smallbuf;
! else
! New(603, tmpbuf, tmplen + 1, char);
! tmpbuf[0] = '_';
! tmpbuf[1] = '<';
! strcpy(tmpbuf + 2, name);
gv = gv_fetchpv(tmpbuf, TRUE, SVt_PVGV);
+ if (tmpbuf != smallbuf)
+ Safefree(tmpbuf);
sv_setpv(GvSV(gv), name);
if (*name == '/' && (instr(name,"/lib/") || instr(name,".pm")))
Index: toke.c
*************** static char *scan_const _((char *start))
*** 22,26 ****
static char *scan_formline _((char *s));
static char *scan_heredoc _((char *s));
! static char *scan_ident _((char *s, char *send, char *dest, I32 ck_uni));
static char *scan_inputsymbol _((char *start));
static char *scan_pat _((char *start));
--- 22,27 ----
static char *scan_formline _((char *s));
static char *scan_heredoc _((char *s));
! static char *scan_ident _((char *s, char *send, char *dest, STRLEN destlen,
! I32 ck_uni));
static char *scan_inputsymbol _((char *start));
static char *scan_pat _((char *start));
*************** static char *scan_str _((char *start));
*** 28,32 ****
static char *scan_subst _((char *start));
static char *scan_trans _((char *start));
! static char *scan_word _((char *s, char *dest, int allow_package, STRLEN *slp));
static char *skipspace _((char *s));
static void checkcomma _((char *s, char *name, char *what));
--- 29,34 ----
static char *scan_subst _((char *start));
static char *scan_trans _((char *start));
! static char *scan_word _((char *s, char *dest, STRLEN destlen,
! int allow_package, STRLEN *slp));
static char *skipspace _((char *s));
static void checkcomma _((char *s, char *name, char *what));
*************** static char * filter_gets _((SV *sv, FIL
*** 47,50 ****
--- 49,54 ----
static void restore_rsfp _((void *f));
+ static char too_long[] = "Identifier too long";
+
/* The following are arranged oddly so that the guard on the switch statement
* can get by with a single comparison (if the compiler is smart enough).
*************** int allow_tick;
*** 475,479 ****
(allow_tick && *s == '\'') )
{
! s = scan_word(s, tokenbuf, allow_pack, &len);
if (check_keyword && keyword(tokenbuf, len))
return start;
--- 479,483 ----
(allow_tick && *s == '\'') )
{
! s = scan_word(s, tokenbuf, sizeof tokenbuf, allow_pack, &len);
if (check_keyword && keyword(tokenbuf, len))
return start;
*************** register char *s;
*** 847,851 ****
unsigned char un_char = 0, last_un_char;
char *send = strchr(s,']');
! char tmpbuf[512];
if (!send) /* has to be an expression */
--- 851,855 ----
unsigned char un_char = 0, last_un_char;
char *send = strchr(s,']');
! char tmpbuf[sizeof tokenbuf * 4];
if (!send) /* has to be an expression */
*************** register char *s;
*** 872,876 ****
weight -= seen[un_char] * 10;
if (isALNUM(s[1])) {
! scan_ident(s,send,tmpbuf,FALSE);
if ((int)strlen(tmpbuf) > 1 && gv_fetchpv(tmpbuf,FALSE, SVt_PV))
weight -= 100;
--- 876,880 ----
weight -= seen[un_char] * 10;
if (isALNUM(s[1])) {
! scan_ident(s, send, tmpbuf, sizeof tmpbuf, FALSE);
if ((int)strlen(tmpbuf) > 1 && gv_fetchpv(tmpbuf,FALSE, SVt_PV))
weight -= 100;
*************** GV *gv;
*** 942,946 ****
{
char *s = start + (*start == '$');
! char tmpbuf[1024];
STRLEN len;
GV* indirgv;
--- 946,950 ----
{
char *s = start + (*start == '$');
! char tmpbuf[sizeof tokenbuf];
STRLEN len;
GV* indirgv;
*************** GV *gv;
*** 952,956 ****
gv = 0;
}
! s = scan_word(s, tmpbuf, TRUE, &len);
if (*start == '$') {
if (gv || last_lop_op == OP_PRINT || isUPPER(*tokenbuf))
--- 956,960 ----
gv = 0;
}
! s = scan_word(s, tmpbuf, sizeof tmpbuf, TRUE, &len);
if (*start == '$') {
if (gv || last_lop_op == OP_PRINT || isUPPER(*tokenbuf))
*************** yylex()
*** 1629,1633 ****
case '*':
if (expect != XOPERATOR) {
! s = scan_ident(s, bufend, tokenbuf, TRUE);
expect = XOPERATOR;
force_ident(tokenbuf, '*');
--- 1633,1637 ----
case '*':
if (expect != XOPERATOR) {
! s = scan_ident(s, bufend, tokenbuf, sizeof tokenbuf, TRUE);
expect = XOPERATOR;
force_ident(tokenbuf, '*');
*************** yylex()
*** 1645,1649 ****
case '%':
if (expect != XOPERATOR) {
! s = scan_ident(s, bufend, tokenbuf + 1, TRUE);
if (tokenbuf[1]) {
expect = XOPERATOR;
--- 1649,1653 ----
case '%':
if (expect != XOPERATOR) {
! s = scan_ident(s, bufend, tokenbuf + 1, sizeof tokenbuf - 1, TRUE);
if (tokenbuf[1]) {
expect = XOPERATOR;
*************** yylex()
*** 1748,1752 ****
s++;
if (s < bufend && isALPHA(*s)) {
! d = scan_word(s, tokenbuf, FALSE, &len);
while (d < bufend && (*d == ' ' || *d == '\t'))
d++;
--- 1752,1756 ----
s++;
if (s < bufend && isALPHA(*s)) {
! d = scan_word(s, tokenbuf, sizeof tokenbuf, FALSE, &len);
while (d < bufend && (*d == ' ' || *d == '\t'))
d++;
*************** yylex()
*** 1847,1851 ****
}
! s = scan_ident(s-1, bufend, tokenbuf, TRUE);
if (*tokenbuf) {
expect = XOPERATOR;
--- 1851,1855 ----
}
! s = scan_ident(s - 1, bufend, tokenbuf, sizeof tokenbuf, TRUE);
if (*tokenbuf) {
expect = XOPERATOR;
*************** yylex()
*** 1956,1960 ****
case '$':
if (s[1] == '#' && (isALPHA(s[2]) || strchr("_{$:", s[2]))) {
! s = scan_ident(s+1, bufend, tokenbuf+1, FALSE);
if (expect == XOPERATOR) {
if (lex_formbrack && lex_brackets == lex_formbrack) {
--- 1960,1965 ----
case '$':
if (s[1] == '#' && (isALPHA(s[2]) || strchr("_{$:", s[2]))) {
! s = scan_ident(s + 1, bufend, tokenbuf + 1, sizeof tokenbuf - 1,
! FALSE);
if (expect == XOPERATOR) {
if (lex_formbrack && lex_brackets == lex_formbrack) {
*************** yylex()
*** 1982,1986 ****
TOKEN(DOLSHARP);
}
! s = scan_ident(s, bufend, tokenbuf+1, FALSE);
if (expect == XOPERATOR) {
if (lex_formbrack && lex_brackets == lex_formbrack) {
--- 1987,1991 ----
TOKEN(DOLSHARP);
}
! s = scan_ident(s, bufend, tokenbuf + 1, sizeof tokenbuf - 1, FALSE);
if (expect == XOPERATOR) {
if (lex_formbrack && lex_brackets == lex_formbrack) {
*************** yylex()
*** 2016,2024 ****
if (*s == '{' && strEQ(tokenbuf, "$SIG") &&
(t = strchr(s,'}')) && (t = strchr(t,'='))) {
! char tmpbuf[1024];
STRLEN len;
for (t++; isSPACE(*t); t++) ;
if (isIDFIRST(*t)) {
! t = scan_word(t, tmpbuf, TRUE, &len);
if (*t != '(' && perl_get_cv(tmpbuf, FALSE))
warn("You need to quote \"%s\"", tmpbuf);
--- 2021,2029 ----
if (*s == '{' && strEQ(tokenbuf, "$SIG") &&
(t = strchr(s,'}')) && (t = strchr(t,'='))) {
! char tmpbuf[sizeof tokenbuf];
STRLEN len;
for (t++; isSPACE(*t); t++) ;
if (isIDFIRST(*t)) {
! t = scan_word(t, tmpbuf, sizeof tmpbuf, TRUE, &len);
if (*t != '(' && perl_get_cv(tmpbuf, FALSE))
warn("You need to quote \"%s\"", tmpbuf);
*************** yylex()
*** 2093,2097 ****
case '@':
! s = scan_ident(s, bufend, tokenbuf+1, FALSE);
if (expect == XOPERATOR)
no_op("Array",s);
--- 2098,2102 ----
case '@':
! s = scan_ident(s, bufend, tokenbuf + 1, sizeof tokenbuf - 1, FALSE);
if (expect == XOPERATOR)
no_op("Array",s);
*************** yylex()
*** 2129,2133 ****
: !GvHV(gv) )))
{
! char tmpbuf[1024];
sprintf(tmpbuf, "Literal @%s now requires backslash",tokenbuf+1);
yyerror(tmpbuf);
--- 2134,2138 ----
: !GvHV(gv) )))
{
! char tmpbuf[sizeof tokenbuf + 40];
sprintf(tmpbuf, "Literal @%s now requires backslash",tokenbuf+1);
yyerror(tmpbuf);
*************** yylex()
*** 2293,2297 ****
keylookup:
bufptr = s;
! s = scan_word(s, tokenbuf, FALSE, &len);
if (*s == ':' && s[1] == ':' && strNE(tokenbuf, "CORE"))
--- 2298,2302 ----
keylookup:
bufptr = s;
! s = scan_word(s, tokenbuf, sizeof tokenbuf, FALSE, &len);
if (*s == ':' && s[1] == ':' && strNE(tokenbuf, "CORE"))
*************** yylex()
*** 2338,2342 ****
if (*s == '\'' || *s == ':' && s[1] == ':') {
! s = scan_word(s, tokenbuf + len, TRUE, &len);
if (!len)
croak("Bad name after %s::", tokenbuf);
--- 2343,2348 ----
if (*s == '\'' || *s == ':' && s[1] == ':') {
! s = scan_word(s, tokenbuf + len, sizeof tokenbuf - len,
! TRUE, &len);
if (!len)
croak("Bad name after %s::", tokenbuf);
*************** yylex()
*** 2557,2561 ****
s += 2;
d = s;
! s = scan_word(s, tokenbuf, FALSE, &len);
tmp = keyword(tokenbuf, len);
if (tmp < 0)
--- 2563,2567 ----
s += 2;
d = s;
! s = scan_word(s, tokenbuf, sizeof tokenbuf, FALSE, &len);
tmp = keyword(tokenbuf, len);
if (tmp < 0)
*************** yylex()
*** 3244,3250 ****
if (isIDFIRST(*s) || *s == '\'' || *s == ':') {
! char tmpbuf[128];
expect = XBLOCK;
! d = scan_word(s, tmpbuf, TRUE, &len);
if (strchr(tmpbuf, ':'))
sv_setpv(subname, tmpbuf);
--- 3250,3256 ----
if (isIDFIRST(*s) || *s == '\'' || *s == ':') {
! char tmpbuf[sizeof tokenbuf];
expect = XBLOCK;
! d = scan_word(s, tmpbuf, sizeof tmpbuf, TRUE, &len);
if (strchr(tmpbuf, ':'))
sv_setpv(subname, tmpbuf);
*************** char *what;
*** 4091,4102 ****
static char *
! scan_word(s, dest, allow_package, slp)
register char *s;
char *dest;
int allow_package;
STRLEN *slp;
{
register char *d = dest;
for (;;) {
if (isALNUM(*s))
*d++ = *s++;
--- 4097,4112 ----
static char *
! scan_word(s, dest, destlen, allow_package, slp)
register char *s;
char *dest;
+ STRLEN destlen;
int allow_package;
STRLEN *slp;
{
register char *d = dest;
+ register char *e = d + destlen - 3; /* two-character token, ending NUL */
for (;;) {
+ if (d >= e)
+ croak(too_long);
if (isALNUM(*s))
*d++ = *s++;
*************** STRLEN *slp;
*** 4119,4129 ****
static char *
! scan_ident(s,send,dest,ck_uni)
register char *s;
register char *send;
char *dest;
I32 ck_uni;
{
register char *d;
char *bracket = 0;
char funny = *s++;
--- 4129,4141 ----
static char *
! scan_ident(s, send, dest, destlen, ck_uni)
register char *s;
register char *send;
char *dest;
+ STRLEN destlen;
I32 ck_uni;
{
register char *d;
+ register char *e;
char *bracket = 0;
char funny = *s++;
*************** I32 ck_uni;
*** 4134,4143 ****
s = skipspace(s);
d = dest;
if (isDIGIT(*s)) {
! while (isDIGIT(*s))
*d++ = *s++;
}
else {
for (;;) {
if (isALNUM(*s))
*d++ = *s++;
--- 4146,4161 ----
s = skipspace(s);
d = dest;
+ e = d + destlen - 3; /* two-character token, ending NUL */
if (isDIGIT(*s)) {
! while (isDIGIT(*s)) {
! if (d >= e)
! croak(too_long);
*d++ = *s++;
+ }
}
else {
for (;;) {
+ if (d >= e)
+ croak(too_long);
if (isALNUM(*s))
*d++ = *s++;
--------------------------------------------------------------------------
End of patch.
-----BEGIN PGP MESSAGE-----
Version: 2.6.3
owHNWVuIJNd5lnDy0A0htjFE5CH827urvtXMdFV3z3TP7Co72h2NBo1mxnNZWews
TXXV6e5yV1e16lR3b0taHAVkbAx+s0GPCYKEgB+CIBiD7bzZxhY2JL4EkocEIkKw
n3Ixxkb4/8+p6qq+zuzu7Eot7W7VqXP+81++/3bOl5/62if+8Kni6atX3vnRX778
/2/90atPP53+/B889f0PP/mrv/jiX31w+Qvvv9f/zbsf/OTn//PrhHHv7fXc/r9/
8O5///KZ37Uv//N7e1/d/Kc/Hnyl95+bhR9e+eDHnzn582/a3y4cfutP7n/vb/70
xv8O3Lf/49Jfv/WPpf3Oz679tFD+v3c+/Yv/+t3rOzee+bMv5f72zt9/+IPf/vxD
++tXPnXjX//h/Ve+c/iO/XdXwWn920+++y/fWN2qf+qAeXZ5uVAoLh2d7Nx6/uSF
p/B33LI44P+6AyeH21t7x3C0dfPkcOf4VXhl83BvZ28bNvduwcHm8c0XoeF6QFRA
kFlOJncaMHR70NL7LPYBLIf7um0zEwaW3wK/xYAzv2eZS9zwrK4PrNOzdd9ynWSD
6X7PYwrR8YAPuc86xE+/ZzvM0+s2A98l7nTf14020tJ9MPB9aDHbTPJel3k9zjzQ
DYNxTpNpOzmbecsAm84QxAzBC1EyDLfn+OA6NDUZ7Ek0fb2NS82+7vh6k4HbwAkx
Xizb8oco9bELJvOZ17EcBlZjPusK2K7bFmrToeu5TU/vgKN3mJlM8W5ojpQUCldK
JYHnur5C8+tIZBjTpuXASo97K3V8cL2keLZdQ7dpBEWNm0PQDPZcTyYB4JbFhT6D
XYS9pD041IeAZnAsp4lSN2IWg7pFmqL1cZZxM4Ec3SArgmG7nPFgmdHz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BIvLWzvXMcO58ODpjjH2ZCVNK4H/zLbGzDRIwZ
jzjRPuOIT0yHHLW0inKsRmdPZ8shtTzLkRMP4sfnVkR0XBl3dpHtZnj6lMry8mT7
TL3lp/fIL9jjbP2Sgi/ol0xuOSZgIu7qvtFaTv4e
=+iaW
-----END PGP MESSAGE-----
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"Vacation time. Families travel east, west, north, or south."
"Some just burrow straight down." -- Crow T. Robot // MST3K
------------------------------
Date: Fri, 18 Apr 1997 09:59:19 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jean-Francois Weber <jfweber@if.insa-lyon.fr>
Subject: Re: Shadow password probleme with Perl 5.003 on Solaris 2.5
Message-Id: <Pine.GSO.3.96.970418095821.17228N-100000@kelly.teleport.com>
On Wed, 16 Apr 1997, Jean-Francois Weber wrote:
> I'd compiled Perl 5.003 on a Solaris 2.5 box.
> When I use the getpwuid function, I get the password filed of my
> /etc/passwd, not the field in /etc/shadow as said in the faq.
Perl gets the info from your system's underlying getpwuid function, so if
that's not doing what you want you'll have to fix that function. Hope this
helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Tue, 22 Apr 1997 09:58:03 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: sorting hashes on values
Message-Id: <rljij5.kb2.ln@localhost>
Hans Suijkerbuijk (Hans.Suijkerbuijk@SD.BE) wrote:
: specs: I'm using Perl 5.001 on NT 4.0.
: My problem:
: I get an undefined number of hashes as results of a query. (each hash is
^^^^^^^^^^^^^^^^^^^^^^^^^^
I think you meant "unknown number of hash elements" here?
^^^^^^^ ^^^^^^^^
A hash is an associative array (they start with a %). Do you really mean
what you said?
eg:
%a_hash
%another_hash
%yet_another_hash
...
: a record) In each hash i have three keys: code, title and a score. I
^^^^^^^^^^^^^^^^^
A hash has only one key. Do you mean you have three hashes or that
the key is composed of three fields? Or do you mean that the _value_,
rather than the key has three fields?
: want to collect the hashes (in a hash or in an array?) and then sort the
: collection of hashes according to the (integer) value of the key score
: before displaying the collection. How do I do this (i experimented a lot
^^^^
Your explanation still leaves me wondering what "this" is ;-)
Could you try again to explain what it is you want?
Some sample data, and desired output would be a wonderfully unambiguous
way to describe what you want...
: with sort-stuff, but nothing worked)?
If you really want to "sort on values", then see the Perl FAQ (part 4):
=head2 How do I sort a hash (optionally by value instead of key)?
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Tue, 22 Apr 1997 19:17:33 GMT
From: dico@peionline.com (Dico Reyers)
Subject: Split and IF / ELSE statements
Message-Id: <335d0c37.3426594@news1.pei.sympatico.ca>
Hello there.
I am writing a little program that reads information from a file like
$line = <FILENAME>; then while that doesn't equal "" it is supposed
to split them @item = split (/:/, $line); ... ok so far? (I will
list the code below)... Now this is where the problem is.... (by the
way... the file that it is reading the information from simply looks
like....
1:23
32:21
11:14
88:33
etc.... )
I would think that $item[0] would equal 1 in the first case and
$item[1] would equal 23. Then as it repeats through the while look it
should change as the lines change.
I want to put an IF statement in there...
if ($item[0] eq "1") { then do this}
elsif ($item[0[ eq "2") {then do something else};
bla bla bla
This doesn't work.... can someone looks the code below and perhaps
tell me why?
if (open (SCART, "$path$cart_value"))
{
$line = <SCART>;
if ($line ne "") { print "<center><table
width='98%'><tr bgcolor='bbbb99'><td>\n";
print "Product Number</td><td>Quantity</td><td>Price</td></tr>\n";
$x = 1;
while ($line ne "")
{
@item = split(/:/, $line);
if ($item[0] eq "1") { print "Item one\n"; }
elsif ($item[0] eq "2") { print "Hello there...\n";
else { print "Who cares\n"; }
print"<tr><td>$item[0]</td><td>$item[1]</td><td>$itemprice</td></tr>\n";
$line = <SCART>;
}
};
if ($x = 1) { print "</td></tr></table></center>\n";
};
}
else {
print "It didn't open the cart";
};
Now... it will print "ITEM ONE" "HELLO THERE" and "WHO CARES"
regardless of whether the statement is true.... why is that? And it
will repeat saying it many times.....
Any help would be appreciated.
If you could email the responsed to
dico@peionline.com
Thanks in Advance,
Dico
------------------------------
Date: 22 Apr 1997 20:15:58 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Substitute
Message-Id: <5jj69u$t2i@pirate.shu.edu>
Eli the Bearded <usenet-tag@qz.little-neck.ny.us> writes:
>David Alan Black <dblack@icarus.shu.edu> wrote:
>>"Markus Kaiser" <mak@dfki.uni-sb.de> writes:
>>>Hi *,
>" *" doesn't match my name. Did you leave a '.' out?
I can't speak for Markus, but I rather assumed it was a
shell glob :-)
>>>can anyone tell me how to do the following substitution:
>>>original: %Test%
>>>result: content of variable $Test.
>Personally I would substitute a $ in and then do an eval.
>>> isn't working. Any elegant solutions are welcome 8^)
>>Elegant solutions-are-us :-)
>>
>>$orig =~ s/%(.*?)%/$$1/g;
>".*?" is not elegant in my book. "[^%]*" is much better.
>For multibyte boundry conditions, back references and a few other
>nasty cases, the non-greedy modifier is better, but for a case like
>this the proper greedy condition will be faster and more portable.
(Yes, I'm one of the lazy people that Jeffrey Friedl talks about
in connection with .* :-)
Come to think of it, since it's supposed to be a valid variable
identifier, \w* might be a good idea.
David Black
dblack@icarus.shu.edu
------------------------------
Date: Tue, 22 Apr 1997 17:30:45 GMT
From: hbaecker@island.net
Subject: Re: Who will win? Borland or Microsoft or Programmers?
Message-Id: <335cea64.2861257@news.van.hookup.net>
On Sun, 20 Apr 1997 11:15:29 -0500, Mark Bracey
<mbracey@interaccess.com> wrote:
>hbaecker@island.net wrote:
>
>> Borland Delphi 2 is incredibly difficult to use.
>
>
>You are kidding...right?
No, I assure you I am not, when compared to Borland Pascal 7 with OWL,
or Tcl/Tk. Delphi is a complex hazard, with incomplete helpfiles
(activate a link and often the dialog telling you to see your vendor
(Borland in my case) for a complete Helpfile appears. And its another
of those "feature rich" messes.
Harry
------------------------------
Date: Tue, 22 Apr 1997 17:45:29 GMT
From: dlrip@one.net (Dave Ripberger)
Subject: Why perl/TK hardly mentioned in Camel Book?
Message-Id: <335cf820.759832@news.one.net>
Nothing about TK in the index, though I haven't completed the book
yet. I also see very few posts and zero responses in
comp.lang.perl.tk. What gives? Is tcl/tk still the "choice" of perl
programmers?
Thanks,
Dave Ripberger
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, add ber
| to username in reply to address.
|________
------------------------------
Date: 22 Apr 1997 18:43:25 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Why perl/TK hardly mentioned in Camel Book?
Message-Id: <5jj0sd$807@fridge-nf0.shore.net>
Dave Ripberger (dlrip@one.net) wrote:
: Nothing about TK in the index, though I haven't completed the book
: yet. I also see very few posts and zero responses in
: comp.lang.perl.tk. What gives? Is tcl/tk still the "choice" of perl
: programmers?
pTk is only Unix-related, and although mentioned in a number of
Unix-centric books, is useless to those not using Unix. I've heard that
there will be a pTk book in the works, but I'm not sure if / when it
will be released. You might check out the pTk FAQ and the excellent
documentation that is included with the package; I'd also found success
looking at the Tcl/Tk book for information (RE: how GUIs are constructed,
etc), but this may or may not be applicable to your needs.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Tue, 22 Apr 1997 12:56:10 -0400
From: Samuel Carliles <emperor@jhu.edu>
Subject: win32 perl
Message-Id: <335CEDAA.3326@jhu.edu>
anyone know how to change drives in perl for win32?
--
samuel carliles
ihsahn@hops.cs.jhu.edu
------------------------------
Date: 22 Apr 1997 19:21:05 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: win32 perl
Message-Id: <5jj331$b8b@fridge-nf0.shore.net>
Samuel Carliles (emperor@jhu.edu) wrote:
: anyone know how to change drives in perl for win32?
You mean like:
$c_drive = 'C:/';
$d_drive = 'D:/';
opendir(C, $c_drive) || die("c drive error: $!");
while($entry = readdir(C)) {
print $entry,"\n";
}
closedir(C);
???
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Tue, 22 Apr 1997 10:39:19 -0800
From: "Richard S. Guse" <fxrsg@Camelot.acf-lab.alaska.edu>
Subject: Windows Programming
Message-Id: <335D05D7.2366@Camelot.acf-lab.alaska.edu>
Does anyone out there use Perl for windows ('95) programming?
Or do you use programs like visual c & visual basic?
Also, for developing perl programs on an ibm (Win '95), what
do people use? I have borlandc on my computer, which has a wonderful
front-end, but I haven't seen anything for perl yet. It seems I need
to edit it in a separate editor, and run it in a different shell.
BorlandC fixes this by having buttons for compiling & running and
opens its own shell when (if) its done. Also, when you examine an
error, it will show you where in the code the error originated. Kinda
nice!
Any suggestions for me? thanks, ->r
------------------------------
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 346
*************************************