[24842] in Perl-Users-Digest
Perl-Users Digest, Issue: 6993 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 11 14:07:30 2004
Date: Sat, 11 Sep 2004 11:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 11 Sep 2004 Volume: 10 Number: 6993
Today's topics:
Re: "RFC": re [un]pack() <nobull@mail.com>
Re: $| (undocumented) magic? <pinyaj@rpi.edu>
Re: another try (Anno Siegel)
Re: better way to parse html <miknrene@drizzle.com>
building Apache::Template 0.9 <ThomasKratz@REMOVEwebCAPS.de>
command line search and replace dilemma (D. Alvarado)
Re: command line search and replace dilemma <mritty@gmail.com>
Re: command line search and replace dilemma <miknrene@drizzle.com>
Re: command line search and replace dilemma <nobull@mail.com>
Re: command line search and replace dilemma <jkeen_via_google@yahoo.com>
Re: How to expand escape sequence (e.g. \n)? <wojtekdz@att.net>
Re: How to expand escape sequence (e.g. \n)? <mritty@gmail.com>
Re: How to expand escape sequence (e.g. \n)? <tadmc@augustmail.com>
Re: How to expand escape sequence (e.g. \n)? <nobull@mail.com>
Re: Name of variable is value of other variable (Bart Van der Donck)
Re: Name of variable is value of other variable <uri@stemsystems.com>
Re: Name of variable is value of other variable <tadmc@augustmail.com>
Re: Name of variable is value of other variable <nobull@mail.com>
Re: Name of variable is value of other variable <uri@stemsystems.com>
Re: Network Scanner (Chad Brown)
Re: Perl 6 and OOP <bik.mido@tiscalinet.it>
Re: Perl 6 and OOP (J. Romano)
Re: Perl XSLT module? <nobull@mail.com>
Re: Xah Lee's Unixism jmfbahciv@aol.com
Re: Xah Lee's Unixism jmfbahciv@aol.com
Re: Xah Lee's Unixism <wyrmwif@tango-sierra-oscar-foxtrot-tango.fake.org>
Re: Xah Lee's Unixism <roo@try-removing-this.darkboong.demon.co.uk>
Re: Xah Lee's Unixism <roo@try-removing-this.darkboong.demon.co.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 11 Sep 2004 16:35:44 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: "RFC": re [un]pack()
Message-Id: <chv5of$m7l$1@sun3.bham.ac.uk>
Anno Siegel wrote:
> Michele Dondi <bik.mido@tiscalinet.it> wrote in comp.lang.perl.misc:
>
>>On Thu, 09 Sep 2004 23:15:25 +0200, Michele Dondi
>><bik.mido@tiscalinet.it> wrote:
>>
>>
>>>Coming to the point, it often happens to resort to "cascaded"
>>>[un]pack()s. In my specific case I have
>>
> I have occasionally used a sequence of pack and unpack in a single
> statement (can't remember triple ones), so I don't see much need for
> your syntax extension.
[snip more stuff]
I concur completely with Anno.
------------------------------
Date: Sat, 11 Sep 2004 09:53:04 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
Subject: Re: $| (undocumented) magic?
Message-Id: <Pine.SGI.3.96.1040911094911.500296A-100000@vcmr-64.server.rpi.edu>
On Fri, 10 Sep 2004, Michele Dondi wrote:
>On Fri, 10 Sep 2004 00:57:20 -0400, Jeff 'japhy' Pinyan
><pinyaj@rpi.edu> wrote:
>
>>The C code implementing $| basically says "if the value assigned to $| is
>>true, have $| return 1, otherwise have it return 0". This leads to the
>
>(Having not seen the actual code, and not being to) I *think* that
>basically it should say "if the result of an assignment is true then
>actually store 1 in it, otherwise store 0 in it". Isn't this closer?
>Thank you for the kind explanation, anyway...
Nothing is ever "stored" in $|, just like nothing is ever "stored" in a
tied variable. $| is like a tied variable, but on an internal level.
When you set $| to a true value, the internals turn off buffering for the
currently selected filehandle, and when you read $|'s value, Perl checks
to see if the currently selected filehandle has buffering on or off. $|
is just a placeholder.
--
Jeff "japhy" Pinyan % How can we ever be the sold short or
RPI Acacia Brother #734 % the cheated, we who for every service
Senior Dean, Fall 2004 % have long ago been overpaid?
RPI Corporation Secretary %
http://japhy.perlmonk.org/ % -- Meister Eckhart
------------------------------
Date: 11 Sep 2004 12:26:12 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: another try
Message-Id: <chuqt4$6sn$1@mamenchi.zrz.TU-Berlin.DE>
Darius <dmedhora@yahoo.com> wrote in comp.lang.perl.misc:
> Mark Clements <mark.clements@kcl.ac.uk> wrote in message
> news:<41415c47$1@news.kcl.ac.uk>...
[text snipped and re-formatted for legibility. please keep your line
length below 72 characters]
> When it was urgent, i used arrays to solve it shamelessly:) but then
How is "using arrays" an alternative to a regex solution?
> looking at this example, and also as per Anno, i dont think its
> possible to use regex anyway.
That's not what I said. In fact, if you had followed the hint
"try a string without another '=' in it" you might have found that
s/="[^=]*?Gotta/="Somethings Gotta/g;
does the right thing with your examples.
The problem is that it is an unreliable ad-hoc solution that works
in this case, but may not in reasonably similar cases.
Anno
------------------------------
Date: Sat, 11 Sep 2004 07:19:38 -0700
From: Michael Slass <miknrene@drizzle.com>
Subject: Re: better way to parse html
Message-Id: <m3k6v0opl1.fsf@eric.rossnet.com>
Fred <noemail@#$&&!.net> writes:
>Greetings,
>I am using this code to impersonate a browser, grab a page and return only
>the data elements I want, namely the ozone level. I would like to
>entertain any comments about style, and in particular what the heck this
>line does:
> $list[2] =~ s/<(?:[^>'"]*|(['"]).*?\1)*>//gs;
>because it is really past my understanding, I got it from the FAQ's
Since Tad has already explained the regex, I'll point you towards the
HTML::Parser module, which is a more generalized way to, well, parse
HTML.
--
Mike Slass
------------------------------
Date: Sat, 11 Sep 2004 15:51:47 +0200
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: building Apache::Template 0.9
Message-Id: <chuvtl$lr1$1@online.de>
I have spend the last 2 days trying to build Apache::Template 0.9 on
perl 5.8.4, win32 with MSVC6 (Apache 1.3.31/mod_perl 1.26/Template
Toolkit 2.13 built without problems).
After solving some strange header file problems and some linking
difficulties (I had to link the apache and mod_perl libraries manually),
I am left with 1 unresolved link:
Template.obj : error LNK2001: unresolved external symbol
_perl_perl_merge_srv_config blib\arch\auto\Apache\Template\Template.dll
: fatal error LNK1120: 1 unresolved externals
Does anybody know which library should have "_perl_perl_merge_srv_config"?
It sure isn't anywhere on my system.
TIA
Thomas
------------------------------
Date: 11 Sep 2004 08:39:02 -0700
From: laredotornado@zipmail.com (D. Alvarado)
Subject: command line search and replace dilemma
Message-Id: <9fe1f2ad.0409110739.2b065866@posting.google.com>
Hello, I have a certain string that appears repeatedly in my code
style="background-image:url("/path/to/an/image");"
I would like to replace all instances with
style="background-image:url('/path/to/an/image');"
where "/path/to/an/image" is not always necessarily the same for each
instance. I learned this great command line search and replace
method:
perl -pi -e 's/expr/replacement/g' *.html
but when I try
> perl -pi -e 's/background-image:url\(\"(.*?)\"\);/background-image:url(\'$1\');/g" *.html
I get the error:
-bash: syntax error near unexpected token `)'
Can anyone help? Thanks, - Dave
------------------------------
Date: Sat, 11 Sep 2004 12:07:31 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: command line search and replace dilemma
Message-Id: <chv7si$bsm$1@misc-cct.server.rpi.edu>
D. Alvarado wrote:
> when I try
>
> perl -pi -e 's/background-image:url\(\"(.*?)\"\);/background-image:url(\'$1\');/g" *.html
>
> I get the error:
>
> -bash: syntax error near unexpected token `)'
Is there some reason you use ' at the start of the program (right after
the -e), but " at the end (right after the /g)?
Paul Lalli
------------------------------
Date: Sat, 11 Sep 2004 09:18:51 -0700
From: Michael Slass <miknrene@drizzle.com>
Subject: Re: command line search and replace dilemma
Message-Id: <m3llfgdbis.fsf@eric.rossnet.com>
laredotornado@zipmail.com (D. Alvarado) writes:
>Hello, I have a certain string that appears repeatedly in my code
>
>style="background-image:url("/path/to/an/image");"
>
>I would like to replace all instances with
>
>style="background-image:url('/path/to/an/image');"
>
>where "/path/to/an/image" is not always necessarily the same for each
>instance. I learned this great command line search and replace
>method:
>
>perl -pi -e 's/expr/replacement/g' *.html
>
>but when I try
>> perl -pi -e 's/background-image:url\(\"(.*?)\"\);/background-image:url(\'$1\');/g" *.html
>
>
>I get the error:
>
>-bash: syntax error near unexpected token `)'
>
>
>Can anyone help? Thanks, - Dave
1) My version of perl won't accept the -i switch unless I provide an
extension for a backup file like -i.bak
2) I've replaced your .*?" with [^"]+ which saves some backtracking.
3) The answer to the heart of your question:
The shell doesn't interpret *anything* inside single quotes, including
a backslash, so you can't escape
>>'s/background-image:url\(\"(.*?)\"\);/background-image:url(\'$1\');/g" *.html
---------------------------------------------------- these ---^---^
like you're trying to. Instead, you'll need to use double quotes for
the shell, and do your escapes in there, including escaping again for perl.
Since you're going to use double quotes for the shell, you're going to
have to escape $, \, and " for the shell.
A good diagnostic for this is to replace the perl command and switches
with echo, so you can see what perl is going to get from the shell.
(pardon the overlength lines below)
perl -pi.bak -e "s/background-image:url\\(\\\"([^\"]+)\\\"\\);/background-image:url(\\'\$1\\');/g" *.html
shell converts to \ ------------------^^
shell converts to \" ---------------------^^^^
shell converts to " ----------------------------^^
shell converts to \" ---------------------------------^^^^
shell converts to \ -------------------------------------^^
And so on.
You can avoid this nastiness by placing your one-liner in a file; then
the shell doesn't get a crack at it.
--
Mike Slass
------------------------------
Date: Sat, 11 Sep 2004 17:43:11 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: command line search and replace dilemma
Message-Id: <chv9mu$o0p$1@sun3.bham.ac.uk>
D. Alvarado wrote:
> Hello, I have a certain string that appears repeatedly in my code
>
> style="background-image:url("/path/to/an/image");"
>
> I would like to replace all instances with
>
> style="background-image:url('/path/to/an/image');"
>
> where "/path/to/an/image" is not always necessarily the same for each
> instance. I learned this great command line search and replace
> method:
>
> perl -pi -e 's/expr/replacement/g' *.html
>
> but when I try
>
>
>>perl -pi -e 's/background-image:url\(\"(.*?)\"\);/background-image:url(\'$1\');/g" *.html
>
>
> I get the error:
>
> -bash: syntax error near unexpected token `)'
I get
bash: syntax error near unexpected token `;'
Are you sure you cut and paste verbatin.
>
>
> Can anyone help?
What you have here is a question about bash which has notihng to do with
Perl.
You know what you want to be passed into perl as the -e argument but you
need to express this string literal in bash.
The problem would be exactly the same if perl were replaced with awk,
sed, python etc.
Hint:
$ echo 'This has a " and a '"' in it"
This has a " and a ' in it
------------------------------
Date: Sat, 11 Sep 2004 16:57:04 GMT
From: Jim Keenan <jkeen_via_google@yahoo.com>
Subject: Re: command line search and replace dilemma
Message-Id: <A7G0d.473$VV2.275@trndny06>
D. Alvarado wrote:
> Hello, I have a certain string that appears repeatedly in my code
>
> style="background-image:url("/path/to/an/image");"
>
> I would like to replace all instances with
>
> style="background-image:url('/path/to/an/image');"
>
> where "/path/to/an/image" is not always necessarily the same for each
> instance. I learned this great command line search and replace
> method:
>
> perl -pi -e 's/expr/replacement/g' *.html
>
> but when I try
>
>
>>perl -pi -e 's/background-image:url\(\"(.*?)\"\);/background-image:url(\'$1\');/g" *.html
>
>
> I get the error:
>
> -bash: syntax error near unexpected token `)'
>
>
> Can anyone help? Thanks, - Dave
Would this suffice?
perl -pi -e "s{\"([/)])}{'\$1}g" *.html
jimk
------------------------------
Date: Sat, 11 Sep 2004 12:53:53 GMT
From: "Wojtek Dziegielewski" <wojtekdz@att.net>
Subject: Re: How to expand escape sequence (e.g. \n)?
Message-Id: <BzC0d.2140$z_3.1622@trndny07>
My apologies for the typo - it was a long day for me.
My actual scenario however is more complex and cannot be addressed by a
simple assignment. I used initial assignment to $a as an illustration and
not the actual piece of code.
my $a = '\n\n'; # in reality $a is read from XML config file, so I can't
say my $a = "\n\n"; instead
I need to take a value of $a (which contains literal '\n\n') and have it
translated to 2 newlines. Haw can I do that?
"Scott W Gifford" <gifford@umich.edu> wrote in message
news:qsz4qm5tl6t.fsf@mspacman.gpcc.itd.umich.edu...
> "Wojtek Dziegielewski" <wojtekdz@att.net> writes:
>
> [...]
>
> > my sequence for the input record separator is inside a variable,
> > like this:
> >
> > my $a = '/n/n';
> >
> > I need to assign the contents of $a to $/ in such a way that /n's will
get
> > translated into newline characters. How can I have it accomplished in
Perl?
>
> It works like you'd expect, except there are two bugs in your code
> above. First, you use a backslash, not a forward slash, to write \n.
> Second, \n isn't interpreted inside of single quotes, but only inside
> of double quotes. So if you do:
>
> my $a = "\n\n";
> $/ = $a;
>
> you'll get what you expect.
>
> ----ScottG.
------------------------------
Date: Sat, 11 Sep 2004 09:12:06 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: How to expand escape sequence (e.g. \n)?
Message-Id: <chutjl$bag$1@misc-cct.server.rpi.edu>
Wojtek Dziegielewski wrote:
> My apologies for the typo - it was a long day for me.
>
> My actual scenario however is more complex and cannot be addressed by a
> simple assignment. I used initial assignment to $a as an illustration and
> not the actual piece of code.
>
> my $a = '\n\n'; # in reality $a is read from XML config file, so I can't
> say my $a = "\n\n"; instead
>
> I need to take a value of $a (which contains literal '\n\n') and have it
> translated to 2 newlines. Haw can I do that?
>
A simple search and replace will do it:
$a =~ s/\\n/\n/g;
That searched for all literal \n and replaces them with a new-line
character.
Paul Lalli
------------------------------
Date: Sat, 11 Sep 2004 08:53:19 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to expand escape sequence (e.g. \n)?
Message-Id: <slrnck60qf.big.tadmc@magna.augustmail.com>
[ Please do not post upside-down. We don't like it here (nor does
anywhere else on Usenet).
]
Wojtek Dziegielewski <wojtekdz@att.net> wrote:
> I need to take a value of $a (which contains literal '\n\n') and have it
> translated to 2 newlines. Haw can I do that?
$a =~ s/\\n/\n/g;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 11 Sep 2004 16:18:24 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to expand escape sequence (e.g. \n)?
Message-Id: <chv4o1$lq1$1@sun3.bham.ac.uk>
Wojtek Dziegielewski top-posts (please don't):
>
> my $a = '\n\n'; # in reality $a is read from XML config file, so I can't
> say my $a = "\n\n"; instead
You could condider using the actual string in the XML rather than a
representation of it.
> I need to take a value of $a (which contains literal '\n\n') and have it
> translated to 2 newlines. Haw can I do that?
Take a step back. The string '\n\n' is a representation of two newlines
in Perl source code. There is a way to cause perl to interpret a
string as Perl source code. This is the eval(STRING) function. The
problem is that if you use the eval(STRING) to implement this you allow
the the person writing the config file to execute arbitrary commands
inclusing stuff like system('rm -rf /'). For this reason many of the
people 'round here consider the existance of eval() to be forbidden
knowledge.
Depending on circumstances it may be that the config file already has
the capability to execute arbitrary code. For example there may be
parameters that are to be interpreted as shell commands. If this is the
case then then perhaps eval() would not be such a bad idea.
So my advice is probably that you should not use eval() but you should
not make this decision by default simply by not being aware of the option.
Should you want to use eval...
chop( $a = eval "<<__EOD__\n$a\n__EOD__" );
This will expand \n and \t and anthing else you could embeb in a
double-quotish context like \x{263a} but also including arbitrary Perl
statements using @{ whatever }.
If you do not want to provide the config file with the full semantics of
Perl double-quotish string then you can implement a subset of the
semantics using a s/// as others have suggested - just choose your subset.
------------------------------
Date: 11 Sep 2004 00:15:33 -0700
From: bart@nijlen.com (Bart Van der Donck)
Subject: Re: Name of variable is value of other variable
Message-Id: <b5884818.0409102315.308bcfe8@posting.google.com>
Tad wrote:
> If you _did_ want to use a symbolic reference (but you don't!),
> then it would be:
> $myvar = $$pp;
I imagined $"$pp" (see previous) and it's amazing how perl pre-felt
that kind of reference I was thinking about.
Despite your advice, I 'm gonna take my chances on $$pp. I believe
this is most suited to what I 'm up to (my initial code was only a
simplification).
thanks Tad & the others
Bart
------------------------------
Date: Sat, 11 Sep 2004 11:31:01 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Name of variable is value of other variable
Message-Id: <x7mzzx11s1.fsf@mail.sysarch.com>
>>>>> "BVdD" == Bart Van der Donck <bart@nijlen.com> writes:
BVdD> Tad wrote:
>> If you _did_ want to use a symbolic reference (but you don't!),
>> then it would be:
>> $myvar = $$pp;
BVdD> I imagined $"$pp" (see previous) and it's amazing how perl pre-felt
BVdD> that kind of reference I was thinking about.
BVdD> Despite your advice, I 'm gonna take my chances on $$pp. I believe
BVdD> this is most suited to what I 'm up to (my initial code was only a
BVdD> simplification).
that isn't advice but very sage wisdom that you are ignoring. it is like
buying a gun and turning down a safety training course. you will shoot
yourself in the foot (or worse) if you use symrefs for ordinary data.
maybe this will convince you. do you realize that using symrefs is just
using the symbol table as a hash tree? and that the symbol table is just
a hash with special side effects? so using a regular hash is safer,
simpler, more flexible (you can have lexical hashes, assign anything to
any slot), handle references better, etc.
the ONLY reason to mung the symbol table is when you need to mung the
symbol table. it is NOT meant for use as a general purpose hash
tree. that is why strict disallows it.
now put down the gun and step back from the keyboard. listen to what
all experienced perl hackers will tell you. DO NOT USE SYMREFS FOR
ORDINARY DATA. do you get it? it is NOT simpler however much your brain
says it is.
you have been warned.
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: Sat, 11 Sep 2004 08:51:20 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Name of variable is value of other variable
Message-Id: <slrnck60mo.big.tadmc@magna.augustmail.com>
Bart Van der Donck <bart@nijlen.com> wrote:
> Tad wrote:
>
>> If you _did_ want to use a symbolic reference (but you don't!),
> Despite your advice, I 'm gonna take my chances on $$pp. I believe
> this is most suited to what I 'm up to
You are making the wrong decision.
You don't need symrefs, you can do just what you want by
using a hash directly rather than shoe-horning your way
into the Symbol Table hash.
You will introduce hard-to-find bugs by using symrefs.
Just say No!
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 11 Sep 2004 16:32:19 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Name of variable is value of other variable
Message-Id: <chv5i2$m2u$1@sun3.bham.ac.uk>
Bart Van der Donck wrote:
> Tad wrote:
>
>
>>If you _did_ want to use a symbolic reference (but you don't!),
>>then it would be:
>> $myvar = $$pp;
>
> Despite your advice, I 'm gonna take my chances on $$pp. I believe
> this is most suited to what I 'm up to (my initial code was only a
> simplification).
Unlike Tad and Uri I am not fanatically opposed to symrefs (and/or
eval). There are cases where the convienence is worth the hazards
implicit in using such a powerfull and hard to control tools.
However I'm ~99% sure this is not such a case.
If you won't accept the advice not to use symrefs from people who always
advise against symrefs then please accept the advice of someone who
doesn't always advise against symrefs. Don't do it.
------------------------------
Date: Sat, 11 Sep 2004 16:07:42 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Name of variable is value of other variable
Message-Id: <x7acvwzt5z.fsf@mail.sysarch.com>
>>>>> "BM" == Brian McCauley <nobull@mail.com> writes:
BM> Bart Van der Donck wrote:
>> Tad wrote:
>>
>>> If you _did_ want to use a symbolic reference (but you don't!),
>>> then it would be:
>>> $myvar = $$pp;
>>
>> Despite your advice, I 'm gonna take my chances on $$pp. I believe
>> this is most suited to what I 'm up to (my initial code was only a
>> simplification).
BM> Unlike Tad and Uri I am not fanatically opposed to symrefs (and/or
BM> eval). There are cases where the convienence is worth the hazards
BM> implicit in using such a powerfull and hard to control tools.
i would like to see such a case where the goal is not to mung the symbol
table and is only for data structure purposes. if the symtable is just a
hash, then symrefs are just an alternate syntax to mung hash trees. and
the minor possible golf benefits of the symref syntax over regular
hashes is not worth the danger. and as i and others have said many
times, regular hashes have many advantages over symrefs but symrefs have
only two features, it mungs the symbol table (very needed) and a diff
syntax from hashes (not important).
BM> If you won't accept the advice not to use symrefs from people who
BM> always advise against symrefs then please accept the advice of
BM> someone who doesn't always advise against symrefs. Don't do it.
so when do you advise their use?
and i hope we haven't lost this newbie to the 7th hells of symrefs. :)
we need more than mjd's var var stuff and the faq entry. i have posted
many times on this with stuff that isn't mentioned in either place
(notably that the symtable is just a hash tree with side effects). this
question is coming up way too often these days.
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: 11 Sep 2004 09:55:33 -0700
From: chad@wononline.net (Chad Brown)
Subject: Re: Network Scanner
Message-Id: <ea150da0.0409110855.3aa8aee7@posting.google.com>
ChrisO <ceo@nospam.on.net> wrote in message news:<8hm0d.9623$ZC7.3452@newssvr19.news.prodigy.com>...
> Chad Brown wrote:
> > I put together a script for scaning a network. Features are DNS
> > resolution, selective port scan, scanning of multiple addresses at one
> > time, and ping sweep. Ports can be customized depending on what is
> > being sought on a network. If anyone decides to add more ideas to this
> > please send me a copy. Im very interested in input. (:
> >
>
> Are you doing this for a learning exercise? Because there are already
> mature, open source network scanners that even a mature, very
> knowledgable Perl developer would be hard put to match.
>
> -ceo
Im well aware of the existence of other scanners. I put this together
so that I could add more stuff onto it and customize and possibly get
other scripts to work with it.
And about the mature... This project is "YES"... a learning
exercise... I wouldnt have took it on if I have seen other scanners
out there. I was looking for constructive help not critisism. Also as
the post says I was looking for ideas. This is not a cocky display of
junky code... Yea im not the best at perl.
------------------------------
Date: Sat, 11 Sep 2004 15:21:36 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl 6 and OOP
Message-Id: <kou5k0l8otfreki2gm4nflunqm84qmcr1c@4ax.com>
On 10 Sep 2004 22:41:53 -0700, jl_post@hotmail.com (J. Romano) wrote:
> But I'm confused as to what the .perl() method would do. Are you
>saying that "$a.perl()" would do the same thing that "Dumper $a" does
Yes, it will yield a stringified perl representation of its object.
>now? And if that's so, what would "$a.python()" and "$a.ruby()"
>generate? (Code that can be eval()'ed in those respective languages,
>maybe? That would be very interesting, I would think. Molto
>interessante...)
Yes, *if* python and ruby *do* support such a thing, I'd say.
(Disclaimer: as you may have already understood, I don't know anything
about these two languages). Anyway (i) they're both being retargeted,
along with Perl, to the parrot runtime[*], AIUI, (ii) ... Larry said
it!
[*] And I *guess* this will greatly improve cross-language
compatibility.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 11 Sep 2004 06:58:34 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: Perl 6 and OOP
Message-Id: <b893f5d4.0409110558.46c9c3eb@posting.google.com>
> >>>>> "JR" == J Romano <jl_post@hotmail.com> writes:
>
> JR> Now to my question: Knowing that Perl 6 will have better OO
> JR> handling, does that mean that Data::Dumper will lose its usefulness on
> JR> Perl 6 objects? Or will it still be able to let a programmer peer
> JR> into them and let him/her tinker with their data using the debugger?
Uri Guttman <uri@stemsystems.com> replied in message
news:<x7zn3ydxkt.fsf@mail.sysarch.com>...
>
> you seem to be conflating data::dumper and OO. dumper is not an OO tool
> but a debugging and data tool. i have (as have many others) used it in
> many non-oo programs. it is just a way to dump perl data structures (oo
> or not) in a way that can be evaled and also read by hyoomans.
Oh, I agree with you there. When I first found out about the
Data::Dumper module I used it all the time to look at the structures
of complex arrays and hashes. But eventually I found out that it also
works amazingly well with blessed objects.
Now I use it whenever I work with Perl objects, whether I wrote
them or not. Debugging OO code is so much easier with Data::Dumper
since I don't have to guess about a blessed object's current structure
based on the code that may or may not have been executed.
Data::Dumper may break the idea of Object-Oriented Information Hiding,
but it's been a wonderful tool for me to use when I venture into the
OO world.
What I'm trying to say is that the Data::Dumper module was so
well-thought out (in my opinion) that it works just as well with Perl
objects as with non-objects. There is no additional tweaking
necessary on my part to get Data::Dumper to work on a reference just
because it is blessed. The module knows about blessed references and
is able to create an appropriate string to eval() without ever having
me worry about it.
-- Jean-Luc
------------------------------
Date: Sat, 11 Sep 2004 17:28:35 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Perl XSLT module?
Message-Id: <chv8rj$nnr$1@sun3.bham.ac.uk>
Anthony Roy wrote:
> Eric Bohlman wrote:
>
>> Look into XML::LibXSLT and XML::Sablotron (there's also XML::XSLT, but
>> it's incomplete and hasn't been touched in a long time).
>
>
> I have had a look at these, and it appears that they are both wrappers
> around C programs. Are there any native perl XSLT transformers available
> in a better state than XML::XSLT which doesn't have enough functionality
> for my requirements?
Maintaing a full featured-XSLT engine is no mean feat. I doubt there
are going to be many people falling over themselves to create a _second_
Pure perl one when development of the first already lacks motivation due
to te fact that there are prefectly good Perl bindings to existing
open-source projects.
If there are features missing in XML::XSLT have you considered adding
them? (Either yourself of by supporting someone else to do so).
> The trouble is that the server I need to install the modules on (i.e.
> the location of my cgi script) is controlled by someone else, and
> getting them to install the C programs required will be nigh on impossible.
Peraps there may be an command line XSLT engine already installed that
you could use via system().
------------------------------
Date: Sat, 11 Sep 04 14:22:44 GMT
From: jmfbahciv@aol.com
Subject: Re: Xah Lee's Unixism
Message-Id: <41431d5f$0$6923$61fed72c@news.rcn.com>
In article <1ctshc.kd52.ln@via.reistad.priv.no>,
Morten Reistad <firstname@lastname.pr1v.n0> wrote:
>In article <1oh3k01cieht04nmfo27pvihg8teme0mdt@4ax.com>,
>Alan Balmer <albalmer@spamcop.net> wrote:
>>On Fri, 10 Sep 2004 00:13:56 +0200, Morten Reistad
>><firstname@lastname.pr1v.n0> wrote:
>>
>>>>However Bush is demonstrably poor. He ignored the warnings from
>>>>the CIA, FBI, outgoing Clinton administration about imminent
>>>>attacks. He was focused on attacking Saddam and Iraq from the
>>>>first, and perverted 9/11 into that at the earliest opportunity.
>>>>He has offended many more than most of his predecessors. I will
>>>>say that he seems to have learned the names of some foreign
>>>>leaders since being elected.
>>>
>>>Bush has had an agenda all right; but I don't quite get what it is.
>>>
>>And, of course, entertaining the possibility that his agenda is just
>>what he says it is, is completely out of the question.
>
>I just cannot understand what he wanted to do with Iraq, so fast and
>with such a limited expedition corps.
>
>If we for a moment give them the benefit of the doubt and assume that
>Iraq WAS a hotbed of terrorists buiding WMD's. There may after all be
>some information they cannot tell us. This would explain the
>hurry and the go-it-alone tactic. In that case , why wasn't the place
>hit a lot harder; int the Nixon/Pinochet style? Why a PHB like Bremer?
>Why not a real tough army goy the first couple of months? I just cannot
>make sense of this scenario.
I had assumed this was to placate France, Germany and Russia.
IMO, there was too much politics and not enough military.
>
>On the other hand, it may be a wish to liberate Iraq from the ravages
>of Saddam, and a final round of being pissed at Saddam repeatedly
>flouting the ceasefire agreement. This is a perfectly legitimate
>reason to escalate the war again (it is the same war, there was never
>a peace agreement, only a cease-fire). In that case a few rounds of
>UN song and dance could be done while a new coalition was built; with
>the US taking around a fourth of the cost and manpower, like last time.
>This could be convincingly sold to the Iraqi populace as a liberation.
But France, Germany and Russia would have nothing to do with that.
It would stop their cash flows with Saddam if we had tried to build
a coalition. They were farting around using all kinds of delay
tactics and were more than willing to allow Saddam to flaunt
the cease fire. With nobody watching the bad boy, he could
do anything he damned well wanted to, including allow transport
across his country from east to west.
>
>So, I don't get it if the agenda is just what is spoken. If the agenda
>is to make way for Israel scenario #2 would still be a better one.
>
>Contrast this with Afghanistan, where there was a pretty high urgency
>to get the al-Quaeda and the Taliban before they moved with another
>terrorist monstrosity. Yet, a large alliance was built, NATO was used
>as far as it could be stretched. the UN was in on it; and the US ended
>taking around half the cost and supplying a fifth of the manpower.
>With a similar strategy in Iraq the US could have resources left over
>to handle North Korea, Sudan, Sierra Leone with less expenditure than
>what you ended up with.
>
>I just don't get it. The stated agenda is either misstated, or grossly
>misimplemented.
Or the agenda changed in midstream.
/BAH
Subtract a hundred and four for e-mail.
------------------------------
Date: Sat, 11 Sep 04 14:24:09 GMT
From: jmfbahciv@aol.com
Subject: Re: Xah Lee's Unixism
Message-Id: <41431db5$0$6923$61fed72c@news.rcn.com>
In article <opsd2vlvy7pqzri1@mjolner.upc.no>,
"John Thingstad" <john.thingstad@chello.no> wrote:
There has been a request to [spit] these newsgroups. Where
do you read from? I'm over in a.f.c.
>On Thu, 09 Sep 04 13:12:17 GMT, <jmfbahciv@aol.com> wrote:
>
>
>> I really want to know. People keep saying this but never say which
>> freedoms have been lost.
>>
>
>Since this is somewhat related to computer programming
>and AI I will reply.
Thank you. I appreciate the effort.
>
>The US has started a initiative to integrate all
>information about people in the USA into a central database.
This is why I'm puzzled. This stuff is nothing new; about
the only difference is the detail.
>
>This includes confidential information like
>your medical files. Think what
>you say to your psychologist is confidential?
It never was confidential. People talk; doctors confer. It
was off limits w.r.t. law enforcement but I think that had
more to do with not having to testify against yourself.
This still is not a freedom; it's a right that is listed.
> ..Think again. Being paranoid
>can be enough to get a "red flag".
>They will have access to all your credit records
>and will monitor all your
>travels in and out of the country.
>If you buy flowers on the apposite side of town they can deduce that you
>have a lover and
>use this as a means of distortion. (Edgar A. Hoover style)
>
>Initially this was just supposed to be used to monitor terrorist like
>behaviour
>but now the FBI and CIA are also seeing the power of such a system.
Sure. They had that kind of power and were abusing it in the 70s.
Both departments got the wings clipped. Because they did get
reorg'ed back then, a lot of the work, that they are accused of not
doing after 9/11, didn't get done because they weren't allowed to
do that work. Now Congress is shifting towards giving them
more leeway. I sure as hell hope they remember Hoover and his
abuses of power before they suggest putting one guy over it all.
>
>The main challenge in computing is sieving through the amount of data.
>Politically it is to pressure the foreign governments to wave their
>privacy protection acts and allow unlimited access to information to a
>foreign power.
This won't happen. Foreign governments will do whatever is in their
best interests as the US should do things in its best interests.
>
>Don't know what you think of this but it scares the hell out of me!
It should. But this isn't a breach of freedom. It is a breach
of privacy which can only be protected by each individual, not
the government.
See, people keep saying freedoms. But I get confused and don't
consider these things freedoms. In some very stretched cases,
I might consider them rights.
/BAH
Subtract a hundred and four for e-mail.
------------------------------
Date: Sat, 11 Sep 2004 16:05:52 -0000
From: SM Ryan <wyrmwif@tango-sierra-oscar-foxtrot-tango.fake.org>
Subject: Re: Xah Lee's Unixism
Message-Id: <10k68j0lqorgqdf@corp.supernews.com>
# But France, Germany and Russia would have nothing to do with that.
# It would stop their cash flows with Saddam if we had tried to build
France said all along it would agree to military action in Iraq
_if_ NBC weapons or development where discoverrd.
So where are these weapons?
France and Germany are in Afghanistan fighting and dying on our behalf,
along with other NATO armies. Iraq had nothing to do with terrorism
except for the echoing looniness inside Dick Cheney's empty skull.
The real war on terrorism is in Afghanistan which the USA abandonned
in search of more profitable plunder. France and Germany and other
NATO armies are fighting the war on terrorism, and they were doing
so long before the USA got involved. It's the USA that abandonned
the war on terrorism in favour of trying to break OPEC and control
the flow of oil from Arab states, not France and Germany.
# the cease fire. With nobody watching the bad boy, he could
# do anything he damned well wanted to, including allow transport
# across his country from east to west.
The borders of Iraq were far better regulated under Saddam than today.
The chaos that USA inflicted openned the borders. Remember Bunker
Hill? Remember Valley Forge? Remember Yorktown? Do you think only
Americans are capable of taking up arms against a foreign occupier
and fighting for their independence? We have become the redcoats
and Hessians. Makes you kinda proud, doesn't it?
--
SM Ryan http://www.rawbw.com/~wyrmwif/
JUSTICE!
Justice is dead.
------------------------------
Date: Sat, 11 Sep 2004 17:57:08 +0100
From: Rupert Pigott <roo@try-removing-this.darkboong.demon.co.uk>
Subject: Re: Xah Lee's Unixism
Message-Id: <1094921828.565587@teapot.planet.gong>
jmfbahciv@aol.com wrote:
[SNIP]
> I had assumed this was to placate France, Germany and Russia.
> IMO, there was too much politics and not enough military.
I can't see why you bother making excuses on behalf of the
Administration. It was the Administration's call as to who
ran the CPA, let them take responsibility for it.
--
Cheers,
Rupert
------------------------------
Date: Sat, 11 Sep 2004 18:08:57 +0100
From: Rupert Pigott <roo@try-removing-this.darkboong.demon.co.uk>
Subject: Re: Xah Lee's Unixism
Message-Id: <1094922538.168258@teapot.planet.gong>
jmfbahciv@aol.com wrote:
> In article <opsd2vlvy7pqzri1@mjolner.upc.no>,
> "John Thingstad" <john.thingstad@chello.no> wrote:
>
> There has been a request to [spit] these newsgroups. Where
> do you read from? I'm over in a.f.c.
>
>>On Thu, 09 Sep 04 13:12:17 GMT, <jmfbahciv@aol.com> wrote:
>>
>>
>>> I really want to know. People keep saying this but never say which
>>> freedoms have been lost.
>>>
>>
>>Since this is somewhat related to computer programming
>>and AI I will reply.
>
> Thank you. I appreciate the effort.
>
>>
>>The US has started a initiative to integrate all
>>information about people in the USA into a central database.
>
> This is why I'm puzzled. This stuff is nothing new; about
> the only difference is the detail.
>>
>>This includes confidential information like
>>your medical files. Think what
>>you say to your psychologist is confidential?
>
> It never was confidential. People talk; doctors confer. It
> was off limits w.r.t. law enforcement but I think that had
> more to do with not having to testify against yourself.
The Hippocratic Oath demands that patient confidentiality
be respected.
I'm sure that there is plenty of material out there which
explains why the Oath exists and why it might be desirable.
--
Cheers,
Rupert
------------------------------
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 6993
***************************************