[28801] in Perl-Users-Digest
Perl-Users Digest, Issue: 45 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 18 00:05:56 2007
Date: Wed, 17 Jan 2007 21:05:05 -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 Wed, 17 Jan 2007 Volume: 11 Number: 45
Today's topics:
Re: convert Vbscript to Perl code <nuke@all.spam>
Re: convert Vbscript to Perl code <uri@stemsystems.com>
Re: converting a perl script <andy@westmidland-internet.co.uk>
Re: converting a perl script <andy@westmidland-internet.co.uk>
Re: FAQ 3.22 How can I get "#!perl" to work on [MS-DOS, trudge@gmail.com
Re: How do you Call a Perl subroutine with a variable n <louis@h4h.com>
Re: include file? <rvtol+news@isolution.nl>
need help with the tr and s/// joez3@yahoo.com
Re: need help with the tr and s/// <novafyre@hotmail.com>
Re: need help with the tr and s/// <tadmc@augustmail.com>
Re: need help with the tr and s/// <purlgurl@purlgurl.net>
Re: parsing xml using perl regex help <tadmc@augustmail.com>
Re: regex problem <jgibson@mail.arc.nasa.gov>
Re: the => operator <louis@h4h.com>
Re: Translation please <tzz@lifelogs.com>
Re: Unable to find form <news@lawshouse.org>
Re: Unable to find form <spamtrap@dot-app.org>
Re: Unable to find form <nospam@home.com>
Re: Unable to find form <tadmc@augustmail.com>
Re: Unable to find form <spamtrap@dot-app.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 18 Jan 2007 03:21:36 GMT
From: "tony.p" <nuke@all.spam>
Subject: Re: convert Vbscript to Perl code
Message-Id: <4JBrh.35593$Gr2.21290@newssvr21.news.prodigy.net>
Uri Guttman wrote:
>>>>>> "V" == Vronans <vronans@nowheresville.spamwall> writes:
>
>> but the point is, how does any amount of help given justify dragging
>> someone through the dirt? Dont even try to tell me that doesn't
>> happen either.
>
> give it up. you don't help, you have no rights to comment. end of
> discussion.
What is this stalin-istic move of supression? Who the in the blue sam
hell made you the god of UseNet, to be able to decide who can and who
cannot make comments? FYI, UseNet is entire based on the concept of
posting and being commenting on said posts.
>> Again, hypocritical response. Why is it ok for Tad, among other, to
>> do it? That is the point. Stop dancing around the bush.
>
> give it up. you don't help, you have no rights to comment. end of
> discussion.
This coming from someone who has take it upon himself determine who can
and cannot reply to posts....
If you weren't so busy defending those who think that just because they
sometimes help that this gives them the right to vent their frustrations
on anyone they choose, you might actually have a foot to stand on.
The reply by Tad to the OP is what sparked this sub thread, and it seems
plainly obvious to me that he was being purposely sarcastic, and I don't
know how you can call that useful to the OP. Why can't people like you
just admit that posts like that just aren't constructive use of one's
time and if one can't post something useful why post at all.
Not like I expect you to actually point out a potential flaw in one of
your colleagues, my we can't have that can we. No, we have to regard
them as celebrities who can do what ever they want.
<snip blind-sheep drivel>
> BTW you are being mocked and you are even more foolish for attempting
> to keep this going. i won't let go until you shut up and leave. keep
> proving how foolish you are by continuing. your choice.
You're going to have your work cut out for you then.
> have a nice perl day,
>
> uri
Grow up. Let me know when you've figured out you have a brain of your
own and that it doesn't belong in that dark place down below.
--
Tony
------------------------------
Date: Wed, 17 Jan 2007 23:39:02 -0500
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: convert Vbscript to Perl code
Message-Id: <x7y7o1j6e1.fsf@mail.sysarch.com>
>>>>> "tp" == tony p <nuke@all.spam> writes:
tp> Uri Guttman wrote:
>>>>>>> "V" == Vronans <vronans@nowheresville.spamwall> writes:
>>
>>> but the point is, how does any amount of help given justify dragging
>>> someone through the dirt? Dont even try to tell me that doesn't
>>> happen either.
>>
>> give it up. you don't help, you have no rights to comment. end of
>> discussion.
tp> What is this stalin-istic move of supression? Who the in the blue sam
tp> hell made you the god of UseNet, to be able to decide who can and who
tp> cannot make comments? FYI, UseNet is entire based on the concept of
tp> posting and being commenting on said posts.
i made myself the lord of this group. i have all the power to make your
code into python! i fart on your codebase. may your children become
cobol programmers!!
tp> This coming from someone who has take it upon himself determine who can
tp> and cannot reply to posts....
no. i make fun of them. and you. and your perl question is?
tp> If you weren't so busy defending those who think that just because they
tp> sometimes help that this gives them the right to vent their frustrations
tp> on anyone they choose, you might actually have a foot to stand on.
nah. this is a group about perl. so flamers who flame about how things
are run and who don't help with perl have no standing. old usenet rules
which all should know or they will be damned into the hell of bill
gates!
tp> The reply by Tad to the OP is what sparked this sub thread, and it seems
tp> plainly obvious to me that he was being purposely sarcastic, and I don't
tp> know how you can call that useful to the OP. Why can't people like you
tp> just admit that posts like that just aren't constructive use of one's
tp> time and if one can't post something useful why post at all.
ok, your turn to answer poorly formed questions with no code or any
semblence of work being done. do it for a few years write guidelines to
help those help themselves. watch as too many never heed them. keep
going at it while keeping a massivly cheerful disposition. when you have
achieved that grasshopper we will grant you the power over this
newsgroup. until then, the door it over there ----------->
tp> Not like I expect you to actually point out a potential flaw in one of
tp> your colleagues, my we can't have that can we. No, we have to regard
tp> them as celebrities who can do what ever they want.
sure. we are celebrities. yes. watch me walk down the red carpet of
usenet. i love papparazis!! just shoot me!!!! (now)
tp> <snip blind-sheep drivel>
oh you know sheep well. i wonder why.
>> BTW you are being mocked and you are even more foolish for attempting
>> to keep this going. i won't let go until you shut up and leave. keep
>> proving how foolish you are by continuing. your choice.
tp> You're going to have your work cut out for you then.
join the fools. oops, you already did. what is your serial number?
tp> Grow up. Let me know when you've figured out you have a brain of your
tp> own and that it doesn't belong in that dark place down below.
oooh, i am so scared. please google for the alaskan electrician. you
have no wattage compared to him. i only need tissue paper thin
insulation to protect myself from your electromagnetic onslaught.
now, when you have you helped with a perl question? show some google
hits please.
next contestant!! i will take on all /f?lamers/ in a no holds barred
perl rasslin' match. watch as i clobber the losers to such a pulp that i
can use file::slurp to drink their guts up a thin straw. watch them spin
around as file::readbackwards upsets their sense of orientation. see
them boggle as they try to master the simplicity and power of
template::simple. MUAHAHAHAHAHAH!!!!!
and i also wish you a happy perl day!
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, 18 Jan 2007 00:06:42 GMT
From: Andy T <andy@westmidland-internet.co.uk>
Subject: Re: converting a perl script
Message-Id: <g5etq2dkiftpd2grb15j6sso9mkok4ib5v@4ax.com>
On 15 Jan 2007 15:42:09 -0800, usenet@DavidFilmer.com wrote:
>Andy T wrote:
>> I havea script called bignosebird which I adapted to send me some info
>> about people booking in for a race meeting. (radio controlled cars)
>
>Hmmm. The name of your script suggest it originally came from
>http://bignosebird.com (a somewhat outdated script site).
Yes this is fact where it came from!
>> I have just been told I am using form mail so I need to change it so I
>> am using nms formmail instead of PHP3 but none of it makes sense?
>
>"form mail" is a script on Matt's Script Archive (MSA,
>http://www.scriptarchive.com/). This site has no association with
>bignosebird, so the justaposition of the two names is somewhat
>confusing. And neither bignosebird nor MSA (to my knowledge) ever
>published programs for the PHP3 language, which adds to the confusion.
The fact my ISP mentioned PHP3 did confuse me somewhat!
>Matt Wright (the MSA guy) wrote and published some scripts back in the
>mid-90's. They weren't very good scripts (as even Matt himself now
>admits). Some PerlMongers established a project (nms) to completely
>rewrite the MSA scripts, but make them drop-in replacements for MSA.
>
>If you did get your mail script from MSA then you really should replace
>it with the nms counterpart:
> http://nms-cgi.sourceforge.net/scripts.shtml
Had a look there and can understand what you say IF I had a MSA script
I would find it quite simple I guess.
>
>Because nms is a drop-in replacement, the only thing you need to do is
>overwrite your MSA-version of formmail.pl (or whatever you called it)
>with the nms version that you can download from the website above. You
>don't need to edit any code. It's a two-minute fix which will close
>the holes in MSA formmail.pl.
Which would be nice LOL
>
>If, however, you really ARE using a bignosebird script, the above
>probably will not apply.
Yes that is the case so what next!.
Am I allowed to post the script to see what people suggest please??
Regards Andy T
--
For users by users - BY-users group
<http://www.by-users.co.uk>
------------------------------
Date: Thu, 18 Jan 2007 00:09:46 GMT
From: Andy T <andy@westmidland-internet.co.uk>
Subject: Re: converting a perl script
Message-Id: <iietq2tiqhrkhnidj7tleqs2j7h0oae7cs@4ax.com>
On 15 Jan 2007 15:42:09 -0800, usenet@DavidFilmer.com wrote:
>
>If, however, you really ARE using a bignosebird script, the above
>probably will not apply.
sorry I forgot the URL of the form!
http://www.bnrc.co.uk/bnb/winter1211.html
My problem is am very happy to learn but I dont have much time as
these forms are being used daily and I need to try and solve my dilema
ASAP.
Any help appreciated!
Regards Andy T
--
For users by users - BY-users group
<http://www.by-users.co.uk>
------------------------------
Date: 17 Jan 2007 16:06:59 -0800
From: trudge@gmail.com
Subject: Re: FAQ 3.22 How can I get "#!perl" to work on [MS-DOS,NT,...]?
Message-Id: <1169078819.638731.197460@m58g2000cwm.googlegroups.com>
PerlFAQ Server wrote:
> This is an excerpt from the latest version perlfaq3.pod, which
> comes with the standard Perl distribution. These postings aim to
> reduce the number of repeated questions as well as allow the community
> to review and update the answers. The latest version of the complete
> perlfaq is at http://faq.perl.org .
>
> --------------------------------------------------------------------
>
> 3.22: How can I get "#!perl" to work on [MS-DOS,NT,...]?
>
> For OS/2 just use
>
> extproc perl -S -your_switches
>
> as the first line in "*.cmd" file ("-S" due to a bug in cmd.exe's
> "extproc" handling). For DOS one should first invent a corresponding
> batch file and codify it in "ALTERNATE_SHEBANG" (see the dosish.h file
> in the source distribution for more information).
>
> The Win95/NT installation, when using the ActiveState port of Perl, will
> modify the Registry to associate the ".pl" extension with the perl
> interpreter. If you install another port, perhaps even building your own
> Win95/NT Perl from the standard sources by using a Windows port of gcc
> (e.g., with cygwin or mingw32), then you'll have to modify the Registry
> yourself. In addition to associating ".pl" with the interpreter, NT
> people can use: "SET PATHEXT=%PATHEXT%;.PL" to let them run the program
> "install-linux.pl" merely by typing "install-linux".
>
> Under "Classic" MacOS, a perl program will have the appropriate Creator
> and Type, so that double-clicking them will invoke the MacPerl
> application. Under Mac OS X, clickable apps can be made from any "#!"
> script using Wil Sanchez' DropScript utility:
> http://www.wsanchez.net/software/ .
>
> *IMPORTANT!*: Whatever you do, PLEASE don't get frustrated, and just
> throw the perl interpreter into your cgi-bin directory, in order to get
> your programs working for a web server. This is an EXTREMELY big
> security risk. Take the time to figure out how to do it correctly.
>
>
>
> --------------------------------------------------------------------
>
> The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
> are not necessarily experts in every domain where Perl might show up,
> so please include as much information as possible and relevant in any
> corrections. The perlfaq-workers also don't have access to every
> operating system or platform, so please include relevant details for
> corrections to examples that do not work on particular platforms.
> Working code is greatly appreciated.
>
> If you'd like to help maintain the perlfaq, see the details in
> perlfaq.pod.
>
> --
> Posted via a free Usenet account from http://www.teranews.com
I develop under Win2K using ActiveState, but all my scripts get
installed on a *nix server.
A few years ago I hit on the idea of installing Perl under /usr/bin on
my Windows machine so I don't have to change anything when I upload
scripts. The shebang line is still #! /usr/bin/perl
--
Amer Neely [www.softouch.on.ca]
------------------------------
Date: Wed, 17 Jan 2007 19:40:54 -0800
From: "Wayne Poe" <louis@h4h.com>
Subject: Re: How do you Call a Perl subroutine with a variable name?
Message-Id: <5188ifF1j6413U1@mid.individual.net>
Tad McClellan wrote:
> Wayne M. Poe <louisREMOVE@REMOVEh4h.com> wrote:
>> Tad McClellan wrote:
>>> Wayne M. Poe <louisREMOVE@REMOVEh4h.com> wrote:
>
>
>>>> What I really dislike here is the approach you (and others
>>>> sometimes) take in conveying this information.
>>>
>>>
>>> Then simply post a few more forgeries to "even it out".
>>
>> I didn't forge anything.
>
>
> Message-ID: <1165296208.732891.75320@16g2000cwy.googlegroups.com>
I suppose that was in sarcasm, but seeing the date on the post was the
Dec 4th, I was drunker than a door knob, having been given Vodka without
being told what it was, at a birthday party I had attended.
Actually at first, when I followed that MsgID, I thought it was in
imposter, as I have no recallection of actually making that post. I do
remember the whooping migrane I had the following morning.
I do apologize. I don't normally drink.
With that all said, I do think you're still conveniently missing the
central point I put forth.
------------------------------
Date: Wed, 17 Jan 2007 23:55:28 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: include file?
Message-Id: <eomd25.1m8.1@news.isolution.nl>
Mirco Wahab schreef:
> perldoc do
> perldoc use
> perldoc require
' -f' x 3
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: 17 Jan 2007 15:50:14 -0800
From: joez3@yahoo.com
Subject: need help with the tr and s///
Message-Id: <1169077814.747544.146710@m58g2000cwm.googlegroups.com>
Hi,
Does anyone have an easy way to replace the end of one string with
another? I have 2 strings one that ends with some unknown number of 0,
and I need to replace the trailing chars in the other string with that
number of 0s. I figure I could do this with a few loops but there has
to be an easy way to use the s/// and the tr to help me out.
any ideas,
zim
------------------------------
Date: Wed, 17 Jan 2007 19:21:15 -0700
From: Mark Donovan <novafyre@hotmail.com>
Subject: Re: need help with the tr and s///
Message-Id: <C1D427AB.94D7%novafyre@hotmail.com>
On 1/17/07 16:50, "joez3@yahoo.com" <joez3@yahoo.com> wrote:
> Does anyone have an easy way to replace the end of one string with
> another? I have 2 strings one that ends with some unknown number of 0,
> and I need to replace the trailing chars in the other string with that
> number of 0s. I figure I could do this with a few loops but there has
> to be an easy way to use the s/// and the tr to help me out.
Let me understand... you want the number of trailing zeros to be the same
for both strings. Here are two ways.
Find the trailing zeros on the first string, count them, remove trailing
zeros from the second string, and append new trailing zeros to the second
string.
$s1 =~ m/(0*)\z/;
$len = length $1;
$s2 =~ s/(.*?)0*\z/$1/;
$s2 .= '0' x $len;
Here's the same result with two statements that run about 15 percent faster.
($len = $s1) =~ s/.*?(0*)\z/length $1/e;
$s2 =~ s/(.*?)0*\z/$1 . '0' x $len/e;
--
Mark
------------------------------
Date: Wed, 17 Jan 2007 19:45:06 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: need help with the tr and s///
Message-Id: <slrneqtk92.hr0.tadmc@tadmc30.august.net>
joez3@yahoo.com <joez3@yahoo.com> wrote:
> Does anyone have an easy way to replace the end of one string with
> another? I have 2 strings one that ends with some unknown number of 0,
> and I need to replace the trailing chars in the other string with that
> number of 0s.
---------------------------
#!/usr/bin/perl
use warnings;
use strict;
my $one_str = '1230000';
my $other_str = 'Laziness, Impatience and Hubris';
(my $zeros = $one_str) =~ s/.*?(?=0+$)//; # strip all but trailing zeros
substr($other_str, -length $zeros) = $zeros;
print "$other_str\n";
__END__
# a shorter, but much too ugly way:
substr($other_str, -length(($one_str =~ m/(0+)$/)[0]) ) =~ s/./0/g;
---------------------------
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 17 Jan 2007 20:43:51 -0800
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: need help with the tr and s///
Message-Id: <45AEFB07.6070300@purlgurl.net>
joez3@yahoo.com wrote:
> Does anyone have an easy way to replace the end of one string with
> another? I have 2 strings one that ends with some unknown number of 0,
> and I need to replace the trailing chars in the other string with that
> number of 0s.
Your article is gibberish.
"I have 2 strings one that ends with some unknown number of 0...."
You have one string which ends with an unknown quantity of zeroes.
Are there zeroes elsewhere in this string or only trailing? Will
data ever have no trailing zeroes? Will data ever be all zeroes?
"...I need to replace the trailing chars in the other string...."
Are readers to guess at what are those trailing characters and
how many trailing characters?
"...replace the trailing chars in the other string... with that number of 0s."
Are you to replace trailing characters of one string with the trailing zeroes
of another string OR replace trailing characters of one string with the actual
"numerical count" of zeroes from another string?
Readers have no choice but to guess what is your task.
Guessing is not a viable programming method.
Best help you will receive is to help yourself write
articles which are clear, concise and cohesive.
Purl Gurl
------------------------------
Date: Wed, 17 Jan 2007 18:54:54 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: parsing xml using perl regex help
Message-Id: <slrneqthau.hr0.tadmc@tadmc30.august.net>
Avalon1178 <Avalon1178@aol.com> wrote:
> So my new regex looks like the following if I want to extract the
> attribute value of type and opt:
>
> my $regex =
> qr/^s*<theNode\s*name=\"(\S+)\"\s*type=\"(\S+)\"\s*opt=\"(\S+)\".*/;
^ ^ ^ ^ ^ ^
^ ^ ^ ^ ^ ^
Double quotes are not meta in regexes, so you should not backslash them.
> I have one other question though...
You only have one other question _now_, but you could end up with
all of these questions too:
How do I extract the attributes from these ones?
<theNode name='blah' type="blah2" opt='blah3'>
<!--
<theNode name="blah" type="blah2" opt="blah3">
-->
<theNode
name
=
"blah"
type
=
"blah2"
opt
="
blah3"
>
> and maybe this is because of my
> fairly novice knowledge of regex's.
No, rather it may be because of your fairly novice knowledge
of the grammar you need to parse (XML).
> Is there another way using regex
> to parse the attributes where the order of the attributes name may not
> be always the same?
Yes, by making the regex and other code larger and more uncomely.
Then you need to add yet more regex and code changes when any
of the above cases arise.
Then you need to add yet *more* regex and code changes when the
inevitable others arise.
If you do it with a real XML Parsing module for this "simple" case,
then it will just silently keep working when any of the "one more"
things arise.
> but is
> there a way to represent it in a single regex?
You should be asking what is the best way, rather than asking for
only a way that uses the Wrong Tool.
[ snip TOFU.
Please do not top-post.
]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 17 Jan 2007 15:40:31 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: regex problem
Message-Id: <170120071540313476%jgibson@mail.arc.nasa.gov>
In article <1169073854.097814.163470@51g2000cwl.googlegroups.com>,
eldwin <dollente@gmail.com> wrote:
> Hey all,
>
> I'm trying to search and replace to the following string:
>
> 0|1061203|150200559802-12345|STUDIO
> 0006979867|STUDIO|0066678||STUDIO|150200559802-12345|STAFF|XX|STAFF|XX|
>
> What I want to do is replace whatever is in between | |.
Which pair of '|'? There are more than one.
>
> For example, I want to replace STAFF with PROSTAFF.
>
> my current regex looks like this:
>
> s/\|.*\|XX\|/\|PROSTAFF\|XX\|/g
.* is a greedy match to all characters in the string, including '|'
characters. You need to make it non-greedy (.*?) or match non-pipe
characters ([^|]*).
'PROSTAFF' is not in your string. Do you mean 'STAFF'?
>
> So, I'm not concerned with STAFF so much, but what's in between | |. I
> know "|" is a special character thus the "\" before it.
>
> When I apply this regex to my code, the resulting string is:
>
> 0|PROSTAFF|XX|
Another approach is to use split to break up your line into the
substrings that occur between pipe characters, modify every other
substring, and put the line back together (untested):
my @f = split(m{\|},$string);
for( my $i = 1; $i <= $#f; $i += 2 ) {
$f[$i] =~ s/^STAFF$/PROSTAFF/;
}
my $newstring = join('|',@f);
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Wed, 17 Jan 2007 18:23:30 -0800
From: "Wayne Poe" <louis@h4h.com>
Subject: Re: the => operator
Message-Id: <51841dF1j35s4U1@mid.individual.net>
Abigail wrote:
> Wayne M. Poe (louisREMOVE@REMOVEh4h.com) wrote on MMMMDCCCLXXXVI
> September MCMXCIII in <URL:news:515003F1ho4vuU1@mid.individual.net>:
> `` Michele Dondi wrote:
> `` > On Tue, 16 Jan 2007 09:13:44 -0800, "Wayne M. Poe"
> `` > <louisREMOVE@REMOVEh4h.com> wrote:
> `` >
> `` > > > -- any document on this opeartor?
> `` > ^
> `` > ^
> `` >
> `` > [snip]
> `` > > > Abigail
> `` > > > --
> `` > > > #!/opt/perl/bin/perl -w
> `` > >
> `` > > Abigail, why in the name of Larry Wall are you using a sig
> `` > > delimiter for a quote-char ? You do realize you breaking any
> `` > > processor that does
> `` >
> `` > AFAIK the sig delimiter is "-- \n", so he's *not* using it as a
> quote `` > char.
> ``
> `` In some places thats exactly what was there (any plank lien that
> was `` quoted ends up being "-- \n")
>
> No.
Actually at the begining there is one occurance:
------------------------------------------------
fatwallet961@yahoo.com (fatwallet961@yahoo.com) wrote on MMMMDCCCLXXXV
September MCMXCIII in
<URL:news:l7unq2h7kj8flbbk01juqhcegnpaubmcg1@4ax.com>:
-- in the following code
--
-- what's => means?
------------------------------------------------
Second to last line. From that line on, my reader shows the content as a
comment. No big deal, just wanted to point out that your unusual quoting
sometime creates problems. "> " has been the defacto quote char for as
long as I can remember, so what's wrong with it?
>
> `` and that makes it break any
> processor `` that color codes quoting levels as well sigs based on
> that key you `` noted.
>
> I'll grand you that it will break any processor if my message
> contained "-- \n". But it didn't.
>
>
> Abigail
------------------------------
Date: Wed, 17 Jan 2007 18:32:10 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Translation please
Message-Id: <g69sle9ut51.fsf@dhcp-65-162.kendall.corp.akamai.com>
On 17 Jan 2007, pleaselogout@gmail.com wrote:
> Could someone please translate this into english please. This is part
> of obfuscation script
>
> perl -n -i.bak -e "if (/([0-9]+\t)([A-Z0-9]*)(.*)$/) { print $1 .
> \"58\" x (length($2) / 2) . $3 . \"\n\"; } else { print; }"
> TBL_BlobData.dat
You can't really translate that into English. Pseudo-code, maybe, but
English doesn't have a way to describe it in less than 3 pages of
dense text.
I'd recommend instead learning:
1) what does the -n switch do?
2) what does the -i.bak switch do?
3) what does the regular expression match? What is saved in $1, $2,
and $3? You should know this, having access to the TBL_BlobData.dat
file, unlike everyone else on this newsgroup.
4) What does this do, and could you use printf there?
print $1 . "58" x (length($2) / 2) . $3 . "\n";
It's really not all that complicated or obfuscated. It's presented
that way as a one-liner, but in 7-8 lines and with comments it's not
nearly as bad.
Ted
------------------------------
Date: Wed, 17 Jan 2007 23:24:44 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: Unable to find form
Message-Id: <1169076275.9268.0@damia.uk.clara.net>
Some anonymous person calling themselves "Nospam" wrote:
> I have tried form_number(1)..form_name(add_posting) ...current_form()..
> still no luck can't figue out the name of the form or it's number, this is a
> sample of the html:
>
> <html>
> ....
This is a Perl group and I'm afraid I don't see any Perl or reference to
it in your posting. If you want to process that form using a Perl CGI
script then you should include the CGI module and use its functions.
Is that what you mean? If so create some Perl CGI code as best you can,
run it, and then seek help here to make it work properly. See the
posting guidelines (Google for them, they're posted often). (With the
CGI module you don't even have to run the Perl in a web server, at least
not to start with.)
If you're not doing it with Perl then you need to find the right group
somewhere else.
--
Henry Law Manchester, England
------------------------------
Date: Wed, 17 Jan 2007 20:04:21 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Unable to find form
Message-Id: <m28xg1402y.fsf@Sherm-Pendleys-Computer.local>
Henry Law <news@lawshouse.org> writes:
> Some anonymous person calling themselves "Nospam" wrote:
>> I have tried form_number(1)..form_name(add_posting) ...current_form()..
>> still no luck can't figue out the name of the form or it's number, this is a
>> sample of the html:
>>
>> <html>
>> ....
>
> This is a Perl group and I'm afraid I don't see any Perl or reference
> to it in your posting. If you want to process that form using a Perl
> CGI script then you should include the CGI module and use its
> functions.
From the references to form_number() and form_name() methods, I think he
might be attempting to parse & submit this form with WWW::Mechanize.
On the other hand, with no code, no error message, and no idea what he's
doing for sure, I wouldn't care to hazard a guess about what's going wrong
with it.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 18 Jan 2007 01:26:06 GMT
From: "Nospam" <nospam@home.com>
Subject: Re: Unable to find form
Message-Id: <O0Arh.17856$696.2538@newsfe7-win.ntli.net>
So far the code is:
#! usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
my $mech = WWW::Mechanize->new();
my $form_name = q(add_posting);
$mech->get('http://swansea.gumtree.com/cgi-bin/add_posting.pl?action=enter_p
assword');
$mech->form_name($form_name);
#also tried $mech->form_number(1);..$mech-#>form_number(2)
$mech->field('posting_id','5069506');
$mech->field('password','password');
if($mech->success) {print "successful \n"; }
------------------------------
Date: Wed, 17 Jan 2007 19:10:25 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Unable to find form
Message-Id: <slrneqti81.hr0.tadmc@tadmc30.august.net>
Nospam <nospam@home.com> wrote:
> I have tried form_number(1)..form_name(add_posting) ...current_form()..
Perl does not have any of those functions.
If you are using some module, such as WWW::Mechanize, then you
should say so.
You forgot to post your code where you tried those.
If you show us your code (and complete data), then we can help you fix it.
> still no luck can't figue out the name of the form
The form does not have a name, so that failure is not surprising.
> or it's number,
It is number 1 unless there was something significant in the ...
part that you snipped.
> this is a
> sample of the html:
>
><html>
> ...
>
> <form method="post" action="/cgi-bin/add_posting.pl">
[ snip the rest of the HTML fragment ]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 17 Jan 2007 23:09:46 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Unable to find form
Message-Id: <m21wlt3rhx.fsf@Sherm-Pendleys-Computer.local>
"Nospam" <nospam@home.com> writes:
> So far the code is:
>
> #! usr/bin/perl
> use strict;
> use warnings;
>
> use WWW::Mechanize;
>
> my $mech = WWW::Mechanize->new();
>
> my $form_name = q(add_posting);
>
> $mech->get('http://swansea.gumtree.com/cgi-bin/add_posting.pl?action=enter_p
> assword');
>
> $mech->form_name($form_name);
>
> #also tried $mech->form_number(1);..$mech-#>form_number(2)
>
> $mech->field('posting_id','5069506');
>
> $mech->field('password','password');
>
> if($mech->success) {print "successful \n"; }
OK, I see two problems here:
First, you've misunderstood what the form_name() method is looking for. It's
not looking at the "action" attribute, it's looking for a "name" attribute.
Since the form in this page has no "name" attribute, form_name() will never
do anything meaningful. You have to use form_number(1) in this case.
Incidentally, why would you expect form_number(2) to do anything meaningful
with a page that has only one form?
The second problem is that you've filled out the form fields, but haven't
actually submitted anything back to the server. You need to call the submit()
method to do that, or click_button() if you want to specify a button to click.
Having said that, I have to say you were lucky to get a response to your
question here. I just happened to receive your posts in the same order that
you posted them, and just happened to remember that you'd posted the HTML
form in your earlier post. And your earlier post just happened to still be
available on my server.
That's a lot of lucky events to rely on. The posting guidelines that are
posted here frequently include a number of tips about how and what to post
in order to make it more likely that you'll get answers here without needing
to depend on luck so much. You really should read (and of course, follow)
the posting guidelines!
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.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 V11 Issue 45
*************************************