[15865] in Perl-Users-Digest
Perl-Users Digest, Issue: 3278 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 7 14:11:18 2000
Date: Wed, 7 Jun 2000 11:10:28 -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: <960401427-v9-i3278@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 7 Jun 2000 Volume: 9 Number: 3278
Today's topics:
How do I exit the recursive File::Find? <no_email@no_email.com>
Re: How do I exit the recursive File::Find? (Greg Bacon)
Re: How do I exit the recursive File::Find? (Greg Bacon)
Re: How do I exit the recursive File::Find? (Randal L. Schwartz)
HTTPS with LWP <jrbrown@cts.com>
localtime <boogiemonster@usa.net>
Re: localtime <tony_curtis32@yahoo.com>
Re: localtime (Neil Kandalgaonkar)
Re: localtime <boogiemonster@usa.net>
Re: localtime <xavier.tardy@alcatel.fr>
Re: localtime <xavier.tardy@alcatel.fr>
Re: localtime <boogiemonster@usa.net>
Perl 5.6 Installation <samay1NOsaSPAM@hotmail.com.invalid>
Re: Perl 5.6 Installation <samay1NOsaSPAM@hotmail.com.invalid>
Re: Perl 5.6 Installation <randy@theoryx5.uwinnipeg.ca>
Re: Perl 5.6 stable?? <sergei_kucherovNOseSPAM@3com.com.invalid>
Re: Perl and memory consumption (Neil Kandalgaonkar)
Re: Perl and memory consumption <godzilla@stomp.stomp.tokyo>
Re: Perl Crypt function (Randal L. Schwartz)
Perl Shortcut? (James Weisberg)
Re: Perl Shortcut? (Greg Bacon)
Re: Perl Shortcut? <aqumsieh@hyperchip.com>
Perl/Tk system() call debers@my-deja.com
perldoc help <skpurcell@hotmail.com>
Re: perldoc help <tina@streetmail.com>
Re: perldoc help <lauren_smith13@hotmail.com>
rich text & mail attachments <rob@megagiga.com>
Re: Ruby -- A better OO Perl than Perl? Python 3000 fea <care227@attglobal.net>
Sending UDP frames from a CGI script boemosers@my-deja.com
Re: Simple regexp question - Bug in Perl? (Abigail)
Re: Simple regexp question (Abigail)
SSL-enabled anonymous proxy <dmitryp@attglobal.net>
string help needed <dpalmeNOSPAM@unitedtraffic.com>
Re: string help needed (Neil Kandalgaonkar)
Re: string help needed <dpalmeNOSPAM@unitedtraffic.com>
Re: the end of perl? (Abigail)
TK System call problem debers@my-deja.com
Re: TK System call problem <aqumsieh@hyperchip.com>
Re: Using Unix SOURCE in PERL SYSTEM?? NEED HELP <rhomberg@ife.ee.ethz.ch>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 07 Jun 2000 10:53:34 -0400
From: Young <no_email@no_email.com>
Subject: How do I exit the recursive File::Find?
Message-Id: <393E61EE.A0AE9B0E@no_email.com>
Hi,
I'm using File::Find and want to exit from the recursive call
completely, immediately after having found a string I'm searching for in
any one of the files in the directory tree. Is there any way to do this,
or am I forced to have the script go through each and every directory?
I see there's something called $File::Find::prune, but I don't
understand what it does, how to set it, and also don't think it's
exactly what I'm looking for.
Any help would be very, very much appreciated. Thanks!
Young
(I've got no e-mail, so please reply back to the newsgroup -- I'll be
checking often. Thanks!)
------------------------------
Date: Wed, 07 Jun 2000 15:55:19 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: How do I exit the recursive File::Find?
Message-Id: <sjss37s62t5113@corp.supernews.com>
In article <393E61EE.A0AE9B0E@no_email.com>,
Young <no_email@no_email.com> wrote:
: I'm using File::Find and want to exit from the recursive call
: completely, immediately after having found a string I'm searching for in
: any one of the files in the directory tree. Is there any way to do this,
: or am I forced to have the script go through each and every directory?
It's nasty but
#! /usr/bin/perl
use strict;
use File::Find;
my $location;
sub wanted {
if (/\.plx$/) {
$location = $File::Find::name;
last EVIL_EXIT;
}
}
EVIL_EXIT:
{
find \&wanted, '/';
}
print "location = '$location'\n";
Greg
--
Got Mole problems?
Call Avogadro: 6.02 x 10^23
------------------------------
Date: Wed, 07 Jun 2000 15:57:57 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: How do I exit the recursive File::Find?
Message-Id: <sjss85592t589@corp.supernews.com>
In article <sjss37s62t5113@corp.supernews.com>,
Greg Bacon <gbacon@hiwaay.net> wrote:
: sub wanted {
: if (/\.plx$/) {
: $location = $File::Find::name;
: last EVIL_EXIT;
: }
: }
That test should be
if (/\.plx\z/) { ... }
Greg :-(
--
I prefer dark chocolate, especially with nuts, but that doesn't mean I should
legislate that you have to eat it.
-- Bjarne Stroustrup
------------------------------
Date: 07 Jun 2000 09:15:18 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How do I exit the recursive File::Find?
Message-Id: <m1itvl79ih.fsf@halfdome.holdit.com>
>>>>> "Greg" == Greg Bacon <gbacon@HiWAAY.net> writes:
Greg> In article <393E61EE.A0AE9B0E@no_email.com>,
Greg> Young <no_email@no_email.com> wrote:
Greg> : I'm using File::Find and want to exit from the recursive call
Greg> : completely, immediately after having found a string I'm searching for in
Greg> : any one of the files in the directory tree. Is there any way to do this,
Greg> : or am I forced to have the script go through each and every directory?
Greg> It's nasty but
Greg> #! /usr/bin/perl
Greg> use strict;
Greg> use File::Find;
Greg> my $location;
Greg> sub wanted {
Greg> if (/\.plx$/) {
Greg> $location = $File::Find::name;
Greg> last EVIL_EXIT;
Greg> }
Greg> }
Greg> EVIL_EXIT:
Greg> {
Greg> find \&wanted, '/';
Greg> }
Greg> print "location = '$location'\n";
Less nasty:
#! /usr/bin/perl
use strict;
use File::Find;
my $location;
sub wanted {
if (/\.plx$/) {
$location = $File::Find::name;
die "FOUND IT";
}
}
eval {
find \&wanted, '/';
};
die $@ if $@ and not $@ =~ /FOUND IT/;
print "location = '$location'\n";
print "Just another Perl hacker," unless $@;
--
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: Wed, 7 Jun 2000 10:21:41 -0700
From: Jason Brown <jrbrown@cts.com>
Subject: HTTPS with LWP
Message-Id: <Pine.BSF.4.21.0006071012350.79067-100000@king.cts.com>
I am writing a PERL script to fetch a web page encrypted by SSL.
I installed:
libwww-perl version 5.48
Crypt:SSLeay version 0.16
OpenSSL version 0.9.5a
I tried the "test script" in the documentation:
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(GET => 'https://www.helsinki.fi/');
my $res = $ua->request($req);
if ($res->is_success) {
print $res->as_string;
} else {
print "Failed: ", $res->status_line, "\n";
}
I got the following error:
Failed: 500 Can't connect to www.helsinki.fi:443 (Bad file number)
What am I doing wrong?????
Jason Brown
------------------------------
Date: Wed, 7 Jun 2000 11:43:32 -0700
From: "J. Joseph Yusko" <boogiemonster@usa.net>
Subject: localtime
Message-Id: <8hlqpa$cm9$1@usenet01.srv.cis.pitt.edu>
can anyone assist me with this problem. I have the following line of code.
my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4]));
and appears as Wed-Jun-7-2000. I'd also like to append the time. how would
i go about that? any help would be greatly apprecated.
------------------------------
Date: 07 Jun 2000 11:08:44 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: localtime
Message-Id: <87vgzl3243.fsf@limey.hpcc.uh.edu>
>> On Wed, 7 Jun 2000 11:43:32 -0700,
>> "J. Joseph Yusko" <boogiemonster@usa.net> said:
> can anyone assist me with this problem. I have the
> following line of code. my($date)=join("-",
> ((split(/\s+/, scalar(localtime)))[0,1,2,4])); and
> appears as Wed-Jun-7-2000. I'd also like to append the
> time. how would i go about that? any help would be
> greatly apprecated.
use POSIX 'strftime';
my $timestr = strftime('%a-%b-%d-%Y-%T', localtime);
hth
t
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: 7 Jun 2000 16:12:44 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: localtime
Message-Id: <8hls9s$he5$1@newsflash.concordia.ca>
In article <8hlqpa$cm9$1@usenet01.srv.cis.pitt.edu>,
J. Joseph Yusko <boogiemonster@usa.net> wrote:
>can anyone assist me with this problem. I have the following line of code.
> my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4]));
>and appears as Wed-Jun-7-2000. I'd also like to append the time. how would
>i go about that? any help would be greatly apprecated.
It sounds like you don't know perl but are trying to modify a script.
What this is basically doing is taking the scalar (formatted) results
of the function localtime, splitting on whitespace, and taking fields 0,
1,2, and 4, and joining them by '-'.
See perldoc -f localtime, perldoc -f split, perldoc -f join.
Or, just use $date = localtime; , if you don't need a precise format.
--
Neil Kandalgaonkar
neil@brevity.org
------------------------------
Date: Wed, 7 Jun 2000 12:30:01 -0700
From: "J. Joseph Yusko" <boogiemonster@usa.net>
Subject: Re: localtime
Message-Id: <8hltgg$ctp$1@usenet01.srv.cis.pitt.edu>
"Neil Kandalgaonkar" <nj_kanda@alcor.concordia.ca> wrote in message
news:8hls9s$he5$1@newsflash.concordia.ca...
> In article <8hlqpa$cm9$1@usenet01.srv.cis.pitt.edu>,
> J. Joseph Yusko <boogiemonster@usa.net> wrote:
> >can anyone assist me with this problem. I have the following line of
code.
> > my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4]));
> >and appears as Wed-Jun-7-2000. I'd also like to append the time. how
would
> >i go about that? any help would be greatly apprecated.
>
> It sounds like you don't know perl but are trying to modify a script.
You got me but i'm trying.
> What this is basically doing is taking the scalar (formatted) results
> of the function localtime, splitting on whitespace, and taking fields 0,
> 1,2, and 4, and joining them by '-'.
>
> See perldoc -f localtime, perldoc -f split, perldoc -f join.
>
> Or, just use $date = localtime; , if you don't need a precise format.
>
I do need a precise format
> --
> Neil Kandalgaonkar
> neil@brevity.org
------------------------------
Date: Wed, 07 Jun 2000 18:18:35 +0200
From: Xavier Tardy <xavier.tardy@alcatel.fr>
To: "J. Joseph Yusko" <boogiemonster@usa.net>
Subject: Re: localtime
Message-Id: <393E75DB.8F92FCD0@alcatel.fr>
"J. Joseph Yusko" wrote:
> can anyone assist me with this problem. I have the following line of code.
> my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4]));
> and appears as Wed-Jun-7-2000. I'd also like to append the time. how would
> i go about that? any help would be greatly apprecated.
did you try
my($date)=join("-", ((split(/\s+/, scalar(localtime(time()))))[0,1,2,4,3]));
Xavier
------------------------------
Date: Wed, 07 Jun 2000 18:18:18 +0200
From: Xavier Tardy <xavier.tardy@alcatel.fr>
Subject: Re: localtime
Message-Id: <393E75CA.45025349@alcatel.fr>
"J. Joseph Yusko" wrote:
> can anyone assist me with this problem. I have the following line of code.
> my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4]));
> and appears as Wed-Jun-7-2000. I'd also like to append the time. how would
> i go about that? any help would be greatly apprecated.
did you try
my($date)=join("-", ((split(/\s+/, scalar(localtime(time()))))[0,1,2,4,3]));
Xavier
------------------------------
Date: Wed, 7 Jun 2000 12:42:53 -0700
From: "J. Joseph Yusko" <boogiemonster@usa.net>
Subject: Re: localtime
Message-Id: <8hlu8k$cva$1@usenet01.srv.cis.pitt.edu>
"Xavier Tardy" <xavier.tardy@alcatel.fr> wrote in message
news:393E75DB.8F92FCD0@alcatel.fr...
> "J. Joseph Yusko" wrote:
>
> > can anyone assist me with this problem. I have the following line of
code.
> > my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4]));
> > and appears as Wed-Jun-7-2000. I'd also like to append the time. how
would
> > i go about that? any help would be greatly apprecated.
>
> did you try
>
> my($date)=join("-", ((split(/\s+/,
scalar(localtime(time()))))[0,1,2,4,3]));
>
yes but gave me a message saying...
(The filename, directory name, or volume label syntax is incorrect)
when i remove the 3 works but the does not append the time.
> Xavier
>
>
------------------------------
Date: Wed, 07 Jun 2000 08:07:56 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Perl 5.6 Installation
Message-Id: <087624f9.d67bbc78@usw-ex0103-019.remarq.com>
Hi, I was running Perl 5.005 fine on my machine.
I had installed serveral modules including DBI
Now, After I installed 5.6, I am having problem
with message that "Program has performed illegal operation and
will be shut down.
I am running:
Windows 98
And My script is:
==================
use DBI;
print "hello world\n";
=====================
Please advise me at what should I do..
Thanks
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Wed, 07 Jun 2000 08:17:49 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: Perl 5.6 Installation
Message-Id: <03f75532.d90ffd2c@usw-ex0103-019.remarq.com>
Further Notes:
I think it's with DBI.pm, which I was using fine with 5.005
installation.
It's 1.13.1 version of DBI
I get the same error ( illegal operation) when I do
'perl dbi.pm'
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 7 Jun 2000 16:29:10 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Perl 5.6 Installation
Message-Id: <8hlt8m$8jh$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, Samay <samay1NOsaSPAM@hotmail.com.invalid> wrote:
> Hi, I was running Perl 5.005 fine on my machine.
> I had installed serveral modules including DBI
> Now, After I installed 5.6, I am having problem
> with message that "Program has performed illegal operation and
> will be shut down".
> I am running Windows 98
Are you using a DBI compiled under 5.6? Versions of XS-based
modules compiled under ActiveState's 5.005 series aren't
binary compatible with ActiveState's 5.6.
best regards,
randy kobes
------------------------------
Date: Wed, 07 Jun 2000 10:29:24 -0700
From: sergei kucherov <sergei_kucherovNOseSPAM@3com.com.invalid>
Subject: Re: Perl 5.6 stable??
Message-Id: <019c2d05.73489855@usw-ex0106-045.remarq.com>
Thanks for your informative reply to my whiny complaints.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 7 Jun 2000 16:04:20 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Perl and memory consumption
Message-Id: <8hlrq4$li0$1@newsflash.concordia.ca>
In article <8hkipc$79e$1@nnrp1.deja.com>, |Odo| <jasonb885@my-deja.com> wrote:
>I have a script which is running into Apache RLimitMEM walls and so I'm
>trying to reduce the amount of memory it uses.
>
>What kind of overhead is associated with using modules?
(already answered by many)
>I attempted to figure out how much memory some of the modules I use
>consume with top (just total memory, not accounting for shared or
>anything). I came up with these figures:
>
>Perl = 2228KB
>DBI = 580KB
You pretty much can't slim down anything here.
>POSIX = 820KB
Junk POSIX if you can. Likely you are using one or maybe two routines,
like strftime or something, fairly easy to do yourself.
> Carp = 32KB
Carp is good, keep it.
>Time::ParseDate = 396KB
I had a look through this module since I'm not familiar with it. It
seems to be optimized for speed rather than memory. In fact there are
sections of it repeated over and over except for small changes, the
sort of thing you would normally use a loop for.
I assume the author knew what he was doing and was using an 'inlining'
technique for speed.
Depending on what you want to do, you might be able to chuck
Time::ParseDate. Date::Calc seems to use 252K less than Time::ParseDate,
in my quick and unscientific check.
>CGI = 296KB
BTW, this may not be an accurate estimate of CGI's memory usage. It
uses AUTOLOAD tricks to delay loading its methods until you actually
use them. A proper estimate includes a script which uses each of the
methods you want at least once.
There are some modules out there which have more limited functionality
than CGI in the same problem space. But it's probably easier to keep it;
you won't have to rewrite everything if it turns out you want full-blown
CGI power later on.
If you're working with perl, you have to accept some memory bloat.
Given the value of programmer time versus the cost of more RAM,
once proper optimizations have been made, extra RAM is usually the
simplest solution.
--
Neil Kandalgaonkar
neil@brevity.org
------------------------------
Date: Wed, 07 Jun 2000 09:54:29 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Perl and memory consumption
Message-Id: <393E7E45.4A4E3CFE@stomp.stomp.tokyo>
Dan Sugalski wrote:
> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> > |Odo| wrote:
> No. There's a very small overhead to using a module,
> Modules certainly *can* take a lot of memory,
Let me know when you have made up your mind
whether or not modules are memory bloat hogs.
Godzilla!
------------------------------
Date: 07 Jun 2000 09:10:17 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl Crypt function
Message-Id: <m1pupt79qu.fsf@halfdome.holdit.com>
>>>>> "Ala" == Ala Qumsieh <aqumsieh@hyperchip.com> writes:
Ala> Yes it is. crypt(), which is derived from the unix command of the same
Ala> name, [...]
No. crypt(1) had nothing to do with crypt(3). A common confusion.
crypt(1) used the "WW-II Enigma rotor machine", while crypt(3) (to
which Perl's crypt() is connected) is based on a modified DES. DES
didn't exist in WW-II. :)
print pack "H*", join "", map {crypt("Why me?", $_) =~ /(..)/} unpack("H*", "Just another Perl hacker,") =~ /(..)/g;
--
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: Wed, 07 Jun 2000 15:39:14 GMT
From: chadbour@wwa.com (James Weisberg)
Subject: Perl Shortcut?
Message-Id: <C0u%4.4412$HD6.93462@iad-read.news.verio.net>
I know you can initialize a simple hash with the following
shortcut:
@teams = qw(dodgers giants rockies diamondbacks);
@stats{@teams} = ("none") x @teams;
which is equivalent to:
$stats{dodgers} = "none";
$stats{giants} = "none";
$stats{rockies} = "none";
$stats{diamondbacks} = "none";
I was wondering if there was a shortcut to initializing the
subkeys of a hash slice. Something like:
@stats{@teams}{wins} = (0) x @teams;
which would be equivalent to:
$stats{dodgers}{wins} = 0;
$stats{giants}{wins} = 0;
$stats{rockies}{wins} = 0;
$stats{diamondbacks}{wins} = 0;
Does any such shortcut exist or I am stuck with the ole for loop?
Thanx for any trickery.
--
World's Greatest Living Poster
------------------------------
Date: Wed, 07 Jun 2000 15:57:04 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Perl Shortcut?
Message-Id: <sjss6g4c2t5133@corp.supernews.com>
In article <C0u%4.4412$HD6.93462@iad-read.news.verio.net>,
James Weisberg <chadbour@wwa.com> wrote:
: I was wondering if there was a shortcut to initializing the
: subkeys of a hash slice. Something like:
:
: @stats{@teams}{wins} = (0) x @teams;
:
: which would be equivalent to:
:
: $stats{dodgers}{wins} = 0;
: $stats{giants}{wins} = 0;
: $stats{rockies}{wins} = 0;
: $stats{diamondbacks}{wins} = 0;
:
: Does any such shortcut exist or I am stuck with the ole for loop?
For loops aren't so bad:
$stats{$_}{wins} = 0 for @teams;
Greg
--
I used to be sad because I had no woman. Then I met a man who had no hands.
-- Rick Riebs
------------------------------
Date: Wed, 07 Jun 2000 16:09:15 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Perl Shortcut?
Message-Id: <7aya4hqxqr.fsf@merlin.hyperchip.com>
chadbour@wwa.com (James Weisberg) writes:
> I know you can initialize a simple hash with the following
> shortcut:
>
> @teams = qw(dodgers giants rockies diamondbacks);
> @stats{@teams} = ("none") x @teams;
>
> which is equivalent to:
>
> $stats{dodgers} = "none";
> $stats{giants} = "none";
> $stats{rockies} = "none";
> $stats{diamondbacks} = "none";
>
> I was wondering if there was a shortcut to initializing the
> subkeys of a hash slice. Something like:
>
> @stats{@teams}{wins} = (0) x @teams;
>
> which would be equivalent to:
>
> $stats{dodgers}{wins} = 0;
> $stats{giants}{wins} = 0;
> $stats{rockies}{wins} = 0;
> $stats{diamondbacks}{wins} = 0;
>
> Does any such shortcut exist or I am stuck with the ole for loop?
> Thanx for any trickery.
If this is all you want then:
@stats{@teams} = ({wins => 0}) x @teams;
should do what you want.
--Ala
------------------------------
Date: Wed, 07 Jun 2000 15:46:01 GMT
From: debers@my-deja.com
Subject: Perl/Tk system() call
Message-Id: <8hlqnl$51f$1@nnrp1.deja.com>
How do I invoke a separate program from a TK gui?
When I use system('prog_path') the second application launches but the
toplevel window is unavailable until I close the second application.
I'm running Perl/Tk on Windows98.
Thanks in advance!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 7 Jun 2000 11:22:45 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: perldoc help
Message-Id: <393e76d9$0$15253@wodc7nh1.news.uu.net>
Hello,
I am trying to use the perldoc to try and solve a problem. The problem is
that I want to point at a tar file, and get the filesize of it.
But I want to know how to do this in the future.
I glanced through the HTML active state pages, but it is overwhelming trying
to find filesize information.
So then I went to the command line, and tried
perldoc -q "filesize"
perldoc -f "filesize"
perldoc -q "size"
but I can't find any entries.
I can never seem to find answers in the help, so I must be doing something
wrong. Could someone get me on the right track here.
Thanks
Scott
------------------------------
Date: 7 Jun 2000 16:52:53 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: perldoc help
Message-Id: <8hlul5$3bk5n$2@fu-berlin.de>
hi,
spurcell <skpurcell@hotmail.com> wrote:
> I am trying to use the perldoc to try and solve a problem. The problem is
> that I want to point at a tar file, and get the filesize of it.
perldoc -f stat
tina
--
http://www.tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Wed, 7 Jun 2000 10:16:23 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: perldoc help
Message-Id: <8hm001$uh7$1@brokaw.wa.com>
spurcell <skpurcell@hotmail.com> wrote in message
news:393e76d9$0$15253@wodc7nh1.news.uu.net...
> Hello,
> I am trying to use the perldoc to try and solve a problem. The problem is
> that I want to point at a tar file, and get the filesize of it.
perldoc -f -X
or for the definitive list:
perldoc perlfunc
Lauren
------------------------------
Date: Wed, 7 Jun 2000 20:01:15 +0200
From: "Rob" <rob@megagiga.com>
Subject: rich text & mail attachments
Message-Id: <960397040.556916@cache.aquanet.co.il>
How do I add attachments to email sent from a perl script (form submission
for example) ?
Also, how do I turn text submitted in a form into 'rich text' email?
Thanks!
------------------------------
Date: Wed, 07 Jun 2000 11:55:47 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Ruby -- A better OO Perl than Perl? Python 3000 features available now?
Message-Id: <393E7083.F9AFC7DD@attglobal.net>
Conrad Schneiker wrote:
>
> Well, at least _some_ people regard Ruby as a better OO Perl than Perl or as
> a means of getting anticipated Python 3000 features now. Maybe if you knew
> more about Ruby, you might become one of them.
And at least _some_ people know its rather rude to post off topic.
You are obviously not one of them. Nice try at a language war.
------------------------------
Date: Wed, 07 Jun 2000 14:58:53 GMT
From: boemosers@my-deja.com
Subject: Sending UDP frames from a CGI script
Message-Id: <8hlnv0$2s3$1@nnrp1.deja.com>
Hi there,
does anyone know a ready Perl CGI script I can use if I want to send a
few UDP frames over the net. I'm quite new with Perl and all I know so
far concerning the sending of UDP frames is that it's somehow working
with setting up a socket. But I don't have the slightest idea what
other things there have to be in a CGI script, especially to treat
maybe occuring errors in the right way.
Regards
Stefan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 7 Jun 2000 16:30:37 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Simple regexp question - Bug in Perl?
Message-Id: <8hltbd$mcf$1@news.panix.com>
On 7 Jun 2000 03:07:44 GMT, Eric Bohlman <ebohlman@netcom.com> wrote:
++ Some guy (angryflower99@hotSPAMmail.com) wrote:
++ :
++ : $vbl="\$INTERNAL"; # From previous advice, added the \
++ : $newval="192.168.1.0/24";
++ : while (<>) {
++ : s/$vbl/$newval/;
++
++ Interpolation will expand this to:
++
++ s/$INTERNAL/192.168.1.0/24/;
++
++ before the regex engine tries to compile the expression. When the regex
++ engine starts to compile it, it sees a dollar sign and guess what it
++ tries to do? That's right; it tries to interpolate the value of the
++ variable $INTERNAL, which evaluates to an empty string.
Huh? Have you actually tried out your hypothesis?
#!/opt/perl/bin/perl -w
use strict;
my $INTERNAL = "foobar";
$_ = "baz $INTERNAL qux\n";
print;
my $vbl = '$INTERNAL';
my $newval = "192.186.1.0/24";
s/$vbl/$newval/;
print;
__END__
According to your speculations, that would print
baz foobar qux
baz 192.186.1.0/24 qux
It does, however, print:
baz foobar qux
baz foobar qux
How come both you and Larry Rosler got the idea of a magical double
interpolation?
The problem here is that $ is special to the regex machine; not that
it's interpolated. You would have the same problems when trying to
replace the string "^INTERNAL".
Abigail
------------------------------
Date: 7 Jun 2000 16:18:40 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: Simple regexp question
Message-Id: <8hlskv$lus$1@news.panix.com>
On Tue, 6 Jun 2000 17:23:09 -0700, Larry Rosler <lr@hpl.hp.com> wrote:
++ In article <393D91DE.57B57BAE@My-Deja.com> on Tue, 06 Jun 2000 17:05:50
++ -0700, Makarand Kulkarni <makarand_kulkarni@My-Deja.com> says...
++ > > $vbl="$INTERNAL";
++
++ > replace with $vbl="\$INTERNAL"; or else $vbl just gets the value of $INTERN
++
++ Nope. Did you test it before posting? Now the attempted interpolation
++ of $INTERNAL takes place in the regex.
Eh? Interpolation only takes place in literals, or with eval.
$foo = "bar";
$baz = "\$foo";
$re = qr /$baz/;
print $re;
prints:
(?-xism:$foo)
The $ is still there, and no interpolation of $foo.
Abigail
------------------------------
Date: Wed, 7 Jun 2000 11:57:21 +0100
From: "Dmitry Podborits" <dmitryp@attglobal.net>
Subject: SSL-enabled anonymous proxy
Message-Id: <393e70b3$0$19625@wodc7nh7.news.uu.net>
Can somebody please point me in the right direction:
I am looking for an implementation of an anonymizing server-side proxy
program (CGI or Apache module) which would work over SSL.
(I am already familiar with James Marshall's excellent CGI-Proxy available
at his Web site but unfortunately it doesn't support SSL).
Thanks a lot,
Dmitry
------------------------------
Date: 7 Jun 2000 16:14:15 GMT
From: "D.W." <dpalmeNOSPAM@unitedtraffic.com>
Subject: string help needed
Message-Id: <01bfd09a$c9a46b40$cf0114ac@raptor.unitedtraffic.com>
I have four variables such as:
$lat1 = 41.837050N;
$lon1 = 87.684965W;
$lat2 = 42.270300N;
$lon = 89.063149W;
I'm wanting to put these values in another variable in the following manner
$string = ( [quote here] $lat1 [space here] $lon1[quote here] [space here]
[quote here] $lat2 [space here] $lon2 [quote here] );
So when I print the statement I get the following result
"41.837050N 87.684965W" "42.270300N 89.063149W"
I want it to print the quotation marks in the string....I'm going to pass
this to another program....but I've spent three long days trying to figure
this out to no avail.....
Any help would be appreciated....I'm sure its simple and I'm just not
thinking of the right way to handle it.
Douglas
------------------------------
Date: 7 Jun 2000 16:30:58 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: string help needed
Message-Id: <8hltc2$nfa$1@newsflash.concordia.ca>
In article <01bfd09a$c9a46b40$cf0114ac@raptor.unitedtraffic.com>,
D.W. <dpalmeNOSPAM@unitedtraffic.com> wrote:
>I have four variables such as:
>
>$lat1 = 41.837050N;
>$lon1 = 87.684965W;
>$lat2 = 42.270300N;
>$lon = 89.063149W;
This wouldn't even compile.
I assume you really mean
$lat1 = '41.837050N';
or you got the values into the scalar some other way.
[...]
>So when I print the statement I get the following result
>
>"41.837050N 87.684965W" "42.270300N 89.063149W"
>
>I want it to print the quotation marks in the string....I'm going to pass
>this to another program....but I've spent three long days trying to figure
>this out to no avail.....
Three days?! Exactly what did you do to try to solve this? If you searched
a perl book to no avail, your perl book sucks worse than any yet known.
print "\"$lat1 $lon1\" \"$lat2 $lon2\"";
or...
print qq{"$lat1 $lon1" "$lat2 $lon2"}; # see man perlop
Suprisingly I don't see a clear description of backslashing the
quote delimter in the perlop manpages. There's something about it in
the q// section but not for qq//.
--
Neil Kandalgaonkar
neil@brevity.org
------------------------------
Date: 7 Jun 2000 16:38:18 GMT
From: "D.W." <dpalmeNOSPAM@unitedtraffic.com>
Subject: Re: string help needed
Message-Id: <01bfd09e$6d44d160$cf0114ac@raptor.unitedtraffic.com>
Yes Neil I mean '41.....';
Sorry about that...I've been trying using \s double quoting everything out,
nothing was working....I'm very new at perl so needless to say this is a
simple problem for most but was confusing for me.....
Thanks for the help I really do appreciate it.
Douglas
Neil Kandalgaonkar <nj_kanda@alcor.concordia.ca> wrote in article
<8hltc2$nfa$1@newsflash.concordia.ca>...
> In article <01bfd09a$c9a46b40$cf0114ac@raptor.unitedtraffic.com>,
> D.W. <dpalmeNOSPAM@unitedtraffic.com> wrote:
> >I have four variables such as:
> >
> >$lat1 = 41.837050N;
> >$lon1 = 87.684965W;
> >$lat2 = 42.270300N;
> >$lon = 89.063149W;
>
> This wouldn't even compile.
>
> I assume you really mean
>
> $lat1 = '41.837050N';
>
> or you got the values into the scalar some other way.
>
> [...]
> >So when I print the statement I get the following result
> >
> >"41.837050N 87.684965W" "42.270300N 89.063149W"
> >
> >I want it to print the quotation marks in the string....I'm going to
pass
> >this to another program....but I've spent three long days trying to
figure
> >this out to no avail.....
>
> Three days?! Exactly what did you do to try to solve this? If you
searched
> a perl book to no avail, your perl book sucks worse than any yet known.
>
> print "\"$lat1 $lon1\" \"$lat2 $lon2\"";
>
> or...
>
> print qq{"$lat1 $lon1" "$lat2 $lon2"}; # see man perlop
>
> Suprisingly I don't see a clear description of backslashing the
> quote delimter in the perlop manpages. There's something about it in
> the q// section but not for qq//.
>
> --
> Neil Kandalgaonkar
> neil@brevity.org
>
------------------------------
Date: 7 Jun 2000 16:58:32 GMT
From: abigail@arena-i.com (Abigail)
Subject: Re: the end of perl?
Message-Id: <8hluvo$mgk$1@news.panix.com>
On Wed, 07 Jun 2000 06:59:31 GMT, Bart Lateur <bart.lateur@skynet.be> wrote:
++
++ It's simple. All characters used in the definition of virtually any
++ programming language, including Perl, are in Ascii. No accented
++ characters or anything like that. (I'm talking about the language
++ itself, not embedded literal strings.) Didn't you ever notice?
This is a valid Perl program:
#!/opt/perl/bin/perl -w
use strict;
$¥ = "foo";
print $¥, "\n";
__END__
Don't tell me that ¥ (\245) is an ASCII character....
Abigail
------------------------------
Date: Wed, 07 Jun 2000 15:35:52 GMT
From: debers@my-deja.com
Subject: TK System call problem
Message-Id: <8hlq4q$oqc$1@nnrp2.deja.com>
How do I invoke a separate program from a TK gui?
When I use system('prog_path') the second
application launches but the toplevel window is
unavailable until I close the second application.
I'm running Perl/Tk on Windows98.
Thanks in advance!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 07 Jun 2000 16:04:18 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: TK System call problem
Message-Id: <7a1z29scjm.fsf@merlin.hyperchip.com>
debers@my-deja.com writes:
> How do I invoke a separate program from a TK gui?
>
> When I use system('prog_path') the second
> application launches but the toplevel window is
> unavailable until I close the second application.
Do you want to capture the output of your external program?
If not, then you can fork() and exec() your new program. Checkout the
entries for 'fork' and 'exec' in perlfunc for more info.
If you want the output, then you have to use open() and the fileevent()
method to read from your external program only when there is data
available. Something like this:
open FH, "my_prog |" or die "couldn't fork: $!";
$widget->fileevent(FH, 'readable', \&some_sub);
and you would define 'some_sub' something like this:
sub some_sub {
# Read a line.
my $line = <FH>;
# Check if the program ended.
if (defined $line) {
# Do something to $line.
push @lines => $line;
} else {
# The program ended. Let's remove the
# fileevent binding.
$widget->filevent(FH, 'readable', '');
}
}
For more info, checkout the Tk::fileevent pods.
--Ala
------------------------------
Date: Wed, 07 Jun 2000 17:51:15 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Using Unix SOURCE in PERL SYSTEM?? NEED HELP
Message-Id: <393E6F73.936AD408@ife.ee.ethz.ch>
Mike wrote:
[Huge snip. Please quote more selectively]
> Yeah.. The shell script that I am trying to run sets up a bunch of
> environment variables that are used here. I need to use those variables in
> my Perl script. There have been people around here that have tried to
> convert the systembuild (shell script) into Perl but have had no success.
> I would like to be able to run the script and then be able to use the
> variables within the current Perl process.
You can run the script and process the output of the 'set' command which
gives you all environment variables:
my @envs = `. shellscript > /dev/null; set`;
(The dot is /bin/sh's equivalent of csh's source)
You can then use the contents of @envs to modify %ENV.
> Is there a way I can run the
> script so that is sets the environment variables for more than the current
> perl processs? My script spawns other scripts as It goes along which may
> need to use the variables in the future.
Any scripts spawned by your script inherit %ENV.
- Alex
------------------------------
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 3278
**************************************