[18596] in Perl-Users-Digest
Perl-Users Digest, Issue: 764 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 25 18:05:51 2001
Date: Wed, 25 Apr 2001 15:05:18 -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: <988236317-v10-i764@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 25 Apr 2001 Volume: 10 Number: 764
Today's topics:
Re: [Regex] Number of Matches (Craig Berry)
Re: [Regex] Number of Matches (Abigail)
Re: [Regex] Number of Matches (Tad McClellan)
accessing hard drive via webpage <mathieu.barroussel@ntlworld.com>
Re: accessing hard drive via webpage <tony_curtis32@yahoo.com>
Re: accessing hard drive via webpage nobull@mail.com
Re: accessing hard drive via webpage (Craig Berry)
binary operations <rayj00@yahoo.com>
Re: binary operations (Craig Berry)
checking case in perl <mroulha1@email.mot.com>
Re: checking case in perl <kellikellin@netscape.net>
Re: checking case in perl <uri@sysarch.com>
Re: checking case in perl <boris@m2b.de>
Re: Counting number of chars in a line (part of reading (Craig Berry)
crypt function disparity problem (5-i's)
Re: crypt function disparity problem (Anno Siegel)
Re: crypt function disparity problem (Abigail)
Re: crypt function disparity problem <bart.lateur@skynet.be>
Re: crypt function disparity problem (5-i's)
Re: crypt function disparity problem <boris@m2b.de>
Re: crypt function disparity problem (5-i's)
Re: Differences between perl and Tcl (Abigail)
Re: Good editor for perl <mischief@velma.motion.net>
Re: Good editor for perl (Tad McClellan)
Re: Good editor for perl (Anno Siegel)
Re: Good editor for perl <moverho1@nycap.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 25 Apr 2001 18:29:31 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: [Regex] Number of Matches
Message-Id: <tee5sbo92em8ef@corp.supernews.com>
Tad McClellan (tadmc@augustmail.com) wrote:
: Simon Stiefel <SiStie@nuclear-network.com> wrote:
: >
: >In a line, which consists of #'s and numbers, I want to count the
: >numbers.
:
: >Does someone have a little hint for me?
:
: $counter++ while $line =~ /\d+/g;
...being sure $counter is 0 first, of course.
My prefered idiom is
$counter = () = $line =~ /\d+/g;
which doesn't require $counter initialization, but does create and destroy
a list under the covers. This could easily be optimized away by a future
version of perl, however.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Wed, 25 Apr 2001 20:40:46 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: [Regex] Number of Matches
Message-Id: <slrn9eedie.5et.abigail@tsathoggua.rlyeh.net>
Simon Stiefel (SiStie@nuclear-network.com) wrote on MMDCCXCIV September
MCMXCIII in <URL:news:3AE6F6DF.7BD60956@nuclear-network.com>:
%% Hi,
%%
%% In a line, which consists of #'s and numbers, I want to count the
%% numbers.
%% A line can look like this:
%%
%% $line ="# # # 4 6 # # 7 # 45 # 43 # 65 56 2 # 4345 # # 23";
%%
%% You see, that there are spaces between the #'s and the numbers and
%% that it is possible that a number follows another.
%%
%% $counter += ($line =~ m/\s\d+\s/g); #won't work. :(
%% ^^
%% Because I have to do this several times, I have to add the number of
%% matches to a consisting variable.
$ perl -ple '$" = "+"; $_ = eval "@{[/(\d+)/g]}"'
# # # 4 6 # # 7 # 45 # 43 # 65 56 2 # 4345 # # 23
4596
^D
$
Abigail
--
#!/opt/perl/bin/perl -- # Remove trailing newline!
BEGIN{$SIG{__WARN__}=sub{$_=pop;y-_- -;print/".*(.)"/;
truncate$0,-1+-s$0;exec$0;}}//rekcaH_lreP_rehtona_tsuJ
------------------------------
Date: Wed, 25 Apr 2001 15:58:43 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: [Regex] Number of Matches
Message-Id: <slrn9eeb3j.vba.tadmc@tadmc26.august.net>
Craig Berry <cberry@cinenet.net> wrote:
>Tad McClellan (tadmc@augustmail.com) wrote:
>: Simon Stiefel <SiStie@nuclear-network.com> wrote:
>: >
>: >In a line, which consists of #'s and numbers, I want to count the
>: >numbers.
>:
>: >Does someone have a little hint for me?
>:
>: $counter++ while $line =~ /\d+/g;
>
>...being sure $counter is 0 first, of course.
>
>My prefered idiom is
>
> $counter = () = $line =~ /\d+/g;
And I had that in my post too, then I cut it back out 'cause I
didn't want to have to explain it.
Anno ended up explaining it better than I would have anyway :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 25 Apr 2001 19:22:06 +0100
From: "mathieu.barroussel" <mathieu.barroussel@ntlworld.com>
Subject: accessing hard drive via webpage
Message-Id: <uBEF6.1562$vJ5.321397@news2-win.server.ntlworld.com>
Hi,
I need to write a cgi (Perl or C) that, from my web page, enables me to
access the c:\ hard drive or just one program, on a remote PC. Is this
possible?
Thank for your help
Mat
------------------------------
Date: 25 Apr 2001 13:29:54 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: accessing hard drive via webpage
Message-Id: <87d7a0est9.fsf@limey.hpcc.uh.edu>
>> On Wed, 25 Apr 2001 19:22:06 +0100,
>> "mathieu.barroussel" <mathieu.barroussel@ntlworld.com> said:
> Hi, I need to write a cgi (Perl or C) that, from my web
> page, enables me to access the c:\ hard drive or just
> one program, on a remote PC. Is this possible?
Nope. The CGI program runs on the *server*. Of course,
what the browser does with the *output* from that program
is another matter altogether.
comp.infosystems.www.authoring.cgi
is more on-topic for this (because as you noted yourself,
it doesn't matter which language you're writing the CGI
part in).
hth
t
--
Just reach into these holes. I use a carrot.
------------------------------
Date: 25 Apr 2001 19:40:51 +0100
From: nobull@mail.com
Subject: Re: accessing hard drive via webpage
Message-Id: <u9itjskeks.fsf@wcl-l.bham.ac.uk>
"mathieu.barroussel" <mathieu.barroussel@ntlworld.com> writes:
> I need to write a cgi (Perl or C) that, from my web page, enables me to
> access the c:\ hard drive or just one program, on a remote PC. Is this
> possible?
I thought this was a silly question when I saw in in CIWAC.
Now Mathieu has decided to spam it here too.
The answer is no.
This is nothing to do with Perl.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 25 Apr 2001 20:12:44 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: accessing hard drive via webpage
Message-Id: <teebtsqe6r240e@corp.supernews.com>
mathieu.barroussel (mathieu.barroussel@ntlworld.com) wrote:
: I need to write a cgi (Perl or C) that, from my web page, enables me to
: access the c:\ hard drive or just one program, on a remote PC. Is this
: possible?
Only if the target machine cooperates by running e.g. an ftp or telnet
server to which your cgi program could connect. If this were possible
without explicit local support, nobody (other than utter fools) would ever
use the net.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Wed, 25 Apr 2001 16:54:04 -0400
From: RayJ <rayj00@yahoo.com>
Subject: binary operations
Message-Id: <3AE7396C.6040607@yahoo.com>
I have a hex value, say a5.
I convert to binary using pack/unpack and
put the results in an array.
Now I need to do something like: check
the bottom 5 bits for a value of 10110
and if so, do something.
My question is the how do I do an "if"
statement? Should it be: if (@array[0...4] eq 10110)???
Or can I refer to the 5 bits as a whole decimal 22?
Thanks,
Ray
------------------------------
Date: Wed, 25 Apr 2001 21:33:14 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: binary operations
Message-Id: <teegkqq42hf132@corp.supernews.com>
RayJ (rayj00@yahoo.com) wrote:
: I have a hex value, say a5. I convert to binary using pack/unpack and
: put the results in an array.
:
: Now I need to do something like: check the bottom 5 bits for a value of
: 10110 and if so, do something.
:
: My question is the how do I do an "if" statement? Should it be: if
: (@array[0...4] eq 10110)??? Or can I refer to the 5 bits as a whole
: decimal 22?
If you need to do binary operations, you're better off working with
integerers rather than binary representation arrays. For example:
my $value = hex 'a5';
my $bottom = hex '16'; # 10110
my $mask = hex '1F'; # 11111
if (($value & mask) == $bottom) {
...
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Wed, 25 Apr 2001 14:59:28 -0500
From: "Roulhac" <mroulha1@email.mot.com>
Subject: checking case in perl
Message-Id: <9c7ali$dkb2@nntp.cig.mot.com>
Hi all:
I want to parse a string to see if the letters are all uppercase or
lowercase. Is there a way to do this in perl? And if so, could someone
please give me a snippet of code...
Thanks in advance!
------------------------------
Date: Wed, 25 Apr 2001 10:33:29 -0500
From: kelli norman <kellikellin@netscape.net>
Subject: Re: checking case in perl
Message-Id: <3AE6EE49.523B9FD0@netscape.net>
if ($var EQ uc($var))
{ print "$var is upper\n"; }
if ($var EQ lc($var))
{ print "$var is lower\n"; }
---
Roulhac wrote:
>
> Hi all:
>
> I want to parse a string to see if the letters are all uppercase or
> lowercase. Is there a way to do this in perl? And if so, could someone
> please give me a snippet of code...
>
> Thanks in advance!
------------------------------
Date: Wed, 25 Apr 2001 20:44:27 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: checking case in perl
Message-Id: <x7sniwhfpl.fsf@home.sysarch.com>
>>>>> "kn" == kelli norman <kellikellin@netscape.net> writes:
kn> if ($var EQ uc($var))
kn> { print "$var is upper\n"; }
kn> if ($var EQ lc($var))
kn> { print "$var is lower\n"; }
umm, what perl operator is EQ? in fact do you know of any perl functions
whose names are upper case?
amusing that a question about case is answered with code using the wrong
case.
:)
and there are regex ways of doing this that might be easier.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html
------------------------------
Date: Wed, 25 Apr 2001 23:16:45 +0200
From: Boris Zentner <boris@m2b.de>
Subject: Re: checking case in perl
Message-Id: <0se7c9.ai9.ln@al.brain.de>
Roulhac wrote:
> Hi all:
>
> I want to parse a string to see if the letters are all uppercase or
> lowercase. Is there a way to do this in perl? And if so, could someone
> please give me a snippet of code...
>
> Thanks in advance!
if ($line =~ /^[^a-z]+$/){
# all letters are Uppercase
} elsif ($line =~ /^[^A-Z]+$/){
# all letter are lowercase
}
--
cu boris
------------------------------
Date: Wed, 25 Apr 2001 18:24:40 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Counting number of chars in a line (part of reading multiline CSV
Message-Id: <tee5j8de870893@corp.supernews.com>
Richard Lawrence (ralawrence@my-deja.com) wrote:
: I'm trying to read in and parse CSV files. I've used the solution
: suggested in the cookbook and it works well, apart from the fact that
: \n's in the fields cause the whole thing to break horribly.
Since CSV files are traditionally one-record-per-line, this is not
surprising. If you don't use \n as a record separator, how *do* you tell
when the record ends?
: So I figured that if I could count the number of "'s in the line
: (ignoring the ""'s) then I could work out whether or not the line below
: needed to be concatenated with the current line.
Again, it would seem better to look for the real record separator. But if
you really want to do it this way, the simplest technique I can think of
looks like this:
(my $copy = $string) =~ s/""//g;
my $quotecount = $copy =~ tr/"//;
This deals properly with e.g. a "" occuring right at the end of a quoted
string: "hello there""" would be counted as containing two quotes.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "When the going gets weird, the weird turn pro."
| - Hunter S. Thompson
------------------------------
Date: Wed, 25 Apr 2001 18:49:30 GMT
From: fiveyes@iiiii.com (5-i's)
Subject: crypt function disparity problem
Message-Id: <3af2170f.253248243@news.atl.bellsouth.net>
I'm obtaining two different results on separate systems and I can't
find any reference as to why or even if this is to be expected.
Perl Version: 5.00503
PERL compile version OS: freebsd
crypt ('password', '47') returns "$1$47$Ct/n4hLOONORfPK4lqkC6."
Perl Version: 5.00402
PERL compile version OS: bsdos
crypt ('password', '47') returns "47amUs3AWvq5A"
The crypted passwords are functional within their respective Apache
htaccess schemes, but are mutually incompatible with each other
(meaning I can't directly migrate a huge htpasswd file, which is a BAD
thing!).
I'd appreciate any insight given, since both the faq and Dejanews are
coming empty for me...
------------------------------
Date: 25 Apr 2001 20:03:44 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: crypt function disparity problem
Message-Id: <9c7aj0$dfi$3@mamenchi.zrz.TU-Berlin.DE>
According to 5-i's <fiveyes@iiiii.com>:
> I'm obtaining two different results on separate systems and I can't
> find any reference as to why or even if this is to be expected.
>
> Perl Version: 5.00503
> PERL compile version OS: freebsd
> crypt ('password', '47') returns "$1$47$Ct/n4hLOONORfPK4lqkC6."
>
> Perl Version: 5.00402
> PERL compile version OS: bsdos
> crypt ('password', '47') returns "47amUs3AWvq5A"
>
> The crypted passwords are functional within their respective Apache
> htaccess schemes, but are mutually incompatible with each other
> (meaning I can't directly migrate a huge htpasswd file, which is a BAD
> thing!).
> I'd appreciate any insight given, since both the faq and Dejanews are
> coming empty for me...
While Perl has a crypt function, what it does is entirely up to
the underlying system. I would ask in a Unix group.
Anno
------------------------------
Date: Wed, 25 Apr 2001 20:52:49 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: crypt function disparity problem
Message-Id: <slrn9eee91.5et.abigail@tsathoggua.rlyeh.net>
5-i's (fiveyes@iiiii.com) wrote on MMDCCXCIV September MCMXCIII in
<URL:news:3af2170f.253248243@news.atl.bellsouth.net>:
!! I'm obtaining two different results on separate systems and I can't
!! find any reference as to why or even if this is to be expected.
!!
!! Perl Version: 5.00503
!! PERL compile version OS: freebsd
!! crypt ('password', '47') returns "$1$47$Ct/n4hLOONORfPK4lqkC6."
!!
!! Perl Version: 5.00402
!! PERL compile version OS: bsdos
!! crypt ('password', '47') returns "47amUs3AWvq5A"
This is to be expected. Not all crypt(2) implementations are the same.
And while often Perl goes to great lengths to give the same results on all
platforms, it relies on the C library in this case. And in my opinion,
rightly so. Interoperability between applications on the same platform
is to be prefered over portability between platforms.
!! The crypted passwords are functional within their respective Apache
!! htaccess schemes, but are mutually incompatible with each other
!! (meaning I can't directly migrate a huge htpasswd file, which is a BAD
!! thing!).
!! I'd appreciate any insight given, since both the faq and Dejanews are
!! coming empty for me...
Since when is Apache written in Perl? Even if Perl on all platforms
returned the same result for crypt(), it wouldn't solve your problem,
would it?
Abigail
------------------------------
Date: Wed, 25 Apr 2001 20:55:32 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: crypt function disparity problem
Message-Id: <91eeetglqelvg9ajrfjqun1d0pesnerntg@4ax.com>
5-i's wrote:
>Perl Version: 5.00503
>PERL compile version OS: freebsd
>crypt ('password', '47') returns "$1$47$Ct/n4hLOONORfPK4lqkC6."
>
>Perl Version: 5.00402
>PERL compile version OS: bsdos
>crypt ('password', '47') returns "47amUs3AWvq5A"
>
>The crypted passwords are functional within their respective Apache
>htaccess schemes, but are mutually incompatible with each other
>(meaning I can't directly migrate a huge htpasswd file, which is a BAD
>thing!).
>I'd appreciate any insight given, since both the faq and Dejanews are
>coming empty for me...
It's a DES vs. MD5 thing... It depends on what your system was told to
use when it was installed. For example, when installing FreeBSD 3.4, I
was asked if I was a US resident. The answer to that question was the
deciding factor for which scheme was going to be used. At that time, not
so long ago, it was still illegal to export DES from the USA, so the
rest of the world had to help themselves with MD5... which is a much
more powerful encryption scheme, BTW. Since then, this law has been
drpopped, AFAIK.
BTW the '$1$' at the start of the string is a marker for the OS telling
it that MD5 had been used. In principle, such a password checking
program can use a combination for both schemes.
A web search revealed this page:
<http://www.infran.ru/TechInfo/BSD/handbook67.html>
--
Bart.
------------------------------
Date: Wed, 25 Apr 2001 21:56:34 GMT
From: fiveyes@iiiii.com (5-i's)
Subject: Re: crypt function disparity problem
Message-Id: <3af6477f.265650367@news.atl.bellsouth.net>
On Wed, 25 Apr 2001 20:55:32 GMT, Bart Lateur <bart.lateur@skynet.be>
wrote:
>5-i's wrote:
>
>>Perl Version: 5.00503
>>PERL compile version OS: freebsd
>>crypt ('password', '47') returns "$1$47$Ct/n4hLOONORfPK4lqkC6."
>>
>>Perl Version: 5.00402
>>PERL compile version OS: bsdos
>>crypt ('password', '47') returns "47amUs3AWvq5A"
>>
>>The crypted passwords are functional within their respective Apache
>>htaccess schemes, but are mutually incompatible with each other
>>(meaning I can't directly migrate a huge htpasswd file, which is a BAD
>>thing!).
>>I'd appreciate any insight given, since both the faq and Dejanews are
>>coming empty for me...
>
>It's a DES vs. MD5 thing... It depends on what your system was told to
>use when it was installed. For example, when installing FreeBSD 3.4, I
>was asked if I was a US resident. The answer to that question was the
>deciding factor for which scheme was going to be used. At that time, not
>so long ago, it was still illegal to export DES from the USA, so the
>rest of the world had to help themselves with MD5... which is a much
>more powerful encryption scheme, BTW. Since then, this law has been
>drpopped, AFAIK.
>
>BTW the '$1$' at the start of the string is a marker for the OS telling
>it that MD5 had been used. In principle, such a password checking
>program can use a combination for both schemes.
>
>A web search revealed this page:
> <http://www.infran.ru/TechInfo/BSD/handbook67.html>
That'll work! Thanks for pointing me in the right direction.
5-i's
------------------------------
Date: Wed, 25 Apr 2001 23:32:48 +0200
From: Boris Zentner <boris@m2b.de>
Subject: Re: crypt function disparity problem
Message-Id: <2qf7c9.vn9.ln@al.brain.de>
5-i's wrote:
> I'm obtaining two different results on separate systems and I can't
> find any reference as to why or even if this is to be expected.
i think it is expected as the manpage say 'Encrypts a string exactly like
the crypt(3) function in the C library' perhaps you can use
Crypt::UnixCrypt and overload the crypt function.
i get crypt ('password', '47') returns "47amUs3AWvq5A" for my
linux 2.4.2-ac14 with perl 5.6.1
> Perl Version: 5.00503
> PERL compile version OS: freebsd
> crypt ('password', '47') returns "$1$47$Ct/n4hLOONORfPK4lqkC6."
>
> Perl Version: 5.00402
> PERL compile version OS: bsdos
> crypt ('password', '47') returns "47amUs3AWvq5A"
>
> The crypted passwords are functional within their respective Apache
> htaccess schemes, but are mutually incompatible with each other
> (meaning I can't directly migrate a huge htpasswd file, which is a BAD
> thing!).
> I'd appreciate any insight given, since both the faq and Dejanews are
> coming empty for me...
>
--
cu boris
------------------------------
Date: Wed, 25 Apr 2001 22:01:17 GMT
From: fiveyes@iiiii.com (5-i's)
Subject: Re: crypt function disparity problem
Message-Id: <3af541d8.264202757@news.atl.bellsouth.net>
On Wed, 25 Apr 2001 20:52:49 +0000 (UTC), abigail@foad.org (Abigail)
wrote:
>5-i's (fiveyes@iiiii.com) wrote on MMDCCXCIV September MCMXCIII in
><URL:news:3af2170f.253248243@news.atl.bellsouth.net>:
>!! I'm obtaining two different results on separate systems and I can't
>!! find any reference as to why or even if this is to be expected.
>!!
>!! Perl Version: 5.00503
>!! PERL compile version OS: freebsd
>!! crypt ('password', '47') returns "$1$47$Ct/n4hLOONORfPK4lqkC6."
>!!
>!! Perl Version: 5.00402
>!! PERL compile version OS: bsdos
>!! crypt ('password', '47') returns "47amUs3AWvq5A"
>
>This is to be expected. Not all crypt(2) implementations are the same.
>And while often Perl goes to great lengths to give the same results on all
>platforms, it relies on the C library in this case. And in my opinion,
>rightly so. Interoperability between applications on the same platform
>is to be prefered over portability between platforms.
Perhaps the documentation might stress where functions might break
across platforms a bit more strongly.
>!! The crypted passwords are functional within their respective Apache
>!! htaccess schemes, but are mutually incompatible with each other
>!! (meaning I can't directly migrate a huge htpasswd file, which is a BAD
>!! thing!).
>!! I'd appreciate any insight given, since both the faq and Dejanews are
>!! coming empty for me...
>
>Since when is Apache written in Perl?
I don't believe my head scratching (the results are different but
obtain the expected results) or expression of frustration (I have a
task that's hit an unexpected snag) implied anything of the sort.
>Even if Perl on all platforms
>returned the same result for crypt(), it wouldn't solve your problem,
>would it?
No, only an insight would.
Oh, and it's a crypt(3) implementation, FYI.
5-i's
------------------------------
Date: Wed, 25 Apr 2001 21:34:52 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Differences between perl and Tcl
Message-Id: <slrn9eegns.5et.abigail@tsathoggua.rlyeh.net>
Joel [CAR:VS11:EXCH] (coopvs14@americasm01.nt.com) wrote on MMDCCXCIV
September MCMXCIII in <URL:news:3AE6EDBA.C81F3815@americasm01.nt.com>:
{} Also, I was wondering if anyone has any significent differences between
{} perl and Tcl to add to my list. Some of these are probably wrong so if
{} you can tell me what is correct, that would also be helpful.
{}
{} Tcl stores all data in strings -- Tcl now supports binary strings but
{} I'm not sure if I quite understand this...does that mean it can store
{} numbers in binary now?
{}
{} Tcl is unicode
What does that mean? I thought Tcl was a programming language.
{} A Tcl list is just a long string
Isn't that just an implementation detail?
{} A tcl array is just a hash (associative list)
Fine. Isn't that an implementation detail as well?
{} Tcl is easier to learn then perl
Could be. So what? It's easier to learn how to ride a tricycle that
it is to drive a formula-1 car too. Does that say anything useful
about their differences?
{} Perl contains way more predefined variables ( that are very confusing)
Then don't use them! Or use C, without any predefined variables!
{} Both languages are now general purpose scripting languages
What is a scripting language?
{} perl is faster at string manipulations and parsing
Fine. If that's important to you.
What is the point of your posting?
Abigail
--
my $qr = qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
$qr =~ s/$qr//g;
print $qr, "\n";
------------------------------
Date: Wed, 25 Apr 2001 20:17:43 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Good editor for perl
Message-Id: <teec779b91hv93@corp.supernews.com>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> According to David Coppit <newspost@coppit.org>:
>> On 23 Apr 2001, Anno Siegel wrote:
>> > > {
>> > > $a = reformat<<" EOF";
>> > > This is
>> > > a block of
>> > > text to be reformatted.
>> > > EOF # Oops. 3 spaces instead of 2.
>> > > }
>> >
>> > Is this here for a purpose? What does it demonstrate?
>>
>> This bites me without syntax hilighting... The terminating " EOF"
>> doesn't have two spaces as specified by <<" EOF", which causes
>> problems. This often happens if you in/out-dent a block of code that
>> has a here-document.
> It would bite you even if the number of blanks before EOF were
> correct. The terminator must appear on a line by itself, no blanks
> on either side, far less comments.
In this case, there must be two spaces to the left of the 'EOF',
because the beginning line specifies the ending line to have two
spaces before. There must not be any _other_ spaces. Let me be
clear in that I trust this is what Anno meant, but I'm afraid
that wording will confuse.
> On the other hand, when you're used to indenting your code without
> automatic help, the problem hardly arises. Putting exactly the
> same number of blanks in front of each line is routine. You'll just
> check twice a critical line like that.
Of course, you can still use vim. Automatic indentation and
syntax highlighting are options which can be turned off
completely.
Chris
--
Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens to
answer a question you've asked, that's incidental. -- nobull, clp.misc
------------------------------
Date: Wed, 25 Apr 2001 16:10:47 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Good editor for perl
Message-Id: <slrn9eebq7.vba.tadmc@tadmc26.august.net>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>According to David Coppit <newspost@coppit.org>:
>> On 23 Apr 2001, Anno Siegel wrote:
>
>> > > $a = reformat<<" EOF";
>> > > This is
>> > > a block of
>> > > text to be reformatted.
>> > > EOF # Oops. 3 spaces instead of 2.
>> This bites me without syntax hilighting
>It would bite you even if the number of blanks before EOF were
>correct.
Eh?
>The terminator must appear on a line by itself, no blanks
>on either side,
^^^^^^
blanks on either side are OK if they are included in the original
spec for the string terminator:
--------------------------
#!/usr/bin/perl -w
use strict;
$_ =<<" EOF "; # three spaces in string terminator
This is
a block of
text to be reformatted.
EOF
print "$_\n";
--------------------------
>far less comments.
The comment does break stuff though.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 25 Apr 2001 21:12:14 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Good editor for perl
Message-Id: <9c7eje$j5t$1@mamenchi.zrz.TU-Berlin.DE>
According to Chris Stith <mischief@velma.motion.net>:
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> > According to David Coppit <newspost@coppit.org>:
> >> On 23 Apr 2001, Anno Siegel wrote:
>
> >> > > {
> >> > > $a = reformat<<" EOF";
> >> > > This is
> >> > > a block of
> >> > > text to be reformatted.
> >> > > EOF # Oops. 3 spaces instead of 2.
> >> > > }
> >> >
> >> > Is this here for a purpose? What does it demonstrate?
> >>
> >> This bites me without syntax hilighting... The terminating " EOF"
> >> doesn't have two spaces as specified by <<" EOF", which causes
> >> problems. This often happens if you in/out-dent a block of code that
> >> has a here-document.
>
> > It would bite you even if the number of blanks before EOF were
> > correct. The terminator must appear on a line by itself, no blanks
> > on either side, far less comments.
>
> In this case, there must be two spaces to the left of the 'EOF',
> because the beginning line specifies the ending line to have two
> spaces before. There must not be any _other_ spaces. Let me be
> clear in that I trust this is what Anno meant, but I'm afraid
> that wording will confuse.
Yes, I should have said "...no additional blanks...".
> > On the other hand, when you're used to indenting your code without
> > automatic help, the problem hardly arises. Putting exactly the
> > same number of blanks in front of each line is routine. You'll just
> > check twice a critical line like that.
> Of course, you can still use vim. Automatic indentation and
> syntax highlighting are options which can be turned off
> completely.
I must look into vim's auto-ident. May I digress? Thank you.
I'm breaking a 10+ year-long habit of indenting by twos in favor
of the mainstream fours, and I feel it's slowing me down a bit.
Two blanks per indent was no problem, four is too much. Otherwise,
the transition is easier than I expected.
Slightly more on topic, yet still going on about vim: what I miss
more than any syntax hilighter (which I don't trust enough) is
the ability to use the QuickFix feature[1]. Perl error messages
have the file and line number last, a format that is impossible
to parse with the scanf-like methods vim offers. Or is it?
Of course it's no problem to pre-process the error output so
that vim can use it. Using $SIG{ __WARN__} and $SIG{ __DIE__}
for the purpose has the additional benefit that programmers are
discouraged from using them themselves :).
Hmm "use Unix::QuickFix;" sounds snappy...
Anno
[1] QuickFix is vim's ability to read a file of error messages
(which may come from multiple files) and jump to the indicated
lines.
------------------------------
Date: Wed, 25 Apr 2001 21:28:18 GMT
From: "Mark" <moverho1@nycap.rr.com>
Subject: Re: Good editor for perl
Message-Id: <SjHF6.137$r3.294914@typhoon.nyroc.rr.com>
I downloaded untraedit today and did not install it because it has a limit
to the free use of 30 days.( this was for the 32 bit version maybe the 16
bit version is unlimited)
though I havent found the template option as of yet in "synedit" there is no
limit to its use.
"Aaron Gross" <amgross@*nospam*westernind.com> wrote in message
news:7%BF6.4$cb4.116@client...
Ultraedit!
Makes your perl code pretty in colors, plus does other stuff like html. :)
"Super-Simon" <simon@super-simon.com> wrote in message
news:9c1csm$loh$1@news1.xs4all.nl...
> Hi all,
>
> I'm searching for a good, fast editor with syntax highlighting for perl
> (CGI) for use under Windows 2000 / Windows 98 (I use windowz only for
> editing scripts, scripts runs on Linux-server). It has to be free (I'm a
> poor student ;-)
>
> Grtz,
>
> Super-Simon
>
>
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 764
**************************************