[29856] in Perl-Users-Digest
Perl-Users Digest, Issue: 1099 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 8 14:09:40 2007
Date: Sat, 8 Dec 2007 11:09:06 -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 Sat, 8 Dec 2007 Volume: 11 Number: 1099
Today's topics:
"use constant X=>(1,2);" or "use constant X=>[1,2];"? <porton@narod.ru>
Re: "use constant X=>(1,2);" or "use constant X=>[1,2]; <bik.mido@tiscalinet.it>
Computer Moving Companies <movers12@movers12.com>
Re: FAQ 4.63 How do I reset an each() operation part-wa <xueweizhong@gmail.com>
Re: FAQ 4.63 How do I reset an each() operation part-wa <1usa@llenroc.ude.invalid>
Re: FAQ 4.63 How do I reset an each() operation part-wa <xueweizhong@gmail.com>
How can I print a number larger than 128? <haoniukun@gmail.com>
Re: How can I print a number larger than 128? QoS@domain.invalid
Re: How can I print a number larger than 128? <smallpond@juno.com>
Re: How can I print a number larger than 128? (Doug Miller)
Re: How to make thumbnail image from web page? <hjp-usenet2@hjp.at>
Re: How to make thumbnail image from web page? <bik.mido@tiscalinet.it>
Re: How to make thumbnail image from web page? <1usa@llenroc.ude.invalid>
Re: How to parse out specific data in text files and pl <rvtol+news@isolution.nl>
Re: Incremental numbers in PerlScript <peter_frankde@yahoo.de>
Re: Incremental numbers in PerlScript <tadmc@seesig.invalid>
Re: Problem in LDAP authentication <visitprakashindia@gmail.com>
Re: Problem in LDAP authentication <kkeller-usenet@wombat.san-francisco.ca.us>
Questions about the operator \(...) <xueweizhong@gmail.com>
Re: Questions about the operator \(...) <bik.mido@tiscalinet.it>
Re: Questions about the operator \(...) <uri@stemsystems.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 8 Dec 2007 09:44:59 -0800 (PST)
From: Victor Porton <porton@narod.ru>
Subject: "use constant X=>(1,2);" or "use constant X=>[1,2];"?
Message-Id: <5199abce-3cd6-4d05-8c20-fb2b83d75cfc@e1g2000hsh.googlegroups.com>
What's better?
use constant X=>(1,2);
or
use constant X=>[1,2];
------------------------------
Date: Sat, 08 Dec 2007 19:53:16 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: "use constant X=>(1,2);" or "use constant X=>[1,2];"?
Message-Id: <8upll3tqcan0avf5c3ck8nlslailhgk9t4@4ax.com>
On Sat, 8 Dec 2007 09:44:59 -0800 (PST), Victor Porton
<porton@narod.ru> wrote:
>What's better?
>
> use constant X=>(1,2);
>
>or
>
> use constant X=>[1,2];
What's better?
my @x = (1,2);
or
my $x = [1,2];
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: Sat, 8 Dec 2007 10:58:05 -0800 (PST)
From: movers <movers12@movers12.com>
Subject: Computer Moving Companies
Message-Id: <fdfcab2c-6943-4abe-90b9-7681e33389dc@b40g2000prf.googlegroups.com>
GET FREE QUOTES from professional moving companies in your area
Licensed & Insurance MC 531644 US DOT 1400507
1. Long Distance Moving -Save on your Move
6 or more movers compete for your move. Sit Back and receive calls
from Movers who want to compete for your move.
http://www.sunshine-mhs.com [domain info]
Sponsored Result
2. Compare Movers - Save Money
Get free quotes from movers in your area. Save up to 65% off of
regular rates!
http://www.linksmoving.com [domain info]
Sponsored Result
3. Movers
Get free estimate from multipl moving companies at the same time,
Licensed and Insured.
http://www.mover4u.com [domain info]
Sponsored Result
4. Moving & Shipping Local, Long Distance
Full Moving Service Company, Moving & Shipping Local, Long Distance
Moving Cross Country Moving Auto Shipping, All States Moving Services
Free Estimate. call 1 (818) 501-3646
http://www.linksmoving.com [domain info]
Sponsored Result
5. U Haul Movers - We Haul Moving Company
Full Service Moving in your area, Local Movers, Long Distance Cross
Country all 48 States Moving, Packing, Labor Loading un Loading. Free
Estimate for your up coming move.
http://www.movinghaul.com [domain info]
Sponsored Result
6. Moving Services - Truck Rentals
Complete moving information. Local and long distant moving services.
International movers. Budget Truck Rentals. Fast - Reasonable Moving
Services...
http://www.123movingcompany.com [domain info]
Sponsored Result
7. Choosing a Moving Company
Article looks at what you should consider when choosing a mover.
http://www.movinghaul.com [domain info]
Sponsored Result
8. California Movers Call 1-818-439-3474
Full Moving service, Local Movers, Long distance moving, International
and auto transport. Call-1-818-439-3474 and get free quote.
http://www.mover4u.com [domain info]
Sponsored Result
9. Moving Companies - Save $$
Compare Moving Companies - Get Competitive Price Quotes - Free
http://www.movinghaul.com [domain info]
Sponsored Result
10. Moving Company Home Movers 818-439-3474
National and Worldwide Moving Company, Full Moving Services Long
Distance, Local, International. labor, packing crating for home,
business and Auto Transporting.
http://www.123movingcompany.com [domain info]
Sponsored Result
11. The best directory for Mover
Check out the best Reviewed sites about Mover. The best Mover portal
on the web. Also a lot more Mover related topics and Mover listings.
http://www.mover4u.com [domain info]
Sponsored Result
12. California World Moving & Storagre
California moves, moving, moving company, moving companies,
relocation, moving boxes, packing supplies, call 1-818-439-3474
http://www.worldmovingandstorage.com [domain info]
Sponsored Result
13. The best directory for Mover
Check out the best reviewed sites about Mover. The best Mover portal
on the web. Also a lot more Mover related topics and Mover listings.
http://www.sunshine-mhs.com [domain info]
Sponsored Result
14. Los Angeles Long Distance Moving
Los Angeles Long Distance Moving, Moving out of State, Cross Country
Moving, Packing Supplies CALL 1 (818) 439-3474
http://www.losangeles-movers.com [domain info]
Sponsored Result
15. Los Angeles, CA movers 818-439-3474
Los Angeles, CA movers 818-439-3474 local movers, long distance
movers, international movers, full moving services & packing. shipping
national & worldwide.
http://www.movers2u.com [domain info]
Sponsored Result
16. Mover
Choose the top 10 sites for Mover now! Find the latest results for
Mover at WhosGot.net!
http://www.mover4u.com [domain info]
Sponsored Result
17. Los Angeles Movers 1-323-678-2704
Full Moving & Packing Services in Los Angeles California, serving
local moving, long distance moving, cross country moving, office
moving, commercial moving, auto shipping .
http://www.movers12.com [domain info]
Sponsored Result
18. CALIFORNIA MOVERS 1-323-678-2704
Full Moving & Packing Services, All Local Moving, Cross C ountry
Moving & Auto Shipping, Packing Supplies & Moving International call
us World Moving & Storage 1-323-678-2704
http://www.movers12.com [domain info]
Sponsored Result
19. Los Angeles Moving Company 323-678-2704
All Movers Moving Services, Full Moving, Packing & Storage Services,
Long Distance Movers, Cross Country Moving all 48 States.
http://www.movers2u.com
Sponsored Result
20. All San Francisco Movers 818-439-3474
All San Francisco Movers Moving Services, Full Moving, Packing &
Storage Services, Long Distance Movers, Moving out of State or Moving
to Florida, Cross Country Moving all 48 States.
http://www.movers12.com
21. All San Francisco Movers 310-925-1720
All San Francisco Movers Moving Services, Full Moving, Packing &
Storage Services, Long Distance Movers, Moving out of State or Moving
to Florida, Cross Country Moving all 48 States.
http://www.attnmovingcompanies.com
22. Moving Services Moving Companies and Movers in your area local
movers, long distance movers free moving estimate moving supplies,
auto transport, oversea moving http://www.movingcompanies.co.il
call 818-439-3474 call 323-678-2704
Related sites:
Home Improvement http://www.homeimprovementlosangeles.com
Locksmith Security Services Home Auto Locksmith http://www.locksmithsecurityservices.com
Location: all states
Location: nationwide
http://www.worldmovingandstorage.com
http://www.mover4u.com
http://www.123movingcompany.com
http://www.movers2u.com
http://www.movers12.com
http://www.sunshine-mhs.com
http://www.movinghaul.com
http://www.attnmovingcompanies.com
http://www.losangeles-movers.com
http://www.locksmithsecurityservices.com
http://www.homeimprovementlosangeles.com
http://www.linksmoving.com
http://www.movingcompanies.co.il
http://www.blogmoving.com
------------------------------
Date: Sat, 8 Dec 2007 01:03:56 -0800 (PST)
From: Todd <xueweizhong@gmail.com>
Subject: Re: FAQ 4.63 How do I reset an each() operation part-way through?
Message-Id: <020a9b41-bf18-4d5e-a9d8-736c30491f79@t1g2000pra.googlegroups.com>
> 4.63: How do I reset an each() operation part-way through?
>
> Using "keys %hash" in scalar context returns the number of keys in the
> hash *and* resets the iterator associated with the hash. You may need to
> do this if you use "last" to exit a loop early so that when you re-enter
> it, the hash iterator has been reset.
The code will be strange even it works. Is there a explicit way to do
this?
Look at this snip:
#! /bin/perl -l
%hash = (1=>a,2=>b,10000=>aaa);
#find if there is an big key
while (($key,$value) = each %hash) {
if ($key > 1000) {
print "$key => $value";
keys %hash; # what will people think about the intention of this
line?
last;
}
}
__END__
-Todd
------------------------------
Date: Sat, 08 Dec 2007 12:38:09 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: FAQ 4.63 How do I reset an each() operation part-way through?
Message-Id: <Xns9A004DAC6B701asu1cornelledu@127.0.0.1>
Todd <xueweizhong@gmail.com> wrote in
news:020a9b41-bf18-4d5e-a9d8-736c30491f79@t1g2000pra.googlegroups.com:
>
>
>> 4.63: How do I reset an each() operation part-way through?
>>
>> Using "keys %hash" in scalar context returns the number of keys
>> in the hash *and* resets the iterator associated with the hash.
>> You may need to do this if you use "last" to exit a loop early so
>> that when you re-enter it, the hash iterator has been reset.
>
> The code will be strange even it works. Is there a explicit way to do
> this?
>
> Look at this snip:
>
> #! /bin/perl -l
>
> %hash = (1=>a,2=>b,10000=>aaa);
>
> #find if there is an big key
> while (($key,$value) = each %hash) {
> if ($key > 1000) {
> print "$key => $value";
> keys %hash; # what will people think about the intention of
> this
> line?
> last;
> }
> }
>
> __END__
Note that the FAQ entry states that *scalar* constraint is required for
the side effect.
my $reset_iterator = keys %hash; # FAQ 4.63
is fairly self explanatory.
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
------------------------------
Date: Sat, 8 Dec 2007 04:47:01 -0800 (PST)
From: Todd <xueweizhong@gmail.com>
Subject: Re: FAQ 4.63 How do I reset an each() operation part-way through?
Message-Id: <09923d1e-7f11-46f6-aea7-26a0215fc6ed@d27g2000prf.googlegroups.com>
> Note that the FAQ entry states that *scalar* constraint is required for
> the side effect.
>
> my $reset_iterator = keys %hash; # FAQ 4.63
>
> is fairly self explanatory.
First, void context is an special case of scalar context. I prefer
using comment for this trick:
# tricky to reset hash iterator
keys %hash;
I think using $reset_iterator is even more confusing.
-Todd
------------------------------
Date: Sat, 8 Dec 2007 05:32:42 -0800 (PST)
From: kun niu <haoniukun@gmail.com>
Subject: How can I print a number larger than 128?
Message-Id: <23f658ee-76ed-4d2f-b77c-de62ade9bcae@d27g2000prf.googlegroups.com>
Dear all,
I'm new here.
I've got a number larger than 128.
I want to send it by socket.
I find that if print the number directly, I'll print the number in
ascii format.
So I'll have 3 separate numbers transmitted.
But I only want to transmit one byte.
How can I do so?
Thanks for any help.
------------------------------
Date: Sat, 08 Dec 2007 15:16:57 GMT
From: QoS@domain.invalid
Subject: Re: How can I print a number larger than 128?
Message-Id: <Jzy6j.1032$bW.927@trnddc07>
kun niu <haoniukun@gmail.com> wrote in message-id: <23f658ee-76ed-4d2f-b77c-de62ade9bcae@d27g2000prf.googlegroups.com>
>
> Dear all,
> I'm new here.
> I've got a number larger than 128.
> I want to send it by socket.
> I find that if print the number directly, I'll print the number in
> ascii format.
> So I'll have 3 separate numbers transmitted.
> But I only want to transmit one byte.
> How can I do so?
>
> Thanks for any help.
You can try developing a compression algo or else use one off the shelf.
Something that reduces the need for consecutive zeros or ones.
The one byte constraint is more than a bit limiting though.
gl;
------------------------------
Date: Sat, 8 Dec 2007 08:08:36 -0800 (PST)
From: smallpond <smallpond@juno.com>
Subject: Re: How can I print a number larger than 128?
Message-Id: <3cabb791-2563-4b45-8994-20e63c971bab@e10g2000prf.googlegroups.com>
On Dec 8, 8:32 am, kun niu <haoniu...@gmail.com> wrote:
> Dear all,
> I'm new here.
> I've got a number larger than 128.
> I want to send it by socket.
> I find that if print the number directly, I'll print the number in
> ascii format.
> So I'll have 3 separate numbers transmitted.
> But I only want to transmit one byte.
> How can I do so?
>
> Thanks for any help.
You should be able to send binary data to a socket using
syswrite(SOCK,$data,$length);
See packtut for information about packing data in network
byte order.
--S
------------------------------
Date: Sat, 08 Dec 2007 17:07:16 GMT
From: spambait@milmac.com (Doug Miller)
Subject: Re: How can I print a number larger than 128?
Message-Id: <6bA6j.5046$fl7.3162@newssvr22.news.prodigy.net>
In article <Jzy6j.1032$bW.927@trnddc07>, QoS@domain.invalid wrote:
>
>kun niu <haoniukun@gmail.com> wrote in message-id:
> <23f658ee-76ed-4d2f-b77c-de62ade9bcae@d27g2000prf.googlegroups.com>
>
>>
>> Dear all,
>> I'm new here.
>> I've got a number larger than 128.
>> I want to send it by socket.
>> I find that if print the number directly, I'll print the number in
>> ascii format.
>> So I'll have 3 separate numbers transmitted.
>> But I only want to transmit one byte.
>> How can I do so?
>>
>> Thanks for any help.
>
>You can try developing a compression algo or else use one off the shelf.
Why would that be necessary?
>Something that reduces the need for consecutive zeros or ones.
Why would that be necessary?
>The one byte constraint is more than a bit limiting though.
Huh? One byte = 8 bits, which can hold values up to 2^8 - 1 = 255. All he
needs to do is send it in binary.
--
Regards,
Doug Miller (alphageek at milmac dot com)
It's time to throw all their damned tea in the harbor again.
------------------------------
Date: Sat, 8 Dec 2007 11:45:55 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: How to make thumbnail image from web page?
Message-Id: <slrnflktf3.km.hjp-usenet2@hrunkner.hjp.at>
On 2007-12-06 10:15, Michele Dondi <bik.mido@tiscalinet.it> wrote:
> On Thu, 6 Dec 2007 00:38:52 +0100, "Peter J. Holzer"
><hjp-usenet2@hjp.at> wrote:
>>> Render, then subsample.
>> ^^^^^^
>> That's the interesting part. How do you render a web-page into a
>>pixmap? Subsampling is trivial.
>
> I saw the question discussed recently. I can't remember whether here
> or at PerlMonks. (Most probably, tertium non datur.) Off the top of my
> memory, and probably in a sloppy way, options include (i) use a
> rendering engine like gecko,
Provided the rendering engine can render into a pixmap instead of a
window at all, and that it can be used from Perl.
> or (ii) launch a browser and take a screenshot. IIRC both actions can
> be automated in perl.
This limits you to the size of the browser window. Which is probably
what you want for a thumbnail, but I was thinking in a more general way
(sorry for not mentioning the shift in focus).
hp
------------------------------
Date: Sat, 08 Dec 2007 12:06:33 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How to make thumbnail image from web page?
Message-Id: <jkukl3dch1ohmlsd164idteao6qekho02j@4ax.com>
On Sat, 8 Dec 2007 11:45:55 +0100, "Peter J. Holzer"
<hjp-usenet2@hjp.at> wrote:
>> I saw the question discussed recently. I can't remember whether here
>> or at PerlMonks. (Most probably, tertium non datur.) Off the top of my
>> memory, and probably in a sloppy way, options include (i) use a
>> rendering engine like gecko,
>
>Provided the rendering engine can render into a pixmap instead of a
>window at all, and that it can be used from Perl.
>
>> or (ii) launch a browser and take a screenshot. IIRC both actions can
>> be automated in perl.
>
>This limits you to the size of the browser window. Which is probably
>what you want for a thumbnail, but I was thinking in a more general way
>(sorry for not mentioning the shift in focus).
As I wrote, I vaguely remember a discussion from people who do know
far better than me. Of course I may be entirely wrong.
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: Sat, 08 Dec 2007 12:44:10 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to make thumbnail image from web page?
Message-Id: <Xns9A004EB1815BAasu1cornelledu@127.0.0.1>
"Peter J. Holzer" <hjp-usenet2@hjp.at> wrote in
news:slrnflktf3.km.hjp-usenet2@hrunkner.hjp.at:
> On 2007-12-06 10:15, Michele Dondi <bik.mido@tiscalinet.it> wrote:
>> On Thu, 6 Dec 2007 00:38:52 +0100, "Peter J. Holzer"
>><hjp-usenet2@hjp.at> wrote:
>>>> Render, then subsample.
>>> ^^^^^^
>>> That's the interesting part. How do you render a web-page into a
>>>pixmap? Subsampling is trivial.
>>
>> I saw the question discussed recently. I can't remember whether here
>> or at PerlMonks. (Most probably, tertium non datur.) Off the top of
>> my memory, and probably in a sloppy way, options include (i) use a
>> rendering engine like gecko,
>
> Provided the rendering engine can render into a pixmap instead of a
> window at all, and that it can be used from Perl.
>
>> or (ii) launch a browser and take a screenshot. IIRC both actions can
>> be automated in perl.
>
> This limits you to the size of the browser window. Which is probably
> what you want for a thumbnail, but I was thinking in a more general
> way (sorry for not mentioning the shift in focus).
There is a plugin for Firefox called Screengrab which I use. It is able
to take a snapshot of the entire contents of the browser window (not the
window decorations, though). Its source code might provide some clues.
Alternatively, on Win32, I would try to use Win32::GuiTest to scroll the
window as necessary (it is not obvious to me how I would figure that
out), take repeated snapshots using IrfanView and stitch them
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
------------------------------
Date: Sat, 8 Dec 2007 14:06:27 +0100
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: How to parse out specific data in text files and plugs into the spreadsheet
Message-Id: <fje8ff.1e8.1@news.isolution.nl>
cyrusgreats@gmail.com schreef:
> Ben Morrow:
>> my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
>> or die "invalid field: '$_'";
>
> I'm getting error: invalid field in this line:
> my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
> or die "invalid field: '$_'";
Maybe you understand it better if you change the code line to:
my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
or die "bad data: invalid field '$_' in chunk $.";
?
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Sat, 08 Dec 2007 09:37:40 +0100
From: Peter Frank <peter_frankde@yahoo.de>
Subject: Re: Incremental numbers in PerlScript
Message-Id: <e1lkl3p8m04srpoek6buo3t725cdiqtv2u@4ax.com>
Jürgen Exner wrote:
>Peter Frank wrote:
>> Can someone please tell me how I can get incremental numbers by using
>> variables in PerlScript, i.e the result should be for example 01, 02,
>> 03, etc.?
>
>Not sure where your problem is. Many ways, e.g. even a trivial "(1..3)".
>If you want to print them in a specific format like e.g. with a leading 0
>then check out printf().
I should have been more specific about what I am trying to achieve.
There is a file renaming tool called awxRename which uses Perl Script
for more complex file renaming purposes.
An example: In order to replace the term "Oldname" in all selected
files with the term "Newname", the perl script command in this program
reads
use locale;$file =~s/Oldname/Newname/g;
The program also contains variables like $name for the current file
name and $ext for the current extension. This allows for example to
replace all current file names (no matter what they are) with a new
term - without modifying the extension:
use locale;$file =~s/$name/Newname$ext/g;
However, since I am not an expert in Perl Script, I don't know how I
would achieve adding incremental numbers to the newly named files. The
program does not appear to offer a variable for incremental numbering.
An example:
Oldname.tif
Othername.tif
File.tif
should be renamed to
Photo_01.tif
Photo_02.tif
Photo_03.tif
There may be many of those files (50 or more), so I wouldn't want to
enter the numbers manually.
Can I somehow do this with Perl Script?
Peter
------------------------------
Date: Sat, 08 Dec 2007 15:48:02 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Incremental numbers in PerlScript
Message-Id: <slrnfller4.dv3.tadmc@tadmc30.sbcglobal.net>
Peter Frank <peter_frankde@yahoo.de> wrote:
> Subject: Incremental numbers in PerlScript
PerlScript is not the same as Perl.
This newsgroup is about Perl, so answers will be given as
a "Perl script" rather than as "PerlScript".
> An example: In order to replace the term "Oldname" in all selected
> files
I think you mean "in all selected filenames" instead.
The name of a file and the contents of a file are not the same either.
> with the term "Newname", the perl script command in this program
> reads
>
> use locale;$file =~s/Oldname/Newname/g;
That code does not operate on any files at all.
It appears to be operating on the name of a file.
> An example:
>
> Oldname.tif
> Othername.tif
> File.tif
>
> should be renamed to
>
> Photo_01.tif
> Photo_02.tif
> Photo_03.tif
> Can I somehow do this with Perl Script?
I do not know if that can be done with PerlScript.
You certainly can do that with a Perl script though:
-----------------------
#!/usr/bin/perl
use warnings;
use strict;
my $num = '01';
foreach my $old ( qw/Oldname.tif Othername.tif File.tif/ ) {
my($ext) = $old =~ /(\.[^.]+)$/; # m// in list context to grab extension
my $var = "Photo_$num$ext"; # build up the string
$num++; # increment "number"
print "$var\n";
}
-----------------------
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 8 Dec 2007 08:01:51 -0800 (PST)
From: Praki <visitprakashindia@gmail.com>
Subject: Re: Problem in LDAP authentication
Message-Id: <780bb7d6-ae0b-4235-9221-99b277db8a6c@a35g2000prf.googlegroups.com>
On Dec 8, 6:13 am, "Thrill5" <nos...@somewhere.com> wrote:
> "Praki" <visitprakashin...@gmail.com> wrote in message
>
> news:63ea3e28-1358-4e73-bc8c-0ecc0cf63bf7@e10g2000prf.googlegroups.com...
>
>
>
> > Greetings All,
>
> > I m trying to authenticate the user for my web page using the ldap
> > server.i m able to get the info using user name. but i m not able to
> > authenticate the password. here is the below code i m using.even if i
> > give the wrong password it access the ldap server.i m not able to
> > authenticate the user with their password. i tried in all ways.
>
> > use Net::LDAP;
> > $ldap = Net::LDAP->new("ldap.abc.com");
> > $mesg = $ldap->bind("$userid",userPassword =>"$pw");
>
> > use Net::LDAP;
> > $ldap = Net::LDAP->new("ldap.abc.com");
> > $ldap->bind("ou=active,ou=employees,ou=people,o=abc.com",
> > password=>"$pw");
>
> > i m using Sun OS and Perl 5. can anyone tell me where i m going
> > wrong...
>
> > thanks,
> > Prakash
>
> Could it be that you are using the wrong attribute name for the password?
> (userPassword instead of password). You are also not checking the error
> returned from the bind. That would at least point you in the right
> direction.
is there any doc to study and get through..
thanks,
Prakash
------------------------------
Date: Sat, 8 Dec 2007 08:41:16 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Problem in LDAP authentication
Message-Id: <d2uq25xioe.ln2@goaway.wombat.san-francisco.ca.us>
On 2007-12-08, Praki <visitprakashindia@gmail.com> wrote:
>
> is there any doc to study and get through..
If you're writing code with a module, the first place to look for
documentation is that provided with the module!
perldoc Net::LDAP
Have you read the Posting Guidelines that are posted here frequently? I
suggest you do so before posting again, or you will likely reduce the
chances of receiving a helpful answer in the future.
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
------------------------------
Date: Sat, 8 Dec 2007 06:09:43 -0800 (PST)
From: Todd <xueweizhong@gmail.com>
Subject: Questions about the operator \(...)
Message-Id: <da96d73d-453d-4c85-83e1-fa921d171548@e6g2000prf.googlegroups.com>
Hi perl guys,
See the results below, what confused me most is difference between the
"case3" and "case4":
#! /bin/perl -l
@a = (aa, bb, cc);
sub foo {@a}
print "case1: ", \foo;
print "case2: ", \@a;
print "case3: ", \(@a);
print "case4: ", \(@a, 1);
__END__
case1: SCALAR(0x10410e54)SCALAR(0x1042ec3c)SCALAR(0x1042ec48)
case2: ARRAY(0x1042eae0)
case3: SCALAR(0x10410f38)SCALAR(0x1042eab0)SCALAR(0x1042ec0c)
case4: ARRAY(0x1042eae0)SCALAR(0x1042ec3c)
From the results shown above, I get:
\(@a) is not (\@a), since the results are 3 references
\(@a, 1) is (\@a, \1), since the results are 2 references.
What's the reason to causes this differences?
I knew there must be some posts where this topics already has been
thoroughly talked, but i can't google it. So may you give me some
hints about this tricky thing?
Best regards,
Todd
------------------------------
Date: Sat, 08 Dec 2007 18:20:36 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Questions about the operator \(...)
Message-Id: <1bkll397a6r79ksgs7on4qicgc8daoitrr@4ax.com>
On Sat, 8 Dec 2007 06:09:43 -0800 (PST), Todd <xueweizhong@gmail.com>
wrote:
>From the results shown above, I get:
>
> \(@a) is not (\@a), since the results are 3 references
> \(@a, 1) is (\@a, \1), since the results are 2 references.
Well, first of all the referentiation operator is indeed very awkward
in that it is *distributive*, which is somewhat inconsistent -with the
rest of Perl- on its own. But then the behaviour that you discovered
is *very* inconsistent: in the first case it seems that @a is
flattened in the list, while in the second it is retained as an
aggregate. IMHO it should be flattened there too.
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: Sat, 08 Dec 2007 17:41:08 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Questions about the operator \(...)
Message-Id: <x7sl2daxu3.fsf@mail.sysarch.com>
>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:
MD> On Sat, 8 Dec 2007 06:09:43 -0800 (PST), Todd <xueweizhong@gmail.com>
MD> wrote:
>> From the results shown above, I get:
>>
>> \(@a) is not (\@a), since the results are 3 references
>> \(@a, 1) is (\@a, \1), since the results are 2 references.
MD> Well, first of all the referentiation operator is indeed very awkward
MD> in that it is *distributive*, which is somewhat inconsistent -with the
MD> rest of Perl- on its own. But then the behaviour that you discovered
MD> is *very* inconsistent: in the first case it seems that @a is
MD> flattened in the list, while in the second it is retained as an
MD> aggregate. IMHO it should be flattened there too.
\ distributes over the syntactical elements in the following
parenthesized list. so it will work with \(@x, @y) and return \@x and
\@y. it is trivial to distribute \ over the expanded elements of the
list with map \$_, @x, @y. so consider the behavior as a syntactical
shortcut as you can get the other semantics with map. i still have never
seen a real world need or use of \() with distribution.
if there is only a single syntactical element inside the \(@x) it will
distribute over the array's elements since making that be the same as
\@x would be redundant.
not the most consistant thing but the choices larry made make the most
flexible use of the concept and syntax.
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: 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 1099
***************************************