[29855] in Perl-Users-Digest
Perl-Users Digest, Issue: 1098 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 8 03:10:00 2007
Date: Sat, 8 Dec 2007 00:09:20 -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: 1098
Today's topics:
Re: /e modifier to s///; short "1 liner" ? <glennj@ncf.ca>
Re: /e modifier to s///; short "1 liner" ? (Name withheld by request)
Re: How to parse out specific data in text files and pl <ben@morrow.me.uk>
Re: How to parse out specific data in text files and pl cyrusgreats@gmail.com
Re: How to parse out specific data in text files and pl cyrusgreats@gmail.com
Incremental numbers in PerlScript <peter_frankde@yahoo.de>
Re: Incremental numbers in PerlScript <jurgenex@hotmail.com>
Re: Incremental numbers in PerlScript <darkon.tdo@gmail.com>
Re: Incremental numbers in PerlScript <krahnj@telus.net>
Re: Incremental numbers in PerlScript <tadmc@seesig.invalid>
Re: Incremental numbers in PerlScript <jurgenex@hotmail.com>
List of free people search engine <freefreefax@yahoo.com.tw>
new CPAN modules on Sat Dec 8 2007 (Randal Schwartz)
Re: passing arguments to a shell script from a perl scr <m@rtij.nl.invlalid>
Perl Question <amerar@iwc.net>
Re: Perl Question <m@rtij.nl.invlalid>
Re: Perl Question <ben@morrow.me.uk>
Re: Perl Question <spamtrap@dot-app.org>
Re: Problem in LDAP authentication <nospam@somewhere.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Dec 2007 23:21:48 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: /e modifier to s///; short "1 liner" ?
Message-Id: <slrnfljlce.qp6.glennj@smeagol.ncf.ca>
At 2007-12-07 02:55PM, "Name withheld by request" wrote:
> >Pls consider:
> >
> > $ echo 'Dec 9'|perl -lpe 's/(Dec)(\s+)(\d+)/printf "$1$2 %d--huh?:",$3 + 5;/e;'
> > Dec 14--huh?:1
> >
> >How do I get rid of the "1" in "--huh?:1". Also why is the "1" there?
>
> >If there is a cleaner approach to the above 1 liner, that would be fine
> >also - I just want preserve the rest of the input,
> >and add an integer offset to the date.
Date calculations should be done with date modules. You probably don't
want to see "Dec 32".
echo 'Dec 9' | perl -MDate::Manip -lne '
print UnixDate(DateCalc(ParseDate($_),ParseDateDelta("+5d")), "%b %e")
'
Note I use -n instead of -p.
--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
------------------------------
Date: 08 Dec 2007 02:36:39 GMT
From: anonb6e9@nyx.net (Name withheld by request)
Subject: Re: /e modifier to s///; short "1 liner" ?
Message-Id: <1197081398.995634@irys.nyx.net>
In article <slrnfljlce.qp6.glennj@smeagol.ncf.ca>,
Glenn Jackman <glennj@ncf.ca> wrote:
>want to see "Dec 32".
>
>echo 'Dec 9' | perl -MDate::Manip -lne '
> print UnixDate(DateCalc(ParseDate($_),ParseDateDelta("+5d")), "%b %e")
>'
Thanks Glen, it works!:
$ echo 'Dec 9' | perl -MDate::Manip -lne ' print UnixDate(DateCalc(ParseDate($_),ParseDateDelta("+25d")), "%b %e")'
Jan 3
$
The focus of my confusion was on the /e modifier, so your help is a bonus. :->
------------------------------
Date: Sat, 8 Dec 2007 00:33:36 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How to parse out specific data in text files and plugs into the spreadsheet
Message-Id: <0c5p25-20t.ln1@osiris.mauzo.dyndns.org>
Quoth cyrusgreats@gmail.com:
> On Dec 7, 9:49 am, Ben Morrow <b...@morrow.me.uk> wrote:
> >
> > [please don't quote Google's -hide quoted text- rubbish]
<snip>
> > Ben- Hide quoted text -
Which part of the above did you fail to understand?
<snip>
> > local $/ = '';
> >
> > while (my $rec = <$FILE>) {
> > my @fields = split /\n/, $rec;
> > my %rec;
> >
> > for (@fields) {
> > my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
> > or die "invalid field: '$_'";
> > $rec{$k} = $v;
> > }
<snip>
> Thanks but I'm getting error: invalid field in this line:
> my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
> or die "invalid field: '$_'";
So... you have a line which doesn't match the pattern. The error message
told you what the line looks like, and which paragraph of the file it was
in. Now change the pattern so it matches what you want it to match.
Ben
------------------------------
Date: Fri, 7 Dec 2007 17:43:54 -0800 (PST)
From: cyrusgreats@gmail.com
Subject: Re: How to parse out specific data in text files and plugs into the spreadsheet
Message-Id: <f4392d50-1c34-433e-b21f-4a512815f8bd@i29g2000prf.googlegroups.com>
On Dec 7, 4:33 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth cyrusgre...@gmail.com:
>
> > On Dec 7, 9:49 am, Ben Morrow <b...@morrow.me.uk> wrote:
>
> > > [please don't quote Google's -hide quoted text- rubbish]
> <snip>
> > > Ben- Hide quoted text -
>
> Which part of the above did you fail to understand?
>
> <snip>
>
> > > local $/ = '';
>
> > > while (my $rec = <$FILE>) {
> > > my @fields = split /\n/, $rec;
> > > my %rec;
>
> > > for (@fields) {
> > > my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
> > > or die "invalid field: '$_'";
> > > $rec{$k} = $v;
> > > }
> <snip>
> > Thanks but I'm getting error: invalid field in this line:
> > my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
> > or die "invalid field: '$_'";
>
> So... you have a line which doesn't match the pattern. The error message
> told you what the line looks like, and which paragraph of the file it was
> in. Now change the pattern so it matches what you want it to match.
>
> Ben
thanks I figured that out...
------------------------------
Date: Fri, 7 Dec 2007 18:36:00 -0800 (PST)
From: cyrusgreats@gmail.com
Subject: Re: How to parse out specific data in text files and plugs into the spreadsheet
Message-Id: <b12e2671-a3b9-4c43-825d-55d8a306992f@b1g2000pra.googlegroups.com>
On Dec 7, 4:33 pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth cyrusgre...@gmail.com:
>
> > On Dec 7, 9:49 am, Ben Morrow <b...@morrow.me.uk> wrote:
>
> > > [please don't quote Google's -hide quoted text- rubbish]
> <snip>
> > > Ben- Hide quoted text -
>
> Which part of the above did you fail to understand?
>
> <snip>
>
> > > local $/ = '';
>
> > > while (my $rec = <$FILE>) {
> > > my @fields = split /\n/, $rec;
> > > my %rec;
>
> > > for (@fields) {
> > > my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
> > > or die "invalid field: '$_'";
> > > $rec{$k} = $v;
> > > }
> <snip>
> > Thanks but I'm getting error: invalid field in this line:
> > my ($k, $v) = /([^:]*) \s* : \s* (.*)/x
> > or die "invalid field: '$_'";
>
> So... you have a line which doesn't match the pattern. The error message
> told you what the line looks like, and which paragraph of the file it was
> in. Now change the pattern so it matches what you want it to match.
>
> Ben
One more thingh before I close my case, what if I want to match the
following:
RDF Throughput R1->R2 (IO/s) : 1609
RDF Throughput R1->R2 (MB/s) : 19.4
I used the this o ne but seems does not work the way I want it:
$match1 =~/RDF Throughput R1->R2 \(MB\/s\)\/;
$match2 =~/RDF Throughput R1->R2 \(IO\/s\)\/;
------------------------------
Date: Fri, 07 Dec 2007 23:30:50 +0100
From: Peter Frank <peter_frankde@yahoo.de>
Subject: Incremental numbers in PerlScript
Message-Id: <j7ijl3ddd2vaasjc3erjonc55001vu6j9m@4ax.com>
Hi,
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.?
Peter
------------------------------
Date: Fri, 07 Dec 2007 22:41:25 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Incremental numbers in PerlScript
Message-Id: <p_j6j.444$1p.258@trndny01>
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().
jue
------------------------------
Date: Fri, 07 Dec 2007 22:52:36 -0000
From: darkon <darkon.tdo@gmail.com>
Subject: Re: Incremental numbers in PerlScript
Message-Id: <Xns99FFB5DA3FBDEdkwwashere@216.168.3.30>
Peter Frank <peter_frankde@yahoo.de> 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.?
Here's one way:
for my $n (0 .. 99) {
my $formatted_n = sprintf "%02d", $n;
print $formatted_n, "\n";
}
See the documentation for sprintf for more info. If you just want to
print out the values you might use printf. I used sprintf in case
you wanted to use them internally, say perhaps as part of a hash key.
------------------------------
Date: Sat, 08 Dec 2007 00:34:20 GMT
From: "John W. Krahn" <krahnj@telus.net>
Subject: Re: Incremental numbers in PerlScript
Message-Id: <4759E687.533D0FFB@telus.net>
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.?
$ perl -le'print for "01" .. "03"'
01
02
03
John
--
use Perl;
program
fulfillment
------------------------------
Date: Sat, 08 Dec 2007 00:54:54 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Incremental numbers in PerlScript
Message-Id: <slrnfljqgu.b7l.tadmc@tadmc30.sbcglobal.net>
Peter Frank <peter_frankde@yahoo.de> wrote:
> Hi,
>
> 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.?
perl -le 'print for "01" .. "09"'
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Sat, 08 Dec 2007 00:59:47 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Incremental numbers in PerlScript
Message-Id: <70m6j.275$Bg7.211@trndny07>
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.?
Actually, on second thought, nobody addressed your question.
You specifically asked how to increment numbers that are stored in
variables.
One way to do that is to use the ++ operator, see perldoc perlop. Or you can
just add 1 to the number.
jue
------------------------------
Date: Fri, 7 Dec 2007 20:42:56 -0800 (PST)
From: cyber <freefreefax@yahoo.com.tw>
Subject: List of free people search engine
Message-Id: <facba732-df2c-411f-b4a8-359a0a2ea76c@i29g2000prf.googlegroups.com>
List of free people search engine -- people search, white page,
background check, people finder, find people, public record, lookup
phone number, find phone number, reverse address lookup, usa people
search, cell phone number search, look phone number up, cell phone
number look up, lookup cell phone number, address find number phone,
find people address, us people search
http://www.geocities.com/freefreepeople/
------------------------------
Date: Sat, 8 Dec 2007 05:42:22 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Dec 8 2007
Message-Id: <JspuIM.1MtB@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
AI-NaiveBayes1-1.3
http://search.cpan.org/~vlado/AI-NaiveBayes1-1.3/
Bayesian prediction of categories
----
BDB-1.3
http://search.cpan.org/~mlehmann/BDB-1.3/
Asynchronous Berkeley DB access
----
Catalyst-Authentication-Store-FromSub-Hash-0.01
http://search.cpan.org/~fayland/Catalyst-Authentication-Store-FromSub-Hash-0.01/
A storage class for Catalyst Authentication using one Catalyst Model class (hash returned)
----
Catalyst-Controller-Atompub-0.2.3
http://search.cpan.org/~takeru/Catalyst-Controller-Atompub-0.2.3/
A Catalyst controller for the Atom Publishing Protocol
----
Catalyst-Controller-Atompub-0.2.4
http://search.cpan.org/~takeru/Catalyst-Controller-Atompub-0.2.4/
A Catalyst controller for the Atom Publishing Protocol
----
Catalyst-Model-SVN-0.09
http://search.cpan.org/~bobtfish/Catalyst-Model-SVN-0.09/
Catalyst Model to browse Subversion repositories
----
Catalyst-Model-SVN-0.10
http://search.cpan.org/~bobtfish/Catalyst-Model-SVN-0.10/
Catalyst Model to browse Subversion repositories
----
Catalyst-Plugin-FormValidator-Lazy-0.04
http://search.cpan.org/~tomyhero/Catalyst-Plugin-FormValidator-Lazy-0.04/
Catalyst FormValidator Plugin in Lazy way
----
Catalyst-Plugin-FormValidator-Lazy-0.05
http://search.cpan.org/~tomyhero/Catalyst-Plugin-FormValidator-Lazy-0.05/
Catalyst FormValidator Plugin in Lazy way
----
Config-Options-0.03
http://search.cpan.org/~ealleniii/Config-Options-0.03/
Module to provide a configuration hash with option to read from file.
----
Data-Rlist-1.37
http://search.cpan.org/~aspindler/Data-Rlist-1.37/
A lightweight data language for Perl, C and C++
----
EV-1.71
http://search.cpan.org/~mlehmann/EV-1.71/
perl interface to libev, a high performance full-featured event loop
----
EV-1.7a
http://search.cpan.org/~mlehmann/EV-1.7a/
perl interface to libev, a high performance full-featured event loop
----
Excel-Template-0.30
http://search.cpan.org/~jegade/Excel-Template-0.30/
Excel::Template
----
Exporter-5.60_01
http://search.cpan.org/~ferreira/Exporter-5.60_01/
Implements default import method for modules
----
ExtUtils-MakeMaker-6.42
http://search.cpan.org/~mschwern/ExtUtils-MakeMaker-6.42/
Create a module Makefile
----
File-Pid-Quick-1.00
http://search.cpan.org/~chaos/File-Pid-Quick-1.00/
Quick PID file implementation
----
Find-Lib-0.01
http://search.cpan.org/~yannk/Find-Lib-0.01/
Helper to find libs to use in the filesystem tree
----
FindLib-0.01
http://search.cpan.org/~yannk/FindLib-0.01/
Helper to find libs to use in the filesystem tree
----
Geo-GoogleEarth-Document-0.09
http://search.cpan.org/~mrdvt/Geo-GoogleEarth-Document-0.09/
Generates GoogleEarth KML Documents
----
Google-Chart-0.02
http://search.cpan.org/~marcel/Google-Chart-0.02/
Draw a chart with Google Chart
----
Gtk2-Ex-Clock-2
http://search.cpan.org/~kryde/Gtk2-Ex-Clock-2/
simple digital clock widget
----
HTML-SimpleLinkExtor-1.19
http://search.cpan.org/~bdfoy/HTML-SimpleLinkExtor-1.19/
Extract links from HTML
----
Image-Imlib2-2.00
http://search.cpan.org/~lbrocard/Image-Imlib2-2.00/
Interface to the Imlib2 image library
----
Image-Imlib2-Thumbnail-0.31
http://search.cpan.org/~lbrocard/Image-Imlib2-Thumbnail-0.31/
Generate a set of thumbnails of an image
----
JSON-1.99_01
http://search.cpan.org/~makamaka/JSON-1.99_01/
JSON (JavaScript Object Notation) encoder/decoder
----
KSx-IndexManager-0.004
http://search.cpan.org/~hdp/KSx-IndexManager-0.004/
high-level invindex management interface
----
Konstrukt-0.5-beta8
http://search.cpan.org/~twittek/Konstrukt-0.5-beta8/
Web application/design framework
----
Mail-DKIM-0.29_4
http://search.cpan.org/~jaslong/Mail-DKIM-0.29_4/
Signs/verifies Internet mail with DKIM/DomainKey signatures
----
Module-ScanDeps-0.81
http://search.cpan.org/~smueller/Module-ScanDeps-0.81/
Recursively scan Perl code for dependencies
----
Net-CSTA-0.04
http://search.cpan.org/~leifj/Net-CSTA-0.04/
Perl extension for ECMA CSTA
----
POE-Component-SSLify-0.09
http://search.cpan.org/~apocal/POE-Component-SSLify-0.09/
Makes using SSL in the world of POE easy!
----
POE-XUL-0.0100
http://search.cpan.org/~gwyn/POE-XUL-0.0100/
Create remote XUL application in POE
----
POE-XUL-0.0200
http://search.cpan.org/~gwyn/POE-XUL-0.0200/
Create remote XUL application in POE
----
Pod-S5-0.08
http://search.cpan.org/~tlinden/Pod-S5-0.08/
Generate S5 slideshow from POD source.
----
Template-Plugin-GoogleChart-0.01
http://search.cpan.org/~marcel/Template-Plugin-GoogleChart-0.01/
Using Google::Chart as a template plugin
----
Term-Cap-1.12
http://search.cpan.org/~jstowe/Term-Cap-1.12/
Perl termcap interface
----
Test-Class-0.25
http://search.cpan.org/~adie/Test-Class-0.25/
Easily create test classes in an xUnit/JUnit style
----
Text-BibTeX-BibStyle-0.03
http://search.cpan.org/~nodine/Text-BibTeX-BibStyle-0.03/
Format Text::BibTeX::Entry items using .bst
----
Text-Pipe-W3CDTF-0.01
http://search.cpan.org/~marcel/Text-Pipe-W3CDTF-0.01/
Text pipes that parse and format W3CDTF datetimes
----
WWW-Dict-Leo-Org-1.30
http://search.cpan.org/~tlinden/WWW-Dict-Leo-Org-1.30/
Interface module to dictionary dict.leo.org
----
WWW-MobileCarrierJP-0.02
http://search.cpan.org/~tokuhirom/WWW-MobileCarrierJP-0.02/
scrape mobile carrier information
----
WWW-MobileCarrierJP-0.03
http://search.cpan.org/~tokuhirom/WWW-MobileCarrierJP-0.03/
scrape mobile carrier information
----
WebService-OkiLab-ExtractPlace-0.01
http://search.cpan.org/~tsukamoto/WebService-OkiLab-ExtractPlace-0.01/
Perl interface to the OkiLab ExtractPlace web service
----
X11-Muralis-0.03
http://search.cpan.org/~rubykat/X11-Muralis-0.03/
Perl module to display wallpaper on your desktop.
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Fri, 7 Dec 2007 22:26:07 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: passing arguments to a shell script from a perl script
Message-Id: <pan.2007.12.07.21.26.07@rtij.nl.invlalid>
On Fri, 07 Dec 2007 11:44:57 -0800, doni wrote:
> Hi,
>
> Is there anyway can I pass arguments to a shell (bash) script from
> within a perl script and execute the shell script.
>
> The reason I want to call a shell script is that I want to export
> environmental variables. Since, we can't do it from a perl script, I
> wanted to write the environmental variables in a shell script and
> execute it.
Just set values in %ENV and your child process will inherit them. No need
for this complicated workaround.
HTH,
M4
------------------------------
Date: Fri, 7 Dec 2007 13:27:45 -0800 (PST)
From: "amerar@iwc.net" <amerar@iwc.net>
Subject: Perl Question
Message-Id: <3d4109e2-c58f-4475-82c0-721b223fb50a@j20g2000hsi.googlegroups.com>
Hi All,
I have an array that I form in Unix, KSH:
set -A fnames "daily_prices.fdp previous_prices.zprs eps_reports.ex3
Z_IND.DAT X_INDUSTRY.SEQ"
Then, I try and pass that to a Perl script: ./a.pl $fnames
I receive it in the Perl script: $x = $ARGV[0];
However, only the first element of the array is prevent......
What am I doing wrong?
Thanks!
------------------------------
Date: Sat, 8 Dec 2007 01:39:55 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Perl Question
Message-Id: <pan.2007.12.08.00.39.55@rtij.nl.invlalid>
On Fri, 07 Dec 2007 13:27:45 -0800, amerar@iwc.net wrote:
> Hi All,
>
> I have an array that I form in Unix, KSH:
>
> set -A fnames "daily_prices.fdp previous_prices.zprs eps_reports.ex3
> Z_IND.DAT X_INDUSTRY.SEQ"
>
> Then, I try and pass that to a Perl script: ./a.pl $fnames
>
> I receive it in the Perl script: $x = $ARGV[0];
>
> However, only the first element of the array is prevent......
>
> What am I doing wrong?
Not a Perl question at all. Read up on argument quoting and try
./a.pl "$fnames"
HTH,
M4
------------------------------
Date: Sat, 8 Dec 2007 00:39:06 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Perl Question
Message-Id: <am5p25-20t.ln1@osiris.mauzo.dyndns.org>
Quoth "amerar@iwc.net" <amerar@iwc.net>:
>
> I have an array that I form in Unix, KSH:
>
> set -A fnames "daily_prices.fdp previous_prices.zprs eps_reports.ex3
> Z_IND.DAT X_INDUSTRY.SEQ"
>
> Then, I try and pass that to a Perl script: ./a.pl $fnames
>
> I receive it in the Perl script: $x = $ARGV[0];
>
> However, only the first element of the array is prevent......
Presumably (I don't know ksh) since you didn't quote $fnames, it got
passed as several arguments instead of one, so the rest are in
@ARGV[1..N].
Ben
------------------------------
Date: Fri, 07 Dec 2007 20:20:56 -0500
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Perl Question
Message-Id: <m1tzmu7zif.fsf@dot-app.org>
"amerar@iwc.net" <amerar@iwc.net> writes:
> I have an array that I form in Unix, KSH:
>
> set -A fnames "daily_prices.fdp previous_prices.zprs eps_reports.ex3
> Z_IND.DAT X_INDUSTRY.SEQ"
>
> Then, I try and pass that to a Perl script: ./a.pl $fnames
>
> I receive it in the Perl script: $x = $ARGV[0];
>
> However, only the first element of the array is prevent......
>
> What am I doing wrong?
The shell is expanding $fnames. Since $fnames has spaces in it, the result
is multiple arguments, not just one argument with spaces in it.
So $ARGV[0] is "daily_prices.fdp", $ARGV[1] is "previous_prices.zprs", etc.
If what you wanted is for the space-separated arguments to appear in Perl
as an array, then you're already there - the shell split them for you before
passing them to Perl.
If you want the whole thing as one argument, try running your script like
this instead:
./a.pl "$fnames"
sherm--
--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Fri, 7 Dec 2007 20:13:49 -0500
From: "Thrill5" <nospam@somewhere.com>
Subject: Re: Problem in LDAP authentication
Message-Id: <LpadncnoSdFQcsTanZ2dnUVZ_oaonZ2d@comcast.com>
"Praki" <visitprakashindia@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.
------------------------------
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 1098
***************************************