[28402] in Perl-Users-Digest
Perl-Users Digest, Issue: 9766 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 26 00:06:01 2006
Date: Mon, 25 Sep 2006 21:05:05 -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, 25 Sep 2006 Volume: 10 Number: 9766
Today's topics:
Re: An interactive interpreter/shell? <robb@acm.org>
Re: An interactive interpreter/shell? <uri@stemsystems.com>
Re: Checking for empty cell in Excel Spreadsheet <mgarrish@gmail.com>
Re: does it matter whether References headers are folde <bikikii-admin@example.com>
Re: empty fields <eric-amick@comcast.net>
Re: empty fields <someone@example.com>
Re: Endless loop in Text::Format::reformat() <see.sig@rochester.rr.com>
Re: list vs. array <robb@acm.org>
Re: list vs. array <David.Squire@no.spam.from.here.au>
Re: list vs. array <robb@acm.org>
Re: list vs. array <uri@stemsystems.com>
Net::LDAP help.... lancerset@gmail.com
Re: Net::LDAP help.... <mritty@gmail.com>
Re: Net::LDAP help.... (reading news)
Re: Post to https using perl script <Giridhar.Bandi@gmail.com>
Re: Post to https using perl script <sherm@Sherm-Pendleys-Computer.local>
Re: Post to https using perl script usenet@DavidFilmer.com
Re: sort with Perl .. <tzz@lifelogs.com>
Re: sort with Perl .. <David.Squire@no.spam.from.here.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Sep 2006 17:01:50 -0700
From: "robb@acm.org" <robb@acm.org>
Subject: Re: An interactive interpreter/shell?
Message-Id: <1159228910.637568.194250@e3g2000cwe.googlegroups.com>
Michele Dondi wrote:
> On 22 Sep 2006 13:46:39 -0700, "robb@acm.org" <robb@acm.org> wrote:
>
> >Is there a shell out there that has functionality like Python's
> >interactive interpreter? I've seen references to a few things out
>
> Yes, but it has a strange name. It's called
>
> perl -de42
Cute response, but OT.
------------------------------
Date: Mon, 25 Sep 2006 23:45:24 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: An interactive interpreter/shell?
Message-Id: <x7r6xzwasr.fsf@mail.sysarch.com>
>>>>> "ro" == robb@acm org <robb@acm.org> writes:
ro> Michele Dondi wrote:
>> On 22 Sep 2006 13:46:39 -0700, "robb@acm.org" <robb@acm.org> wrote:
>>
>> >Is there a shell out there that has functionality like Python's
>> >interactive interpreter? I've seen references to a few things out
>>
>> Yes, but it has a strange name. It's called
>>
>> perl -de42
ro> Cute response, but OT.
again, you are very wrong. that is an actual perl shell. you can type
perl commands on a line and they get executed. does a shell do much more
than that? do you even understand what that command does?
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: 25 Sep 2006 15:14:30 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Checking for empty cell in Excel Spreadsheet
Message-Id: <1159222470.786025.78430@h48g2000cwc.googlegroups.com>
Pam wrote:
> Bob Walton wrote:
> > Pam wrote:
> > ...
> > > Yes I want to check each row in a particular column to see if anything
> > > is there and then write to it. Is it possible you can give me a
> > > snippet of that code for the defined function, This is the last piece
> > > I have to fix
> > ...
> > > Pam
> > ...
> >
> > Check the code in the first example in the documentation for the
> > Win32::OLE module:
> >
> > perldoc Win32::OLE
> >
> > It shows you how to read the value of a cell, how to use the defined()
> > function, and lots more. And, it goes without saying:
> >
> > perldoc -f defined
Please stop top posting. You've been told this before. Have you noticed
that you're the only one posting your entire followup over top of the
previous part of the thread?
You've also been told not to post garbage code that can't be run, yet
once again you've done that.
>
> Can you tell me what I am doing wrong here. None of my cells are being
> highlighted or wrote to it they are empty.
>
[snip lots of code that won't run under strictures and generally makes
little sense]
>
> if (undef $cell){
>
What do you think the above is doing?
Matt
------------------------------
Date: 25 Sep 2006 23:58:44 -0000
From: BiKiKii <bikikii-admin@example.com>
Subject: Re: does it matter whether References headers are folded?
Message-Id: <81AJ2EOY38985.790787037@anonymous.poster>
On 25 Sep 2006, BiKiKii wrote:
>Anonymous <nobody@bikikii.ath.cx.invalid> wrote in
>news:1K0ORU6738936.6401388889@anonymous.poster:
>
>> In article <2c0c58bebd78da6b816987b210060211@dizum.com>
>> Nomen Nescio <nobody@dizum.com> wrote:
>>>
>>> RFC 1036 says the message-IDs in the References header should be
>>> separated by a space, but it's quite common to see them folded
>>> (separated by a newline and some spaces or a newline and a tab).
>>>
>>> Does it matter?
>>>
>>> Is either folded or unfolded better or worse than the other?
>>
>> It shouldn't matter, but there are times when it matters to some
>> home-grown applications. For example I've found that the BigApple
>> mail2news software, currently run by Bikikii I think, barfs on folded
>> headers by only including the first line. Other times we've seen
>> non-folded headers truncated by a limit on line length.
>>
>> What to do.
>>
>>
>
>BiKiKii M2N routine includes BA posting software.
>Was not aware of folding References issue.
>Will look into fix for folded Ref header within BiKiKii's M@N routine.
>
> ...apparently she is in need of swift kick (kickstart) too
>
Please send test messages to BiKiKii M2N which have folded Ref Header
need raw data to do some fix of routine
BiKiKii
------------------------------
Date: Mon, 25 Sep 2006 18:33:09 -0400
From: Eric Amick <eric-amick@comcast.net>
Subject: Re: empty fields
Message-Id: <r0mgh2pepvobt48ue5muj23gjh5bt4i9fu@4ax.com>
On Mon, 25 Sep 2006 02:51:34 GMT, "John W. Krahn" <someone@example.com>
wrote:
>Eric Amick wrote:
>> According to the description in perlrun (ahem), you need
>>
>> perl -an -F, "print $F[5],$#F+1"
>>
>> I tried it.
>
>Are you really, really, *really* sure that you tried it?
>
>
>> It works.
>
>Prove it.
Fine. I misread a semicolon as a comma. The basic point is still
correct.
--
Eric Amick
Columbia, MD
------------------------------
Date: Tue, 26 Sep 2006 00:37:03 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: empty fields
Message-Id: <PC_Rg.27641$Lb5.21158@edtnps89>
Eric Amick wrote:
> On Mon, 25 Sep 2006 02:51:34 GMT, "John W. Krahn" <someone@example.com>
> wrote:
>
>>Eric Amick wrote:
>>>According to the description in perlrun (ahem), you need
>>>
>>>perl -an -F, "print $F[5],$#F+1"
>>>
>>>I tried it.
>>Are you really, really, *really* sure that you tried it?
>>
>>
>>>It works.
>>Prove it.
>
> Fine. I misread a semicolon as a comma.
Huh?
> The basic point is still correct.
It has more wrong than just a semicolon or a comma.
John
--
use Perl;
program
fulfillment
------------------------------
Date: Tue, 26 Sep 2006 03:51:31 GMT
From: Bob Walton <see.sig@rochester.rr.com>
Subject: Re: Endless loop in Text::Format::reformat()
Message-Id: <7t1Sg.48189$uH6.24997@twister.nyroc.rr.com>
Gunnar Hjalmarsson wrote:
> Bob Walton wrote:
...
Aha. Here is an input line that causes an infinite loop complete with
your warning :
$line=' >'.('a' x 114);
Try input to reformat() that contains a line like that. The number of
a's isn't important as long as there are enough of them.
Before the while loop, _unstuff gets rid of the leading space, then in
the while loop, _stuff puts the space back in front because of the >,
and then the third alternative in the elseif matches with $1 undef and
$2 the string starting with >. Then the while repeats on exactly the
same $line forever.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: 25 Sep 2006 15:18:02 -0700
From: "robb@acm.org" <robb@acm.org>
Subject: Re: list vs. array
Message-Id: <1159222682.283336.156090@b28g2000cwb.googlegroups.com>
> i would say a list is a value (could be generated from a func call or
> expression) and an array is a variable which can hold a list.
>
Oy!
IMO, what a crazy distinction. Especially since the words 'array' and
'list' have meanings in the real world - for example, different kinds
of Abstract Data Types.
------------------------------
Date: Mon, 25 Sep 2006 23:29:04 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: list vs. array
Message-Id: <ef9l60$rl$1@gemini.csx.cam.ac.uk>
robb@acm.org wrote:
>> i would say a list is a value (could be generated from a func call or
>> expression) and an array is a variable which can hold a list.
>>
>
> Oy!
>
> IMO, what a crazy distinction. Especially since the words 'array' and
> 'list' have meanings in the real world - for example, different kinds
> of Abstract Data Types.
>
Oh for goodness sake! All programming languages give their reserved
words specific and restricted means compared to the usage of that word
in the "real world". Get used to it. There is a difference between a
Perl array and a Field Programmable Gate array too.
Ah you saying that the distinction between a string variable and a
string literal in almost every programming language is also "crazy"?
There is an important distinction between a variable and the values it
can represent?
'This is a string literal';
my $string; # this is a variable capable of representing a string
(amongst other things).
DS
------------------------------
Date: 25 Sep 2006 15:43:44 -0700
From: "robb@acm.org" <robb@acm.org>
Subject: Re: list vs. array
Message-Id: <1159224224.401639.285790@b28g2000cwb.googlegroups.com>
David Squire wrote:
> Oh for goodness sake!
:-)
>
> Ah you saying that the distinction between a string variable and a
> string literal in almost every programming language is also "crazy"?
>
Not at all. Especially as you named them, respectively:
"string variable", and
"string literal".
But as soon as you'd call one a "string", and the other something like
"text block", then it gets suspicious.
Now applying (your!) naming logic (which I agree with), two names such
as:
"list variable", and
"list literal"...
would generate a guaranteed 10% reduction in pointless questions to
c.l.p.m.
------------------------------
Date: Mon, 25 Sep 2006 23:43:47 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: list vs. array
Message-Id: <x7venbwavg.fsf@mail.sysarch.com>
>>>>> "ro" == robb@acm org <robb@acm.org> writes:
ro> Now applying (your!) naming logic (which I agree with), two names such
ro> as:
ro> "list variable", and
ro> "list literal"...
ro> would generate a guaranteed 10% reduction in pointless questions to
ro> c.l.p.m.
balderdash. people reading the docs would lower the pointless questions
to almost 0. computer stuff is about being exact in what you code and
that means exact in the meanings of terms. perl like all other projects
chose its names and terms and the key is to be consistant with them, not
to make them cater to those who don't care. if you want to hack perl you
talk perl. you don't talk cobol or python here. lists and arrays are
well defined in perl and they are not the same. did you even read the
differences i listed? did you understand how they are actually more
different than they are the same? do you understand the concept of a
value vs a variable (types don't matter)? string variable vs string
literal. the difference is variable vs literal and string doesn't
matter. list value and array variable. notice the differences there?
both terms are different so they both mean something. lists are not
variables nor arrays. arrays are not values (but they contain a value
and can supply that value to an expression).
learn perl and stop asking for perl to learn you.
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: 25 Sep 2006 19:09:21 -0700
From: lancerset@gmail.com
Subject: Net::LDAP help....
Message-Id: <1159236561.825948.233940@m73g2000cwd.googlegroups.com>
Hello All,
I am having a problem with getting this to work. In this code section
I'm fetching data from mysql and assigning it to the array @Users
array. $Users[0] contains username and $Users[1] contains the password.
So i'm trying to add this info to my ldap server. The script runs, but
ldap does not contain the new entry. I'm not sure if this is a good way
to go about this. Any suggestions ??? Thanks,
use Net::LDAP::Entry;
while ( @Users = $sth->fetchrow_array( ) ) {
$entry = Net::LDAP::Entry->new;
$entry->dn($host);
$entry->add('uid' => '$Users[0]' );
$entry->add('userPassword' => '$Users[1]' );
$entry->add('givenName' => '$Users[0]' );
$entry->add('loginShell' => '/bin/bash' );
$entry->add('gidNumber' => '2222' );
$entry->add('homeDirectory' => '/home/ftpusers/$Users[0]' );
$entry->add('objectClass' => 'top');
$entry->add('objectClass' => 'person');
$entry->add('objectClass' => 'posixAccount');
}
------------------------------
Date: 25 Sep 2006 19:13:16 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Net::LDAP help....
Message-Id: <1159236796.286601.58130@h48g2000cwc.googlegroups.com>
lancer...@gmail.com wrote:
> I am having a problem with getting this to work. In this code section
> I'm fetching data from mysql and assigning it to the array @Users
> array. $Users[0] contains username and $Users[1] contains the password.
> So i'm trying to add this info to my ldap server. The script runs, but
> ldap does not contain the new entry. I'm not sure if this is a good way
> to go about this. Any suggestions ??? Thanks,
>
> use Net::LDAP::Entry;
> while ( @Users = $sth->fetchrow_array( ) ) {
> $entry = Net::LDAP::Entry->new;
> $entry->dn($host);
> $entry->add('uid' => '$Users[0]' );
> $entry->add('userPassword' => '$Users[1]' );
> $entry->add('givenName' => '$Users[0]' );
> $entry->add('loginShell' => '/bin/bash' );
> $entry->add('gidNumber' => '2222' );
> $entry->add('homeDirectory' => '/home/ftpusers/$Users[0]' );
> $entry->add('objectClass' => 'top');
> $entry->add('objectClass' => 'person');
> $entry->add('objectClass' => 'posixAccount');
> }
I know nothing about LDAP, but I know enough about Perl to see that
four different times, you think you're using the values in the @Users
array, but you're actually using the literal strings '$Users[0]'
("dollar, u, s, e, r, s, bracket, 0, bracket")
Single quotes do not interpolate. Double quotes do.
For those three that have nothing but the variable in the string, drop
the quotes entirely. For the fourth one, switch to double quotes.
Paul Lalli
------------------------------
Date: Tue, 26 Sep 2006 03:21:28 GMT
From: "Mumia W. (reading news)" <paduille.4058.mumia.w@earthlink.net>
Subject: Re: Net::LDAP help....
Message-Id: <Y01Sg.12669$v%4.3384@newsread1.news.pas.earthlink.net>
On 09/25/2006 09:09 PM, lancerset@gmail.com wrote:
> Hello All,
> I am having a problem with getting this to work. In this code section
> I'm fetching data from mysql and assigning it to the array @Users
> array. $Users[0] contains username and $Users[1] contains the password.
> So i'm trying to add this info to my ldap server. The script runs, but
> ldap does not contain the new entry. I'm not sure if this is a good way
> to go about this. Any suggestions ??? Thanks,
>
> use Net::LDAP::Entry;
> while ( @Users = $sth->fetchrow_array( ) ) {
> $entry = Net::LDAP::Entry->new;
> $entry->dn($host);
> $entry->add('uid' => '$Users[0]' );
> $entry->add('userPassword' => '$Users[1]' );
> $entry->add('givenName' => '$Users[0]' );
> [...]
The single quotes around $Users[0] and $Users[1] prevent interpolation.
If you have a LDAP utility for viewing the data that you've input, you
will probably the literal string $Users[1] in the userPassword field,
instead of the actual password.
For the user name and password, leave out the single quotes. For the
home directory, concatenate the path with the user name, e.g.
my $homedir = '/external/home/' . $Users[0];
--
paduille.4058.mumia.w@earthlink.net
------------------------------
Date: 25 Sep 2006 15:07:33 -0700
From: "cardsharper" <Giridhar.Bandi@gmail.com>
Subject: Re: Post to https using perl script
Message-Id: <1159222053.889301.131720@m73g2000cwd.googlegroups.com>
hmmm looked at the webserver log .. and found this
"POST / HTTP/1.1" 302 95 "-" "libwww-perl/5.805"
anyidea where i am going wrong with the code ?
------------------------------
Date: Mon, 25 Sep 2006 18:32:51 -0400
From: Sherm Pendley <sherm@Sherm-Pendleys-Computer.local>
Subject: Re: Post to https using perl script
Message-Id: <m2slifziek.fsf@Sherm-Pendleys-Computer.local>
"cardsharper" <Giridhar.Bandi@gmail.com> writes:
> hmmm looked at the webserver log .. and found this
> "POST / HTTP/1.1" 302 95 "-" "libwww-perl/5.805"
>
> anyidea where i am going wrong with the code ?
What code? There's no code there, just a line from your web server log.
A line, I should add, that doesn't indicate an error. What makes you think
something might be going wrong?
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: 25 Sep 2006 15:39:05 -0700
From: usenet@DavidFilmer.com
Subject: Re: Post to https using perl script
Message-Id: <1159223945.225173.286370@i42g2000cwa.googlegroups.com>
cardsharper wrote:
> $response = $ua->post($https_post, [
> filename =>['/tmp/abc.txt'],
> ], );
Time to spend some more time with the docs:
>>> The POST method also supports the multipart/form-data content
>>> used for Form-based File Upload as specified in RFC 1867.
>>> You trigger this content format by specifying a content type of
>>> 'form-data' as one of the request headers.
This is the last time I will quote the docs for you (and I've really
done it two times too many). Please RTFM before posting questions in
usenet.
Why aren't you using WWW::Mechanize? Most folks find this module so
much easier for this type of thing...
--
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Mon, 25 Sep 2006 20:39:35 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: sort with Perl ..
Message-Id: <g69odt3a2bc.fsf@CN1374059D0130.kendall.corp.akamai.com>
On 25 Sep 2006, tfurnitu@cisco.com wrote:
> I have paid attention to all the messages in the thread ( just that I havent
> replied to each one of them )
>
> I dont know why people are annoyed by my request here ??? I came across a
> problem which I could not solve ( after spending some time on it ) , and so
> I though of seeing if anyone here could help with .
> I guess I am missing something here ( I have just started visiting this
> newsgroup, and check only once in a while ) ...
> I though this newsgroup was for people to improve and learned people to
> help others improve their Perl...... ??
It is. I think one of the absolute best things you can do is to
"lurk" (meaning, read only, don't post) for 2 months here. I
guarantee you that you will learn lots of Perl that way, and you'll
see why some people were annoyed with you. For the record, I don't
think you did anything wrong, and I hope you stick around.
Ted
------------------------------
Date: Tue, 26 Sep 2006 01:46:14 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: sort with Perl ..
Message-Id: <ef9t76$gbc$1@gemini.csx.cam.ac.uk>
Ted Zlatanov wrote:
> On 25 Sep 2006, tfurnitu@cisco.com wrote:
>
>> I have paid attention to all the messages in the thread ( just that I havent
>> replied to each one of them )
>>
>> I dont know why people are annoyed by my request here ??? I came across a
>> problem which I could not solve ( after spending some time on it ) , and so
>> I though of seeing if anyone here could help with .
>> I guess I am missing something here ( I have just started visiting this
>> newsgroup, and check only once in a while ) ...
>> I though this newsgroup was for people to improve and learned people to
>> help others improve their Perl...... ??
>
> It is. I think one of the absolute best things you can do is to
> "lurk" (meaning, read only, don't post) for 2 months here. I
> guarantee you that you will learn lots of Perl that way, and you'll
> see why some people were annoyed with you. For the record, I don't
> think you did anything wrong, and I hope you stick around.
I don't think much, or even most, of the annoyance was with the OP. The
main gripe with the OP was that he/she did not show any code. Then
others leapt in with solutions (including me, once the flood gates were
open), which annoyed some folk.
Many here think that when asking for help, you should show us the code
for your attempt so far. People are happy to help you to get your code
working. They are generally not happy to write code for people from
scratch. Also, getting feedback on your code is likely to be a much more
fruitful learning experience than simply getting a ready-made solution -
particularly since some here take pleasure in producing clever and
compact solutions, rather than ones easily understandable by novices :)
DS
------------------------------
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 9766
***************************************