[16250] in Perl-Users-Digest
Perl-Users Digest, Issue: 3662 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 14 03:10:28 2000
Date: Fri, 14 Jul 2000 00:10:20 -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: <963558619-v9-i3662@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 14 Jul 2000 Volume: 9 Number: 3662
Today's topics:
Re: String length? <o1technospam@skyenet.nospam.net>
Re: String length? <o1technospam@skyenet.nospam.net>
Re: String length? (Craig Berry)
strings and symbol refs and strict - oh my! <nnickee@nnickee.com>
Re: strings and symbol refs and strict - oh my! <uri@sysarch.com>
Re: strings and symbol refs and strict - oh my! (jason)
Re: strings and symbol refs and strict - oh my! <nnickee@nnickee.com>
Re: strings and symbol refs and strict - oh my! <wyzelli@yahoo.com>
Re: strings and symbol refs and strict - oh my! <uri@sysarch.com>
Re: strings and symbol refs and strict - oh my! <nnickee@nnickee.com>
Re: strings and symbol refs and strict - oh my! <nnickee@nnickee.com>
Re: The problem of two Submit buttons (Philip Lees)
Re: UDP / ICMP checksum generation - 1's complement sum <wizard_oz@gmx.net>
Upper-to-lower case problem (Alan Page)
Re: Upper-to-lower case problem (jason)
Re: Upper-to-lower case problem (Alan Page)
Re: Upper-to-lower case problem (jason)
Re: Upper-to-lower case problem (jason)
Re: Upper-to-lower case problem (Tad McClellan)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 14 Jul 2000 01:45:56 -0500
From: "Jim Kauzlarich" <o1technospam@skyenet.nospam.net>
Subject: Re: String length?
Message-Id: <Bzyb5.892$RX5.2612@newsfeed.slurp.net>
"Tad McClellan" <tadmc@metronet.com> wrote in message
news:slrn8mseeq.c0u.tadmc@magna.metronet.com...
> On Thu, 13 Jul 2000 16:43:12 -0500, Jim Kauzlarich
<o1technospam@skyenet.nospam.net> wrote:
> >"Craig Berry" <cberry@cinenet.net> wrote in message
> >news:sms11e6qnd629@corp.supernews.com...
> >> Jim Kauzlarich (o1technospam@skyenet.nospam.net) wrote:
> >> s/\@/\$/
> >
> >Regular expression I assume? I haven't really delved into them yet. Is
> >that a substitution?
>
>
> Yes.
>
> But it is a substitution that _you_ (not perl) should make.
>
> Instead of saying "change the @ to a $" in English, we tend
> to say the same thing in Perl instead.
>
>
> i.e. if ( $_[$count] ne "" ) {
> ^
> ^ scalar, not array slice as you have above
Sorry, don't know what you mean here. (I've really got to quit reading this
stuff at the end of the day. But I've convinced my ISP that I know enough
to try to troubleshoot dail-up connections over the phone =] , and after
work I stick around and enjoy the fast internet connection and the shell
access to my website.) I understand that regular expressions are a powerful
part of Perl, but I learn best (when studying on my own) by going where my
obsesion leads. I'm only just curious about regular expressions, but I'm
still pushing down other aveniues (sp). I'm going to have to look into them
soon though.
> >I'm a bit surprised that no one snapped at my mis-attempt at using
strict.
> >"use strict();" I'd been up for about 20 hours, and when I attempted to
add
> >strict. It came back with the following err that I'm still not sure what
> >means (mee tawk gud englush, eh?)
>
>
> Are you sure?
About which part?
And no, by the way. I'm not. :)
> All of the messages that perl might issue (and even some that are
> NOT issued by perl) are documented in the perldiag.pod standard doc.
>
> perldoc perldiag
Cool.
> ---------------------
> =item Global symbol "%s" requires explicit package name
>
> (F) You've said "use strict vars", which indicates that all variables
> must either be lexically scoped (using "my"), declared beforehand using
> "our", or explicitly qualified to say which package the global variable
> is in (using "::").
> ---------------------
I eventually did figure out the "my" stuff.
> >What is an "explicit package name"?
> It is the name of the package that contains the 'x'.
> If it was complaining about $x, then strict wants you to
> give the package name as well as the variable name:
>
> $main::x; # the $x variable in the 'main' package
>
> $MyPackage::x; # the $x variable in the 'MyPackage' package
Ahh. Cool beans. That looks right. Also that makes other stuff that I've
seen (mostly in "Perl in a Nutshell") make more sence now. Not
comprehension yet, but the fog is lightening.
> type:
>
> perldoc perlmod
>
> and see the "Packages" section.
Ok. Is a perldoc question off topic? I'm gonna admit it. Every time I try
to use perldoc I can't seem to scroll through it the way it seems I should.
And when I type in 'perldoc -h' I don't get a lot of help on the subject.
What do I type to get a list of the commands to scroll through and search
perldoc? And I have tried 'perldoc perldoc'. Sorry, I'm not familliar with
(the way things are done in) UNIX at all.
Well, ok. I'm more familliar than I was a month ago. ;)
> >I also
> >don't understand why I didn't get an error when I put "use strict()" at
the
> >top of my program.
> Probably because it is not a (syntax) error!
> You can supply a LIST to "use".
>
> It lists the things that you want to use.
>
> If the list is empty, you are saying that you don't want to use
> any of it.
dat splainz it.
> Please do not quote .sigs. It is bad netiquette.
No problemo.
Tanx, and l8r
JMK
[Please note the lack of a trailing quoted signature. ;-) ]
------------------------------
Date: Fri, 14 Jul 2000 01:51:45 -0500
From: "Jim Kauzlarich" <o1technospam@skyenet.nospam.net>
Subject: Re: String length?
Message-Id: <1Fyb5.894$RX5.1415@newsfeed.slurp.net>
"Jim Kauzlarich" <o1technospam@skyenet.nospam.net> wrote in message
news:Bzyb5.892
> > i.e. if ( $_[$count] ne "" ) {
> > ^
> > ^ scalar, not array slice as you have above
>
> Sorry, don't know what you mean here. (I've really got to quit reading
this
Wahhh! I understand what your saying. Sometimes the brain-farts win you
know. But it seems to me that when I have tried to access scalars in this
manner that I got unexpeted results. I'll have to experiment some more.
JMK
------------------------------
Date: Fri, 14 Jul 2000 07:00:49 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: String length?
Message-Id: <smtel1icnd6138@corp.supernews.com>
Jim Kauzlarich (o1technospam@skyenet.nospam.net) wrote:
: > : if ( @_[$count] ne "" ) {
: >
: > s/\@/\$/
:
: Regular expression I assume? I haven't really delved into them yet. Is
: that a substitution?
Yes it is. It was my shorthand way of saying that your @_ should be $_;
as written, it's an array slice. And you should get up to speed on at
least simple regexes soon; they're at the core of Perl.
: I'm a bit surprised that no one snapped at my mis-attempt at using strict.
: "use strict();" I'd been up for about 20 hours, and when I attempted to add
: strict. It came back with the following err that I'm still not sure what
: means (mee tawk gud englush, eh?)
:
: Global symbol "x" requires explicit package name at count3.cgi line 22.
:
: What is an "explicit package name"?
This just means that you used a variable name without either explicitly
declaring it as global (with 'use vars', or 'our' under 5.6) or making it
lexical with a 'my' declaration. The somewhat misleading error means that
Perl wouldn't complain about the undeclared global if it were given an
explicit package qualifier, like '$main::x'. See the discussion on
packages in the Camel book.
: I figured that I'd added in strict incorrectly, and changed it. I also
: don't understand why I didn't get an error when I put "use strict()" at the
Strict can take an argument list, to determine what kinds of strictness
you want. This was just interpreted as an empty list, indicating that you
want full strictness.
--
| Craig Berry - http://www.cinenet.net/users/cberry/home.html
--*-- "Beauty and strength, leaping laughter and delicious
| languor, force and fire, are of us." - Liber AL II:20
------------------------------
Date: Thu, 13 Jul 2000 23:20:48 -0500
From: Nnickee <nnickee@nnickee.com>
Subject: strings and symbol refs and strict - oh my!
Message-Id: <EE816C7B9D45FBCA.7BD7DEDB9E47EEA8.47936D926C9159A0@lp.airnews.net>
I'm trying to get in the habit of using strict, and I've done
something stupid (again :) I know this is in the docs, but I can't
seem to get a grasp on it.
#!perl -w
use strict;
my $num = 1;
my $alph = 'a';
print "$num $alph";
works correctly.
#!perl -w
use strict;
my $num = 1;
my $alph = 'a';
print $num $alph;
doesn't work. returns Can't use string ("1") as a symbol ref while
"strict refs" in use at strict.pl line 5.
(Yup, I read strict and perlref and perlreftut and perldiag - but I
honestly couldn't say how much of it I actually absorbed -- if I need
to go back and re-read those 3 until I have them memorized I will do
so, but any help at this point will be very much appreciated)
#!perl -w
use strict;
my $alph = 'a';
print $alph;
works.
Why is the 1 not allowed; or why isn't the 'a' considered a symbol
ref?
perlfaq4 says that vars shouldn't be quoted 99.8% of the time -- have
I stumbled upon that 0.2 where they have to be? What am I not
understanding here?
TIA
Nnickee
------------------------------
Date: Fri, 14 Jul 2000 04:45:11 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: strings and symbol refs and strict - oh my!
Message-Id: <x71z0xjp5y.fsf@home.sysarch.com>
>>>>> "N" == Nnickee <nnickee@nnickee.com> writes:
N> #!perl -w
N> use strict;
N> my $num = 1;
N> my $alph = 'a';
N> print $num $alph;
that is making $num into an indirect filehandle. put a comma after $num
to just print both vars.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 14 Jul 2000 04:49:18 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: strings and symbol refs and strict - oh my!
Message-Id: <MPG.13d9391bd0df19ac9896a4@news>
Nnickee wrote ..
>I'm trying to get in the habit of using strict, and I've done
>something stupid (again :) I know this is in the docs, but I can't
>seem to get a grasp on it.
>
>#!perl -w
>use strict;
>my $num = 1;
>my $alph = 'a';
>print "$num $alph";
>
>works correctly.
>
>#!perl -w
>use strict;
>my $num = 1;
>my $alph = 'a';
>print $num $alph;
>
>doesn't work. returns Can't use string ("1") as a symbol ref while
>"strict refs" in use at strict.pl line 5.
ok .. this is a perfect situation where using strict has saved you ..
but you've just been thrown by a slightly unintuitive error message
you're missing a comma in your print statement .. Perl thinks your first
argument is a filehandle .. like the following
print FOO $alph;
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 14 Jul 2000 00:04:47 -0500
From: Nnickee <nnickee@nnickee.com>
Subject: Re: strings and symbol refs and strict - oh my!
Message-Id: <534C638F969A65F0.5F4D7740D4ACD775.969EA07D415E7735@lp.airnews.net>
On Fri, 14 Jul 2000 04:45:11 GMT, someone claiming to be Uri Guttman
<uri@sysarch.com> said:
>>>>>> "N" == Nnickee <nnickee@nnickee.com> writes:
>
> N> #!perl -w
> N> use strict;
> N> my $num = 1;
> N> my $alph = 'a';
> N> print $num $alph;
>
>that is making $num into an indirect filehandle.
Ah! Thank you!
>put a comma after $num to just print both vars.
And that worked, but <whiney voice> then I lost the space in between 1
and a. So in this case, since I do want to retain the space, would
you say that I should quote the variables? Or is there a better way
of getting the result that I'm wanting? (I know there are other ways,
I'm just trying to determine the best way)
Thank you, again.
Nnickee
------------------------------
Date: Fri, 14 Jul 2000 14:49:18 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: strings and symbol refs and strict - oh my!
Message-Id: <_nxb5.13$oA.4914@vic.nntp.telstra.net>
Nnickee <nnickee@nnickee.com> wrote in message
news:534C638F969A65F0.5F4D7740D4ACD775.969EA07D415E7735@lp.airnews.net..
.
> On Fri, 14 Jul 2000 04:45:11 GMT, someone claiming to be Uri Guttman
> <uri@sysarch.com> said:
>
>
> And that worked, but <whiney voice> then I lost the space in between 1
> and a. So in this case, since I do want to retain the space, would
> you say that I should quote the variables? Or is there a better way
> of getting the result that I'm wanting? (I know there are other ways,
> I'm just trying to determine the best way)
>
print $num $alph;
Quote the variables. Or do what I see a lot (but hate cos it looks
ugly) concatenate with a space..
print $num." ".$alph;
print "$num $alph"; # so much nicer looking...
(Not saying concatenation is bad or nuthin...)
Wyzelli
------------------------------
Date: Fri, 14 Jul 2000 05:31:13 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: strings and symbol refs and strict - oh my!
Message-Id: <x7wvipi8gt.fsf@home.sysarch.com>
>>>>> "N" == Nnickee <nnickee@nnickee.com> writes:
N> And that worked, but <whiney voice> then I lost the space in
N> between 1 and a. So in this case, since I do want to retain the
N> space, would you say that I should quote the variables? Or is
N> there a better way of getting the result that I'm wanting? (I know
N> there are other ways, I'm just trying to determine the best way)
there are many ways to do that. one is to set the $, var to ' ' and then
print a list of vars. remember to localize it in a block or it will
affect all other prints.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 14 Jul 2000 01:21:36 -0500
From: Nnickee <nnickee@nnickee.com>
Subject: Re: strings and symbol refs and strict - oh my!
Message-Id: <1083EBC27D91E10F.8A9FF166869C018E.5DE216F1C06B6BFC@lp.airnews.net>
On Fri, 14 Jul 2000 14:49:18 +0930, someone claiming to be "Wyzelli"
<wyzelli@yahoo.com> said:
>Nnickee <nnickee@nnickee.com> wrote in message
>news:534C638F969A65F0.5F4D7740D4ACD775.969EA07D415E7735@lp.airnews.net..
>> And that worked, but <whiney voice> then I lost the space in between 1
>> and a. So in this case, since I do want to retain the space, would
>> you say that I should quote the variables? Or is there a better way
>> of getting the result that I'm wanting? (I know there are other ways,
>> I'm just trying to determine the best way)
>Quote the variables. Or do what I see a lot (but hate cos it looks
>ugly) concatenate with a space..
>print $num." ".$alph;
I hate that too. Not only ugly, it's too many characters (not that
I'm anywhere near good enough to start playing Golf yet, but still :)
>print "$num $alph"; # so much nicer looking...
Yeah, it is. And that's how I've written 99% of my print statements
when I haven't used here docs. Now that I'm trying to get into the
habit of using strict, I have to unlearn some bad habits :) And
again, perlfaq4 says that quoting vars is a bad thing to do most of
the time, so that's why I asked about better ways to do it.
>(Not saying concatenation is bad or nuthin...)
It has its place, for sure.
Thank you, Wyzelli, for this and for your previous reply. Between you
and Uri, I'm actually *understanding* why I was getting the results I
was getting.
Nnickee
------------------------------
Date: Fri, 14 Jul 2000 01:21:37 -0500
From: Nnickee <nnickee@nnickee.com>
Subject: Re: strings and symbol refs and strict - oh my!
Message-Id: <63F5D1864D143A59.5CC40DA9F2606AA6.A2FD13A029762145@lp.airnews.net>
On Fri, 14 Jul 2000 05:31:13 GMT, someone claiming to be Uri Guttman
<uri@sysarch.com> said:
>>>>>> "N" == Nnickee <nnickee@nnickee.com> writes:
> N> And that worked, but <whiney voice> then I lost the space in
> N> between 1 and a. So in this case, since I do want to retain the
> N> space, would you say that I should quote the variables?
>there are many ways to do that. one is to set the $, var to ' ' and then
>print a list of vars. remember to localize it in a block or it will
>affect all other prints.
Ooooh.. I like that one.
Gonna hafta go give perlvar another read-thru now to see what else I
need to be careful about.
I *so* wish I had started out with Learning Perl and this newsgroup -
I think I'd be a lot further along than I currently am, since the book
I did start with never mentioned perlfunc or perldoc or use strict
or... etc etc... to the best of my recollection (and I can't check it
now, because I actually threw the dern thing away). Unlearning bad
habits is a slow process :/
Thank you, again, Uri. You've been most helpful :)
Nnickee
------------------------------
Date: Fri, 14 Jul 2000 06:31:13 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: The problem of two Submit buttons
Message-Id: <396eb2df.3544406@news.grnet.gr>
On Tue, 11 Jul 2000 15:15:36 +0530, Senthil Raja
<senthil.raja@adcc.alcatel.be> wrote:
>Lets say I have a form with name="training"
>and in that form I have two submit buttons like,
>
><input type=submit name=add value=ADD>
><input type=submit name=remove value=REMOVE>
>
>In my CGI script I need to identify which submit button
>submitted the form because based upon the button that submitted
>the form I need to perform different actions.
>
>How do I do that?
Along with the other helpful advice you have received, may I offer
this?:
$q = new CGI;
$add_button = $q->param('add');
$remove_button = $q->param('remove');
if ( ! $add_button eq "" ){
#add something
}else{
#remove something
}
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Thu, 13 Jul 2000 23:46:27 -0600
From: "Ingmar" <wizard_oz@gmx.net>
Subject: Re: UDP / ICMP checksum generation - 1's complement sum
Message-Id: <smtdk843nd6139@corp.supernews.com>
Thanks to all,
I already figured it out .... here's my perl code - not very complicated
after all
============================================================================
==============
$cor = 0x0000FFFF; # THIS WILL BE USED LATER TO GET RID OF FFFFs
@data=(0x030d,0x0000,0x4500,0x0030,0x03a7,0x4000,0x7e06,0x62a9,0xa9c5,0x0a2a
,0xa9c5,0x38c3,0x0492,0x0018,0x20ec,0xac2e);
# ADD ALL WORDs TOGETHER AND AUTOMATICALLY ACCUMULATE THE CARRY OVER BIT
for (@data)
{ $sum = $sum + $_ }
$carryover = ($sum & 0xFFFF0000) / 0xFFFF;
$word = $sum & 0x0000FFFF;
print "CHECKSUM: ";
# ADD CARRY OVER BIT TO THE SUM
$checksum = $word + $carryover;
# INVERT (COMPLEMENT) FINAL SUM AND REMOVE TRAILING FFFFs
$checksum = ~$checksum & $cor;
print sprintf "%lx", $checksum;
============================================================================
==============
Ingmar.
"Ingmar Koecher" <wizard_oz@gmx.net> wrote in message
news:smsnr08qnd6150@corp.supernews.com...
> I am trying to send out UDP and ICMP packets manually and therefor need to
> calculate the checksum for those packets manually. I am using RawIP perl
> module on LINUX.
>
> I already looked into the RFC 1071 that explains the generation and the
> algorithm, but I still can't make it work. One problem is that I don't
know
> exactly how I calculate a 1's complement sum of hex values. One source I
> have explains it like this:
>
> 1. Treat the data as a stream of 16-bit words
> 2. Compute the 1's complement sum of the 16-bit words
> 3. Take the 1's complement of the computed sum
>
> I have a source code in C (at the bottom), but that doesn't help me either
> since I can't program C.
>
> What I tried:
>
> I calculated the 1's complement like: $a_compl = ~$a;
> I added all 16-bit words complements
> I added the carry-over bit to the sum
> I created the 1's complement of the previously generated sum
>
> However, it doesn't work. I also tried not complementing the first value,
> but no success, my calculation never matches the correct one (I know
because
> I'm using a sniffer).
>
> Well, I'm at the end. I've tried for appr. 2 days now, installed linux in
a
> 4day session just for this reason and here I fail, sitting on a table with
> papers full of hex code.
>
>
> If anybody out there can help me I would be very happy.
>
> Below the C code,
>
> many thanks,
>
> Ingmar.
>
> ====================== C - code ====================================
> unsigned short in_cksum( void *addr, int len ) {
> long sum = 0;
> unsigned short *ip = (unsigned short *) addr;
>
> while ( len > 1 ) {
> sum += *((unsigned short *) ip)++;
> if (sum & 0x80000000) /* if high-order bit
> set, fold */
> sum = (sum &0xFFFF) + (sum >> 16);
> len -= 2;
> }
>
> if ( len ) sum += (unsigned short) *(unsigned char *) ip;
>
> while ( sum >> 16 ) sum = ( sum & 0xFFFF ) + ( sum >> 16 );
>
> return ~sum;
> }
> ====================== C - code ====================================
>
>
------------------------------
Date: 14 Jul 2000 04:51:08 GMT
From: alandpage@aol.comnospam (Alan Page)
Subject: Upper-to-lower case problem
Message-Id: <20000714005108.07703.00001224@ng-ch1.aol.com>
Hello again,
Got an easy one this time. I'm trying to convert a variable's content from
upper to lower case using:
...
$batch = $input{'batch'};
$batch =~ tr/A-Z/a-z/;
...
But whenever I add that second line to an otherwise functional script, I get a
500 Internal Server Error with this detail in my server error log:
Can't open perl script "
": No such file or directory
[Thu Jul 13 20:52:11 2000] [error] [client 209.66.144.2] Premature end of
script headers
This line is right out of the llama book, but I must be misusing it somehow.
Any ideas?
Thanks,
Alan
------------------------------
Date: Fri, 14 Jul 2000 05:07:36 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Upper-to-lower case problem
Message-Id: <MPG.13d93d599a19f65e9896a6@news>
Alan Page wrote ..
>Got an easy one this time. I'm trying to convert a variable's content from
>upper to lower case using:
>
>...
>$batch = $input{'batch'};
>$batch =~ tr/A-Z/a-z/;
>...
>
>But whenever I add that second line to an otherwise functional script, I get a
>500 Internal Server Error with this detail in my server error log:
>Can't open perl script "
>": No such file or directory
>[Thu Jul 13 20:52:11 2000] [error] [client 209.66.144.2] Premature end of
>script headers
first of all - there's a function for doing this that will work more
dependably (it respects locales) and a little quicker
perldoc -f lc
secondly .. the problem is probably happening because $input{'batch'}
doesn't contain what you think it does and sometime later you're trying
to run that as another script (with eval() or do() or require())
if that's the case then check the contents of $input{'batch'} .. they
look like they'll at least need chomping
perldoc -f chomp
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 14 Jul 2000 05:18:34 GMT
From: alandpage@aol.comnospam (Alan Page)
Subject: Re: Upper-to-lower case problem
Message-Id: <20000714011834.07703.00001230@ng-ch1.aol.com>
>first of all - there's a function for doing this that will work more
>dependably (it respects locales) and a little quicker
>
> perldoc -f lc
OK, I hate to ask the obvious, but is perldoc a command line expression? I
don't have telnet access to this machine; can I get that documentation online.
>secondly .. the problem is probably happening because $input{'batch'}
>doesn't contain what you think it does and sometime later you're trying
>to run that as another script (with eval() or do() or require())
The variable $batch contains either an uppercase alpha character or a lowercase
alpha character. I've tested this extensively before I added the one line.
Thanks,
Alan
------------------------------
Date: Fri, 14 Jul 2000 06:05:38 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Upper-to-lower case problem
Message-Id: <MPG.13d94afc2a8945309896a7@news>
Alan Page wrote ..
>>first of all - there's a function for doing this that will work more
>>dependably (it respects locales) and a little quicker
>>
>> perldoc -f lc
>
>OK, I hate to ask the obvious, but is perldoc a command line expression? I
>don't have telnet access to this machine; can I get that documentation online.
yes .. perldoc a command line utility
documentation is online (you're going to kick yourself) at www.perl.com
.. there's a link second from the top on the left .. the go to "Perl's
Builtin functions" and then follow the link to lc
>>secondly .. the problem is probably happening because $input{'batch'}
>>doesn't contain what you think it does and sometime later you're trying
>>to run that as another script (with eval() or do() or require())
>
>The variable $batch contains either an uppercase alpha character or a lowercase
>alpha character. I've tested this extensively before I added the one line.
ok .. well the lc will probably not help you then (there was nothing
wrong with your tr/// code - assuming that you're using an english
locale - the default) .. show more code - like where else you're using
$batch
what does the code output when you run it from the command line ?
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 14 Jul 2000 06:06:32 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Upper-to-lower case problem
Message-Id: <MPG.13d94b37c3e87e479896a8@news>
jason wrote ..
>what does the code output when you run it from the command line ?
sorry .. I forgot - no telnet .. you must be testing it somewhere ?
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Fri, 14 Jul 2000 01:10:08 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Upper-to-lower case problem
Message-Id: <slrn8mt85g.ctf.tadmc@magna.metronet.com>
On 14 Jul 2000 05:18:34 GMT, Alan Page <alandpage@aol.comnospam> wrote:
>>first of all - there's a function for doing this that will work more
>>dependably (it respects locales) and a little quicker
>>
>> perldoc -f lc
>
>OK, I hate to ask the obvious, but is perldoc a command line expression?
Yes. (I think. I'm not too sure what "expression" might mean there...)
>I
>don't have telnet access to this machine; can I get that documentation online.
Perl is free.
Download it and install it on your local computer.
It comes with the complete set of docs, as well as the perldoc program.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
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 3662
**************************************