[19719] in Perl-Users-Digest
Perl-Users Digest, Issue: 1914 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 11 18:05:31 2001
Date: Thu, 11 Oct 2001 15: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: <1002837908-v10-i1914@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 11 Oct 2001 Volume: 10 Number: 1914
Today's topics:
Re: 20-line webserver in perl ? (Randal L. Schwartz)
A more complete background (RoJo)
counting substrings in strings (shaz)
Re: counting substrings in strings (John J. Trammell)
endless loop <blnukem@hotmail.com>
Re: endless loop <bart.lateur@skynet.be>
Re: File test operators can't tell a file from a direct <novastar@novastar.dtdns.net>
Re: File test operators can't tell a file from a direct <uri@sysarch.com>
Re: File test operators can't tell a file from a direct <bart.lateur@skynet.be>
Re: Filename case... <bart.lateur@skynet.be>
FTP mirror script <anders.floderus@swipnet.se>
Integration <bridenho@bio.indiana.edu>
Problem with fileparse function <Anthony.Heuveline@wanadoo.fr>
Re: Problem with fileparse function <echang@netstorm.net>
Problems installing Archive::Tar <wusyk@americasm01.nt.com>
sfsdf (SWM Columbus)
Signal SEGV with overload (Ari Jolma)
String To List <jay@utils.net.nospam>
Re: What is faster?? <newspost@coppit.org>
win32::TieRegistry <boogiemonster@usa.net>
Re: win32::TieRegistry <ron@indra.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Oct 2001 13:03:22 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: 20-line webserver in perl ?
Message-Id: <m1g08q2bcl.fsf@halfdome.holdit.com>
>>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:
ML> All work was done in 20 lines without modules. Of course it isn't
ML> complete web server, but it works.
Uri> i think randal did that one. i am sure he will pop in here with the
Uri> answer either way.
Uri> it was an extremely minimal server but it did use modules for the socket
Uri> and related stuff.
No, I've not written a webserver that didn't use HTTP::Daemon.
Why? BECAUSE I REFUSE TO REINVENT A WORKING WHEEL.
{sigh}
This "without modules" thing keeps getting me irritated.
Part of Perl culture is the ability to install modules and reuse the
CPAN. Without that, I argue you don't have *true* access to Perl. So
if you're getting so-called "perl" from a webhost service, but they
don't let you install modules (or they don't install CPAN modules for
you), YOU ARE NOT GETTING perl!
--
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: Thu, 11 Oct 2001 21:27:29 GMT
From: rojo@mindspring.com (RoJo)
Subject: A more complete background
Message-Id: <3bc60e9b.22195655@news.mindspring.com>
Michael,
I'm sorry I haven't been giving you incomplete information. I wasn't
trying to frustrate you or leave you confused. In the interest of
keeping these messages brief, I've tried including what seemed
relevant. Since I'm new to Perl, I probably didn't use all the terms
correctly. I do appreciate your patience. So let me take a minute to
give you the whole picture. Hopefully, this will help the prior
messages make more sense. I'm a contract Business Analyst with 23
years of I.T. experience. Most of my experience is in project
leadership, analysis & design. I've done some programming, but not a
lot. I only have experience with dBase IV & PowerBuilder on the PC
platform. I made the paradigm shift to OO just 4 years ago. In the
analytical world, I'm up to speed. I gather user requirements and
produce object-oriented designs using Rational Requise Pro & Rational
Rose; I design systems using lots of UML modeling. If you want to see
any more about my professional background, visit
http://www.rhjconsulting.com/personal/. It includes my resume, in the
Career section of the initial page.
My goal here is to learn more about the web software platform, so I
can be a more effective Analyst. I tried learning Java once, using an
IDE called Visual Cafe. Without any coaching, it was too much new
material to absorb. Too many dead ends. So I later decided to pursue
CGI. I arrived on Perl because, with just a minor increase to my
monthly ISP bill (I already have DSL), I gained web server
accessibility running Perl. I did not desire a domain, but it was a
means to an end. I didn't know until recently that Perl could be run
on a workstation !
But back to goals. I'm in the process of translating the Asset
Management app (previously developed using PowerBuilder) to HTML and
PERL. I plan next to translate the Contact Manager I wrote. These
will be members of a suite of apps, complete with a nice show-and-tell
OO design that I can show to prospective employers. I want to be able
to run the apps from any PC connected to the web. I did not jump at
the idea of installing a web server to run on my PC because I want
these apps to work on any PC. Sorry I misunderstood you on that
subject. Since the web server is just for development purposes, then
I'm ready to go in that direction. Do you have any to recommend?
Cheap and downloadable are of course most appealing. Honestly, I'm
still concerned about developing on a local web server, and then
porting it to Mindspring's. If I cannot port it successfully (i.e.
find & fix all the incompatilities), then I will fail to achieve my
goal.
I licensed Textpad and the DzSoft Perl Editor. Textpad helped me over
my very first hurdle. I did not know that Unix used just LF at the
end of each line (vs. CR LF). The DzSoft editor, combined with
ActiveState Perl on my Win2000 Professional PC at home, has helped me
find a lot of my typos and syntax errors. Since I want these apps to
run from any PC, that is why I ftp them to the Mindspring web server.
And that's where I'm experiencing a lot of frustration. I can't fix
an error I can't diagnose! I'm beginning to wonder if Mindspring has
a compete, successful installation of Perl on that server. I'll try
the use CGI::Carp qw(fatalsToBrowser); next, and let you know how that
goes. Thanks again for all your patience.
On Wed, 10 Oct 2001 08:08:35 -0500, Michael Carman <mjcarman@home.com>
wrote:
>RoJo wrote:
>>
>> I have been running ActiveState's Perl on my Win2000 Prof'l
>> workstation. But the Perl running on the MindSpring server
>> sometimes returns "500 Server Error" or "Cannot display page".
>> I'm operating almost blind, trying to diagnose them because these
>> errors do NOT get flagged in ActivePerl. That's why I wish I
>> could run compiles on the server.
>
>Those aren't Perl errors -- they come from the web server. They *might*
>be a symptom of a syntax error in your script, but it could also be a
>sign that you've made a logic error in your program. They aren't
>terribly helpful, though, which is why there's this module:
>
> use CGI::Carp qw(fatalsToBrowser);
>
>Which redirects fatal error messages to the web browser. Read the
>documentation and give it a try.
>
>> I've tried the use PSI::ESP; you suggested, but it errors out.
>
>That's, uh, not a real module. (Though we could wish that it was.)
>PSI::ESP is a mythical module that the folks on this newsgroup use to
>try to figure out what a person's problem is when they haven't stated it
>clearly. Saying 'use PSI::ESP' is a tongue-in-cheek way of saying "I'm
>trying to read your mind."
>
>Thanks for the chuckle, though. :)
>
>> I need the data on a real web server because it's for an app that
>> I want to run anywhere, using any current-technology browser. A
>> standalone web server cannot fill that need.
>
>You misunderstand me; I suggested installing your own web server to aid
>in the development. It can be much easier to debug when you can do it
>locally instead of having to upload your changes to a remote server
>every time. Once it works locally you can upload it to its final home.
>
>-mjc
------------------------------
Date: 11 Oct 2001 14:16:06 -0700
From: ssa1701@yahoo.co.uk (shaz)
Subject: counting substrings in strings
Message-Id: <23e71812.0110111316.33ad8f63@posting.google.com>
I want to count the number of times that a substring appears within a
longer string.
The following was suggested, but it does not work the way I would like
it to.
$check = grep { index($_, $substring) != -1 } keys %longstrings;
This is being used in the following code: -
foreach $substring (keys %substrings)
{
$check = grep { index($_, $substring) != -1 } keys %longstrings;
if ($check != 0)
{
print "$substring found in longer strings";
}
}
The problem with the code is:-
If $substring = "the" it should find "the end" and "end the" etc
BUT at the moment it also finds "there is" and "then" amongst others.
This is not correct.
NOTE: The substring will change as the foreach loop continues,
therfore, it must be declared as a variable and not something like
/^the/
How can I can find the frequency of occurance of a substring within
longer strings?
I would perfer a method similar to that shown above (if possible),
since I only need to make changes on that particular line of code.
------------------------------
Date: Thu, 11 Oct 2001 16:54:20 -0500
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: counting substrings in strings
Message-Id: <slrn9sc58c.lfs.trammell@haqq.hypersloth.net>
On 11 Oct 2001 14:16:06 -0700, shaz <ssa1701@yahoo.co.uk> wrote:
> I want to count the number of times that a substring appears within a
> longer string.
>
[sample code snipped]
>
> The problem with the code is:-
>
> If $substring = "the" it should find "the end" and "end the" etc
> BUT at the moment it also finds "there is" and "then" amongst others.
> This is not correct.
>
I think it's misleading for you to use the word "substring" --
that word has been taken already, and assigned a different
meaning. Here's some code that may suit you:
[ ~ ] ./foo.pl
the thethethe
0
foo "fie, fie, foo, fum"
1
bar "bar the doors, the barbarians are coming"
1
^D
[ ~ ] cat foo.pl
#!/usr/bin/perl -w
use strict;
while (<>)
{
my ($word,$string) = split(' ',$_,2);
my $count = () = $string =~ m/\b$word\b/g;
print $count, "\n";
}
[ ~ ]
------------------------------
Date: Thu, 11 Oct 2001 21:42:33 GMT
From: "Blnukem" <blnukem@hotmail.com>
Subject: endless loop
Message-Id: <dnox7.201386$w7.33355851@news02.optonline.net>
Hi All
Can someone tell me why this don't work? It goes into a endless loop. What
I'm trying to retrieve a form value that is always different. 1-10 fist page
11-20 next page and so on I cant seem to figure it out.
print "Content-type: text/html\n\n"
for ($i = 0; $i < 10; $i += 1 ) {
$i = $FORM{$i};
print $i;
}
Thanx in advance
Blnukem
------------------------------
Date: Thu, 11 Oct 2001 21:55:59 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: endless loop
Message-Id: <v25cstoscf2s7588o5bj543a8278tsq61k@4ax.com>
Blnukem wrote:
>Can someone tell me why this don't work? It goes into a endless loop. What
>I'm trying to retrieve a form value that is always different. 1-10 fist page
>11-20 next page and so on I cant seem to figure it out.
>
>print "Content-type: text/html\n\n"
>
>for ($i = 0; $i < 10; $i += 1 ) {
>$i = $FORM{$i};
>print $i;
>}
You're changing $i inside the loop. As soon as you set it to a value
you've had before, you'll get an endless loop. For example, let's say
that $FORM{0} = 0 and $FORM{1} = 0. Then you'll endlessly get 0, 0, 0,
1, 0, 1, ...
--
Bart.
------------------------------
Date: Thu, 11 Oct 2001 22:24:32 +0200
From: "novastar" <novastar@novastar.dtdns.net>
Subject: Re: File test operators can't tell a file from a directory
Message-Id: <9q4rkn$3bc$1@usenet.otenet.gr>
take a look at this one :
&recursive_dir("c:/temp");
sub recursive_dir
{
my ($pwd,$i)=($_[0],$i++);
opendir ($i,$pwd) || die "Can't list $pwd\n";
while (my $node=readdir $i)
{
next if $node=~/^\.*$/; # skip the first two dotted entries
$node="$pwd\\$node";
print "dir : $node\n" if -d $node;
print "file : $node\n" if -f $node;
&recursive_dir($node) if -d $node ;
}
closedir $i
}
------------------------------
Date: Thu, 11 Oct 2001 20:41:44 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: File test operators can't tell a file from a directory
Message-Id: <x7lmih7vtg.fsf@home.sysarch.com>
>>>>> "n" == novastar <novastar@novastar.dtdns.net> writes:
n> take a look at this one :
n> &recursive_dir("c:/temp");
as i said before, use File::Find. it comes with perl and it works.
n> sub recursive_dir
n> {
n> my ($pwd,$i)=($_[0],$i++);
n> opendir ($i,$pwd) || die "Can't list $pwd\n";
n> while (my $node=readdir $i)
n> {
n> next if $node=~/^\.*$/; # skip the first two dotted entries
what about a file or dir named ...?
n> $node="$pwd\\$node";
n> print "dir : $node\n" if -d $node;
n> print "file : $node\n" if -f $node;
n> &recursive_dir($node) if -d $node ;
n> }
n> closedir $i
n> }
and what about symbolic links?
and that is depth first. what about breadth first?
stop reinventing the wheel.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 11 Oct 2001 21:03:40 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: File test operators can't tell a file from a directory
Message-Id: <3v1cstonhh25nm9d8kt5tvr1g9huq7v667@4ax.com>
Eamonn wrote:
>Hi,
>
>I open a directory and read all the files and sub-directories into an
>array like so :
>_____________________________________________________
>opendir (THISDIR, ".") || die "could not open";
>@topdir = grep { $_ ne '.' and $_ ne '..' and $_ ne 'CVS' } readdir
>THISDIR;
>closedir THISDIR;
>_____________________________________________________
>
>Then I cycle through the entries in the array to sort the files from
>the directories. The files are put into another array and the
>directories are examined in the same way. Every time a directory is
>found it is opened and examined in the same way, the files are put
>into the big file array and the directories are opened and examined.
>_____________________________________________________
>
>my $entrycount = 0;
>my $subdircount = 0;
>
>foreach $entry (@topdir)
>{
> if (-f $entry)
> {
> $entries[$entrycount] .= "$entry";
> $entrycount++;
> print " File entry added: $entry\n";
> } else #if (-d $entry)
> {
> $subdirs[$subdircount] .= "$entry";
> $subdircount++;
> print " level 1 DIRECTORY entry added: $entry\n";
>
> # read all directory entries except for the . and .. files
> # and put them in an array
> opendir (L1DIR, "$entry") || die "could not open $entry";
> @thissubdir = grep { $_ ne '.' and $_ ne '..' and $_ ne 'CVS' }
>readdir L1DIR;
> closedir L1DIR;
>
> foreach $subdirentry (@thissubdir)
> {
> print " listing $subdirentry\n";
> if (-d $subdirentry)
> {
> $subdirs[$subdircount] .= "$subdirentry";
> $subdircount++;
> print " Level 2 DIRECTORY FOUND: $subdirentry\n";
>
> # read all directory entries except for the . and .. files
> # and put them in an array
> print "Opening $entry/$subdirentry for reading\n";
> opendir (L2DIR, "$entry/$subdirentry") || die "could not
>open";
> @thissubsubdir = grep { $_ ne '.' and $_ ne '..' and $_ ne
>'CVS' } readdir L2DIR;
> closedir L2DIR;
>........................etc
>_____________________________________________________
>
>Once I get down into the second level of sub-directories, the file
>test operators don't seem to be able to tell the difference between a
>file and a directory.
No they don't. You seem to think that -d $whatisit is enough to tell the
difference between a directory and a file. But if the name isn't
pointing to a file, both -d and -f will return false. And that is what's
happening here. readdir() returns bare filenames, even if you're testing
at a deeper level:
> opendir (L2DIR, "$entry/$subdirentry") || die "could not open";
See? You read filenames in a subdirectory $entry. But your test doesn't
include that path:
if (-d $subdirentry) { ... }
and $subdirentry, in this form, doesn't exist in the current directory.
File::Find uses a trick: it chdirs to that directory when entering a
directory. If you don't do that, you must include the path in the file
test.
--
Bart.
------------------------------
Date: Thu, 11 Oct 2001 21:07:27 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Filename case...
Message-Id: <da2csto1t0p7o2koes3igcp04qqbb8iprl@4ax.com>
Brian Racer wrote:
>What I need to do is in certain directories(unix), change every filename
>that has any upper-case letters to a filename with only lower-case
>charactors. I am somewhat new to perl (would perl even be the best tool for
>this?) and I just have no idea how to go about doing this. Any help will be
>greatly appreciated!!!
Use the standard module File::Find to traverse the file tree. Use lc()
to get the lowercase version of a file name. Use rename() to change the
name if they're not the same.
If your renaming includes changing names of directories, you're better
of using finddepth() instead of find().
use FIle::Find;
finddepth sub { if(-f and (my $lc = lc) ne $_) {
rename $_, $lc }
}, "."; # or any other starting directory
--
Bart.
------------------------------
Date: Thu, 11 Oct 2001 23:10:48 +0200
From: "ANDERS FLODERUS" <anders.floderus@swipnet.se>
Subject: FTP mirror script
Message-Id: <SInx7.4046$Ad3.14512@nntpserver.swip.net>
I have not done very much Perl programming and none
for communication over the net.
Now I have made a mirror script but before I try it, I wonder
if somebody can check to see if it ought to work, I am afraid
to do something that will anger my ISP.
( I found a mirror.pl script on the web but it was 91 KB.
I think that is to much.)
( Of course, if somebody is interested, it is all right to use it.)
Script:
######################################################
# mirror.pl
use strict;
use Net::FTP;
my $ftp;
################################################
## supply your own parameters
my $host = 'myHost'; # host
my $ldir = 'C:\\myLdir'; # local directory
my $rdir = 'myRdir'; # remote directory
my $user = 'myUser';# user name
my $passw = 'myPassw';# password
##
#################################################
$ftp = Net::FTP->new( $host ) or
die "Can not connect: $@\n";
$ftp->login( $user, $passw ) or
die 'Can not login: ', $ftp->message;
$ftp->cwd( $rdir ); # set working directory
&update( 'a', '.htm' );
&update( 'b', '.jpg' );
&update( 'b', '.gif' );
$ftp->quit;
exit 0;
####################################################
sub update( ) {
if( $_[0] eq 'a' ) { $ftp->ascii; }
else { $ftp->binary; }
my $dev, my $ino, my $mode, my $nlink, my $uid;
my $gid, my $rdev, my $size, my $atime, my $ltime;
my $ctime, my $blksize, my $blocks;
my $file, my @lfiles, my $lfile, my $rtime;
opendir( DIRHANDLE, $ldir );
@lfiles = readdir( DIRHANDLE );
closedir( DIRHANDLE );
foreach $file ( @lfiles ) {
if( $file !~ m/$_[1]/ ) { next; }
$lfile = $ldir . '\\' . $file;
( $dev, $ino, $mode, $nlink, $uid,
$gid, $rdev, $size, $atime, $ltime,
$ctime, $blksize, $blocks ) = stat( $lfile );
$rtime = $ftp->mdtm( $file ); # remote modification time
if( $rtime ) {
if( $ltime <= $rtime ) { next; }
$ftp->delete( $file );
}
$ftp->put( $lfile, $file );
}
}
------------------------------
Date: Thu, 11 Oct 2001 13:15:45 -0500
From: Ben Ridenhour <bridenho@bio.indiana.edu>
Subject: Integration
Message-Id: <9q4nlp$ac0$1@jetsam.uits.indiana.edu>
Is there a way to make perl do integration (and perhaps other calculus
functions)? I'm running some simulations in mathematica and they are
horribly slow, so I thought maybe I could do them in perl and speed up the
algorithms...
Thanks,
Ben
------------------------------
Date: Thu, 11 Oct 2001 21:39:09 +0200
From: "Anthony Heuveline" <Anthony.Heuveline@wanadoo.fr>
Subject: Problem with fileparse function
Message-Id: <9q4sfu$999$1@wanadoo.fr>
Hi,
I have created a page in which the user can upload a file using a file
field. I want to get only the name of the file in the entire path. In order
to do this, I use the File::Basename module and more particularly the
fileparse function. With a path like the following, it works:
($name,$path) = fileparse("c:/dir1/dir2/file.ext");
But with this type of file, it doesn't work:
($name,$path) = fileparse("c:\dir1\dir2\file.ext");
The problem is that my file field returns pathes like the last one. As the
server is running on Linux, I used fileparse_set_fstype(); before calling
fileparse but with no success.
Is it possible to force a file field to return a path like the first one or
is there anything to do with the basename module?
Thank you for your help.
Anthony.
------------------------------
Date: Thu, 11 Oct 2001 21:54:05 GMT
From: "E.Chang" <echang@netstorm.net>
Subject: Re: Problem with fileparse function
Message-Id: <Xns9137B7035921Cechangnetstormnet@207.106.92.86>
"Anthony Heuveline" <Anthony.Heuveline@wanadoo.fr> wrote in
news:9q4sfu$999$1@wanadoo.fr:
> Hi,
[Repeated question snipped]
There's a reply on alt.perl.
Please don't post separate separately to different newsgroups;
crosspost so both show up in the heading.
--
EBC
------------------------------
Date: Thu, 11 Oct 2001 14:00:46 -0400
From: "Usyk, Walter [SKY:1P67:EXCH]" <wusyk@americasm01.nt.com>
Subject: Problems installing Archive::Tar
Message-Id: <3BC5DE4E.52F75821@americasm01.nt.com>
I'm trying to compile and build Archive::Tar and I get the following
error below when running nmake test. Does anyone have an idea why this
is
happening?
I'm at my wits end. All your help would be appreciated.
F:\.cpan\build\Archive-Tar-0.22>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cp Tar.pm blib\lib\Archive\Tar.pm
\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\bin\Perl.exe
-I\\zmers01a\disk1\spiffcc\
tools\winnt-4.0\perl\5.6.1\lib
-I\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\lib -I\\zmers01
a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\site\lib -MExtUtils::Command
-e cp ptar blib\script\ptar
\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\bin\Perl.exe
-I\\zmers01a\disk1\spiffcc\
tools\winnt-4.0\perl\5.6.1\lib
-I\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\lib -I\\zmers01
a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\site\lib -e "system
qq[pl2bat.bat ].shift" blib\script\p
tar
F:\.cpan\build\Archive-Tar-0.22>nmake test
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\bin\Perl.exe
-I\\zmers01a\disk1\spiffcc\
tools\winnt-4.0\perl\5.6.1\lib
-I\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\lib -I\\zmers01
a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\site\lib -MExtUtils::Command
-e cp ptar blib\script\ptar
\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\bin\Perl.exe
-I\\zmers01a\disk1\spiffcc\
tools\winnt-4.0\perl\5.6.1\lib
-I\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\lib -I\\zmers01
a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\site\lib -e "system
qq[pl2bat.bat ].shift" blib\script\p
tar
\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\bin\Perl.exe
-Iblib\arch -Iblib\lib -I\\
zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\lib
-I\\zmers01a\disk1\spiffcc\tools\winnt-4.0\per
l\5.6.1\lib
-I\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\site\lib test.pl
1..10
ok 1
ok 2
ok 3
Can't call method "gzwrite" on an undefined value at
blib\lib/Archive/Tar.pm line 492.
NMAKE : fatal error U1077:
'\\zmers01a\disk1\spiffcc\tools\winnt-4.0\perl\5.6.1\bin\Perl.exe' :
retu
rn code '0xff'
Stop.
--
Walter Usyk - Tools Developer
Software Development Environment Tools (1P67)
email: wusyk@nortelnetworks.com
ESN: 398-4603
Tel: (613) 768-4603
------------------------------
Date: 11 Oct 2001 14:33:40 -0700
From: rus_rayburn@yahoo.com (SWM Columbus)
Subject: sfsdf
Message-Id: <4fb53c5d.0110111333.23061165@posting.google.com>
wfsd
------------------------------
Date: Thu, 11 Oct 2001 21:21:25 +0000 (UTC)
From: ajolma@water.hut.fi (Ari Jolma)
Subject: Signal SEGV with overload
Message-Id: <9q52gl$ao1$1@water.hut.fi>
Why do I get a Signal SEGV with this code:
$a = init();
domore($a);
sub init {
my $a = new Object;
return $a;
}
sub domore {
my $a = shift;
$a += 1;
}
package Object;
use overload ('fallback' => 1,
'+=' => 'add');
sub new {
my $class = shift;
my $self = {};
bless($self, $class);
return $self;
}
sub add {
my $self = shift;
my $add = shift;
print "$self\n";
}
The code works OK if I use the add method directly or if I do not
use my $a in domore.
Regards,
Ari
--
Ari.Jolma@hut.fi
------------------------------
Date: Thu, 11 Oct 2001 14:50:40 -0700
From: Jay <jay@utils.net.nospam>
Subject: String To List
Message-Id: <3BC61430.B93CBEF3@utils.net.nospam>
Here is what I am trying to do:
In the sample 4 field text file attached below, I would like to select
particular lines based on user input, which is a string. What will be
the
better choice for the format of this user string, so that user can
provide
fieldName(s) and fieldValue or fieldName(s) and pattern
For now what I have is:
$matchStr = "-f1 m* , -f2 d*g" OR "-f4 0, -f3 8" OR "-f m1 m2"
This is what I am doing:
@conds = split(/\,/, matchStr );
print "$conds[1]"; # gives me blank. I am expecting "-f2 ..."
Ideally I would like to ask from the perl tk GUI a value which gives
me which field and what pattern. Whatever way options are
provided it shouldn't use escaping of characters.
Any comments on what will happen if a format like the following is
used.
What will be the easiest way to extract fieldName and fieldValues which
could be exact value or a pattern.
"(f1 pattern) (f2 pattern)... "
Text File:
field1 field2 field3 field4
-----------------------------------------------
pplus drawing 14 0
cont drawing 6 0
m1 drawing 8 0
m1 vss 8 2
m1 vdd 8 1
via1 drawing 19 0
m2 drawing 10 0
m2 vss 10 2
m2 vdd 10 1
via2 drawing 29 0
m3 drawing 30 0
m3 vss 30 2
m3 vdd 30 1
--------------------------------------------
Thanks.
-jay
------------------------------
Date: Thu, 11 Oct 2001 17:06:27 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: What is faster??
Message-Id: <3BC609D3.8080909@coppit.org>
Joe Schaefer wrote:
> Balance Keeper <anordae@pisem.net> writes:
>
>
>>Suppose we have $_="haha:lala:rere";
>>What is faster??
>>($haha) = split /:/, $_; # or
>>($haha) = split(/:/, $_, 1);
>>
>
> % perldoc Benchmark
>
> A better question would be
>
> "Which is correct?"
lol. What is faster??
($haha) = split /:/, $_; # or
($haha) = split(/:/, $_, 1); # or
($haha) = ();
;) People never seem to understand that making something fast is rarely
the important problem. And in any case, it's always secondary to getting
it right.
David
------------------------------
Date: Thu, 11 Oct 2001 15:25:04 -0400
From: "Joseph" <boogiemonster@usa.net>
Subject: win32::TieRegistry
Message-Id: <9q4rpl$k2$1@usenet01.srv.cis.pitt.edu>
Here is my problem. I want to print all the keys in a registry key but it
has subkeys so it prints it out in hash. How can I get it so that it doesnt
matter whether it has subkeys or not. Here is my code...
use Win32::TieRegistry;
$Machine = $ARGV[0];
$remMachKey= $Registry->Connect( $Machine, "LMachine", {Delimiter=>"/"} )
or die "Can't Connect to $Machine HKEY_LOCAL_MACHINE key: $^E\n";
# this works if I have no subkeys but if I do have subkeys it doesnt.
Prints out in Hash.
$tips=
$remMachKey->{"Software/Microsoft/Windows/CurrentVersion/Explorer/Tips"}
or die "Can't find the key: $^E\n";
foreach( keys %$tips )
{
print "$_: ", $tips->{$_}, "\n";
}
can anyone help?
------------------------------
Date: Thu, 11 Oct 2001 14:44:02 -0600
From: Ron Reidy <ron@indra.com>
Subject: Re: win32::TieRegistry
Message-Id: <3BC60492.6893CC0A@indra.com>
Joseph wrote:
>
> Here is my problem. I want to print all the keys in a registry key but it
> has subkeys so it prints it out in hash. How can I get it so that it doesnt
> matter whether it has subkeys or not. Here is my code...
>
> use Win32::TieRegistry;
>
> $Machine = $ARGV[0];
>
> $remMachKey= $Registry->Connect( $Machine, "LMachine", {Delimiter=>"/"} )
> or die "Can't Connect to $Machine HKEY_LOCAL_MACHINE key: $^E\n";
>
> # this works if I have no subkeys but if I do have subkeys it doesnt.
> Prints out in Hash.
> $tips=
> $remMachKey->{"Software/Microsoft/Windows/CurrentVersion/Explorer/Tips"}
> or die "Can't find the key: $^E\n";
>
> foreach( keys %$tips )
> {
if (ref($tips) eq 'HASH')
{
# go through this key
}
else
{
> print "$_: ", $tips->{$_}, "\n";
}
> }
>
> can anyone help?
See above...
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
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 1914
***************************************