[24509] in Perl-Users-Digest
Perl-Users Digest, Issue: 6689 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 14 14:05:53 2004
Date: Mon, 14 Jun 2004 11:05:14 -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 Mon, 14 Jun 2004 Volume: 10 Number: 6689
Today's topics:
Re: ActivePerl and Expect question (Dipak Prasad)
Re: Beginner Perl/CGI Book <cooladamrichardson@yahoo.com>
Re: Beginner Perl/CGI Book <cooladamrichardson@yahoo.com>
Re: Contructing a dir. tree ctcgag@hotmail.com
definition of a "straight hash"? (John Davis)
Re: definition of a "straight hash"? ctcgag@hotmail.com
Re: File::Glob can't load module [cygwin], perl-5.8.4 9 <usenet@morrow.me.uk>
Installing perl on Sol 2.6 it hangs at the: Checking i (Brian R.)
Re: Perl 6 (was: 2 naive questions: Perl 6; Perl vs. sh <usenet@morrow.me.uk>
permonks: random images/texts for web page (Wenjie)
rearrange "columns" of a multi-level hash? (hymie!)
Re: rearrange "columns" of a multi-level hash? <usenet@morrow.me.uk>
Re: redirect as POST with hidden fields <noreply@gunnar.cc>
Re: redirect as POST with hidden fields <bernard.el-haginDODGE_THIS@lido-tech.net>
Re: redirect as POST with hidden fields <noreply@gunnar.cc>
Re: redirect as POST with hidden fields <nospam@bigpond.com>
Re: redirect as POST with hidden fields <noreply@gunnar.cc>
Re: redirect as POST with hidden fields <rgasiore@wp.pl>
Re: redirect as POST with hidden fields <flavell@ph.gla.ac.uk>
Re: redirect as POST with hidden fields <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Searching for the best scripting language, (Cameron Laird)
Re: Values From Multiple Arrays <bmb@ginger.libs.uga.edu>
Re: wrap a really long line <usenet@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Jun 2004 08:37:07 -0700
From: dipakprasad@hotmail.com (Dipak Prasad)
Subject: Re: ActivePerl and Expect question
Message-Id: <6ab178e3.0406140737.1bee17a8@posting.google.com>
spamtotrash@toomuchfiction.com (Kevin Collins) wrote in message news:<slrnccjq9j.q1h.spamtotrash@doom.unix-guy.com>...
> In article <6ab178e3.0406110554.1c4e14f5@posting.google.com>, Dipak Prasad
> wrote:
> > Hi
> >
> > I have a question regarding ActivePerl and Expect. I am working with
> > already existing ActivePerl (5.6.1 Build 635) s/w for Windows. I need
> > to integrate and automate an interactive CLI-Menu driven 3rd party s/w
> > to the ActivePerl s/w. I was planning to do that using Expect, when I
> > found out that Expect is not supported by ActivePerl. My question is
> > there something equivalent to Expect provided by ActivePerl (I have
> > never used Active Perl before), and/or is there a way to make Expect
> > work with ActivePerl?
>
> Are your referring to the Perl Expect module (i.e., Perl::Expect or Expect.pm)
> or are you talking about the extension of the Tcl programming languange called
> Expect? The former is based (I expect - pun intended!) on the latter, but they
> are different things.
>
> Kevin
I had done some Expect/Tcl scripting a long time ago, and for this
current requirement it appeared that if a similar extension was
available for Perl I can achieve what I wanted to do. I did some
digging around and came across the Expect.pm module, but found out it
was incompatible with ActivePerl.
In essence, I am looking to get the Expect/Tcl behavior within
ActivePerl.
Sorry for the confusion, and your suggestions are welcome.
Dipak
------------------------------
Date: Mon, 14 Jun 2004 15:50:53 +0100
From: Adam <cooladamrichardson@yahoo.com>
Subject: Re: Beginner Perl/CGI Book
Message-Id: <2j5s94Ft6raqU1@uni-berlin.de>
On 13/06/04 23:07, Bob Walton wrote:
> Adam wrote:
>
>> On 13/06/04 20:20, GM wrote:
>>
>>> Adam wrote:
> ...
>
>
>> Does it introduce perl at all? As I say above, I'm really looking for a
>> book to introduce both perl and CGI together.
>
>
> Try: Practical Perl with CGI Applications by Elizabeth B. Chang, Scott
> Jones Publishers.
Sounds good :-) but hard to find! I can only find it at the publishers
and since I'm in the UK...
Adam
--
Adam Richardson
Email me at: stonemonkey~but.not.this.monkey~@ntlworld.com
Carpe Diem
------------------------------
Date: Mon, 14 Jun 2004 15:55:52 +0100
From: Adam <cooladamrichardson@yahoo.com>
Subject: Re: Beginner Perl/CGI Book
Message-Id: <2j5sifFtcj3gU1@uni-berlin.de>
On 13/06/04 23:19, norfernuman wrote:
> Adam wrote:
>> he wants
>> to do some scripting stuff for his websites and has done a bit of
>> programming in the past.
>>
> CGI Programming 101
>
> This was recommended to me and it got me started, although I don't use
> 99% of what I learned from it anymore, it's a BASIC starting point with
> Perl/CGI. Perl is used for so many things that it's hard to find a
> really good place to learn how to use it for specificlly web jobs,
> especially since PHP has risen to what ever it's risen to.
>
> There is also, MySQL and Perl for the Web, but he goets into mod_perl
> kind of soon. You might want to look at it.
>
> Perhaps a tie and a PHP book? ;-)
Heh heh - maybe I'll just get him some socks!
So, I know nothing about "PHP". Should I be looking at that rather than
CGI/Perl? If not - don't worry ;-)
I've had a quick look at the CGI 101 book - looks good I think I'll go
with that :-)
Thanks a lot all,
Adam
--
Adam Richardson
Email me at: stonemonkey~but.not.this.monkey~@ntlworld.com
Carpe Diem
------------------------------
Date: 14 Jun 2004 16:20:32 GMT
From: ctcgag@hotmail.com
Subject: Re: Contructing a dir. tree
Message-Id: <20040614122032.272$8L@newsreader.com>
Paul Lalli <ittyspam@yahoo.com> wrote:
>
> > my $count = 0;
>
> That's an almost-completely worthless initialization
> my $count;
> will have the same effect sine all you're ever doing to count is
> incrementing it. (An undef value increments to 1 without so much as a
> warning).
If all you ever do with count is increment it, then
the variable itself is useless, regardless of how it is initialized.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 14 Jun 2004 07:45:12 -0700
From: tudmuf2b@onebox.com (John Davis)
Subject: definition of a "straight hash"?
Message-Id: <7167a8d.0406140645.7be83377@posting.google.com>
I was looking at some of the posts and was a little confused on that
term. What exactly is a straight hash? I've tried doing a search for
it but came up empty. Is that just an ordinary associative array or is
something special with references, etc...
Thanks!
John
------------------------------
Date: 14 Jun 2004 16:26:14 GMT
From: ctcgag@hotmail.com
Subject: Re: definition of a "straight hash"?
Message-Id: <20040614122614.104$cK@newsreader.com>
tudmuf2b@onebox.com (John Davis) wrote:
> I was looking at some of the posts and was a little confused on that
> term. What exactly is a straight hash? I've tried doing a search for
> it but came up empty. Is that just an ordinary associative array or is
> something special with references, etc...
Well, depending on context, it could be a hash that isn't tied to anything,
or a hash that doesn't contain references, or a hash that doesn't have any
references to it (other than perls behind the scenes ones), or a hash that
isn't a de facto part of some more intricate data structure.
It doesn't have any meaning apart from the more complex thing it is being
compared to.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Mon, 14 Jun 2004 14:02:58 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: File::Glob can't load module [cygwin], perl-5.8.4 9 (newbie)
Message-Id: <cakb6i$7am$1@wisteria.csv.warwick.ac.uk>
Quoth "Mike O." <mikeo@tconl.com>:
> I am playing with compiling Perl 5.8.4 under cygwin. Can anyone help me fix
> the error I seem not get past?
>
> ./perl harness
> Can't load module File::Glob, dynamic loading not available in this perl.
> (You may need to build a new perl executable which either supports
> dynamic loading or has the File::Glob module statically linked into it.)
> at harness line 52
> Compilation failed in require at harness line 52.
> BEGIN failed--compilation aborted at harness line 52.
>
> I was trying to compile using:
> sh Configure -Duse64bitint \
> -Duseshrplib \
> -Dprefix=/u01/app/perl \
> -Dinstallusrbinperl=n -Dcc=gcc -Doptimize='-O2' \
> -Dperladmin='<e-mail address>' -des
Run Configure without -des, and when you get to the question about
dynamic loading say that you want to support it. If perl won't do that
under cygwin (??) then you will need to add File::Glob to the list of
extensions to be build in statically.
Ben
--
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
ben@morrow.me.uk
------------------------------
Date: 14 Jun 2004 06:42:05 -0700
From: brichardson@edocs.com (Brian R.)
Subject: Installing perl on Sol 2.6 it hangs at the: Checking if fcntl-based file locking works
Message-Id: <d32ca50.0406140542.4aa55e72@posting.google.com>
I am attempting to set up Perl in my home directory for personal usage
and I run the standard
sh Configure -D/home/MYNAME
It runs the setup fine and when it gets to the:
Checking if fcntl-based file locking works...
portion it hangs every single time. I need to get this installed
ASAP. I am using the stable.tar version of Perl 5.8.4 from perl.com.
Can someone help me??
------------------------------
Date: Mon, 14 Jun 2004 14:14:50 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Perl 6 (was: 2 naive questions: Perl 6; Perl vs. shell scripts)
Message-Id: <cakbsq$7am$3@wisteria.csv.warwick.ac.uk>
Quoth Michele Dondi <bik.mido@tiscalinet.it>:
>
> Oh, and once (IIRC) I had heard one thing about Perl6 that I could not
> find again later on, namely that it would have had a parser
> configurable at runtime. Was that just an idea that was subsequently
> rejected?
Absolutely not! See Apocalype 5
(http://www.perl.com/pub/a/2002/06/04/apo5.html).
Ben
--
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/' # ben@morrow.me.uk
------------------------------
Date: 14 Jun 2004 06:27:59 -0700
From: gokkog@yahoo.com (Wenjie)
Subject: permonks: random images/texts for web page
Message-Id: <d2804eb3.0406140527.28d410a0@posting.google.com>
Hello,
I searched the web and find some randam image perl scripts. But not as
elegant as I imagined. Do you know how the random image is implemented at:
http://www.perlmonks.org/ ???
Furthermore, I want to get some insights into the following points:
- How could I pickup some random image/text file from some directories?
- How could I glob a set of user text files and pick up some particular
paragraph's data for random input?
- Shall I use SSI if my page is dynamically generated by perl CGI script?
- I saw some onliner on perl cook book, does anyone have such a solution,
maybe just several lines?
Thanks and greetings!
Wenjie
------------------------------
Date: Mon, 14 Jun 2004 14:14:21 -0000
From: hymie@lactose.smart.net (hymie!)
Subject: rearrange "columns" of a multi-level hash?
Message-Id: <10crcltibum94e6@corp.supernews.com>
Greetings. I don't have that special knack for properly forming a
Google search that will give me the answer I seek, so I apologize if
I'm asking an old question.
I'm taking over a project from a co-worker.
We are processing a file that has information in it:
customer vendor transType productCode appNumber resultCode
We have to prepare 2 reports from this data.
Without too much detail, the first report is sorted by Customer, then by
TransactionType, then by ProductCode, and then by resultCode, with a count
of the number of lines that match each configuration.
The second report is similar, but is sorted by Customer, then by Vendor,
then by TransType, ProdCode, and resultCode.
Co-worker wrote the script with (I don't know the correct term) a multi-
level hash:
unless( exists $list{ $customer } )
{
$list{ $customer } = () ;
}
unless( exists $list{ $customer }{ $type } )
{
$list{ $customer }{ $type } = () ;
}
and so on, down to
unless( exists $list{$customer}{$type}{$productCode}{$appNo}{$vendor} )
{
$list{ $customer }{ $type }{ $productCode }{ $appNo }{ $vendor } =
{ 130 => 0,
150 => 0,
385 => 0 } ;
}
if( exists $list{$customer}{$type}{$productCode}{$appNo}
{$vendor}{$returnCode} )
{
$list{$customer}{$type}{$productCode}{$appNo}{$vendor}{$returnCode} = 1
}
Then he reads the data thusly:
foreach $customer ( keys(%list) )
{
print "Customer: $customer\n\n" ;
foreach $type ( keys(%{$list{ $customer }}) )
{
printf "\n Type: %s", $type ;
foreach $productCode ( keys(%{$list{ $customer }{ $type }}) )
{
printf "\n Product: %s\n", $productCode ;
foreach $appNo (keys(%{$list{ $customer }{ $type }{ $productCode }}))
{
foreach $vendor (keys(%{$list{$customer}{$type}
{$productCode}{$appNo}}))
{
if( $list{ $customer }{ $type }{ $productCode }
{ $appNo }{ $vendor }{385})
{
$no385++ ;
}
if( $list{ $customer }{ $type }{ $productCode }
{ $appNo }{ $vendor }{150})
{
$no150++ ;
}
}
}
}
}
}
This generates the frst report that is sorted by Customer and Type.
He wrote a second, almost identical script to re-parse all of the original
data into a new hash with the variables in customer-vendor-type order.
What I want to know is if there is
(*) an easier way to re-arrange the first hash (visualize taking a column
in a spreadsheet and moving it over, then resorting with the new
column order)?
(*) a better/easier way to start from scratch?
Thanks.
hymie! http://www.smart.net/~hymowitz hymie@lactose.smart.net
===============================================================================
------------------------------
Date: Mon, 14 Jun 2004 15:20:42 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: rearrange "columns" of a multi-level hash?
Message-Id: <cakfoa$b31$1@wisteria.csv.warwick.ac.uk>
Quoth hymie@lactose.smart.net (hymie!):
>
> We are processing a file that has information in it:
> customer vendor transType productCode appNumber resultCode
>
> We have to prepare 2 reports from this data.
>
> Without too much detail, the first report is sorted by Customer, then by
> TransactionType, then by ProductCode, and then by resultCode, with a count
> of the number of lines that match each configuration.
>
> The second report is similar, but is sorted by Customer, then by Vendor,
> then by TransType, ProdCode, and resultCode.
>
> Co-worker wrote the script with (I don't know the correct term) a multi-
> level hash:
That term'll do fine... some people here use HoH, for Hash-of-Hash.
> unless( exists $list{ $customer } )
> {
> $list{ $customer } = () ;
> }
> unless( exists $list{ $customer }{ $type } )
> {
> $list{ $customer }{ $type } = () ;
> }
> and so on, down to
> unless( exists $list{$customer}{$type}{$productCode}{$appNo}{$vendor} )
> {
> $list{ $customer }{ $type }{ $productCode }{ $appNo }{ $vendor } =
> { 130 => 0,
> 150 => 0,
> 385 => 0 } ;
> }
None of this is necessary. What was *meant* here, I think, is to create
a new anon hash for each level; in that case it should have been '= {}'
not '= ()'. In any case, if you treat an undefined variable as though
it's got a hashref in it, Perl will create a new anon hash and put a ref
to it in there for you. Also, a hash key that doesn't exist will return
a value of undef, which is zero in numeric context (with a warning you
can turn off)...
> if( exists $list{$customer}{$type}{$productCode}{$appNo}
> {$vendor}{$returnCode} )
> {
> $list{$customer}{$type}{$productCode}{$appNo}{$vendor}{$returnCode} = 1
> }
...so this whole lot can be replaced with the one line
$list{$customer}{$type}{$productCode}{$appNo}{$vendor}{$returnCode} = 1
if grep $_ == $returnCode, qw/130 150 385/;
If you need the keys of the last hash to be right, or you specifically
need the zeros, you could do
my @validCodes = qw/130 150 385/;
for ($list{$customer}...{$vendor}) {
@{$_}{@validCodes} = (0) x @validCodes;
grep $_ == $returnCode, @validCodes
and $_->{$returnCode} = 1;
}
The expression @{$_}{@validCodes} is perhaps a little confusing: the
first {} are for disambiguation, the second are a hash slice. Compare
with @hash{@validCodes}.
Why is the data stored like this at all? Surely it would be better to
store the return code straight in the hash, rather than have another
level with only one (significant) value?
$list{$customer}...{$vendor} = $returnCode
if grep $_ == $returnCode, qw/130 150 385/;
Also, what happens if the return code *isn't* in the list? Is the list
supposed to be exhaustive (in which case you can simply strip the greps
out of the above)?
> Then he reads the data thusly:
(unnecessary use of -ly: 'thus' means 'like this' all by itself)
> foreach $customer ( keys(%list) )
This is not sorted. Did you simply mean 'grouped by', or should it be
for $customer (sort keys %list)
?
> {
> print "Customer: $customer\n\n" ;
> foreach $type ( keys(%{$list{ $customer }}) )
> {
> printf "\n Type: %s", $type ;
Don't use printf when interpolation will do.
> foreach $productCode ( keys(%{$list{ $customer }{ $type }}) )
> {
> printf "\n Product: %s\n", $productCode ;
> foreach $appNo (keys(%{$list{ $customer }{ $type }{ $productCode }}))
> {
> foreach $vendor (keys(%{$list{$customer}{$type}
> {$productCode}{$appNo}}))
> {
> if( $list{ $customer }{ $type }{ $productCode }
> { $appNo }{ $vendor }{385})
> {
> $no385++ ;
This should be a hash. Variables with systematically similar names
nearly always should be.
$no{385}++;
I would use a hash rather than an array even though the keys are
numeric because they are sparse.
> }
> if( $list{ $customer }{ $type }{ $productCode }
> { $appNo }{ $vendor }{150})
> {
> $no150++ ;
> }
> }
> }
> }
> }
> }
This is a mess :). I would recast it with a dispatch table (untested):
my %no;
sub do_keys {
my $ivalue = shift;
my $action = shift;
if ('HASH' eq ref $value) {
for (keys %$value) {
$action and $action->($_);
do_keys $value->{$_}, @_;
}
}
else {
$action and $action->($value);
}
}
do_keys \$list,
sub { print "Customer: $_[0]" },
sub { print " Type: $_[0]" },
sub { print " Product: $_[0]" },
undef,
undef,
sub { $no{$_[0]}++ };
> This generates the frst report that is sorted by Customer and Type.
> He wrote a second, almost identical script to re-parse all of the original
> data into a new hash with the variables in customer-vendor-type order.
>
> What I want to know is if there is
> (*) an easier way to re-arrange the first hash (visualize taking a column
> in a spreadsheet and moving it over, then resorting with the new
> column order)?
The obvious, though maybe not the most efficient, way is to unwrap it
into a big list of records and wrap it up again:
# old order: customer type product appno vendor
# new order: customer vendor type product appno
my %new_list;
# customer is still first, so we can leave that
for my $cust (keys %list) {
my @records;
my %me;
do_keys $list{$cust},
sub { $me{type} = $_[0] },
sub { $me{prod} = $_[0] },
sub { $me{appn} = $_[0] },
sub { $me{vend} = $_[0] },
sub { push @records, { %me, code => $_[0] } }
for (@records) {
$new_list{ $cust }
{ $_->{vend} }
{ $_->{type} }
{ $_->{prod} }
{ $_->{appn} } = $_->{code};
}
}
Ben
--
Razors pain you / Rivers are damp
Acids stain you / And drugs cause cramp. [Dorothy Parker]
Guns aren't lawful / Nooses give
Gas smells awful / You might as well live. ben@morrow.me.uk
------------------------------
Date: Mon, 14 Jun 2004 14:54:16 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: redirect as POST with hidden fields
Message-Id: <2j5mc6Fu0oa4U1@uni-berlin.de>
[ Don't top-post! ]
Radek G. wrote:
> Gunnar Hjalmarsson wrote:
>> Radek G. wrote:
>>> The problem is: redirect as sending a http heading with ulr is
>>> not enoght. I need redirect as 'POST' becouse there are some
>>> hidden fileds with big values which must be all the time
>>> stored.
>>
>> libwww-perl might be what you need.
>>
>> perldoc LWP
>>
>> perldoc lwpcook
>
> Thanks for usfull information :P - better you avoid help like
> this
Pardon me? You need to pass info using POST, and I pointed you to
documentation - with examples - that shows how you can do just that.
> I did all I could in free time - and as You could guess (but You
> didn't) now my time is out - that why I've posted it here, not
> becouse I'm lazy.
Excuse me, but this is not a helpdesk for people who are short of
time. I know I would be able to emulate a form, but not without
studying the docs. And I see absolutely no reason why I - or anybody
else - would paste code examples from the docs and post them here,
when you could see directly in the docs how it's done.
Wake up, please!
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 14 Jun 2004 15:08:42 +0200
From: "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
Subject: Re: redirect as POST with hidden fields
Message-Id: <Xns95089A5B1F23Belhber1lidotechnet@62.89.127.66>
"Radek G." <rgasiore@wp.pl> wrote:
> Uzytkownik "Gunnar Hjalmarsson" <noreply@gunnar.cc> napisal w
> wiadomosci news:2j5hcaFt2pplU1@uni-berlin.de...
>> [ Don't post the same question in different messages to multiple
>> newsgroups! ]
>>
>> Radek G. wrote:
>> > The problem is: redirect as sending a http heading with ulr is
>> > not enoght. I need redirect as 'POST' becouse there are some
>> > hidden fileds with big values which must be all the time
>> > stored.
>>
>> libwww-perl might be what you need.
>>
>> perldoc LWP
>>
>> perldoc lwpcook
>
>
> Thanks for usfull information :P - better you avoid help like
> this - helpless.
You are the only one who is helpless here.
> I did all I could in free time - and as You could guess (but You
> didn't) now my time is out
What the hell!? We are not here to _guess_ what you did or did not do
in your attempt to solve the problem, as we are not here to _guess_
how much time you have or don't have left to do it.
You got what was at least an attempt at helping you, even though you
broke no less than 3 posting guidelines in this thread alone, yet you
scoff at it trying to be smart while only managing to be a smart ass.
If Gunnar's suggestion is not helpful to you, either explain why or
piss off. At this poinr I suggest the latter.
--
Cheers,
Bernard
------------------------------
Date: Mon, 14 Jun 2004 15:01:54 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: redirect as POST with hidden fields
Message-Id: <2j5mr3Ftvr3hU1@uni-berlin.de>
Gregory Toomey wrote:
> Your post mentions HTML, hidden fields, and redirects (usually
> performed by a web server).
>
> Why do you think this has anything to do with Perl?
Q:
How do you use Perl for opening a file for reading?
A (using Toomey logic):
Since you can use many programming languages for that, it's not a Perl
question.
;-)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 14 Jun 2004 23:24:19 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: redirect as POST with hidden fields
Message-Id: <1108161.YbfUc5KPgu@GMT-hosting-and-pickle-farming>
Gunnar Hjalmarsson wrote:
> Gregory Toomey wrote:
>> Your post mentions HTML, hidden fields, and redirects (usually
>> performed by a web server).
>>
>> Why do you think this has anything to do with Perl?
>
> Q:
> How do you use Perl for opening a file for reading?
>
> A (using Toomey logic):
> Since you can use many programming languages for that, it's not a Perl
> question.
>
> ;-)
>
??
The OP was about html. If in bash I write:
echo "<table><tr><<td> ....... </table>"
then I don't go and ask news:gnu.bash.bug about fixing my html.
gtoomey
------------------------------
Date: Mon, 14 Jun 2004 15:22:12 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: redirect as POST with hidden fields
Message-Id: <2j5o2rFt8m26U1@uni-berlin.de>
Gregory Toomey wrote:
> Gunnar Hjalmarsson wrote:
>> Gregory Toomey wrote:
>>> Your post mentions HTML, hidden fields, and redirects (usually
>>> performed by a web server).
>>>
>>> Why do you think this has anything to do with Perl?
>>
>> Q:
>> How do you use Perl for opening a file for reading?
>>
>> A (using Toomey logic):
>> Since you can use many programming languages for that, it's not a
>> Perl question.
>>
>> ;-)
>
> ??
>
> The OP was about html. If in bash I write:
>
> echo "<table><tr><<td> ....... </table>"
>
> then I don't go and ask news:gnu.bash.bug about fixing my html.
Well, I understood the actual OP problem being how to make a POST
request from a Perl script.
Anyway, other parts of this thread have got off the tracks, so let's
not continue this wrangling.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 14 Jun 2004 16:52:41 +0200
From: "Radek G." <rgasiore@wp.pl>
Subject: Re: redirect as POST with hidden fields
Message-Id: <cakdre$k9o$1@atlantis.news.tpi.pl>
Hello gain...
One question: did I lash into strong language. No - but You did..that's
nasty but whatever...
I've written I need some ready examples, so you could just feel free to not
answaring my question and all would be ok.
I would like to say sorry if I've written something wrong.
My purpose was not to be 'smart' posting a message - but I see some answars
are just to show own 'big brain" to The World.
One more time I would like to say sorry to Gunnar Hjalmarsson. LWP should be
enought.
regards
rgasiore <eye>
Użytkownik "Bernard El-Hagin" <bernard.el-haginDODGE_THIS@lido-tech.net>
napisał w wiadomości news:Xns95089A5B1F23Belhber1lidotechnet@62.89.127.66...
> "Radek G." <rgasiore@wp.pl> wrote:
>
> > Uzytkownik "Gunnar Hjalmarsson" <noreply@gunnar.cc> napisal w
> > wiadomosci news:2j5hcaFt2pplU1@uni-berlin.de...
> >> [ Don't post the same question in different messages to multiple
> >> newsgroups! ]
> >>
> >> Radek G. wrote:
> >> > The problem is: redirect as sending a http heading with ulr is
> >> > not enoght. I need redirect as 'POST' becouse there are some
> >> > hidden fileds with big values which must be all the time
> >> > stored.
> >>
> >> libwww-perl might be what you need.
> >>
> >> perldoc LWP
> >>
> >> perldoc lwpcook
> >
> >
> > Thanks for usfull information :P - better you avoid help like
> > this - helpless.
>
>
> You are the only one who is helpless here.
>
>
> > I did all I could in free time - and as You could guess (but You
> > didn't) now my time is out
>
>
> What the hell!? We are not here to _guess_ what you did or did not do
> in your attempt to solve the problem, as we are not here to _guess_
> how much time you have or don't have left to do it.
>
> You got what was at least an attempt at helping you, even though you
> broke no less than 3 posting guidelines in this thread alone, yet you
> scoff at it trying to be smart while only managing to be a smart ass.
> If Gunnar's suggestion is not helpful to you, either explain why or
> piss off. At this poinr I suggest the latter.
>
>
> --
> Cheers,
> Bernard
------------------------------
Date: Mon, 14 Jun 2004 16:09:41 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: redirect as POST with hidden fields
Message-Id: <Pine.LNX.4.53.0406141608510.8374@ppepc56.ph.gla.ac.uk>
On Mon, 14 Jun 2004, Radek G. wrote:
> Thanks for usfull information :P - better you avoid help like this -
> helpless.
I made a mental note earlier that you'd likely earn yourself a place
in the killfile. Unfortunately, I wasn't wrong.
------------------------------
Date: Mon, 14 Jun 2004 08:20:44 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: redirect as POST with hidden fields
Message-Id: <cofkac.mbv.ln@goaway.wombat.san-francisco.ca.us>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
On 2004-06-14, Radek G. <rgasiore@wp.pl> wrote:
> I did all I could in free time - and as You could guess (but You didn't) now
> my time is out - that why I've posted it here, not becouse I'm lazy.
It looks like everyone else has also used up their free time. It's
unfortunate they had to use it with no code to read.
- --keith
- --
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFAzcJKhVcNCxZ5ID8RAux3AJ9dGFgBKcrIQWFn+2BHQP9ETa4t4wCgj6t6
Ywn/WWlspz4b4O/w51/kHII=
=IxMZ
-----END PGP SIGNATURE-----
------------------------------
Date: Mon, 14 Jun 2004 13:23:13 -0000
From: claird@lairds.com (Cameron Laird)
Subject: Re: Searching for the best scripting language,
Message-Id: <10cr9m1q7tlp4b4@corp.supernews.com>
In article <9hdzc.93679$DG4.801@fe2.columbus.rr.com>,
Carl Banks <imbosol@aerojockey.invalid> wrote:
.
.
.
>(Since when does Perl have an interactive interpretter?)
.
.
.
Long time <URL:
http://phaseit.net/claird/comp.lang.perl.misc/perl_interactive.html >.
--
Cameron Laird <claird@phaseit.net>
Business: http://www.Phaseit.net
------------------------------
Date: Mon, 14 Jun 2004 12:53:12 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Values From Multiple Arrays
Message-Id: <Pine.A41.4.58.0406141250540.43176@ginger.libs.uga.edu>
On Sat, 12 Jun 2004, blnukem wrote:
> I'm REALLY lost on getting this to work maybe someone can help me I have
> three arrays that look like this:
>
> my @Array1 = qw(john bill peter james);
> my @Array2 = qw(car house motorcycle house);
> my @Array3 = qw(red blue green teal);
>
> and I want to output this format:
>
> john car red
> bill house blue
> peter motorcycle green
> james house teal
The Array::Each module will do this ...
use strict;
use warnings;
use Array::Each;
my @Array1 = qw(john bill peter james);
my @Array2 = qw(car house motorcycle house);
my @Array3 = qw(red blue green teal);
my $set = Array::Each->new( \( @Array1, @Array2, @Array3 ) );
while( my( $dude, $moneysink, $color ) = $set->each ) {
print "$dude $moneysink $color\n";
}
__END__
john car red
bill house blue
peter motorcycle green
james house teal
http://search.cpan.org/~bbaxter/Array-Each-0.02/Each.pm
Regards,
Brad
------------------------------
Date: Mon, 14 Jun 2004 14:09:02 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: wrap a really long line
Message-Id: <cakbhu$7am$2@wisteria.csv.warwick.ac.uk>
Quoth "gnari" <gnari@simnet.is>:
> "Ken Sington" <ken_sington@nospam_abcdefg.com> wrote in message
> news:KXOdnbq1X6-1aVHdRWPC-g@speakeasy.net...
> > criticism is good.
> > here's my function to wrap really long lines:
> > very basic.
> >
> > # wrap long lines ###################################
> > sub wrapLine {
> > my ($line) = @_;
> > $line =~ s/.{70}/$&\n/g;
>
> the use of $& degrades performance, if that is an issue.
Note that the right answer (s/(.{70})/$1\n/g) will not increase the
speed of *that* regex, it will just prevent a speed penalty on matches
which don't use capturing brackets.
To the OP: try Text::Wrap or Text::Format, or even the faq...
Ben
--
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~ Jorge Luis Borges, 'The Babylon Lottery'
------------------------------
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 6689
***************************************