[13689] in Perl-Users-Digest
Perl-Users Digest, Issue: 1099 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 17 11:05:34 1999
Date: Sun, 17 Oct 1999 08:05:11 -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: <940172711-v9-i1099@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 17 Oct 1999 Volume: 9 Number: 1099
Today's topics:
Re: Assistance required, please help... <gellyfish@gellyfish.com>
Re: Bad Ref <gellyfish@gellyfish.com>
Re: Can a perl script output image? <gellyfish@gellyfish.com>
Re: Confused about reference vs. value... <gellyfish@gellyfish.com>
Exact pattern match <paschal1@mindspring.com>
Re: Exact pattern match (Abigail)
Re: File Locking in Win32 PerlScript. <gellyfish@gellyfish.com>
Re: FTP Perl Module??? <gellyfish@gellyfish.com>
Re: Gettin Path except last dir <gellyfish@gellyfish.com>
Re: hashes <gellyfish@gellyfish.com>
Re: how to get a script load as the first page rancorr@hotmail.com
Re: How to inquire, position and click the mouse in PER (Nim Chu)
Re: How to install GD.PM <gellyfish@gellyfish.com>
Re: How to install GD.PM <me@toao.net>
I am a newbie and need help! <golf@tfz.net>
Re: I am a newbie and need help! (Brett W. McCoy)
Re: list last five messages <gellyfish@gellyfish.com>
Re: Need a hand-Databases, Hahses, and Odd Photos. <gellyfish@gellyfish.com>
Re: Opinions? Efficiency & Drain of Pack/UnPack <gellyfish@gellyfish.com>
Re: Perl script taking regex as argument? <gellyfish@gellyfish.com>
Public apololgy <pooka@cygnus.ucdavis.edu>
Re: Public apololgy (Abigail)
Re: qr operator the $_ (Kragen Sitaker)
Re: Setuid script using Net::FTP <gellyfish@gellyfish.com>
smallest hardware for perl development ? <hvtijen@hotmail.com>
Re: smallest hardware for perl development ? <gellyfish@gellyfish.com>
Re: smallest hardware for perl development ? <webresearch@indy-soft.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Oct 1999 11:35:44 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Assistance required, please help...
Message-Id: <7uccag$4en$1@gellyfish.btinternet.com>
On 16 Oct 1999 22:32:01 GMT David Efflandt wrote:
> On 15 Oct 1999 22:28:50 -0500, Abigail <abigail@delanet.com> wrote:
>>Hobbes (hobbes@MailAndNews.com) wrote on MMCCXXXVII September MCMXCIII in
>><URL:news:3808F338@MailAndNews.com>:
>>..
>>.. I am having trouble with checkboxes. Can someone please help me? Email me
>>.. and
>>.. I will give you the details of my problem.
>>
>>
>>Tk problems are best discussed in comp.lang.perl.tk.
>>
>>But be sure to describe your problem there.
>>
>>
> Abigail, what are we going to do with you? The original poster is most
> likely a CGI newbie who has not discovered the proper *.cgi newsgroup
> nor the Perl CGI module. They might find much insight by typing: perldoc CGI
>
I didnt see any indication in the original post that would indicate that
the question was about Perl, Visual Basic, Tk let alone CGI.
My curiosity was aroused by the posters reticence to describe his problem
in public.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 10:13:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Bad Ref
Message-Id: <7uc7gs$43m$1@gellyfish.btinternet.com>
On Sat, 16 Oct 1999 16:39:36 GMT Jimmy Humphrey wrote:
> Hi,
>
> I am noticing that some people on aol browsers cause my cgi scripts to
> crash on when I check for their $ENV{'HTTP_REFERER'}
>
What do you mean by 'crash' ? You should be handling the possibility
that an externally supplied variable is not set in a graceful manner:
if (exists $ENV{HTTP_REFERER})
{
# do something virtually pointless with referer info
}
else
{
# oops browser didnt send http_referer header
# make like chicken with head off
}
The http referer header is trivially spoofed :
#!/usr/bin/perl -w
use strict;
use LWP::UserAgent;
my $agent = new LWP::UserAgent;
$agent->agent("Gelzilla/666");
my $request = new HTTP::Request 'GET' => 'http://localhost';
$request->header('Accept' => 'text/html');
$request->referer('http://www.perl.com/index.html');
my $result = $agent->request($request);
if ($result->is_success)
{
print $result->content;
}
else
{
print "Error: " . $result->status_line . "\n";
}
Resulting in this log entry:
127.0.0.1 - - [17/Oct/1999:10:10:15 +0000] "GET / HTTP/1.0" 200 459 "http://www.perl.com/index.html" "Gelzilla/666"
Do not use HTTP_REFERER for security purposes.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 12:13:42 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can a perl script output image?
Message-Id: <7ucehm$4he$1@gellyfish.btinternet.com>
On Fri, 15 Oct 1999 12:42:59 -0400 Stacey wrote:
> Can a perl script output an image? Some HTML files display images (eg hit
> counters) as the output of a cgi file. How is this done?
> I found the following code in a web page.
>
> <p align="center"><img
> src="http://www.myserver.com/cgi-bin/Count.cgi?id=abcdef"></p>
>
Just for fun here is a CGI hack on something I made earlier:
#!/usr/bin/perl -w
use CGI qw(:standard);
use strict;
use GD;
use vars qw($magnitude);
my ($x_centre,$y_centre) = (320,175);
if ( scalar param() < 3 )
{
print header,start_html,
"Insufficient parameterss",
end_html;
}
else
{
my $P = param('real');
my $Q = param('imaginary');
my $scale = param('scale');
my $image = new GD::Image($x_centre * 2,$y_centre * 2);
my $back_colour = $image->colorAllocate(255,255,255);
my $fore_colour = $image->colorAllocate(0,0,0);
my ($x,$y) = (0.50001,0);
$magnitude = ($P*$P) + ($Q*$Q);
$P = 4*$P/$magnitude;
$Q = -4*$Q/$magnitude;
$scale = $x_centre * $scale;
for ( 1 .. 12000 )
{
my $temp_x = ($x * $P ) - ($y * $Q );
$y = ($x * $Q) + ($y * $P );
my $temp_y = $y;
$x = 1 - $temp_x;
$magnitude = sqrt(($x * $x ) + ($y * $y));
$y = sqrt((-$x + $magnitude)/2);
$x = sqrt(($x + $magnitude)/2);
($x = -$x) if ($temp_y < 0 );
if ( rand() < 0.5 )
{
$x = -$x;
$y = -$y;
}
$x = (1- $x) / 2;
$y = $y / 2;
my $col = int(($scale * ($x - 0.5 )) + $x_centre);
my $row = int($y_centre - ($scale * $y));
if ( ($_ > 0 ) &&
($col >= 0 ) &&
($col < (2 * $x_centre)) &&
($row >= 0 ) &&
($row < ($y_centre * 2 )))
{
$image->setPixel($col,$row,$fore_colour);
}
}
print header('image/gif');
binmode(STDOUT);
print $image->gif;
}
__END__
You can use values of real and imaginary as examples :
1.646009 0.967049
2.447261 -0.967049
1.325508 0.786533
1.415414 0.856803
1.255399 0.691977
2.792809 -0.657593
3.018153 -0.098854
2.998122 0.004298
Adjust scale to taste ( probably <= 1 ).
The original code was from 'Fractal programming in C' by Roger T. Stevens.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 13:14:37 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Confused about reference vs. value...
Message-Id: <7uci3t$4ln$1@gellyfish.btinternet.com>
On Fri, 15 Oct 1999 11:39:33 GMT Python Addict wrote:
> Hello. I've inherited a bunch of scripts that were cobbled together in
> the mid 14th century and as I'm not keen on having my box rooted, I
> thought it might be a good idea to bring them into modern times.
>
> I'm having a slight problem understanding passing values. Consider this
> sub:
>
> - - - - -
> sub trim {
> # Trim spaces
> my $tempParam = shift;
> my $temp = param($tempParam);
> $temp =~ s/^\s+//; # trim first space(s)
> $temp =~ s/\s+$//; # trim last space(s)
> param($tempParam,$temp);
> }
> - - - - -
>
> When I call this sub via something like
>
> - - - - -
> if ( trim(param('whatever')) eq "" ) {
> ...
> - - - - -
>
> not a great deal happens.
>
I dont think that is how you are supposed to use the subroutine - it
is expecting a parameter *name* and then it alters that parameter
in place by setting the parameter to the value with leading and trailing
white space removed so that subsequent uses of param() will return
that new value.
> If I understand things correctly, passing by reference requires a
> leading '\'. But I'm not actually sure what kind of thingie (thanks
> Camel book!) I'm passing. Is it an array? Hmmm.
>
You are passing it a simple scalar value - in your example usage the *value*
of the parameter (whereas it is should be the *name*).
The subroutine is returning the new altered value of the parameter as
a side effect as well as altering it inplace.
You would want to use something like this instead :
if (trim('whatever'))
{
# something remains of param('whatever')
}
else
{
# param('whatever') was entirely whitespace and is now empty
}
> param(), by the way, has been conjoured up by way of saying 'use CGI;' at
> the top of my script. It's a fresh CGI.pm as I grabbed it via CPAN last
> night.
>
> Any beatings with the clue stick gleefully received.
>
Read the CGI.pm manpage
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Oct 1999 09:15:17 -0400
From: "¿¤BaX¤¿" <paschal1@mindspring.com>
Subject: Exact pattern match
Message-Id: <7uchtr$m2a$1@nntp8.atl.mindspring.net>
I'm trying to get an EXACT match for user names from a flat file,
The (shamefully stolen) code that I'm using returns partial matches.
Using this:
##################################################
@names = split(/ +/,$user);
foreach $aname (@names) {
if ($qfield =~ /\b$aname/i ) {
&print_results;
}
##################################################
A search for "SMITH, JOE"
will return
"SMITH, BOB"
"SMITH, JOE"
"SMITH, SUE ELLA"
I need to get only the exact match "SMITH, JOE"
I've tried quite a few variations including a simple ($qfield =~ $user)
but just can't seem to get it to work
Thanks for any help that you can provide to this humble novice
Please pardon if I have duplicated a question or
overlooked some specific documentation which would
have answered my question.
I sometimes tend to bump into trees while searching for the forest.
Dave
paschal1@mindspring.com
------------------------------
Date: 17 Oct 1999 09:25:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Exact pattern match
Message-Id: <slrn80jn21.q8s.abigail@alexandra.delanet.com>
¿¤BaX¤¿ (paschal1@mindspring.com) wrote on MMCCXXXVIII September MCMXCIII
in <URL:news:7uchtr$m2a$1@nntp8.atl.mindspring.net>:
^^ I'm trying to get an EXACT match for user names from a flat file,
Surprise, surprise, there's an operator for this.
The man page will tell you the details.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Oct 1999 11:44:59 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: File Locking in Win32 PerlScript.
Message-Id: <7uccrr$4er$1@gellyfish.btinternet.com>
On Sun, 17 Oct 1999 00:05:49 -0400 Bob Walton wrote:
> epan@my-deja.com wrote:
>>
>> If I am to open a file for input in an ASP page
>>
>> <%
>> open(FILE, ">>test.txt");
>> print FILE "Testing only.\n";
>> close(FILE);
>> %>
>>
>> and there are a few users opening the page at the same time. Will the
>> file be locked until a user has closed the FILEHANDLE? If yes, it will
>> be a problem if 100 user open the page at the same time. Is there a
>> solution if that's the case?
> ...
> If you're running NT, see the "flock" function in perlfunc. If you
> are running other versions of Win32, you are probably out of luck,
> as "flock" doesn't seem to work on Win9x.
But it would generally be considered a mistake to be doing any serious
multiuser application on Win9[58] anyhow - although it might make testing
a pain I guess.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 13:52:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: FTP Perl Module???
Message-Id: <7uckbg$4qs$1@gellyfish.btinternet.com>
On Fri, 15 Oct 1999 02:18:31 GMT Brett W. McCoy wrote:
> Also Sprach ldh7@my-deja.com <ldh7@my-deja.com>:
>
>>I need help finding the FTP perl module. Can anyone suggest how do
>>find it?
>
> Start up the cpan shell (perl -MCPAN -e shell (altough the letst perl will
> start up just with 'cpan'). Then enter 'i /FTP/ and it will list all of
> the modules available. Actually, if you use cpan for the first time, it
> will install the FTP module anyway (Net::FTP) as part of the
> configuration.
>
Alternatively if they are on Windoss then they might want to use PPM
(Perl Package Manager) -
C:\>ppm install libnet
See the activestate documentation for more on PPM.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 13:32:35 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Gettin Path except last dir
Message-Id: <7ucj5j$4qk$1@gellyfish.btinternet.com>
On Fri, 15 Oct 1999 15:17:01 -0700 Tom Phoenix wrote:
> On Fri, 15 Oct 1999, A Zielke wrote:
>
>> How about a
>>
>> my ( $ShortenedPath ) = ( $LongPath =~ /(.*)\\.+/ );
>
> Because it doesn't work reliably. Remember that dot doesn't match newlines
> by default, and a directory name could (possibly) contain a newline. Also,
> what about files in the current directory? Also, why be non-portable?
> Also, why reinvent the wheel?
>
> use File::Basename;
>
I am disappointed. I was fully expecting File::Spec to declare some variable
with the platform specific path separator so I could contrive some
ultimately pointless and hopelessly longwinded example that would address
all of these points (with the exception of the last :) - but it doesnt
so I wont - perhaps it should :?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 11:31:04 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: hashes
Message-Id: <7ucc1o$4ek$1@gellyfish.btinternet.com>
On Sun, 17 Oct 1999 03:20:52 -0500 Frank Hale wrote:
> Martien Verbruggen wrote:
>>
>> On Sun, 17 Oct 1999 03:09:56 -0500,
>> Frank Hale <frankhale@trespass.net> wrote:
>> > Okay I got a hash which stores usernames with there login times. Problem
>> > is I don't want a duplicate key in the hash. For instance say user
>> > "john" logs in at 13:22 and then logs in again at 13:45, I don't want
>> > him in the hash 2 times. How can I test for this and
>> > only enter him in the list once?
>>
>> Use the username as a key.
>>
>
> I am. It still allows the key to be in the hash.
>
yes but only once :
my %hash = (
burt => 1,
burt => 2,
ernie => 1,
fred => 1,
kermit => 1
);
print $_,":",$hash{$_},"\n" foreach (keys %hash);
giving:
fred:1
ernie:1
kermit:1
burt:2
If you dont want to replace a value for an existing key then you should
check with with 'exists %hash' before you assign to the $hash.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Oct 1999 14:42:55 GMT
From: rancorr@hotmail.com
Subject: Re: how to get a script load as the first page
Message-Id: <7ucn9e$v4m$1@nnrp1.deja.com>
thanks to everyone's responses. the meta tag solution was what i was
looking for.
In article <38059CDA.2A9F47A8@argogroup.com>,
Jason P Tribbeck <jtribbeck@argogroup.com> wrote:
> Tom Phoenix wrote:
> >
> > On Thu, 14 Oct 1999 rancorr@hotmail.com wrote:
> >
> > > I'm trying to get a perl script to load up as the first page of my
> > > website;
> >
> > It sounds as if you want to get your webserver to do something.
Your local
> > expert or webmaster will know more about your webserver and how it's
>
> What you could do if your server doesn't allow this to happen (ie. you
> don't have control over the configuration files) is to create an
> index.html page which does a meta-refresh to index.cgi with a 0 second
> refresh period.
>
> --
> Jason Tribbeck Argo
Interactive
> ltd
> Senior Design Engineer 7 Dukes Court,
> Chichester
> West Sussex,
PO19
> 2FX
> Tel: +44 1243 815 815 Fax: +44 1243 815 805
> England
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 17 Oct 1999 15:12:42 GMT
From: nimchu@hal-pc.org (Nim Chu)
Subject: Re: How to inquire, position and click the mouse in PERL?
Message-Id: <7uceg8$2q80$1@news.hal-pc.org>
ebohlman@netcom.com (Eric Bohlman) wrote:
>You'll need to either use Win32::API to call the GetCursorPos (to find
>the cursor position) and mouse_event (to simulate mouse movements and
>clicks) Win32 API functions, or else write an XS sub to call those functions.
Thanks. I follow you directions, and come with the following code:
(The following will move the cursor to the position x=100,y=200)
use Win32::API;
$SetCursorPos = new Win32::API("user32", "SetCursorPos", [I,I], V);
$SetCursorPos->Call(100,200);
Also my Perl installation does not have the API module. I need to
install the API module by typing into a dos shell:
ppm install win32-api
------------------------------
Date: 17 Oct 1999 10:45:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to install GD.PM
Message-Id: <7uc9bh$46r$1@gellyfish.btinternet.com>
On Sat, 16 Oct 1999 23:09:50 GMT Graham W. Boyes wrote:
> Hello,
> I want to create a gif image from some other images. These images will
> be bundled together side by side. I have been trying to use the GD.PM
> module, but am having trouble installing it, even the demos won't
> work. I am using Hypermart, if that is any help.
I assume that by "I am using Hypermart" you mean you are trying to install
on the server of some free web service right ? And you dont have shell
access right ? Well its basically tough - you will have to contact the
provider and ask them to install it for you as it has components that
need to compiled on the machine in question - it is not simply a matter
of copying the GD.pm file somewhere.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Oct 1999 13:04:50 GMT
From: Graham W. Boyes <me@toao.net>
Subject: Re: How to install GD.PM
Message-Id: <7uchhg$rm4$1@nnrp1.deja.com>
I am using Perl 5.003 on Hypermart's server. I do not own the server of
course, so I do not know what OS they are using. I would guess Unix or
something... I have tried a few versions of GD, the latest, and a few
older ones, but I do not know how to install it properly.
I'll put it this way...I have two GIF images that I want to put together
into a single GIF image side by side. What is the best way to do this?
Thanks very much,
Graham W. Boyes
--
"The One and Only"
me AT toao DOT net ~ http://www.toao.net
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 17 Oct 1999 10:07:33 -0400
From: "Jim" <golf@tfz.net>
Subject: I am a newbie and need help!
Message-Id: <7ucl9o$s6m$1@bgtnsc02.worldnet.att.net>
Hi, i have been upload this script
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<HTML><BODY BGCOLOR=\"#000000\"></BODY></HTML>";
to virtualave.net
I am uploading just to see if I can get it to work, but I am gettin an
internal 500 error. Whats wrong with it?
------------------------------
Date: Sun, 17 Oct 1999 14:15:05 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: I am a newbie and need help!
Message-Id: <slrn80jmnh.8qh.bmccoy@moebius.foiservices.com>
Also Sprach Jim <golf@tfz.net>:
>Hi, i have been upload this script
>
>#!/usr/bin/perl
>
>
>
>print "Content-type: text/html\n\n";
>print "<HTML><BODY BGCOLOR=\"#000000\"></BODY></HTML>";
>
>to virtualave.net
>
>I am uploading just to see if I can get it to work, but I am gettin an
>internal 500 error. Whats wrong with it?
Is the script executable on your ISP's host? Does your ISP's host have
perl available at the location you indicated in the shebang line? Are you
sure your host allows you to run random CGI scripts?
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: 17 Oct 1999 10:32:07 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: list last five messages
Message-Id: <7uc8j7$46n$1@gellyfish.btinternet.com>
On Sat, 16 Oct 1999 18:05:32 GMT sbarros6592@my-deja.com wrote:
> Dear All:
> I have a WWWBoard Matts Wright.
>
Please do not use that :
$long_date = "$months[$mon] $mday, 19$year at $hour\:$min\:$sec";
(Amongst other things)
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 14:09:25 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Need a hand-Databases, Hahses, and Odd Photos.
Message-Id: <7uclal$4sd$1@gellyfish.btinternet.com>
On Thu, 14 Oct 1999 18:28:38 +1700 garmark wrote:
> thumbnailing porposes,
>
You leave my cetacean buddies out of this ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 13:43:31 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Opinions? Efficiency & Drain of Pack/UnPack
Message-Id: <7ucjq3$4qn$1@gellyfish.btinternet.com>
On Fri, 15 Oct 1999 12:34:19 GMT Paul D wrote:
>
> I've been working on a couple of nifty scripts here, and think I may
> be drawing on the use of Pack and Unpack alot, so I just want to ask;
>
> Is the use of Pack and Unpack a significant strain on a system? IE:
> Does it make a script particularly slower and in need of more system
> resources/memory to do these two functions?
They are probably more efficient than other ways of doing the same IMO
but you will want to compare the various techniques using the Benchmark
module to measure runtime and some system tool such as 'top' or 'sar'
to measure the effect on system resources (thinks must write module to
work with the sar data files ... of course using unpack :)
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 17 Oct 1999 11:22:11 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl script taking regex as argument?
Message-Id: <7ucbh3$4dl$1@gellyfish.btinternet.com>
On Sat, 16 Oct 1999 22:47:08 -0500 Gregory Stoll wrote:
> as a sidenote, is there any way
> to view all the perldoc files available?) I'm running perl 5.005 on a
> Linux box...Thanks for your help! :-)
>
perl -MFile::Find -e'find sub {print $_,"\n" if /\.pod$/;}, @INC'
or perhaps more fulfilling:
#!/usr/bin/perl
use strict;
use File::Find;
use CGI qw(:standard);
use Pod::Html;
print header;
my $me = script_name();
if ( my $podfile = param('podfile') )
{
open(STDERR,'>/dev/null') || die "really cant cope with that -$!\n";
if(chdir("/tmp")) # my system prefers that
{
pod2html("--infile=$podfile","--noindex");
}
}
else
{
print start_html("Perl Installation Details"),"\n";
print "<H1>Installed POD files: </H1>\n";
eval { find(\&wanted,@INC)};
}
print end_html;
sub wanted
{
if ( $File::Find::name =~ /\.pod$/)
{
open(PODFILE,$File::Find::name) || return;
while(<PODFILE>)
{
if (/^=head1 NAME/)
{
my $name ;
while ($name = <PODFILE>)
{
chomp $name;
$name =~ s/^\s+$//;
last if $name;
}
print qq|<A HREF="$me?podfile=$File::Find::name">|,
$name,"</A><BR>\n";
last;
}
}
}
}
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Oct 1999 12:37:24 GMT
From: Brandon <pooka@cygnus.ucdavis.edu>
Subject: Public apololgy
Message-Id: <3809524E.82A184B2@cygnus.ucdavis.edu>
In light of such overwhelming opposition, I have carefully reviewed the
principles at work in my HTML comment extractor, and determined that it
could be viewed as a simple parser. While I'll still contend that
HTMLcomment is regular, getting there requires traversal of what could
be thought of as an elementary parse tree. So I offer my apologies to
Abigail, who behaved with class when faced with an erroneous claim,
which is more than I can say for most others, and myself.
------------------------------
Date: 17 Oct 1999 08:18:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Public apololgy
Message-Id: <slrn80jj50.q8s.abigail@alexandra.delanet.com>
Brandon (pooka@cygnus.ucdavis.edu) wrote on MMCCXXXVIII September
MCMXCIII in <URL:news:3809524E.82A184B2@cygnus.ucdavis.edu>:
^^
^^ So I offer my apologies to
^^ Abigail, who behaved with class when faced with an erroneous claim,
^^ which is more than I can say for most others, and myself.
Oh, dear! You're ruining my reputation.
Abigail
--
Apologies accepted.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 17 Oct 1999 15:01:01 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: qr operator the $_
Message-Id: <NwlO3.11934$E_1.655839@typ11.nn.bcandid.com>
In article <7uacns$i26$1@charm.magnus.acs.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>To put credit where it belongs: IIRC, phrase "quoting operator" in
>context of compilation of regular expressions belongs to Larry. He
>was objecting to my reuse of `study' as an operator to compile a REx:
>
> $compiled_REx = study /REx/;
>
>was how the initial implementation looked like. It was later that I
>realized that an introduction of (?foo-bar:REx) and of transparent
>stringification of $compiled_REx allow one to remove *all* the magic
>altogether. The motto became
>
> "It may be compiled, but this is an implementation detail." ;-)
So, in fact, it really *does* compile the regex behind the scenes, and
the compiled regex gets used if I say $var =~ $compiled_REx or
/$compiled_REx/, but not if I say /foo$compiled_REx/?
It would be nifty if you could use the Japanese corner quote characters
in Unicode Perl to do a qr without having to say "qr" -- the same way
"" does qq, '' does q, and `` does qx without you having to specify
it. Everybody who's read Friedl would go home happy. :)
BTW, the various quoting operators that use > to match <, ) to match (,
and so forth -- do they recognize the various Unicode brackets, like
the lenticular and tortoise-shell brackets? There's probably a more
appropriate place to ask, right?
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Sat Oct 16 1999
24 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: 17 Oct 1999 13:59:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Setuid script using Net::FTP
Message-Id: <7uckn7$4s8$1@gellyfish.btinternet.com>
On Fri, 15 Oct 1999 11:17:20 +0200 Lars Erik wrote:
> my($ftp) = Net::FTP->new($srvr, Debug => 1, "Timeout=5");
>
> The messages I get in my error log are:
> Odd number of elements in hash assignment at
> /usr/lib/perl5/site_perl/5.005/Net/FTP.pm line 47.
>
my $ftp = Net::FTP->new($srvr,Debug => 1, Timeout => 5);
Net::FTP->new does this :
my $pkg = shift;
my $peer = shift;
my %arg = @_;
Thus all arguments after the server name must be in Key => Value pairs.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Oct 1999 13:52:58 +0200
From: "h" <hvtijen@hotmail.com>
Subject: smallest hardware for perl development ?
Message-Id: <3809b6f5$0$15210@reader1.casema.net>
On the bus, in bed, on the beach, you know the list. Of course, you want to
hack some perl on any location in all circumstances.
So what's the ideal hardware ? Small, fit in you pocket. Also, boot and save
time should be minimal.
* Linux on a PDA, like 7k on Psion 5 ? (http://www.calcaria.net/)
* Toshiba Libretto or Portege ?
* HP sub notebook ?
Do you have any experience on downsizing your perl hardware ?
Please share us your findings !
\henk
------------------------------
Date: 17 Oct 1999 12:29:38 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: smallest hardware for perl development ?
Message-Id: <7ucffi$4ku$1@gellyfish.btinternet.com>
On Sun, 17 Oct 1999 13:52:58 +0200 h wrote:
> On the bus, in bed, on the beach, you know the list. Of course, you want to
> hack some perl on any location in all circumstances.
>
> So what's the ideal hardware ? Small, fit in you pocket. Also, boot and save
> time should be minimal.
>
<snip>
> Do you have any experience on downsizing your perl hardware ?
>
> Please share us your findings !
>
The *hardware* is immaterial and off-topic for this group - please look
at the list of OS platforms to which Perl has been ported at :
<http://www.perl.com>
if Perl has been ported to some OS and that OS will run on your choice of
hardware then that is the ideal choice. If you want to talk about
hardware and OS options I would suggest you take it to one of the comp.sys.*
newsgroups .
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 17 Oct 1999 14:59:00 GMT
From: "Web Research" <webresearch@indy-soft.com>
Subject: Re: smallest hardware for perl development ?
Message-Id: <UulO3.5437$PV2.82086@news.rdc1.tn.home.com>
> smallest hardware for perl development ?
a newbie brain.
Results may vary (wildly)
------------------------------
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 1099
**************************************