[16750] in Perl-Users-Digest
Perl-Users Digest, Issue: 4162 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 29 06:05:25 2000
Date: Tue, 29 Aug 2000 03:05:10 -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: <967543509-v9-i4162@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 29 Aug 2000 Volume: 9 Number: 4162
Today's topics:
Re: ActivePerl output to my browser? (Colin Keith)
Re: appending to files (Colin Keith)
Re: Counting across multiple lines? (Colin Keith)
Re: DBI - DBI::ORACLE HELP <pm@katz.cc.univie.ac.at>
Re: Executable file creating executable file -- doesn't (Colin Keith)
Re: File access over a network <gellyfish@gellyfish.com>
File handles with scalar value <qarnos@ozemail.com.au>
Re: Help Calling A Function!!!! <gellyfish@gellyfish.com>
Re: hour difference between localtime and POSIX::mktime (Villy Kruse)
Re: How do I manipulate each element of an array? (Hasanuddin Tamir)
Re: How do I manipulate each element of an array? <gellyfish@gellyfish.com>
Re: How to create a simple backup program? <bart.lateur@skynet.be>
Re: How to Unzip a .tar.gz file (BUCK NAKED1)
Re: How to Unzip a .tar.gz file <bart.lateur@skynet.be>
Re: How to Unzip a .tar.gz file <hb@mediastudio.de>
Re: How to Unzip a .tar.gz file <bart.lateur@skynet.be>
If Perl supports recursion calls? <kai@bcv01y01.vz.cit.alcatel.fr>
Re: If Perl supports recursion calls? <kai@bcv01y01.vz.cit.alcatel.fr>
Is perl powerful enough to create cybermoney? pohanl@my-deja.com
Re: making sure input is a certain way i.e. starting an <gellyfish@gellyfish.com>
Re: New user <Peter.Dintelmann@dresdner-bank.com>
Re: Parsing a Excell table - or - a "Tab New_Line" text <bart.lateur@skynet.be>
Re: pattern matching question <nickco3@yahoo.co.uk>
Re: Please help: How to check for $var is null or not? <gellyfish@gellyfish.com>
Re: quickie obfuscation... <nickco3@yahoo.co.uk>
Re: turn characters into meta characters <Peter.Dintelmann@dresdner-bank.com>
Re: turn characters into meta characters <gellyfish@gellyfish.com>
Re: Win32 path with spaces <johnroth@ameritech.net>
Re: Writing FAQs via PERL <thunderbear@bigfoot.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 29 Aug 2000 08:32:02 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: ActivePerl output to my browser?
Message-Id: <6yKq5.1$05.85071@nnrp2.clara.net>
In article <HhI9oW5DAHA.308@asd24-aux-005.tis.telfort.net>, "Charles Betman" <cbetman@raketnet.nl> wrote:
>What I want is to test my scripts (from by browser) and send the output back
>to my browser. Can anybody please tell me if that's possible and if so, how?
It is possible. The simplest answer is to install a web server. Since this
is a Perl group, I'd suggest a cute little program called httpi. Its a web
server written in <10K of Perl :) I found this particularly useful because I
could go and hack in extra bits when I needed to (logging and stuff)
Of course there are bigger servers: Apache, Xitami are both cool. I think
PWS (Microsoft's Personal web server) will run CGI scripts too. If you want
to run one up yourself, have a look at the examples for a TCP server in the
perlipc man pages and places like the Perl Cookbook.
Col. - if($having_to_program_in_C){ require perl_badly; } :):)
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Tue, 29 Aug 2000 08:37:48 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: appending to files
Message-Id: <wDKq5.2$05.85535@nnrp2.clara.net>
In article <8odd8c$mld$1@nnrp1.deja.com>, Manuel Ho <mslho@my-deja.com>
wrote:
>how can i achieve appending to the second last line of a file?
>and is there a function in perl that reads a line at a time?
>thanks all.
The man pages for perlfaq5, section "How do I change one line in a
file/delete a line in a file/insert a line in the middle of a file/append to
the beginning of a file?" should guide you. And the operator for reading a
line is "<>". Depending on the context in which you use it, it will read
from different streams, but if you want to be sure, you can specify a file
handle for instance:
open(FH, '<myfile.txt') || die "Failed to read from myfile.text - $!";
while(<FH>){
printf "%-3d: %s", $., $_;
}
Will give something like:
1 : #!/usr/bin/perl -w
2 : use strict;
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Tue, 29 Aug 2000 09:49:55 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Counting across multiple lines?
Message-Id: <7HLq5.3$05.90465@nnrp2.clara.net>
In article <39A8981B.47000002@uswest.net>, Pedro A Navarro <pnavarro@uswest.net> wrote:
>TADSTWTASRTDRAFTARSGRQWTS
>AGSTDRASGATFSASDGTASTTAGS
>TQTRAEWSTATSGATSGTASTATST
>
>That is for a protein sequence file, in case you are wondering. When I
I did :)
>$count=tr/A-Z//;
>print "$count\n";
>
>I get the number of characters for each line, instead of for the whole
>thing. I have tried to get rid of the newline character with
>
>$count=tr/\n//d;
>but that gives me a count of "1" for each line, and I still have
Which it would because you're making 1 translation.
>How do I get rid of the newline character, or at the very least, how do
chomp($_); # best
$_ =~ s/\n$//; # change to \r\n \r\r or the like as needed
>I join the multiple lines so I have one single string? I'm fairly sure
>this is a simple thing to do, but so far I don't know what else to try!
my($sum) = 0;
$sum += length($_) while(<STDIN>);
$sum -= $.; # cheeky cos it assumes 1 \n per line
print "Number of characters: $sum\n";
or
my($sum) = 0;
while(<STDIN>){
chomp;
$sum += length($_);
}
er.. or
$/ = "\n\n"; # (won't match for us)
$_ = <STDIN>;
s/\n//g;
print length($_);
You get the idea .. I would suggest length() rather than tr// because tr is
replacing the characters it finds, so it takes longer. (And naturally
replace STDIN with your file handle if you don't want to pipe it in on the
command line)
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: 29 Aug 2000 09:01:39 GMT
From: Peter Marksteiner <pm@katz.cc.univie.ac.at>
Subject: Re: DBI - DBI::ORACLE HELP
Message-Id: <8ofu5j$45hu$1@www.univie.ac.at>
umesh.patel@usa.net wrote:
: How can you run
: set transaction use rollback segment R_BIG
: delete xyz table where stauts = 'open'
[snip]
: When I do that I found out that Oracle is not using
: R_BIG rollback segment it is using default rollback segment which is I
: do not want to use.
: (I can use set trans... and delete statement.... together from SQLPLUS
: without any problem)
: Any idea how to do it in perl?
AutoCommit => 0 should help.
--
Peter Marksteiner
Vienna University Computer Center
------------------------------
Date: Tue, 29 Aug 2000 10:04:28 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Executable file creating executable file -- doesn't work
Message-Id: <MULq5.4$05.91486@nnrp2.clara.net>
In article <8oeb4n$pdd$1@nnrp1.deja.com>, joshfeingold@my-deja.com wrote:
>is that when parent.pl is run and creats child.pl via the Internet the
I hope this code is *extremely* strictly coded if it creates a script based
on input from some random punk.
>file is put in the Unix group "staff" which is not executable by me.
>How can I make a file which can be executed and have permissions
>changed by me?
"parent.pl" needs to chown the script to the correct group when it creates
it. To do this it needs to be a member of the group it is trying to change
to or to be run as a super user which allows it to change to any group. To
do this you'd need to make "parent.pl" a root owned setuid script. Look at
the perl docs for 'chown' (and prolly chmod too) and also check the
'perlsec' doc for taint checking if you're going to run the script suid.
I'd also fix your (web?) server so it isn't running with the GID staff, it
should have the crappiest privileges possible.
Argh! Someone just opened the blind and now I can't see cos of the
reflection on my monitor :p (and they all think I want it closed cos I'm
geeky:)
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: 29 Aug 2000 07:08:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: File access over a network
Message-Id: <8ofk12$gv8$1@orpheus.gellyfish.com>
On Mon, 28 Aug 2000 19:21:38 GMT kliquori wrote:
> I'm trying to write a Perl script to access files on different UNIX
> boxes. I want to be able to search through /etc/passwd on three
> different boxes. I would like, however, to avoid using shell commands
> if possible. I see one of two ways:
> 1) Use NFS and access the file as if it's local.
Having /etc available over NFS might be considered a bad thing by some.
> 2) Use rcp with the system command to copy the files locally.
>
Or use rsh (or preferably ssh) to run the searching program on the remote host.
> Are there any other ways to do this?
>
Plenty and the majority have nothing much to do with Perl, although you
are likely to find most of them have an implementation as a Perl module.
A few suggestions off the top of my head :
* Have a web server on each machine with a CGI program that does the
required search - you could make a client using LWP::UserAgent that
gets the results.
* Create a custom server (possibly run by inetd) that performs the
search from arguments supplied by a client of your own devising.
* Make your authentication details available via LDAP and create a
client that can search through these use Net::LDAP for instance.
You will probably want to determine which approach you want to use before
progressing - the searching through the passwd file is trivial in Perl.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Tue, 29 Aug 2000 18:28:14 +1000
From: QarnoS <qarnos@ozemail.com.au>
Subject: File handles with scalar value
Message-Id: <39AB741E.366F9CBB@ozemail.com.au>
Hi!
I'm in the intermediate stages of learning Perl and have a question
which is annoying me enough to matter ;-)
When working with the CGI module, if the submitted form contains a file
upload, the CGI::param method will return a scalar which doubles as a
filename and a file handle.
Ie. I can do this:
$file = $cgi->param('uploadedfile');
print "Contents of $file:";
print <$file>;
I was just wondering how the CGI module achieves this.
Thanks for any help.
-- QarnoS
{ Insert witty comment here }
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GO d- s:+ a--- c++(++++) UL P+ L+ E W+++ N++ o--
K---- w-- O? M-- V? PS PE Y-- PGP- t+(+++)
5-- X+(++) R* tv b DI-- D+ G-(--) e(*) h! !r(---) m
------END GEEK CODE BLOCK------
------------------------------
Date: 29 Aug 2000 08:25:51 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help Calling A Function!!!!
Message-Id: <8ofohv$h7a$1@orpheus.gellyfish.com>
On 28 Aug 2000 15:44:12 -0000 Anno Siegel wrote:
> <houseofpain@my-deja.com> wrote in comp.lang.perl.misc:
>>The function I want to call is somewhere in the inheritance hierarchy.
>>You would normally call $this->foo() and it would search for the
>>function from the derived class to the base class. My problem is that
>>the function foo() is stored in a variable.
>>Example:
>> my $function = “foo”;
>
> Uh. Your quotes look funny. I'd check them.
>
That'll be Microsoft quotes then. I got a little worried as it looked
like ?foo? in tin and I thought this was some undocumented quoting mechanism
but no : 'Use of uninitialized value in pattern match ...'
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 29 Aug 2000 08:50:31 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: hour difference between localtime and POSIX::mktime
Message-Id: <slrn8qmuad.9dk.vek@pharmnl.ohout.pharmapartners.nl>
On Tue, 29 Aug 2000 06:30:25 GMT,
steinra@my-deja.com <steinra@my-deja.com> wrote:
>> well I guess it is because of the summer/winter time.
>> try it out with another month and you'll
>> be surprised.
>> I think mktime takes care of summer/winter and
>> ctime does not. (didn't find the
>> explanation in the POSIX manpage, though)
>>
>> tina
>
>Thank you!
>
>I feel really dumb now :) *blush* It didn't even occur to me. I really
>hate dumb mistakes.
>
Not sure you what your mistake is supposed to be. I tried to run your
program and find no problems.
If ctime, mktime and localtime does not all handle summer and winter
time properly I would call that a bug.
#!/usr/local/bin/perl
use POSIX;
$time = time;
print "Date = ", POSIX::ctime($time);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($time);
$newtime = POSIX::mktime( $sec,$min,$hour,$mday,$mon,$year );
print qq( $sec,$min,$hour,$mday,$mon,$year ), "\n";
print "Date = ", POSIX::ctime($newtime);
print "Hour: $hour\n";
$time_t = POSIX::mktime( 0, 30, 10, 31, 00, 100 );
print "Date = ", POSIX::ctime($time_t);
$time_t = POSIX::mktime( 13, 29, 0, 29, 7, 100 );
print "Date = ", POSIX::ctime($time_t);
$time_t = POSIX::mktime( 13, 29, 1, 29, 7, 100 );
print "Date = ", POSIX::ctime($time_t);
__END__
And my results.
Date = Tue Aug 29 10:46:00 2000
0,46,10,29,7,100
Date = Tue Aug 29 10:46:00 2000
Hour: 10
Date = Mon Jan 31 10:30:00 2000
Date = Tue Aug 29 00:29:13 2000
Date = Tue Aug 29 01:29:13 2000
--
Villy
------------------------------
Date: Tue, 29 Aug 2000 22:59:44 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: How do I manipulate each element of an array?
Message-Id: <slrn8qmuma.53p.hasant@borg.intern.trabas.co.id>
On 28 Aug 2000 11:47:48 +0100, gellyfish@gellyfish.com wrote:
## On Mon, 28 Aug 2000 10:46:50 +0200 Lincoln Marr wrote:
[snipped]
## You dont have to worry about it as the foreach will only iterate over the
## defined elements of the array. Indeed you dont need to use your indexing
## scheme as in the foreach $_ is aliased to each element in turn so altering
## $_ will alter the value of the element so you can do :
AFAIK, foreach doesn't care about defined-ness of array elements,
because no test is performed, unlike C-like for or while loop.
The perlsyn says,
"The foreach loop iterates over a normal list value and sets
the variable VAR to be each element of the list in turn."
So,
perl -we '@array = (qw/one two three/, undef, 4, ''); \
for (@array) { print "($_)\n" }'
results,
(one)
(two)
(three)
Use of uninitialized value at -e line 1.
()
(4)
()
One has still to worry and take care about undefined elements
in some cases.
## #!/usr/bin/perl -w
##
## use strict;
##
## my @array = ('foo','','zub','blah','','');
##
## foreach (@array)
## {
## $_ = 'nbsp;' if $_ eq '';
## }
This will triger the same uninitialized warning if the element
in question happens to be undefined. You also omitted the &.
foreach (@array) {
$_ = ' ' unless defined and $_ ne '';
}
## print "@array";
##
##
## Note that I have only interpolated the array into a double quoted string
## for clarity in printing.
##
Unfortunately the OP only specified about "empty" value,
I don't know what he wanted to do with "undefined" one.
BR,
san
--
trabasLabs * hasant@trabas.com * http://www.trabas.com
Zero Point * hasant@zp.f2s.com * http://www.zp.f2s.com
------------------------------
Date: Tue, 29 Aug 2000 09:12:57 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How do I manipulate each element of an array?
Message-Id: <t8Lq5.502$pD2.60693@news.dircon.co.uk>
On Tue, 29 Aug 2000 22:59:44 GMT, Hasanuddin Tamir Wrote:
> On 28 Aug 2000 11:47:48 +0100, gellyfish@gellyfish.com wrote:
> ## On Mon, 28 Aug 2000 10:46:50 +0200 Lincoln Marr wrote:
> [snipped]
>
> ## You dont have to worry about it as the foreach will only iterate over the
> ## defined elements of the array. Indeed you dont need to use your indexing
> ## scheme as in the foreach $_ is aliased to each element in turn so altering
> ## $_ will alter the value of the element so you can do :
>
> AFAIK, foreach doesn't care about defined-ness of array elements,
> because no test is performed, unlike C-like for or while loop.
> The perlsyn says,
>
Yes, yes. If I had meant what you are implying I did I would have said
'those elements with a defined value'. Perhaps 'existing' might have
been a better choice to avoid confusion when not using a word in its explicit
Perl sense.
/J\
------------------------------
Date: Tue, 29 Aug 2000 09:49:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to create a simple backup program?
Message-Id: <dgtmqsknfca3gl4bn403gcp9gfmn3rusk4@4ax.com>
Philip Garrett wrote:
>> If I want to backup *.txt from "C:" or "/" and preserve the directory
>> structure, how would I do this? I didn't want to use a bunch of system
>> functions.
>>
>
>You probably want some combination of File::Find, Archive::Tar, and
>Compress::Zlib.
Archive::Tar, yes. But there's no need to apply Compress::Zlib yourself.
Archive::Tar has a built-in option for that. Just
Oh, and yes: Archive::Tar is in the standard distribution for Win32
perl. The supplied package installation script (PPM) makes use of it.
`write('file.tar',$compressed)'
Will write the in-memory archive to disk.
If the second argument is true, the module
will try to write the file compressed.
(This is a method of the Archive::Tar object containing the archive in
memory.)
--
Bart.
------------------------------
Date: Tue, 29 Aug 2000 02:24:45 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: How to Unzip a .tar.gz file
Message-Id: <9976-39AB653D-136@storefull-242.iap.bryant.webtv.net>
bart.lateur@skynet.be (Bart=A0Lateur) wrote: The module Archive:::Tar
may help. The disadvantage is that the WHOLE unzipped file is in memory
at once.
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0use Archive::Tar;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0my $tar =3D
Archive::Tar->new("ultrakdata1.tgz",1); =A0 =A0 =A0 foreach my $file
($tar->list_files) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0if=
($file
=3D~ /\/$/) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0print "Dir: $file\n";
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0}
else {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0my
$contents =3D $tar->get_content($file); =A0 =A0 =A0 =A0 =A0 =A0 =A0 my
$length =3D length $contents;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0print
"File: $file length: $length bytes\n";
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0}
=A0=A0=A0=A0=A0=A0=A0=A0}
Hmmm... I'm getting "can't find undef value for gzseek"
And tar itself can be used to decompress .tar.gz files in one go.
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0tar -xzPf
filename.tar.gz -C /where/do/you/want/it
Make sure the directory /where/do/you/want/it exists.
And I can't get the above coding to work (internal server error 500)
either. Here's how I tried it:
> #!/usr/bin/perl -w
> tar -xzPf lwp.tar.gz -C /tmp
I had lwp.tar.gz in the same directory as the script. I also tried
changing -C to -d and still no go. I'm trying it on a webserver, not on
PC, if that makes any difference, and I checked... and the
Archive/Tar.pm is located in @INC.
Are your codes above correct?
Regards,
Dennis
------------------------------
Date: Tue, 29 Aug 2000 09:54:06 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to Unzip a .tar.gz file
Message-Id: <f02nqsobbf557hp80f615t2igovdc699cl@4ax.com>
BUCK NAKED1 wrote:
>Are your codes above correct?
And tested.
Anybody any clues?
The second one could be a permissions problem, on the .tar.gz file.
--
Bart.
------------------------------
Date: Tue, 29 Aug 2000 11:52:07 +0100
From: Heiko Bentrup <hb@mediastudio.de>
Subject: Re: How to Unzip a .tar.gz file
Message-Id: <39AB95D7.E2B0EF00@mediastudio.de>
hi there,
i tried it that way, and it worked for me:
#!/usr/bin/perl
system "tar xzf archive.tar.gz";
That's all, i unpacked a linux-kernal that way, without any problem. You
may now get a 500 Error, because there is no HTTP-Header right now, but
you should know how to add that
Maybe your script did run, but you did forget to print a proper header?
regards
Heiko
"What A Man !" wrote:
>
>
> BUCK NAKED1 wrote:
>
>> Can someone please help me out with a perl script(not command line
>> input) for unzipping a .tar.gz file from my Unix/Apache webserver.
>> I've
>> tried
>>
>> do gunzip xvf filename.tar.gz -tar
>>
>> etc., and it gives an internal 500 error and won't run. I tried to
>> use
>> the module Compress::Zlib which is installed on my server, but all
>> the
>> error log says when using that module is that inflate() failed.
>>
>> Thanks.
>>
>> --Dennis
>>
>
> I forgot to add that I have also tried the following codes on my
> webserver to no avail:
>
> /usr/um/gnu/bin/gunzip filename.tar.Z
> tar -xvf filename.tar
>
> or
>
> /usr/um/gnu/bin/zcat filename.tar.Z | tar -xvf -
>
> FWIW, I have a perl script that will unzip a .zip (Windows) file, but
> not one to unzip .tar.gz (Unix) files. A perl script to extract a
> .tar.gz file would really be helpful, as sometimes I'm on a system
> that has no available program for unzipping .tar.gz files.
> Additionally, it might cut down on some of my perl questions here
> because much of the perl documentation is only in .tar.gz format.
> Would someone PLEEZE post a working perl script to do this?!?! I'm
> begging, yes.
>
> Thanks,
> Dennis
------------------------------
Date: Tue, 29 Aug 2000 09:57:42 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to Unzip a .tar.gz file
Message-Id: <i42nqsg8659948395hdb9cl1l4s4ndmicp@4ax.com>
Bart Lateur wrote:
>The second one could be a permissions problem, on the .tar.gz file.
Oh, I just come to think of it: sometimes tar outputs some warnings if
it cannot set permission (the -P opetion) according to the original.
Maybe those warnings throw of your server. adding a "2>&1" at the end of
the line, and capturing the output (for example using backticks) could
solve that.
If at ll possible, try testing the command line though telnet. If you
have telnet access, that is.
--
Bart.
------------------------------
Date: Tue, 29 Aug 2000 09:25:29 +0200
From: Fu Kai <kai@bcv01y01.vz.cit.alcatel.fr>
Subject: If Perl supports recursion calls?
Message-Id: <39AB6569.4BAF1F6@bcv01y01.vz.cit.alcatel.fr>
I try,but it does not work,so if perl supports recursion calls?
If can,is that do like C?Thx.
Best regard
--
Kai
------------------------------
Date: Tue, 29 Aug 2000 09:36:47 +0200
From: Fu Kai <kai@bcv01y01.vz.cit.alcatel.fr>
Subject: Re: If Perl supports recursion calls?
Message-Id: <39AB680F.88A0205D@bcv01y01.vz.cit.alcatel.fr>
I found the answer,just remove it,thank u.
------------------------------
Date: Tue, 29 Aug 2000 07:04:51 GMT
From: pohanl@my-deja.com
Subject: Is perl powerful enough to create cybermoney?
Message-Id: <8ofnab$c3k$1@nnrp1.deja.com>
The future of money.
As we all know, in the United States and many other countries,
the government prints money as a way for people to trade goods
and services.
As we move into the new century, the money system is being changed.
The value of currency is now being based on a subjective (demand
based) rather than an objective (backed by gold) basis.
Before, when the government prints new money, they hold the same value
in gold in a vault somewhere.
Now, the government prints new money when inflation rate is low or loan
interest rate is high.
It is being based on demand. The new money they create out of thin
air is loaned to banks at a low interest. The banks end up loaning
the money to you or through a business.
The banks make money from the difference in interest rates on the loan
(you pay higher interest, and they collect the difference between
your rate and the rate they pay to the government).
Before, when the government gives money to the banks (a loan), they
make sure that they hold the same amount in gold in a vault somewhere.
But now they make more money out of thin air when they feel it is
time to pump the economy with money for growth. When people have
money, they buy more stuff, which end up making the businesses
richer, which end up stimulating the economy. (but if they
create too much money, inflation results because businesses know
people have a lot of money, so they can raise the prices, which ends
up making the dollar have less value: more money required to purchase
same product)
This is the same system used in companies that have an
Initial Public Offering. The companies in the beginning have no
cash. They end up creating stocks out of thin air (any number they
want). Then they put the stocks out on the market and people purchase
the stocks. If they are willing to pay 10.00 per stock, then each
made up stock is worth that much. Usually the companies keep 30%
or more of the stock for themselves (for the presidents, CEO's,
founders, etc) and the other 70% of the shares
are offered to the public. The money gotten from the public buying
the stocks is now the company's keep. This is how they raise money.
But have you noticed something? In the same case as the government
making cash out of thin air, the companies are creating cash out of
thin air. The government prints new money (ANY amount they want).
Likewise, the companies creates stocks (ANY amount they want).
Whereas the banks purchase the new money (as a loan), the public
at large is purchasing the stocks (not a loan). Whereas the
government is creating money out of thin air, and asking the banks
to give it back as a loan... The companies are creating stocks out
of thin air and exchanging it for money from the public purchasing
the stocks.
Both are subjective. The value of the stocks are based on how
much people are willing to pay per stock. The value of money
from the government is based on how much businesses charge per item.
If the government releases a lot of money, then the value decreases.
For the companies the value of stocks have absolutely nothing to do with
the profit and loss of a company. If the company is making a lot of
profit, but there is no demand for the stock, then each share
may be worth nothing. If the company is making no money, but
there is demand for the stock, then each share may be worth a lot.
This is how most internet stocks work now. There is demand, but
the internet companies are making no money, or is losing money.
The companies make money out of thin air and trade it for money
in an IPO (initial public offering). Later if it needs more money,
it can create another million shares if it wants (but each time it
does, they dilute the percentage the founders and owners of the company
hold in the company in stock) But if the public is still buying
the stocks, then the price they purchase still reflects the value of
each stock.
What does this mean? This means that money is subjective. Its
not real. Its based on demand. Like the government printing new
money, the companies are creating stocks that may end up creating
more money (if there is demand that drives up the prices) or sucking
up money (if no demand and the prices drop).
What does this lead to? Demand based virtual money. Some companies
have tried to emulate the system by creating cybermoney. Money
created out of thin air and see if people are willing to exchange
services or products for them. They will emulate the government,
creating new money to lend to cyberpeople and "bank-like" entities.
As the internet goes full force, connecting the world, a standard
cybermoney could become a viable solution to replace all the currencies.
Similar to the European Union's convergence to a single type of money.
(the EU).
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 29 Aug 2000 07:21:16 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: making sure input is a certain way i.e. starting and ending with double quotes
Message-Id: <8ofkos$h0i$1@orpheus.gellyfish.com>
On Mon, 28 Aug 2000 17:41:53 GMT arthur wrote:
>
> I need what the user (I love that name) inputs into 'question' to start and
> end with double quotes. How can I check that and put up a warning message if
> they have not started and ended in double quotes.
>
Sounds like a regular expression to me :
if ( $question !~ /^".+"$/ )
{
print "No quotes\n";
}
Check out the perlre manpage for more on regular expressions.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Tue, 29 Aug 2000 09:13:36 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: New user
Message-Id: <8ofnrd$jpk1@intranews.bank.dresdner.net>
Hi,
NBNet News schrieb in Nachricht ...
>I am a new user, and am having a little problem. I have a perl script
which
>I want to run on an IIS server. I believe I need some runtime files to
>execute this, but I'm not sure. Does anybody have insight for me?
usually this is an IIS configuration issue not
a perl problem. I will send you the details
by email.
Peter
------------------------------
Date: Tue, 29 Aug 2000 08:34:37 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Parsing a Excell table - or - a "Tab New_Line" text file?
Message-Id: <97tmqs4tu018c516asufvmnq6v75vtj1hr@4ax.com>
Bob Walton wrote:
>I also note that one can instead specify a worksheet as follows:
>
> my $table='[Sheet1$]';
>
>to replace
>
> my $table='table1';
>
>The square brackets and the $ are required, and "Sheet1" must be the
>name of a sheet in the workbook.
Any idea on how you can get the count of worksheets out of a file, as
well as the names? Otherwise, you cannot possibly write very generic
data extraction code, can you?
Also, getting the size of a worksheet, rows x columns, would be
interesting.
It's not necessary for every single developer to rediscover this info by
themselves. Somebody should collect all these instructions and put them
in some (web) page or a FAQ.
--
Bart.
------------------------------
Date: Tue, 29 Aug 2000 09:53:33 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: pattern matching question
Message-Id: <39AB7A0C.E437AEF@yahoo.co.uk>
Jakob Schmidt wrote:
> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>
> > Wyzelli wrote:
> >
> > > Nuff Sed.
> >
> > No, not enough is said. You are childish, petty and
> > grasping at any lame excuse to afford yourself a
> > chance to be hateful.
>
> Oh man - I'm sorry to go off-topic but this is the first time I ever
> bothered to read any of Godzillas post in a thread all the way through -
> and it's hillarious.
>
> I've never read anything more funny on usenet.
I agree! Kira's posts are great. When I come onto this group I always look
for her stuff first. Her knowledge of Perl is actually not that bad, however
her grasp of programming skills and computers generally is pretty much
non-existent. Combine that with a tendency to lecture and fly of the handle
at the slightest, most constructive criticisms (obvious flames don't seem to
faze her) and you've got a pretty hilarious combination.
> What A completely wild and explosive reaction when someone reveals a
> pretty obvious error in his script. It reminds me of the characters in the
> English TV-series
> "Bottom" (two guys from the old "The Young Ones" crew). Does any of you
> know it?
I know the one you mean.
> Unbelievable!
>
> I expect it'll get pretty boring rather fast though...
Not so far. I do feel slightly guilty about laughing at someone who's sanity
is somewhat intermittent, but only slightly.
------------------------------
Date: 29 Aug 2000 07:13:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Please help: How to check for $var is null or not?
Message-Id: <8ofk9l$gvl$1@orpheus.gellyfish.com>
On Mon, 28 Aug 2000 19:17:26 GMT kiran_mamidi@my-deja.com wrote:
> Hi Guys
> I need help with the following.
>
> How do I check if a variable is null.
>
>
> For example if I want to check $rec_date is null or not. How do I do
> that,
>
Firstly you have to determine what you mean by 'null' - do you mean that
it contains the empty string :
if ( $var eq '' )
{
}
Or whether it contains an undefined value :
if ( not defined $var )
{
}
You might also check the length of the contents of the variable :
if ( not length $var )
{
}
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Tue, 29 Aug 2000 09:41:29 +0100
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: quickie obfuscation...
Message-Id: <39AB7739.BC8073D2@yahoo.co.uk>
"Godzilla!" wrote:
[this ought to be good - Kira wading into a perlguts discussion]
> Craig Berry wrote:
[snipped]
> > Make sense?
>
> * applauds *
>
> This is one of the best written articles I have
> read in a long time. Very clear, well organized,
> well planned, exceptionally easy to read and
> equally easy to understand.
>
> Godzilla!
Wow. Where's Kira and what have you done with her?
------------------------------
Date: Tue, 29 Aug 2000 09:21:56 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: turn characters into meta characters
Message-Id: <8ofob0$jpr1@intranews.bank.dresdner.net>
Hi Aaron,
maybe this is not the most elegant solution but it works
$var = 'asdf\n\tasdf';
eval '$var2 ="'.$var.'"';
print $var2; # prints what you expect
Best regards,
Peter Dintelmann
------------------------------
Date: 29 Aug 2000 08:14:35 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: turn characters into meta characters
Message-Id: <8ofnsr$h5p$1@orpheus.gellyfish.com>
On Mon, 28 Aug 2000 17:01:11 GMT aaronp243@my-deja.com wrote:
> Hi, I have a programming question. I have a string that contains
> "\t\t\t\t". Those are not tabs, they would be matched like this:
> m/\\t/g
>
> but I want to turn them in to tabs. However, I don't want to hardcode
> anything. I want to turn all "\n"'s into newlines, any "\t"'s into
> tabs, etc. Any help would be greatly appreciated.
>
This is a not unreasonable use for the widely disparaged 'eval STRING' :
use strict;
my $foo = '*\t*\n*\t*';
eval "\$foo = qq%$foo%";
print $foo;
Read about eval in the perlfunc manpage.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Tue, 29 Aug 2000 04:51:59 -0500
From: "John Roth" <johnroth@ameritech.net>
Subject: Re: Win32 path with spaces
Message-Id: <kFLq5.16449$OG.490537@nntp0.chicago.il.ameritech.net>
BobS <sturdevr@yahoo.com> wrote in message
news:8oe3dl$o98$1@bob.news.rcn.net...
> Hi,
>
> I'm having a problem with spaces in win32 path names. Specifically:
>
> system( 'C:/program files/windows nt/accessories/wordpad.exe',
> 'c:/sms/readme.doc' );
>
> launches wordpad but then wordpad chokes saying it cannot open
> 'c:\sms\files\windows'.
> It appears perl is parsing the line twice. The second time _files/windows_
> is thought to be the argument because of the surrounding spaces. I've
tried
> several permutations but each that launched wordpad also produces this
> error. I've found that
>
> system( 'c:\program~1\window~2\access~1\wordpad.exe',
'c:\sms\readme.doc' )
>
> opens wordpad and displays the readme but I'm concerned the numerals in
the
> DOS equivalent names may not be the same on all systems. I'd appreciate a
> shove in the right direction. tia.
>
>
If it is parsing the string twice, then the problem is to get a second set
of quotes past
the first parse and to the command line itself. Something like
system("\'C:/program files .... exe\"' might work.
John Roth
------------------------------
Date: Tue, 29 Aug 2000 11:18:51 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: Writing FAQs via PERL
Message-Id: <39AB7FFB.F00C138C@bigfoot.com>
Roger Daniel Pease wrote:
>
> I think I once heard that there was a module or methodology for writing FAQ's in PERL.
> The idea was that you enter the question and answer (for some topic often
> completely unrelated to PERL) only once and the results would be printable in text,
> HTML, or whatever other format you choose to output. Unfortunately every time I look
> for 'PERL FAQ' in search engines/etc I get information about the PERL faq's.
You may think of the POD format in which the FAQ's are written.
See "perldoc perlpod".
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4162
**************************************