[19762] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1957 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 18 11:05:43 2001

Date: Thu, 18 Oct 2001 08:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1003417507-v10-i1957@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 18 Oct 2001     Volume: 10 Number: 1957

Today's topics:
    Re: Array / Regular Expression / Searching (Tad McClellan)
        Cannot make/install newest Date::Calc on Solaris 2.5.1  <NOSPsbaAM@ocegr.fr>
    Re: Case-insensitive Command Line Args <josef.moellers@fujitsu-siemens.com>
        charAt??? (Markus Dehmann)
    Re: charAt??? <bernard.el-hagin@lido-tech.net>
    Re: charAt??? (John J. Trammell)
    Re: charAt??? <bernard.el-hagin@lido-tech.net>
    Re: Checking a line of string <Graham.T.Wood@oracle.com>
    Re: Checking the remote file (Peter Sun)
    Re: Creating a hash from a sub that parses XML (George Jempty)
    Re: Creating a hash from a sub that parses XML (George Jempty)
    Re: how to find memory leaks in perl 5.004_04 <mjcarman@home.com>
    Re: Looking for DOS equiv to pause <lmoran@wtsg.com>
    Re: NMAKE error while installing SNMP module <jsjones@acm.org>
    Re: Perl CGI problem printing Javascript... <jemptyg@rwmc.net>
    Re: precedence question (Tad McClellan)
    Re: Problem with output order <Chris@Clapham.org>
    Re: readdir probs??? (Andrew Hutchinson)
    Re: readdir probs??? (Bruno Boettcher)
    Re: Writing and reading encrypted string (password) <dump@the-core.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 18 Oct 2001 14:18:15 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Array / Regular Expression / Searching
Message-Id: <slrn9stl5b.ofh.tadmc@tadmc26.august.net>


[ Please have a look at (wrapped):

   http://mail.augustmail.com/~tadmc/clpmisc/
      clpmisc_guidelines.html#item_Use_an_effective_followup_style

  Text rearranged into normal chronology.
]


Geoff Clark <gclark@wavetel.com> wrote:
>"Garry Williams" <garry@ifr.zvolve.net> wrote in message
>news:slrn9ssjm8.l1i.garry@zfw.zvolve.net...
>> On Thu, 18 Oct 2001 02:29:56 GMT, Geoff Clark <gclark@wavetel.com> wrote:

>> > This script needs to search through a text file
>and
>> > find a match and give back a result.

>> > p10020D6ACB204  00      10.1.66.13      10.1.64.2       1021903392
>> > voicedhc
>> > p10020D6BC31B4  00      10.1.66.14      10.1.64.2       1022592484
>> > voicedhc
>> > p10020D68CDA8D  00      10.1.66.15      10.1.64.2       1026616822
>> > voicedhc


Has word-wrap broken your data there?

You might need to fix the configuration of your newsreader
to avoid that happening again.


>> > I need to be able to search on the first column and display the result
>from
>> > the 3rd column.


>> It would be a big help, if you gave us complete code that illustrates
>> your problem.  The code you show has no way of "displaying the
>> result".


[ Please have a look at (wrapped):

   http://mail.augustmail.com/~tadmc/clpmisc/
      clpmisc_guidelines.html#item_Provide_enough_information
]


>> Maybe this will help:
>>
>>   while ($current_line = <TEXT_FILE>) {
>>     if ( substr($current_line, 0, 14) eq $mac ) {
>> print +(split " ", $current_line)[2], "\n";
>>     }
>>   }


[ snip .signature ]

   
>This is what I have tried :


One good thing to try before posting is to add a few debugging
print() statements:

>while ($current_line = <dhcp.txt>) {

   print "processing '$current_line'\n";

Would have shown that:

   1) the loop is executing only one time (or not at all!)

   2) $current_line does not contain a line at all! It contains
      a file_name_, not a file's _contents_.

Easy to do, and gives lots of insight into what is wrong. You could
have tried that yourself.

So, why are you getting the above behavior? Let's ask the Deparse module:

   perl -MO=Deparse -e '<dhcp.txt>'

<dhcp.txt> is not doing a readline(), as you expect it is. 

It is doing a filename glob().


> if ( substr($current_line, 0, 14) eq $mac ) {
>  print +(split " ", $current_line)[2], "\n";
> }
>}
>
>I am receiving a blank result.
                  ^^^^^^^^^^^^

Proper terminology is important when discussing technical things.

You are not getting a "blank result". You are getting "no output".

"blank" will be taken by many to mean "space character", which
is not the case here.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 18 Oct 2001 16:00:24 +0200
From: "Stephane Barizien" <NOSPsbaAM@ocegr.fr>
Subject: Cannot make/install newest Date::Calc on Solaris 2.5.1 / Perl 5.003
Message-Id: <9qmnn7$8a3$1@suaar1ac.prod.compuserve.com>

Any clue?

cpan> install Date::Calc
Running install for module Date::Calc
Running make for S/ST/STBEY/Date-Calc-5.0.tar.gz
Fetching with LWP:

ftp://ftp.oleane.net/pub/mirrors/CPAN/authors/id/S/ST/STBEY/Date-Calc-5.0.ta
r.gz
Scanning cache /net/lynx/home/sba/perl/CPAN/build for sizes
Deleting from cache: /net/lynx/home/sba/perl/CPAN/build/NNTPClient-0.37
(25.5>25.0 MB)
Deleting from cache: /net/lynx/home/sba/perl/CPAN/build/podlators-1.09
(25.3>25.0 MB)
CPAN: MD5 loaded ok
Fetching with LWP:
  ftp://ftp.oleane.net/pub/mirrors/CPAN/authors/id/S/ST/STBEY/CHECKSUMS
Checksum for
/net/lynx/home/sba/perl/CPAN/sources/authors/id/S/ST/STBEY/Date-Calc-5.0.tar
 .gz ok
x Date-Calc-5.0, 0 bytes, 0 tape blocks
x Date-Calc-5.0/t, 0 bytes, 0 tape blocks
x Date-Calc-5.0/t/f023.t, 4017 bytes, 8 tape blocks
x Date-Calc-5.0/t/f006.t, 797 bytes, 2 tape blocks
x Date-Calc-5.0/t/f025.t, 526 bytes, 2 tape blocks
x Date-Calc-5.0/t/f008.t, 888 bytes, 2 tape blocks
x Date-Calc-5.0/t/f027.t, 7086 bytes, 14 tape blocks
x Date-Calc-5.0/t/f029.t, 4015 bytes, 8 tape blocks
x Date-Calc-5.0/t/f011.t, 502 bytes, 1 tape blocks
x Date-Calc-5.0/t/f030.t, 1452 bytes, 3 tape blocks
x Date-Calc-5.0/t/f013.t, 1346 bytes, 3 tape blocks
x Date-Calc-5.0/t/f032.t, 5818 bytes, 12 tape blocks
x Date-Calc-5.0/t/f015.t, 625 bytes, 2 tape blocks
x Date-Calc-5.0/t/f034.t, 5628 bytes, 11 tape blocks
x Date-Calc-5.0/t/m001.t, 17992 bytes, 36 tape blocks
x Date-Calc-5.0/t/f017.t, 2220 bytes, 5 tape blocks
x Date-Calc-5.0/t/f036.t, 16985 bytes, 34 tape blocks
x Date-Calc-5.0/t/m003.t, 1573 bytes, 4 tape blocks
x Date-Calc-5.0/t/f019.t, 2606 bytes, 6 tape blocks
x Date-Calc-5.0/t/m005.t, 4417 bytes, 9 tape blocks
x Date-Calc-5.0/t/m007.t, 823 bytes, 2 tape blocks
x Date-Calc-5.0/t/m009.t, 3596 bytes, 8 tape blocks
x Date-Calc-5.0/t/f001.t, 597 bytes, 2 tape blocks
x Date-Calc-5.0/t/f020.t, 3428 bytes, 7 tape blocks
x Date-Calc-5.0/t/f003.t, 813 bytes, 2 tape blocks
x Date-Calc-5.0/t/f022.t, 3836 bytes, 8 tape blocks
x Date-Calc-5.0/t/f005.t, 730 bytes, 2 tape blocks
x Date-Calc-5.0/t/f024.t, 1888 bytes, 4 tape blocks
x Date-Calc-5.0/t/f007.t, 481 bytes, 1 tape blocks
x Date-Calc-5.0/t/m010.t, 2959 bytes, 6 tape blocks
x Date-Calc-5.0/t/f026.t, 1100 bytes, 3 tape blocks
x Date-Calc-5.0/t/f009.t, 1283 bytes, 3 tape blocks
x Date-Calc-5.0/t/f028.t, 7084 bytes, 14 tape blocks
x Date-Calc-5.0/t/f010.t, 1596 bytes, 4 tape blocks
x Date-Calc-5.0/t/f012.t, 2180 bytes, 5 tape blocks
x Date-Calc-5.0/t/f031.t, 16597 bytes, 33 tape blocks
x Date-Calc-5.0/t/f014.t, 2505 bytes, 5 tape blocks
x Date-Calc-5.0/t/f033.t, 965 bytes, 2 tape blocks
x Date-Calc-5.0/t/f016.t, 3899 bytes, 8 tape blocks
x Date-Calc-5.0/t/f035.t, 18466 bytes, 37 tape blocks
x Date-Calc-5.0/t/m002.t, 17973 bytes, 36 tape blocks
x Date-Calc-5.0/t/f018.t, 3047 bytes, 6 tape blocks
x Date-Calc-5.0/t/m004.t, 1405 bytes, 3 tape blocks
x Date-Calc-5.0/t/m006.t, 3800 bytes, 8 tape blocks
x Date-Calc-5.0/t/m008.t, 7424 bytes, 15 tape blocks
x Date-Calc-5.0/t/f000.t, 3019 bytes, 6 tape blocks
x Date-Calc-5.0/t/f002.t, 1202 bytes, 3 tape blocks
x Date-Calc-5.0/t/f021.t, 4634 bytes, 10 tape blocks
x Date-Calc-5.0/t/f004.t, 926 bytes, 2 tape blocks
x Date-Calc-5.0/examples, 0 bytes, 0 tape blocks
x Date-Calc-5.0/examples/linearcal.pl, 1932 bytes, 4 tape blocks
x Date-Calc-5.0/examples/time.pl, 1259 bytes, 3 tape blocks
x Date-Calc-5.0/examples/nth_weekday.pl, 2246 bytes, 5 tape blocks
x Date-Calc-5.0/examples/vacation.pl, 969 bytes, 2 tape blocks
x Date-Calc-5.0/examples/anniversaries.pl, 2271 bytes, 5 tape blocks
x Date-Calc-5.0/examples/income.pl, 2879 bytes, 6 tape blocks
x Date-Calc-5.0/examples/age_in_days_eu.pl, 4658 bytes, 10 tape blocks
x Date-Calc-5.0/examples/cal.c, 2261 bytes, 5 tape blocks
x Date-Calc-5.0/examples/holidays.pl, 1976 bytes, 4 tape blocks
x Date-Calc-5.0/examples/delta.pl, 2556 bytes, 5 tape blocks
x Date-Calc-5.0/examples/calendar.cgi, 21396 bytes, 42 tape blocks
x Date-Calc-5.0/examples/weiberfastnacht.pl, 1263 bytes, 3 tape blocks
x Date-Calc-5.0/examples/age_in_days_us.pl, 4658 bytes, 10 tape blocks
x Date-Calc-5.0/lib, 0 bytes, 0 tape blocks
x Date-Calc-5.0/lib/Carp, 0 bytes, 0 tape blocks
x Date-Calc-5.0/lib/Carp/Clan.pod, 3753 bytes, 8 tape blocks
x Date-Calc-5.0/lib/Carp/Clan.pm, 7710 bytes, 16 tape blocks
x Date-Calc-5.0/lib/Date, 0 bytes, 0 tape blocks
x Date-Calc-5.0/lib/Date/Calendar, 0 bytes, 0 tape blocks
x Date-Calc-5.0/lib/Date/Calendar/Profiles.pm, 129742 bytes, 254 tape blocks
x Date-Calc-5.0/lib/Date/Calendar/Profiles.pod, 17354 bytes, 34 tape blocks
x Date-Calc-5.0/lib/Date/Calendar/Year.pm, 17554 bytes, 35 tape blocks
x Date-Calc-5.0/lib/Date/Calendar/Year.pod, 27619 bytes, 54 tape blocks
x Date-Calc-5.0/lib/Date/Calc, 0 bytes, 0 tape blocks
x Date-Calc-5.0/lib/Date/Calc/Object.pm, 43144 bytes, 85 tape blocks
x Date-Calc-5.0/lib/Date/Calc/Object.pod, 37409 bytes, 74 tape blocks
x Date-Calc-5.0/Calc.xs, 33426 bytes, 66 tape blocks
x Date-Calc-5.0/tools, 0 bytes, 0 tape blocks
x Date-Calc-5.0/tools/compile.pl, 1096 bytes, 3 tape blocks
x Date-Calc-5.0/tools/iso2pc.c, 15620 bytes, 31 tape blocks
x Date-Calc-5.0/tools/pc2iso.c, 15620 bytes, 31 tape blocks
x Date-Calc-5.0/tools/compile.bat, 985 bytes, 2 tape blocks
x Date-Calc-5.0/tools/compile.sh, 995 bytes, 2 tape blocks
x Date-Calc-5.0/MANIFEST, 1209 bytes, 3 tape blocks
x Date-Calc-5.0/CREDITS.txt, 13289 bytes, 26 tape blocks
x Date-Calc-5.0/ToolBox.h, 8487 bytes, 17 tape blocks
x Date-Calc-5.0/DateCalc.c, 80547 bytes, 158 tape blocks
x Date-Calc-5.0/Calendar.pm, 6233 bytes, 13 tape blocks
x Date-Calc-5.0/INSTALL.txt, 12592 bytes, 25 tape blocks
x Date-Calc-5.0/CHANGES.txt, 11727 bytes, 23 tape blocks
x Date-Calc-5.0/DateCalc.h, 30676 bytes, 60 tape blocks
x Date-Calc-5.0/Makefile.PL, 1969 bytes, 4 tape blocks
x Date-Calc-5.0/Artistic.txt, 6111 bytes, 12 tape blocks
x Date-Calc-5.0/README.txt, 12217 bytes, 24 tape blocks
x Date-Calc-5.0/TOOLS.txt, 5238 bytes, 11 tape blocks
x Date-Calc-5.0/GNU_LGPL.txt, 25273 bytes, 50 tape blocks
x Date-Calc-5.0/EXAMPLES.txt, 21024 bytes, 42 tape blocks
x Date-Calc-5.0/GNU_GPL.txt, 17985 bytes, 36 tape blocks
x Date-Calc-5.0/typemap, 941 bytes, 2 tape blocks
x Date-Calc-5.0/Calc.pod, 86951 bytes, 170 tape blocks
x Date-Calc-5.0/Calendar.pod, 18477 bytes, 37 tape blocks
x Date-Calc-5.0/Calc.pm, 8318 bytes, 17 tape blocks

  CPAN.pm: Going to build S/ST/STBEY/Date-Calc-5.0.tar.gz

Checking if your kit is complete...
Looks good
Warning: prerequisite Bit::Vector 5.7 not found at (eval 1) line 220.
Writing Makefile for Date::Calc
Writing patchlevel.h for /usr/local/bin/perl (5.00503)
---- Unsatisfied dependencies detected during
[S/ST/STBEY/Date-Calc-5.0.tar.gz] -----
    Bit::Vector
Running make test
  Delayed until after prerequisites
Running make install
  Delayed until after prerequisites
Running install for module Bit::Vector
Running make for S/ST/STBEY/Bit-Vector-6.1.tar.gz
Fetching with LWP:

ftp://ftp.oleane.net/pub/mirrors/CPAN/authors/id/S/ST/STBEY/Bit-Vector-6.1.t
ar.gz
Checksum for
/net/lynx/home/sba/perl/CPAN/sources/authors/id/S/ST/STBEY/Bit-Vector-6.1.ta
r.gz ok
x Bit-Vector-6.1, 0 bytes, 0 tape blocks
x Bit-Vector-6.1/examples, 0 bytes, 0 tape blocks
x Bit-Vector-6.1/examples/benchmark.pl, 467 bytes, 1 tape blocks
x Bit-Vector-6.1/examples/SetObject.pl, 4210 bytes, 9 tape blocks
x Bit-Vector-6.1/examples/primes.pl, 2623 bytes, 6 tape blocks
x Bit-Vector-6.1/BitVector.c, 102921 bytes, 202 tape blocks
x Bit-Vector-6.1/Vector.pod, 98783 bytes, 193 tape blocks
x Bit-Vector-6.1/GNU_LGPL.txt, 25273 bytes, 50 tape blocks
x Bit-Vector-6.1/t, 0 bytes, 0 tape blocks
x Bit-Vector-6.1/t/01________new.t, 9786 bytes, 20 tape blocks
x Bit-Vector-6.1/t/03_operations.t, 15037 bytes, 30 tape blocks
x Bit-Vector-6.1/t/30_overloaded.t, 22809 bytes, 45 tape blocks
x Bit-Vector-6.1/t/15________add.t, 5451 bytes, 11 tape blocks
x Bit-Vector-6.1/t/02____destroy.t, 1870 bytes, 4 tape blocks
x Bit-Vector-6.1/t/05_____primes.t, 4566 bytes, 9 tape blocks
x Bit-Vector-6.1/t/12_____string.t, 8217 bytes, 17 tape blocks
x Bit-Vector-6.1/t/08_____resize.t, 5786 bytes, 12 tape blocks
x Bit-Vector-6.1/t/10__intervals.t, 8447 bytes, 17 tape blocks
x Bit-Vector-6.1/t/11______shift.t, 5895 bytes, 12 tape blocks
x Bit-Vector-6.1/t/04__functions.t, 2507 bytes, 5 tape blocks
x Bit-Vector-6.1/t/09_parameters.t, 16636 bytes, 33 tape blocks
x Bit-Vector-6.1/t/28__chunklist.t, 1569 bytes, 4 tape blocks
x Bit-Vector-6.1/t/00____version.t, 1532 bytes, 3 tape blocks
x Bit-Vector-6.1/t/13__increment.t, 2495 bytes, 5 tape blocks
x Bit-Vector-6.1/t/07____compare.t, 4919 bytes, 10 tape blocks
x Bit-Vector-6.1/t/16___subtract.t, 5461 bytes, 11 tape blocks
x Bit-Vector-6.1/t/14______empty.t, 1971 bytes, 4 tape blocks
x Bit-Vector-6.1/t/06_____subset.t, 1413 bytes, 3 tape blocks
x Bit-Vector-6.1/BitVector.h, 16579 bytes, 33 tape blocks
x Bit-Vector-6.1/lib, 0 bytes, 0 tape blocks
x Bit-Vector-6.1/lib/Carp, 0 bytes, 0 tape blocks
x Bit-Vector-6.1/lib/Carp/Clan.pod, 3753 bytes, 8 tape blocks
x Bit-Vector-6.1/lib/Carp/Clan.pm, 7710 bytes, 16 tape blocks
x Bit-Vector-6.1/lib/Bit, 0 bytes, 0 tape blocks
x Bit-Vector-6.1/lib/Bit/Vector, 0 bytes, 0 tape blocks
x Bit-Vector-6.1/lib/Bit/Vector/Overload.pm, 27373 bytes, 54 tape blocks
x Bit-Vector-6.1/lib/Bit/Vector/Overload.pod, 43960 bytes, 86 tape blocks
x Bit-Vector-6.1/MANIFEST, 674 bytes, 2 tape blocks
x Bit-Vector-6.1/GNU_GPL.txt, 17985 bytes, 36 tape blocks
x Bit-Vector-6.1/CREDITS.txt, 7107 bytes, 14 tape blocks
x Bit-Vector-6.1/ToolBox.h, 8487 bytes, 17 tape blocks
x Bit-Vector-6.1/Vector.pm, 986 bytes, 2 tape blocks
x Bit-Vector-6.1/typemap, 995 bytes, 2 tape blocks
x Bit-Vector-6.1/INSTALL.txt, 7390 bytes, 15 tape blocks
x Bit-Vector-6.1/CHANGES.txt, 11567 bytes, 23 tape blocks
x Bit-Vector-6.1/Makefile.PL, 1928 bytes, 4 tape blocks
x Bit-Vector-6.1/Vector.xs, 76439 bytes, 150 tape blocks
x Bit-Vector-6.1/Artistic.txt, 6111 bytes, 12 tape blocks
x Bit-Vector-6.1/README.txt, 13104 bytes, 26 tape blocks

  CPAN.pm: Going to build S/ST/STBEY/Bit-Vector-6.1.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for Bit::Vector
Writing patchlevel.h for /usr/local/bin/perl (5.00503)
mkdir blib
mkdir blib/lib
mkdir blib/lib/Bit
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/Bit
mkdir blib/arch/auto/Bit/Vector
mkdir blib/lib/auto
mkdir blib/lib/auto/Bit
mkdir blib/lib/auto/Bit/Vector
mkdir blib/man3
cp lib/Carp/Clan.pod blib/lib/Carp/Clan.pod
cp lib/Bit/Vector/Overload.pod blib/lib/Bit/Vector/Overload.pod
cp Vector.pod blib/lib/Bit/Vector.pod
cp lib/Carp/Clan.pm blib/lib/Carp/Clan.pm
cp lib/Bit/Vector/Overload.pm blib/lib/Bit/Vector/Overload.pm
cp Vector.pm blib/lib/Bit/Vector.pm
/opt/SUNWspro/SC4.0/bin/acc -c  -I/usr/local/include -O     -DVERSION=\"6.1\
"  -DXS_VERSION=\"6.1\" -Kpic -I/usr/local/lib/perl5/5.00503/sun4-solaris/CO
RE  BitVector.c
/usr/local/bin/perl -I/usr/local/lib/perl5/5.00503/sun4-solaris -I/usr/local
/lib/perl5/5.00503 /usr/local/lib/perl5/5.00503/ExtUtils/xsubpp  -typemap
/usr/local/lib/perl5/5.00503/ExtUtils/typemap -typemap typemap Vector.xs
>xstmp.c && mv xstmp.c Vector.c
/opt/SUNWspro/SC4.0/bin/acc -c  -I/usr/local/include -O     -DVERSION=\"6.1\
"  -DXS_VERSION=\"6.1\" -Kpic -I/usr/local/lib/perl5/5.00503/sun4-solaris/CO
RE  Vector.c
Running Mkbootstrap for Bit::Vector ()
chmod 644 Vector.bs
LD_RUN_PATH="" /opt/SUNWspro/SC4.0/bin/acc -o
blib/arch/auto/Bit/Vector/Vector.so  -G -L/usr/local/lib] -L/usr/local/SUNWs
pro/SC4.0/lib -L/usr/ucblib -L/usr/local/lib -L/usr/ccs/lib BitVector.o
Vector.o
chmod 755 blib/arch/auto/Bit/Vector/Vector.so
cp Vector.bs blib/arch/auto/Bit/Vector/Vector.bs
chmod 644 blib/arch/auto/Bit/Vector/Vector.bs
Manifying blib/man3/Carp::Clan.3
Manifying blib/man3/Bit::Vector::Overload.3
Manifying blib/man3/Bit::Vector.3
  /usr/ccs/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1
/usr/local/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.00503/su
n4-solaris -I/usr/local/lib/perl5/5.00503 -e 'use Test::Harness qw(&runtests
$verbose); $verbose=0; runtests @ARGV;' t/*.t
t/00____version....ok
t/01________new....ok
t/02____destroy....ok
t/03_operations....ok
t/04__functions....ok
t/05_____primes....ok
t/06_____subset....ok
t/07____compare....ok
t/08_____resize....ok
t/09_parameters....ok
t/10__intervals....ok
t/11______shift....ok
t/12_____string....ok
t/13__increment....ok
t/14______empty....ok
t/15________add....ok
t/16___subtract....ok
t/28__chunklist....ok
t/30_overloaded....ok
All tests successful.
Files=19, Tests=67255, 230 wallclock secs (47.76 cusr +  5.81 csys = 53.57
CPU)
  /usr/ccs/bin/make test -- OK
Running make install
Installing
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/Bit/Vector/Vector.so
Installing
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/Bit/Vector/Vector.bs
Files found in blib/arch --> Installing files in blib/lib into architecture
dependend library tree!
Installing /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Bit/Vector/Over
load.pod
Installing
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Bit/Vector/Overload.pm
Installing /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Bit/Vector.pod
Installing /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Bit/Vector.pm
Installing /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Carp/Clan.pod
Installing /usr/local/lib/perl5/site_perl/5.005/sun4-solaris/Carp/Clan.pm
Installing /usr/local/lib/perl5/5.00503/man/man3/Carp::Clan.3
Installing /usr/local/lib/perl5/5.00503/man/man3/Bit::Vector::Overload.3
Installing /usr/local/lib/perl5/5.00503/man/man3/Bit::Vector.3
Writing
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/auto/Bit/Vector/.packlist
Appending installation info to
/usr/local/lib/perl5/5.00503/sun4-solaris/perllocal.pod
  /usr/ccs/bin/make install  -- OK
Running make for S/ST/STBEY/Date-Calc-5.0.tar.gz
  Is already unwrapped into directory
/net/lynx/home/sba/perl/CPAN/build/Date-Calc-5.0

  CPAN.pm: Going to build S/ST/STBEY/Date-Calc-5.0.tar.gz

mkdir blib
mkdir blib/lib
mkdir blib/lib/Date
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/Date
mkdir blib/arch/auto/Date/Calc
mkdir blib/lib/auto
mkdir blib/lib/auto/Date
mkdir blib/lib/auto/Date/Calc
mkdir blib/man3
cp lib/Date/Calendar/Profiles.pod blib/lib/Date/Calendar/Profiles.pod
cp Calc.pod blib/lib/Date/Calc.pod
cp lib/Carp/Clan.pm blib/lib/Carp/Clan.pm
cp Calendar.pm blib/lib/Date/Calendar.pm
cp lib/Date/Calc/Object.pm blib/lib/Date/Calc/Object.pm
cp lib/Date/Calendar/Year.pm blib/lib/Date/Calendar/Year.pm
cp lib/Carp/Clan.pod blib/lib/Carp/Clan.pod
cp lib/Date/Calendar/Profiles.pm blib/lib/Date/Calendar/Profiles.pm
cp Calendar.pod blib/lib/Date/Calendar.pod
cp lib/Date/Calc/Object.pod blib/lib/Date/Calc/Object.pod
cp Calc.pm blib/lib/Date/Calc.pm
cp lib/Date/Calendar/Year.pod blib/lib/Date/Calendar/Year.pod
/usr/local/bin/perl -I/usr/local/lib/perl5/5.00503/sun4-solaris -I/usr/local
/lib/perl5/5.00503 /usr/local/lib/perl5/5.00503/ExtUtils/xsubpp  -typemap
/usr/local/lib/perl5/5.00503/ExtUtils/typemap -typemap typemap Calc.xs
>xstmp.c && mv xstmp.c Calc.c
/opt/SUNWspro/SC4.0/bin/acc -c  -I/usr/local/include -O     -DVERSION=\"5.0\
"  -DXS_VERSION=\"5.0\" -Kpic -I/usr/local/lib/perl5/5.00503/sun4-solaris/CO
RE  Calc.c
/opt/SUNWspro/SC4.0/bin/acc -c  -I/usr/local/include -O     -DVERSION=\"5.0\
"  -DXS_VERSION=\"5.0\" -Kpic -I/usr/local/lib/perl5/5.00503/sun4-solaris/CO
RE  DateCalc.c
Running Mkbootstrap for Date::Calc ()
chmod 644 Calc.bs
LD_RUN_PATH="" /opt/SUNWspro/SC4.0/bin/acc -o
blib/arch/auto/Date/Calc/Calc.so  -G -L/usr/local/lib] -L/usr/local/SUNWspro
/SC4.0/lib -L/usr/ucblib -L/usr/local/lib -L/usr/ccs/lib Calc.o  DateCalc.o
chmod 755 blib/arch/auto/Date/Calc/Calc.so
cp Calc.bs blib/arch/auto/Date/Calc/Calc.bs
chmod 644 blib/arch/auto/Date/Calc/Calc.bs
Manifying blib/man3/Date::Calendar::Profiles.3
Manifying blib/man3/Carp::Clan.3
Manifying blib/man3/Date::Calendar.3
Manifying blib/man3/Date::Calc.3
Manifying blib/man3/Date::Calc::Object.3
Manifying blib/man3/Date::Calendar::Year.3
  /usr/ccs/bin/make  -- OK
Running make test
PERL_DL_NONLAZY=1
/usr/local/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.00503/su
n4-solaris -I/usr/local/lib/perl5/5.00503 -e 'use Test::Harness qw(&runtests
$verbose); $verbose=0; runtests @ARGV;' t/*.t
t/f000....ok
t/f001....ok
t/f002....ok
t/f003....ok
t/f004....ok
t/f005....ok
t/f006....ok
t/f007....ok
t/f008....ok
t/f009....ok
t/f010....ok
t/f011....ok
t/f012....ok
t/f013....ok
t/f014....ok
t/f015....ok
t/f016....ok
t/f017....ok
t/f018....ok
t/f019....ok
t/f020....ok
t/f021....ok
t/f022....ok
t/f023....ok
t/f024....ok
t/f025....ok
t/f026....ok
t/f027....ok
t/f028....ok
t/f029....ok
t/f030....ok
t/f031....ok
t/f032....ok
t/f033....ok
t/f034....FAILED test 24
        Failed 1/251 tests, 99.60% okay
t/f035....ok
t/f036....ok
t/m001....ok
t/m002....ok
t/m003....ok
t/m004....ok
t/m005....ok
t/m006....ok
t/m007....ok
t/m008....ok
t/m009....ok
t/m010....ok
Failed Test Stat Wstat Total Fail  Failed  List of Failed
----------------------------------------------------------------------------
---
t/f034.t                 251    1   0.40%  24
Failed 1/47 test scripts, 97.87% okay. 1/2929 subtests failed, 99.97% okay.
*** Error code 29
make: Fatal error: Command failed for target `test_dynamic'
  /usr/ccs/bin/make test -- NOT OK
Running make install
  make test had returned bad status, won't install without force





------------------------------

Date: Thu, 18 Oct 2001 16:15:22 +0200
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: Case-insensitive Command Line Args
Message-Id: <3BCEE3FA.BAC89348@fujitsu-siemens.com>

Buck Turgidson wrote:
> =

> I adapted a version of grep I found somewhere, and got it working for
> the most part, to my liking.  However, I want to be able to enter
> command line args such as "GREP -IL"  in upper case, just in case I am
> set to upper case.  I tried adding the noted line, but it is ignored.
> Can someone suggest what I should change?  I am trying to avoid
> putting lc() on each reference to $opt in the program.
> =

> #-------------------
> # i ignore case
> # c count only
> # l list name only
> # e regex
> #-------------------
> =

> use Getopt::Std;
> my %opt;
> getopts('ivcle:',\%opt);
> $opt =3D lc($opt);         #  <----- added this

This definitely won't work, since %opt and $opt are two completely
different beasts.

Since you have only 5 options, why not write
if (exists($opt{'I'}) $opt{'i'} =3D $opt{'I'};	# similar for C, L, E, V

or

foreach (keys %opt) {
   next if /[a-z]/;
   $opt{lc($_)} =3D $opt{$_};
   # delete $opt{$_};
}


HTH,
-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett


------------------------------

Date: 18 Oct 2001 06:48:02 -0700
From: markus.cl@gmx.de (Markus Dehmann)
Subject: charAt???
Message-Id: <c1e48b51.0110180548.53178571@posting.google.com>

If I want just one char out of a string - do I have to use substr?

For example, I want the char number 3:
$_ = "Markus";
print substr $_, 3, 1;

> k

There is something more efficient, right? I couldn't find something like 
print charAt $_, 3
or so! What is it?

Markus.


------------------------------

Date: 18 Oct 2001 13:55:39 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: charAt???
Message-Id: <slrn9stndq.85e.bernard.el-hagin@gdndev25.lido-tech>

On 18 Oct 2001 06:48:02 -0700, Markus Dehmann <markus.cl@gmx.de> wrote:
> If I want just one char out of a string - do I have to use substr?


You don't *have* to, but it's actually a pretty good way of going
about it.


> For example, I want the char number 3:
> $_ = "Markus";
> print substr $_, 3, 1;
> 
>> k
> 
> There is something more efficient, right?


substr is actually quite efficient.


> I couldn't find something like 
> print charAt $_, 3
> or so! What is it?


Use substr if you know which character you want.


Cheers,
Bernard


------------------------------

Date: Thu, 18 Oct 2001 08:57:58 -0500
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: charAt???
Message-Id: <slrn9stnv6.k2p.trammell@haqq.hypersloth.net>

On 18 Oct 2001 06:48:02 -0700, Markus Dehmann <markus.cl@gmx.de> wrote:
> If I want just one char out of a string - do I have to use substr?
> 
> For example, I want the char number 3:
> $_ = "Markus";
> print substr $_, 3, 1;
> 
> > k
> 
> There is something more efficient, right? I couldn't find something like 
> print charAt $_, 3
> or so! What is it?
> 

sub charAt { return substr($_[0],$_[1],1) }

-- 
According to the Genesis account, the tower of Babel was man's second
major engineering undertaking, after Noah's ark.  Babel was the first
engineering fiasco.
                                - F. Brooks, _The Mythical Man-Month_


------------------------------

Date: 18 Oct 2001 14:00:34 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: charAt???
Message-Id: <slrn9stnnf.85e.bernard.el-hagin@gdndev25.lido-tech>

On Thu, 18 Oct 2001 08:57:58 -0500, John J. Trammell
<trammell@haqq.hypersloth.invalid> wrote:
> On 18 Oct 2001 06:48:02 -0700, Markus Dehmann <markus.cl@gmx.de> wrote:
>> If I want just one char out of a string - do I have to use substr?
>> 
>> For example, I want the char number 3:
>> $_ = "Markus";
>> print substr $_, 3, 1;
>> 
>> > k
>> 
>> There is something more efficient, right? I couldn't find something like 
>> print charAt $_, 3
>> or so! What is it?
>> 
> 
> sub charAt { return substr($_[0],$_[1],1) }


How is that more efficient than substr?


Cheers,
Bernard


------------------------------

Date: Thu, 18 Oct 2001 15:18:20 +0100
From: Graham Wood <Graham.T.Wood@oracle.com>
Subject: Re: Checking a line of string
Message-Id: <3BCEE4AB.8B7FF361@oracle.com>

This is a multi-part message in MIME format.
--------------E8FC32AF4B53C0EA01FA52FD
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit



Sasha wrote:

> Hi
> I am writing a program which receives one line at a time. Each line may have
> some comment marked  # or data containing name and phone number, I was
> wodering if some one could tell me how can I skips or ignore the data
> started or after # skips a line if it starts with # or skips a line with
> more than two words and save the lines data if it has two words.
>
>  The data in a line looks like this
>
>  # Here is an example of  line data
>
> Peter        2131111111   # correct data  it should be saved
>
> Andre      212112   333333  # Wrong data and it should be ignored
>
> Mark       212112   Angel    #  Wrong data and it should be ignored
>
> My program looks like  :
>
> If (open (MYFILE, "data.dat")){
>
> $line = <MYFILE>;
>
> while ($line ne "")  # Not end of file

> {

> if (it_is_ a_comment ){ } #dont save it

>
> if (it_is_ a_wrong ){ } # dont save it
>
> if (it_is_correct){ #save it }
>
> }
>
> }

while($line=<MYFILE>){
    next if($line =~ /^#/); # skip comment line
    $line =~  s/#.*//; # remove comments from other lines
    next if((split ' ',$line)[2]); # skip if there are 3 words in the line
    push(@OK,$line);
}

You then have lines with 2 words in them in the array @OK

Graham Wood

--------------E8FC32AF4B53C0EA01FA52FD
Content-Type: text/x-vcard; charset=UTF-8;
 name="Graham.T.Wood.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Graham Wood
Content-Disposition: attachment;
 filename="Graham.T.Wood.vcf"

begin:vcard 
n:;Graham
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:Graham.T.Wood@oracle.com
fn:Graham Wood
end:vcard

--------------E8FC32AF4B53C0EA01FA52FD--



------------------------------

Date: 18 Oct 2001 07:08:14 -0700
From: sunpl@yahoo.com (Peter Sun)
Subject: Re: Checking the remote file
Message-Id: <699c9db.0110180608.4fdcb0c8@posting.google.com>

cfedde@fedde.littleton.co.us (Chris Fedde) wrote in message news:<fm6z7.109$1L8.187441152@news.frii.net>...
> In article <699c9db.0110161320.4b25f063@posting.google.com>,
> Peter Sun <sunpl@yahoo.com> wrote:
> >Hi,
> >
> > if (-e "servername:/home/peter/file.txt") { print "The file does
> >exist";}
> >
> 
> Not much chance that is going to work. 
> Try instead something on the lines of 
> 
>     system('rsh servername test -e /home/peter/file.txt');
>     if ($? == 0) {
> 	print "The file does exist\n";
>     } 
> 
> I tested this with ssh which exits with the exit code of the remote
> command. IIRC rsh does the same thing.
> 
> Good Luck!

Thank you so much.

We have not used the SSH in our system,  but I have a try using your
mention. it doesn't work properly.
Excuse me , could you tell me how to copy a file to another server by
rcp in Perl? Do I need install some model?

Peter


------------------------------

Date: 18 Oct 2001 07:05:11 -0700
From: jemptyg@rwmc.net (George Jempty)
Subject: Re: Creating a hash from a sub that parses XML
Message-Id: <2ecd96e6.0110180605.285b8416@posting.google.com>

mgjv@tradingpost.com.au (Martien Verbruggen) wrote in message news:<slrn9ssagl.l88.mgjv@verbruggen.comdyn.com.au>...
> On Wed, 17 Oct 2001 18:40:20 GMT,
> 	George Jempty <jemptyg@rwmc.net> wrote:
> 
> (line wrapped to fit in 72 characters)
> http://groups.google.com/groups?
> 	as_umsgid=WcSK3.895%24ry3.9280%40news.rdc1.ne.home.com
> 
> Martien

Hello Martien:

Well you have certainly "identified" me as the perpetrator of that
absurd thread of mine from two years ago.  I thought about not using
my real name, but that would have been rather cowardly.

Instead, it is by my behavior that I plan on not being associated with
that two year old thread.  I plan on doing my best to be a good
citizen.  Please feel free to let me know if you think I am not doing
so, OK?

I was wondering if anybody would notice my return.  I thought I would
be in everybody's kill files ;)

George


------------------------------

Date: 18 Oct 2001 07:12:02 -0700
From: jemptyg@rwmc.net (George Jempty)
Subject: Re: Creating a hash from a sub that parses XML
Message-Id: <2ecd96e6.0110180612.4464644b@posting.google.com>

tadmc@augustmail.com (Tad McClellan) wrote in message 

> Are you enabling warnings? You should.

I'm having IIS5 web server on Win2k call perl as follows:

C:\perl\bin\perl.exe -wT %s %s

> >So I know it "works", 
> 
> 
> No, you know it works on the data you tried it with. 
> 
> I'll bet it can be broken by other data. I'll break it for
> you in a separate followup  :-)

You are right of course.  For this purpose I plan to always get my
data from XML generated by Access 2002, so it will always be formatted
the same way.

> I think you are probably talking about returning a *reference*
> to a hash, but that isn't what your code does.
> 
>    perldoc perlreftut
> 
> can help you figure out how to return a reference to a hash instead
> of a flattened out list of alternating key/value pairs.

Thanks, that is just what I needed!


------------------------------

Date: Thu, 18 Oct 2001 08:27:18 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: how to find memory leaks in perl 5.004_04
Message-Id: <3BCED8B6.38FB190C@home.com>

Dave Tweed wrote:
> 
> Michael Carman wrote:
> >
> > As I said in my original reply, the Devel::Leak module may help.
> > (I've never tried it myself.) About the only other diagnostic
> > I'm aware of is to sprinkle your code with system calls which
> > check your memory usage and print it out along with their location.
> > Hopefully one of these methods will yeild a smallish subset of the
> > code where the problem occurs. At that point you can scrutinize it
> > to try to isolate the problem. (It might be a problem in perl, but
> > it could be something like a scoping problem as well.)
> 
> ... which is just a much more verbose version of my advice, which
> was to "learn enough Perl so that you can debug it yourself."

No, it isn't. A more verbose version of your advice would have been

  "In order to do that which you desire, you must first become a 
   pupil and study the ways of the Perl. You must learn its 
   inticate and idiosyncratic ways, to wield its power for good
   but never for evil. It is a long and difficult journey, and
   you must make it alone, for neither I nor anyone else may 
   guide you. Only then will you be prepared for the task that
   lies ahead of you."

It's perfectly reasonable advice, but all it does is tell the OP what he
already knew. That's why he said that it was useless. I tried to tell
him something he *didn't* know.

Followups set.

-mjc


------------------------------

Date: Thu, 18 Oct 2001 11:02:25 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Re: Looking for DOS equiv to pause
Message-Id: <9mrtstkh1e2n22vua69am3mbltsb3vprt9@4ax.com>

On Thu, 18 Oct 2001 08:26:15 +1000, "Tintin" <tintin@snowy.calculus>
wrote wonderful things about sparkplugs:

SNIP
>
>And your limited Perl knowledge is not sufficient to work out how to change
>the message?
>

yup that's the problem

--
TMTOWTDI: My way tends to be wrong...
lmoran@wtsg.com


------------------------------

Date: Thu, 18 Oct 2001 09:03:23 -0500
From: "Jim Jones" <jsjones@acm.org>
Subject: Re: NMAKE error while installing SNMP module
Message-Id: <GkBz7.390$Cn2.93441@news.uswest.net>

Just some additional notes... FYI...

When you installed MSVC you had the opportunity to check a box that would
have set up your environment variables for LIB, INCLUDE, PATH, and/or other
variables so that when you run the command-line tools (nmake and such)
things will work. The GUI tools have such settings built-in to their
operation. You did not check that box at installation time. Often we don't
want the box checked because we many have installed several different
development environments on our computer (MSVC, Tornado, CodeWarrior, etc)
and each one has its own libraries and headers (e.g., stdio.h, unistd.h,
etc). Often there is a batch file to set up the environment when you have to
do it manually with each DOS window you open (e.g., torvars.bat for Tornado
or vcvars32.bat for MSVC). For convenience you may want to copy these batch
files to somewhere in your PATH.

Jim Jones

"Thomas Wilson" <tewilson@mitre.org> wrote in message
news:3BCEBE62.AAD17C15@mitre.org...
> I suspect that you must first set the environment for using MSVC++
> utilities by executing the file "vcvars32.bat" which if you do a search
> will find under somewhere on your computer.  Include the path to the
> folder that contains the ".bat" file in your environment settings for
> your computer so from the command line you do not have to navigate to
> each time.  Good luck.
>
> Tony McIver wrote:
> >
> > I am trying to build the net-snmp-4.2.2 package for use on an WIN/2000
> > system so that I can use the Perl module SNMP.PM in Perl scripts.
Everything
> > built using MS Visual C++ correctly. When I execute nmake I get the
error
> > "SNMP.xs(26) : fatal error C1083: Cannot open include file: 'unistd.h':
No
> > such file or directory" How do I solve this problem? Any help would be
> > greatly appreciated.
> >
> > Thanks in advance,
> >
> > Tony McIver




------------------------------

Date: Thu, 18 Oct 2001 13:50:16 GMT
From: "George Jempty" <jemptyg@rwmc.net>
Subject: Re: Perl CGI problem printing Javascript...
Message-Id: <1003412693.811530@airwave-sb.scottsbluff.net>

Brian:

Out of the bunch, this is answer closest to being right.  I encountered this
sort of thing as a professional CGI programmer at Agilent last summer.  I
remember there were two scenarios.  I'd either have a CGI script print my
<SCRIPT> tags to the browser, of course specifying the appropriate .js file
as the SRC attribute.  Or in some instances, I actually had to "open()" the
 .js file using Perl, and then print it line by line inside the dynamically
generated HTML page.

HTH

"BUCK NAKED1" <dennis100@webtv.net> wrote in message
news:28418-3BCE57E7-20@storefull-246.iap.bryant.webtv.net...
> <SCRIPT LANGUAGE="Javascript" SRC="www.pschallenge.com/cgi-bin/bc.pl"
> type="text/javascript">
> </script>
>
> Don't know if this is what's causing your prob, but you're using
> "<script language=javascript... blah... type=text/javascript>", and then
> you use a PERL file for your script file. IOW, shouldn't your SRC file
> end in .js, and be a JAVASCRIPT file?
>
> Regards,
> --Dennis
>




------------------------------

Date: Thu, 18 Oct 2001 14:18:16 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: precedence question
Message-Id: <slrn9stm1h.ofh.tadmc@tadmc26.august.net>

Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
>Dave Tweed <dtweed@acm.org> writes:
>
>[...]
>
>> The middle expression happens to be an assignment, whose right-hand
>> side gets evaluated before its left-hand side. All as described in the
>> documentation.  
>
>Where exactly in the Perl documentation does it say that the RHS 
>of an assignment always gets _fully evaluated_ *before* the LHS does?


Took me a while to find it. Tried:

   grep Assignment *.pod
   grep Order *.pod
   grep Evaluat *.pod
   grep -i order *pod |grep -i evaluat

No joy.

Didn't think to try (from the Subject):

      grep Precedence *.pod

That would have (eventually) gotten there. Finally tried

      grep RHS *.pod


Eureka!

perltrap.pod:

   "LHS vs. RHS of any assignment operator.  LHS is evaluated first
    in perl4, second in perl5"

Kinda squirreled away in the deep dark recesses of the docs...


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 18 Oct 2001 14:36:53 +0100
From: Chris Hall <Chris@Clapham.org>
Subject: Re: Problem with output order
Message-Id: <3BCEDAF5.4040908@Clapham.org>

Josef Möllers wrote:

> Chris Hall wrote:
> 
>>Hi,
>>
>>I've got a bit on an annoying problem with a Perl prog I'm currently
>>writing. This is to be run by cron so I'd like a logfile to be kept, but
>>the snippet of code below always writes the stderr before stdout in said
>>logfile.
>>
> 
> You should set STDOUT to autoflush:
> 	my $oldfh = select STDOUT; $|=1; select $oldfh;


Thankyou, that's got it

-- 
Chris.



------------------------------

Date: Thu, 18 Oct 2001 13:26:28 GMT
From: andrew.hutchinson@mcmail.vanderbilt.edu (Andrew Hutchinson)
Subject: Re: readdir probs???
Message-Id: <3bced608.490684843@news.vanderbilt.edu>

You're opening a _filehandle_, and then using readdir to read from it.
Try opening a directory handle rather than a file handle:

#!/usr/bin/perl -w

opendir(THISDIR,"/home/bboett/test") || die "Cannot open dirhandle:
$!";
while(defined(my @dirlist=readdir(THISDIR))){
        for my $file(@dirlist){
                next if $file=~m/^\.{1,2}$/; #skip the . and .. files
                print "$file\n";
        }
exit;
}

Andrew


On Thu, 18 Oct 2001 12:25:43 +0000 (UTC), bboett@bboett.dyndns.org
(Bruno Boettcher) wrote:

>hello,
>  i have the following:
>if(open(THISDIR,'/home/bboett/test/'))
>{
>  my @dirlist = readdir(THISDIR);
>  print "error: $!\n";
>  print "openend list: '@dirlist'\n";
>  foreach my $filename (@dirlist)
>  {
>    print "processing $filename\n";
>  }
>}
>
>the dir exists, i can make an 'ls' on it, and the opendir runs fine
>(means reports no error...) but the readdir gives me:
>
>error: Bad file descriptor
>i nearly cut&pasted this example from the perl doc, so i don't
>understand what's going wrong....
>
>and as expected @dirlist is empty....
>-- 
>ciao bboett
>==============================================================
>bboett@earthling.net
>http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett



------------------------------

Date: Thu, 18 Oct 2001 13:37:11 +0000 (UTC)
From: bboett@bboett.dyndns.org (Bruno Boettcher)
Subject: Re: readdir probs???
Message-Id: <9qmlu7$5j3$1@hadron.noos.net>

In article <9qmho7$r72$1@neon.noos.net>,
Bruno Boettcher <bboett@bboett.dyndns.org> wrote:
>if(open(THISDIR,'/home/bboett/test/'))
>{
>  my @dirlist = readdir(THISDIR);
ah yeah... i am really dumb.... sorry!
-- 
ciao bboett
==============================================================
bboett@earthling.net
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett


------------------------------

Date: Thu, 18 Oct 2001 16:04:34 +0200
From: Lars Oeschey <dump@the-core.net>
Subject: Re: Writing and reading encrypted string (password)
Message-Id: <7aotst8f48osf72lujkjssm754u2ojk489@4ax.com>

On Thu, 18 Oct 2001 15:02:18 +0200, Lars Oeschey <dump@the-core.net>
wrote:

>		$enc=pack'C*',map{$newpass ^int(32*r())} unpack
>'C*',$newpass;

sorry, found it. The first $newpass should be a $_. Works no, thanks a
lot!


Lars
-- 
GPZ900R xxMm+2,5Mm  http://www.oeschey.de
GS400 xxMm+1,5Mm  http://www.the-core.net


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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 1957
***************************************


home help back first fref pref prev next nref lref last post