[24156] in Perl-Users-Digest
Perl-Users Digest, Issue: 6350 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 1 09:05:50 2004
Date: Thu, 1 Apr 2004 06:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 1 Apr 2004 Volume: 10 Number: 6350
Today's topics:
Boxed Perl or ActiveState Perl? <victor@nospam.invalid>
Re: count files + dirs <simalt@totalise.co.uk>
Re: data types anuradha.k.r@sify.com
Re: data types (Anno Siegel)
Re: Inline C on Windows - what am i doing wrong? <ThomasKratz@REMOVEwebCAPS.de>
Re: Looking for Perl regexp powered Editor <jtc@shell.dimensional.com>
Re: Looking for Perl regexp powered Editor (Randal L. Schwartz)
Re: Looking for Perl regexp powered Editor <uri@stemsystems.com>
Re: multiple lines / success or failure?! <postmaster@castleamber.com>
Re: multiple lines / success or failure?! <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: multiple lines / success or failure?! <postmaster@castleamber.com>
Re: multiple lines / success or failure?! <bernard.el-haginDODGE_THIS@lido-tech.net>
Perl syntax <anders_postkasse@hotmail.com>
Re: Perl syntax <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: Perl syntax <noreply@gunnar.cc>
Re: Perl syntax <anders_postkasse@hotmail.com>
Re: Perl syntax <anders_postkasse@hotmail.com>
Re: Perl syntax <noreply@gunnar.cc>
Re: Python from the command line (was: Choosing Perl/Py <fma@doe.carleton.ca>
Re: Python from the command line (was: Choosing Perl/Py (Cameron Laird)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 01 Apr 2004 10:36:47 GMT
From: Vittorio <victor@nospam.invalid>
Subject: Boxed Perl or ActiveState Perl?
Message-Id: <3hSac.965$hc5.16660@news3.tin.it>
On my dual-boot (linux debian testing & windows xp) box under linux I
have installed debian testing and the deb perl 5.6 packages boxed with
the debian distribution.
Now, using perl both under linux and win xp I've installed activestate
perl 5.8 under M$ win and it looks great!
The same activestate site offer a debianized perl-5.8 package which is
installed under usr/local/bin.
In the opinion of more experienced users than I am is there any
advantage for me to install activestate perl instead of the standard deb
packages?
Can both versions of perl coexist?
If I install activestate perl, could I eliminate the boxed debian perl
packages (to avoid duplication, of course) or they're essential for the
installation?
Ciao
Vittorio
------------------------------
Date: Thu, 1 Apr 2004 13:38:37 +0100
From: "Simon" <simalt@totalise.co.uk>
Subject: Re: count files + dirs
Message-Id: <406c0d4e$1@primark.com>
I know there are a few mistakes in the code but I was just testing it that
is why the odd code.
I will test out your suggestion.
Thanks.
Simon
"Paul Lalli" <ittyspam@yahoo.com> wrote in message
news:20040331095631.M19862@dishwasher.cs.rpi.edu...
> On Wed, 31 Mar 2004, Simon wrote:
>
> > Hi,
> >
> > Is there a way to count files and directories as separate entities.
> >
> > If I use the following program it correctly displays the files in a
> > directory but also it treats subdirectories as files.
> >
> > Could I not somehow code it to know that say x are files and n are
> > subdirectories so I know what is what?
> >
>
> perldoc -f -X
>
> the -f and -d filetests tell you if a given directory entry is a file or
> directory, respectively.
>
>
> > Thanks for you help, newbie in perl.
> >
> > Below is the test script.
> > #!/perl/bin/perl -w
> >
> > use strict;
> > my ($count);
> >
> > my $dir = 'd:/active/';
> >
> > opendir DIR, $dir or die "Could not opendir $dir; Reason: $!";
> >
> > my @files = grep !/^\.\.?$/ => readdir DIR;
> >
> >
> >
> > $count=@files + 1;
>
>
> Why are you doing this? @files in scalar context gives the number of
> elements in the array. You should not be adding one to it.
>
> >
> > closedir DIR;
> >
> >
> > foreach (@files)
> >
> > {
> >
> > print "File: $_ \n";
> >
> >
> > }
> >
> > print "$count"-1;
>
>
> what the heck is this??
>
> >
> >
> > result
> > ========
> > D:\utils\Perl>perl read_dir.pl
> > File: open relay.txt
> > File: Server.txt
> > File: test
> > 3
> > ------------------
> >
> > In the result "test" is not a file but directory and I am trying to
> > distinguish this from the files so it would correctly say 2 files and 1
> > subdirectory.
> >
> > Much appreciated.
> >
> > Simon
> >
> >
> >
------------------------------
Date: 1 Apr 2004 00:43:59 -0800
From: anuradha.k.r@sify.com
Subject: Re: data types
Message-Id: <57efaf35.0404010043.1255d882@posting.google.com>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<c4903m$ki4$1@mamenchi.zrz.TU-Berlin.DE>...
> <anuradha.k.r@sify.com> wrote in comp.lang.perl.misc:
>
> [please don't top-post]
>
> > Hi,
> > Well let me be little more clear.The format of the file which I am
> > readiing is what I am actually looking for.In pl/1 irrespective of
> > what the data format is ie say integer/character/bits when read into a
> > bit(16) say
> > READ FILE INTO(X) where X is X(128) BIT(16),X will always give a
> > binary value ie the character/integer represented as 16 bit values.So
> > you need not know whether the data in file is fixed binary or varying
> > binary.However when I am porting this to perl ,I need to worry about
> > the exact data format in the file.
> > Thatz the reason why I asked that it would be necessary that my data
> > in file is in directly binary format(made of 1s and 0s) let it be
> > representing a character or a decimal value?
> > In my pl/1 program I am manipulating the bitstrings only to compute
> > some values.
> > Only if I am sure of the data format in the file in perl can I go for
> > options to manipulate them in my program,and see whether I need
> > pack/unpack etc.
> > I hope now its more clear?
>
> Not really.
>
> I guess what you're saying is:
>
> I have this file, and this is how I read it in PL/1. How can I read
> it in Perl, or, if I can't, how should I re-format it so that I can.
>
Exactly this is what i am looking for.
> The problem is that you have described your problem in terms of PL/1
> which few people here speak fluently. Neither the specification
> "...where X is X(128) BIT(16)", nor the terms "fixed binary" and
> "varying binary" have specific meaning outside PL/1 terminology.
>
I thought there were some pl1 experts in this group who knew perl as
well.They would definetely understand what the above statement means.
> Anno
>
> [TOFU snipped]
------------------------------
Date: 1 Apr 2004 12:23:33 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: data types
Message-Id: <c4h1k5$57o$1@mamenchi.zrz.TU-Berlin.DE>
<anuradha.k.r@sify.com> wrote in comp.lang.perl.misc:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message
> news:<c4903m$ki4$1@mamenchi.zrz.TU-Berlin.DE>...
> > <anuradha.k.r@sify.com> wrote in comp.lang.perl.misc:
[...]
> > The problem is that you have described your problem in terms of PL/1
> > which few people here speak fluently. Neither the specification
> > "...where X is X(128) BIT(16)", nor the terms "fixed binary" and
> > "varying binary" have specific meaning outside PL/1 terminology.
> >
> I thought there were some pl1 experts in this group who knew perl as
> well.They would definetely understand what the above statement means.
You mean you were hoping for Perl experts who know PL/1 as well. Of
course they would understand it. Everyone with a PL/1 manual or an
Internet connection can understand it if they make the effort to
look it up. However, it is neither polite, nor particularly clever
to require that.
You have better chances if you invest the time to explain your problem
in in general terms (bits, bytes and endian-ness) instead of sending
people to dusty language manuals before they understand what you mean.
Anno
------------------------------
Date: Thu, 01 Apr 2004 13:17:39 +0200
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: Inline C on Windows - what am i doing wrong?
Message-Id: <406bfb8b.0@juno.wiesbaden.netsurf.de>
SketchySteve wrote:
> I installed nmake incorrectly and solved the problem but the error message
> I'm now getting is as follows.
>
>
>
> Microsoft (R) Program Maintenance Utility Version 1.50
>
> Copyright (c) Microsoft Corp 1988-94. All rights reserved.
>
> C:\Perl\bin\perl.exe C:\Perl\lib\ExtUtils/xsubpp -typemap
> C:\Perl\lib\ExtUtils\typemap hello_pl_b1a688f821f707 19.xs >
> hello_pl_b1a688f821f70719.xsc && C:\Perl\bin\perl.exe -MExtUtils::Command -e
> mv hello_pl_b1a688f821f70719.xsc he llo_pl_b1a688f821f70719.c
>
> cl -c -IC:/ -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STR
> ICT -DHAVE_DES_FCRYPT -DNO_HASH_SE
> ED -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO
>
> -DPERL_MSVCRT_READFIX -MD -Zi -DNDEBUG -O1 -DVERSION=\"0.
>
> 00\" -DXS_VERSION=\"0.00\" "-IC:\Perl\lib\CORE" hello_pl_b1a688f821f70719.c
> 'cl' is not recognized as an internal or external command, operable program
> or batch file. NMAKE : fatal error
This means the VC++ command line compiler could not be found.
Do you have VC++ installed? If yes, run the batch file
VCVARS32.BAT (in the VC98\bin directory)
before running nmake.
If not, you'll have to install it.
Thomas
--
open STDIN,"<&DATA";$=+=14;$%=50;while($_=(seek( #J~.> a>n~>>e~.......>r.
STDIN,$:*$=+$,+$%,0),getc)){/\./&&last;/\w| /&&( #.u.t.^..oP..r.>h>a~.e..
print,$_=$~);/~/&&++$:;/\^/&&--$:;/>/&&++$,;/</ #.>s^~h<t< ..~. ...c.^..
&&--$,;$:%=4;$,%=23;$~=$_;++$i==1?++$,:_;}__END__#....>>e>r^..>l^...>k^..
------------------------------
Date: 31 Mar 2004 23:35:42 -0700
From: Jim Cochrane <jtc@shell.dimensional.com>
Subject: Re: Looking for Perl regexp powered Editor
Message-Id: <slrnc6ne1u.625.jtc@shell.dimensional.com>
In article <22061727.UXHrqH1ePx@GMT-hosting-and-pickle-farming>, Gregory Toomey wrote:
> Loup Blanc wrote:
>
>> Hi,
>> I'm looking for a text editor or a word processor that allows the use
>> of perl regexp commands. e.g. s/ / / and the like. The more perl
>> features available, the best it is.
>> Usually we have to make the script work on the closed text file, this
>> is what I want to avoid.
>> Plus, for word processing files, the previous solution won't work
>> because of the word processor particular coding of the text. So it
>> would be great to have perl text processing embedded in it.
>> Let me know if such softs exist, especially for MS Win.
>>
>> TIA
>
>
> If all you want is regular expressions, vi & emacs will do the job.
> Available on most platforms.
And vim is an "improved" version of vi that is available for win32.
--
Jim Cochrane; jtc@dimensional.com
[When responding by email, include the term non-spam in the subject line to
get through my spam filter.]
------------------------------
Date: 01 Apr 2004 04:27:23 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Looking for Perl regexp powered Editor
Message-Id: <86r7v7nas4.fsf@blue.stonehenge.com>
*** post for FREE via your newsreader at post.newsfeed.com ***
>>>>> "Jürgen" == Jürgen Exner <jurgenex@hotmail.com> writes:
Jürgen> Loup Blanc wrote:
>> I'm looking for a text editor or a word processor that allows the use
>> of perl regexp commands. e.g. s/ / / and the like. The more perl
>> features available, the best it is.
Jürgen> It should be fairly simple to write an elisp extension for emacs which calls
Jürgen> Perl on the mini-buffer or the edited text.
For a while, someone was maintaining a way to embed Perl inside of
Emacs, so you could write Perl programs that used Elisp (from the
command line), or Elisp routines that used Perl (while in full-screen
"editing" mode).
Very cool, but I never got it to work very well. I think I found it
in the CPAN somewhere.
print "Just another Perl hacker,"; # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
------------------------------
Date: Thu, 01 Apr 2004 13:29:04 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Looking for Perl regexp powered Editor
Message-Id: <x7k70zn7xc.fsf@mail.sysarch.com>
>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
Jürgen> It should be fairly simple to write an elisp extension for
Jürgen> emacs which calls Perl on the mini-buffer or the edited text.
RLS> For a while, someone was maintaining a way to embed Perl inside of
RLS> Emacs, so you could write Perl programs that used Elisp (from the
RLS> command line), or Elisp routines that used Perl (while in full-screen
RLS> "editing" mode).
RLS> Very cool, but I never got it to work very well. I think I found it
RLS> in the CPAN somewhere.
i copied these from somewhere and i just rediscovered them as i forgot i
had them. i just wrote a one liner to do some simple munging that would
be tons of lisp code (matching and grabbing and changes to case, etc.).
(defun perl-region (command)
"Run perl command on selected region"
(interactive "sWhat command: perl ")
(shell-command-on-region (mark) (point) (concat "perl " command) t t))
(defun perl-buffer (command)
"Run perl command on entire buffer"
(interactive "sWhat command: perl ")
(shell-command-on-region (point-min) (point-max) (concat "perl " command) t t))
(defun perl-point (command)
"Run perl command at point"
(interactive "sWhat command: perl ")
(shell-command (concat "perl " command) t))
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 01 Apr 2004 00:39:15 -0600
From: John Bokma <postmaster@castleamber.com>
Subject: Re: multiple lines / success or failure?!
Message-Id: <406bb98b$0$24338$58c7af7e@news.kabelfoon.nl>
Bernard El-Hagin wrote:
> John Bokma <postmaster@castleamber.com> wrote:
>
>>Geoff Cox wrote:
>>
>>
>>>Hello
>>>
>>>Re my previous posting on how to capture successive blocks of text
>>>between <p> and </p> where the </p> is not on the first line of the
>>>blocl of text in an html file ....
>
> It would have been so much more helpful to the OP if you'd actually
> told him where to look.
Google?
>>slurp your file in one scalar (search google, perl slurp mode)
>
> Why search google when the docs have the information?
take a peek at http://www.google.com/search?q=perl+slurp+mode
for example: http://www.perl.com/lpt/a/2003/11/21/slurp.html
how is that about some cool info?
> perldoc perlvar (look for $/)
I guess if you know which variable to look for you already know the
solution. I personally rather know the name of the technique (slurp
mode) than its something with a $ and some other funny character :-D.
>>find out how you can do minimal matching, or non-greedy matching
>
> perldoc perlretut
> perldoc perlre
http://www.google.com/search?q=perl+minimal+matching
e.g. http://iis1.cps.unizar.es/Oreilly/perl/prog/ch01_07.htm (is this
legal? seems an O´Reilly book)
>>find out how you can match a new line (\n) with .
>
> perldoc perlop (look for m/PATTERN/cgimosx)
http://www.google.com/search?q=perl+minimal+matching
e.g. http://www.wellho.net/regex/perl.html
perldoc is the reference, I agree, but with google you will find more
stuff, and i guess easier, often in an easier to read format, and with
more examples (yes, some wrong and / or bad too).
--
John personal page: http://johnbokma.com/
Freelance Perl / Java developer available - http://castleamber.com/
------------------------------
Date: Thu, 1 Apr 2004 09:22:42 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: multiple lines / success or failure?!
Message-Id: <Xns94BE5EA5BC78elhber1lidotechnet@62.89.127.66>
John Bokma <postmaster@castleamber.com> wrote:
> Bernard El-Hagin wrote:
>
>> John Bokma <postmaster@castleamber.com> wrote:
>>
>>>Geoff Cox wrote:
>>>
>>>
>>>>Hello
>>>>
>>>>Re my previous posting on how to capture successive blocks of
>>>>text between <p> and </p> where the </p> is not on the first
>>>>line of the blocl of text in an html file ....
>>
>> It would have been so much more helpful to the OP if you'd
>> actually told him where to look.
>
> Google?
What about it?
>>>slurp your file in one scalar (search google, perl slurp mode)
>>
>> Why search google when the docs have the information?
>
> take a peek at http://www.google.com/search?q=perl+slurp+mode
>
> for example: http://www.perl.com/lpt/a/2003/11/21/slurp.html
>
> how is that about some cool info?
Yeah, "cool info", but the docs which are on your harddrive have
sufficient information to solve the OP's problem.
>> perldoc perlvar (look for $/)
>
> I guess if you know which variable to look for you already know
> the solution.
That's why I told the OP which variable to look for. Duh.
> I personally rather know the name of the technique
> (slurp mode) than its something with a $ and some other funny
> character :-D.
The name of the "technique" is right there in the docs where I
pointed the OP.
>>>find out how you can do minimal matching, or non-greedy matching
>>
>> perldoc perlretut
>> perldoc perlre
>
> http://www.google.com/search?q=perl+minimal+matching
So what's your point? That there is a lot of Perl related information
on the Web? Duh. My point was that the OP's question could be
answered by just looking at the standard documentation which is
(should be) available right there on his harddrive.
> e.g. http://iis1.cps.unizar.es/Oreilly/perl/prog/ch01_07.htm (is
> this legal? seems an O´Reilly book)
It sure looks illegal to me. Not only is it illegal, it's out of
date. Not only is it illegal and out of date, it's *also*
"Programming Perl" which is hugely based on the standard
documentation which is right there on the OP's harddrive.
>>>find out how you can match a new line (\n) with .
>>
>> perldoc perlop (look for m/PATTERN/cgimosx)
>
> http://www.google.com/search?q=perl+minimal+matching
>
> e.g. http://www.wellho.net/regex/perl.html
And how is the OP to choose a good site from the multiple choices
Google gives him? I know that if I were a beginner and I stumbled
upon a site that sells "Regular expression mousemats", as does the
site you quoted, I'd move quickly along (whether I would be right or
not in doing so is beside the point). On the other hand, I *know*
that the documentation provided in the Perl distribution comes from a
reliable source.
> perldoc is the reference, I agree
It's a fact. You can't agree or disagree with facts.
> but with google you will find more stuff
You'll also find more crap, and when you're a beginner you often
can't tell the difference between good advice and crap.
> and i guess easier, often in an easier to read format
You mean in a format other than text?
> and with more examples (yes, some wrong and / or bad too).
"yes, some wrong and / or bad too" is the reason why saying "search
on google" to a beginner is not always the best advice, when the
answer to a question is right there in the ~1200 pages of well
written documentation provided by Larry Wall and co.
--
Cheers,
Bernard
------------------------------
Date: Thu, 01 Apr 2004 01:47:19 -0600
From: John Bokma <postmaster@castleamber.com>
Subject: Re: multiple lines / success or failure?!
Message-Id: <406bc9b9$0$24361$58c7af7e@news.kabelfoon.nl>
Bernard El-Hagin wrote:
> John Bokma <postmaster@castleamber.com> wrote:
>
>>Bernard El-Hagin wrote:
> "yes, some wrong and / or bad too" is the reason why saying "search
> on google" to a beginner is not always the best advice, when the
> answer to a question is right there in the ~1200 pages of well
> written documentation provided by Larry Wall and co.
And sometimes it is a good addition, or in an easier to read format (as
better formatted, clear tables, and with a proportional font etc). Also
more examples are provided, as in the first google result I posted.
Finally, contrary to populair belief, Usenet is not a helpdesk. I did
not get paid to give the answer. It contained a lot of useful hints to
get started in the FAQs, on Google (as I showed), or the perl
documentation. If the OP found my hints not useful, he could ask for
some clarification.
--
John personal page: http://johnbokma.com/
Freelance Perl / Java developer available - http://castleamber.com/
------------------------------
Date: Thu, 1 Apr 2004 10:23:08 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: multiple lines / success or failure?!
Message-Id: <Xns94BE68E498E95elhber1lidotechnet@62.89.127.66>
John Bokma <postmaster@castleamber.com> wrote:
> Bernard El-Hagin wrote:
>
>> John Bokma <postmaster@castleamber.com> wrote:
>>
>>>Bernard El-Hagin wrote:
>
>> "yes, some wrong and / or bad too" is the reason why saying
>> "search on google" to a beginner is not always the best advice,
>> when the answer to a question is right there in the ~1200 pages
>> of well written documentation provided by Larry Wall and co.
>
> And sometimes it is a good addition, or in an easier to read
> format (as better formatted, clear tables, and with a proportional
> font etc). Also more examples are provided, as in the first google
> result I posted.
>
> Finally, contrary to populair belief, Usenet is not a helpdesk.
I do not share that "popular belief", so we agree there.
> I did not get paid to give the answer.
Of course not, but if you've decided to give an answer then at least
make it useful. Otherwise you're just making noise and nobody here
gets paid to wade through noise either.
> It contained a lot of useful hints
Hints are nice, but only if they're useful. A "hint" which results in
21.600 hits ("slurp mode" on google) is as close to crap as anything
I produce after having indian food. A beginner is never going to be
able to tell which of the hits are good and which aren't. But he
*can* be sure that the documentation provided with Perl, which is
*perfectly sufficient* to solve his problem, can be relied on.
> to get started in the FAQs, on Google (as I showed), or the perl
> documentation. If the OP found my hints not useful, he could
> ask for some clarification.
"ask for some clarification" == more noise which was totally
unnecessary in this case.
As far as I'm concerned this topic is closed.
--
Cheers,
Bernard
------------------------------
Date: Thu, 01 Apr 2004 13:38:29 +0200
From: Anders Christensen <anders_postkasse@hotmail.com>
Subject: Perl syntax
Message-Id: <c4guse$2lmh$1@news.cybercity.dk>
Hey,
Could anyone help me understanding the following code-example. The
code-example is taken out of a context, so it won't give any functionality
as you see it - what I'd like help on is what $:: and %:: means...? Which
scalar and hash is in question?
The codeexample:
#[Bla,bla,bla...]
sub ProcessFormFields {
my ($buffer) = (@_);
return ParseUrlString($buffer, %::FORM, %::MFORM);
}
#[Bla,bla,bla...]
if ( defined $::FORM{$fieldname} ) {
$::FORM{$fieldname} .= $fieldvalue;
#[Bla,bla,bla...]
}
./Anders
------------------------------
Date: Thu, 1 Apr 2004 13:55:00 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: Perl syntax
Message-Id: <Xns94BE8CCFF26EEelhber1lidotechnet@62.89.127.66>
Anders Christensen <anders_postkasse@hotmail.com> wrote:
> Hey,
> Could anyone help me understanding the following code-example. The
> code-example is taken out of a context, so it won't give any
> functionality as you see it - what I'd like help on is what $::
> and %:: means...? Which scalar and hash is in question?
$::x is equivalent to $main::x. In other words, the default package
which is always assumed unless you explicitely specify a different one.
--
Cheers,
Bernard
------------------------------
Date: Thu, 01 Apr 2004 14:21:27 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Perl syntax
Message-Id: <c4h1hu$2hovfh$1@ID-184292.news.uni-berlin.de>
[ DO NOT MULTI-POST!!
I just answered your question in alt.perl, since I didn't know that
you had posted in comp.lang.perl.misc as well and that Bernard already
had answered.
That's rude! Behave yourself!! ]
Anders Christensen wrote:
> Could anyone help me understanding the following code-example.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Thu, 01 Apr 2004 15:13:11 +0200
From: Anders Christensen <anders_postkasse@hotmail.com>
Subject: Re: Perl syntax
Message-Id: <c4h4e1$2r1c$1@news.cybercity.dk>
Hi Gunnar,
I'm sorry about that! :-/
Thank you very much for your answer.
./Anders
------------------------------
Date: Thu, 01 Apr 2004 15:15:30 +0200
From: Anders Christensen <anders_postkasse@hotmail.com>
Subject: Re: Perl syntax
Message-Id: <c4h4ic$2r1c$2@news.cybercity.dk>
Hi Gunnar,
I'm sorry about that! :-/
Thank you very much for your answer.
./Anders
------------------------------
Date: Thu, 01 Apr 2004 15:14:07 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Perl syntax
Message-Id: <c4h4kn$2hhhb7$2@ID-184292.news.uni-berlin.de>
Anders Christensen wrote:
> Hi Gunnar,
> I'm sorry about that! :-/
> Thank you very much for your answer.
Okay...
That's a netiquette thing. Now you know when you post to Usenet next
time. ;-)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 1 Apr 2004 06:29:31 GMT
From: Fred Ma <fma@doe.carleton.ca>
Subject: Re: Python from the command line (was: Choosing Perl/Python for my particular niche)
Message-Id: <406BB6C4.7F3ADD4@doe.carleton.ca>
Cameron Laird wrote:
>
> In article <4069F1FD.601C9079@doe.carleton.ca>,
> Fred Ma <fma@doe.carleton.ca> wrote:
> .
> .
> .
> >Perl/sed. About invoking Perl as part of a simple command in a
> >pipeline, I mean that one doesn't even have to write a script for it,
> >similar to sed
> >
> > Command1 | sed -e Expression1 -e Expression2 ... | Command_N
> >
> >This might also be possible in Python, in which case so much the better.
> >I'll find out (or someone might answer in a follow-up post). Thanks
> .
> .
> .
> # python -c "print 3 + 5"
> 8
I was 99.99% sure that it was possible (heck, if tcsh and bash can do
it, python surely can). It's a little easier to squish it into a simple
command in a pipeline for a terse/compact "language" e.g. sed. On a
side-note, I've abused sed before by embedded sed scripts into bash
scripts without actually writing the sed script:
Bash_Command | \
sed \
-e 'Expression1' \
-e 'Expression2' \
-e 'Conditional1 {' \
-e 'Body_of_Conditional1' \
-e 'More_of_Body' \
-e '}' \
| More_Bash_Commands
Not that I want to do everything in sed, of course. And for
perl/python, there is probably not much reason to mix commands
with bash, since (unlike sed) they have the shell functionality.
I've put in a request to my sysadmin to install python. The
way to get hooked on it is to start small, with mundane tasks
(same as with any new shell, I suppose). If it doesn't get
installed due to lack of priority, I can always get it
bundled with my next cygwin update. Cygwin is an absolute
blessing. Everything comes prebuilt (lots of stuff) and
you have superuser priveleges, as well as simultaneous
access to Windows. Just as long as your HDD isn't FAT
(that prevents chmod from working).
But I digress.....
Fred
--
Fred Ma
Dept. of Electronics, Carleton University
1125 Colonel By Drive, Ottawa, Ontario
Canada, K1S 5B6
------------------------------
Date: Thu, 01 Apr 2004 12:50:08 -0000
From: claird@lairds.com (Cameron Laird)
Subject: Re: Python from the command line (was: Choosing Perl/Python for my particular niche)
Message-Id: <106o400l16eub3f@corp.supernews.com>
In article <406BB6C4.7F3ADD4@doe.carleton.ca>,
Fred Ma <fma@doe.carleton.ca> wrote:
.
.
.
>I've put in a request to my sysadmin to install python. The
>way to get hooked on it is to start small, with mundane tasks
>(same as with any new shell, I suppose). If it doesn't get
>installed due to lack of priority, I can always get it
>bundled with my next cygwin update. Cygwin is an absolute
>blessing. Everything comes prebuilt (lots of stuff) and
>you have superuser priveleges, as well as simultaneous
>access to Windows. Just as long as your HDD isn't FAT
>(that prevents chmod from working).
.
.
.
Oh! Apparently Win* is the platform of interest; that
hadn't occurred to me.
There's a LOT to say specifically on the topic of Python-
for-Windows-system-administration. You might want to
start with Mark Hammond's book.
I'm no great fan of CYGWIN for my own use, although I
certainly recognize it's been historically important.
It occurs to me that perhaps we haven't made adequately
clear how easy it is to install native Python on Windows.
It should take less time doing it than talking about do-
ing it. I'm not arguing with your approach; I just want
to ensure we've been clear about the alternatives.
Follow-ups narrowed.
--
Cameron Laird <claird@phaseit.net>
Business: http://www.Phaseit.net
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 6350
***************************************