[13756] in Perl-Users-Digest
Perl-Users Digest, Issue: 1166 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 24 12:05:31 1999
Date: Sun, 24 Oct 1999 09:05:07 -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: <940781107-v9-i1166@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 24 Oct 1999 Volume: 9 Number: 1166
Today's topics:
Re: Associative Array (Abigail)
Re: CGI[perl] output picture <air_space@yahoo.com>
Changing attribs of a file on server, how? <nikita@mondenet.com>
Re: Changing attribs of a file on server, how? <marcel.grunauer@lovely.net>
Re: Comments in Perl <ltl@rgsun40.viasystems.com>
How to pick a random item from an array? (AcCeSsDeNiEd)
Re: How to pick a random item from an array? (AcCeSsDeNiEd)
Re: How to round a number? (Abigail)
Re: Jeff Murphy Are You Available???? (Tad McClellan)
Re: numbers only, no text (Tad McClellan)
Perl and cookies <support@celebritybase.net>
Re: Perl Exam Beta Testers Required - How good are you? (Chris Nandor)
Re: Random Number <andrew_lee@earthlink.net>
Re: Redundant POD (was Re: Underlying data structure be (Abigail)
replacing special characters to %xx for browsers <richard@rcannons.demon.co.uk>
Re: replacing special characters to %xx for browsers <marcel.grunauer@lovely.net>
Re: Request style comments (code included - longish) <rick.delaney@home.com>
Re: Something like DEFINE?? (Tad McClellan)
Re: Something like DEFINE?? (Brett W. McCoy)
Re: stealing the news: how hard can it be? (Abigail)
Re: stealing the news: how hard can it be? <webresearch@indy-soft.com>
Re: Substitution (Abigail)
Re: Substitution (Matthew Bafford)
Web based email program bababozorg@aol.com
Re: why isn't my mod_perl working? <jtolley@bellatlantic.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Oct 1999 10:21:14 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Associative Array
Message-Id: <slrn8168ui.fji.abigail@alexandra.delanet.com>
Govindaraj (umungo01@shafika.vetri.com) wrote on MMCCXLII September
MCMXCIII in <URL:news:s0tdjgatr0132@corp.supernews.com>:
::
::
:: I just like to know this...!!! Sorry, I am not able to find this in any
:: perl references.....!!!
Then look harder. It's there.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== 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, 24 Oct 1999 21:26:36 +0800
From: "airspace" <air_space@yahoo.com>
Subject: Re: CGI[perl] output picture
Message-Id: <7uv1dk$8pd$1@umacss2.umac.mo>
where is CPAN? what is GD? where to find it?
------------------------------
Date: Sun, 24 Oct 1999 15:10:40 GMT
From: Nikita Synytskyy <nikita@mondenet.com>
Subject: Changing attribs of a file on server, how?
Message-Id: <38132179.61A2B285@mondenet.com>
Greetings!
The questions in this post deal more with general CGI programming issues
(read: newbie questions) and not with Perl itself. I have tried posting
to CGI-related newsgroups, but most of them have such low traffic that
posts sit there for weeks without getting answered.
I am working on my homepage, and currently I'm trying to set up a couple
of CGI scripts. I have a problem, however: I don't know how to change
the attributes of files to "executable", so that the server can run
them. The problem is I upload my files via ftp to the server, I don't
have "direct" access to the files, so "chmod 755 filename.ext" does not
work (or else I just don't know how to issue it so that the server would
understand me). Any ideas/workarounds/etc?
Also, I am familiar with Pascal, C/C++ and Java, but have no clue about
Perl, so I would like to write the CGI programs in one of the languages
I know. For compiled languages, if I compile the code on a machine
running WinNT, will it run on an Apache server? No? How about Java
bytecodes, which are supposed to be universally portable? Any ideas how
I can NOT learn Perl?
Thanks in advance,
Nikita.
------------------------------
Date: Sun, 24 Oct 1999 15:20:23 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: Changing attribs of a file on server, how?
Message-Id: <IjATOHVuYbKGhUTIVBO0wgJwjiWQ@4ax.com>
On Sun, 24 Oct 1999 15:10:40 GMT, Nikita Synytskyy
<nikita@mondenet.com> wrote:
> The questions in this post deal more with general CGI programming issues
> (read: newbie questions) and not with Perl itself. I have tried posting
> to CGI-related newsgroups, but most of them have such low traffic that
> posts sit there for weeks without getting answered.
Low traffic isn't a problem in this group, but the result will likely
be the same. If you measure the probability of getting an answer by
looking at the amount of traffic in a group, I suggest you try one of
the alt.binaries groups.
> Also, I am familiar with Pascal, C/C++ and Java, but have no clue about
> Perl, so I would like to write the CGI programs in one of the languages
> I know.
Since you don't want a Perl-related answer, wouldn't it make
marginally more sense to ask this in a newsgroup that's related to a
language you'd like the answer to be based on? Not that yours is a
question of which language to use, but stil...
> Any ideas how I can NOT learn Perl?
Sure.
- Don't post to this newsgroup
- Don't install Perl
- Don't read books about Perl
- Don't look at Perl code
> Thanks in advance,
You're welcome.
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: 24 Oct 1999 14:24:04 GMT
From: lt lindley <ltl@rgsun40.viasystems.com>
Subject: Re: Comments in Perl
Message-Id: <7uv4q4$2r3$1@rguxd.viasystems.com>
Abigail <abigail@delanet.com> wrote:
:>Bart Lateur (bart.lateur@skynet.be) wrote on MMCCXLV September MCMXCIII
:>in <URL:news:3817d08d.2942606@news.skynet.be>:
:>%% Abigail wrote:
:>%%
:>%% >~~ > One byte less on Unix, same amount of bytes on Windows.
:>%% >~~
:>%% >~~ Only in a file. :)
:>%% >
:>%% >I assume you're not going to comment out stuff for things you
:>%% >type interactively....
:>%%
:>%% I guess Martien ment that on Windows, CRLF is converted to LF when
:>%% reading from a text file, and back to CRLF when writing to it. So, in
:>%% memory, it's the same amount of bytes, likely even the same bytes, as on
:>%% Unix.
:>Oh, really?
:>I assume that when the program is compiled, comments are gone.
:>So, the "in memory" doesn't make sense. Of course I'm talking about
[snip]
$_ = qq{Somecommentsarethrownawaybythecompiler};
$qr = qr{Some comments are #not
thrown away by the compiler}x;
print $qr if /$qr/;
__END__
(?x-ism:Some comments are #not
thrown away by the compiler)
Of course these are comments preserved by a quoting operator that are
later ignored, nevertheless, you did leave an opening.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Sun, 24 Oct 1999 13:24:44 GMT
From: dillon_rm@magix.com.sg (AcCeSsDeNiEd)
Subject: How to pick a random item from an array?
Message-Id: <3813085f.4326664@news.magix.com.sg>
Hi, I can't figure this out. I'm pretty weak at arrays.
I have a code that reads a column from a Sql Server database:
use DBI;
# open connection to SQL server database "companies"
$dsn = "no1sg_coy";
$dbh = DBI->connect("dbi:ODBC:$dsn",'user@mycom','mypass') or die
"$DBI::errstr\n";
# prepare and execute SQL statement
$sql= qq|SELECT Company_Name FROM [user\@mycom].Companies|;
$sth = $dbh->prepare($sql);
$sth->execute or die "ERROR: could not execute SQL
statement:\n\t$sql\n";
# output database results
while (@row=$sth->fetchrow_array) {
print "@row\n"
}
Now, how would I pick a random Company Name from @row ?
For reasons, I cannot use the rand fx built into SQL server.
So, I'll have to do it using perl.
The random code that I was using looks like this:
srand(time ^ $$);
$num = rand(@row); # Pick a Random Company from @row
# Print Out Random Company
print "Random Company picked is: $row[$num]\n";
A million thanks.
To e-mail me, remove "_rm"
------------------------------
Date: Sun, 24 Oct 1999 14:39:26 GMT
From: dillon_rm@magix.com.sg (AcCeSsDeNiEd)
Subject: Re: How to pick a random item from an array?
Message-Id: <38131a0c.3313828@news.magix.com.sg>
Hi folks. I've managed to figure it out:
I "push" the results of the database into another array then rand the
new array:
# output database results
while (@row=$sth->fetchrow_array) {
push(@pick, @row);
}
$num = rand(@pick); # Pick a Random Company
# Print Out Random Company
print "Random Company picked is: $pick[$num]\n";
On Sun, 24 Oct 1999 13:24:44 GMT, dillon_rm@magix.com.sg
(AcCeSsDeNiEd) wrote:
>Hi, I can't figure this out. I'm pretty weak at arrays.
>
>I have a code that reads a column from a Sql Server database:
>
>use DBI;
>
># open connection to SQL server database "companies"
>
>
>$dsn = "no1sg_coy";
>$dbh = DBI->connect("dbi:ODBC:$dsn",'user@mycom','mypass') or die
>"$DBI::errstr\n";
>
>
># prepare and execute SQL statement
>
>$sql= qq|SELECT Company_Name FROM [user\@mycom].Companies|;
>
>$sth = $dbh->prepare($sql);
>$sth->execute or die "ERROR: could not execute SQL
>statement:\n\t$sql\n";
>
>
># output database results
>while (@row=$sth->fetchrow_array) {
> print "@row\n"
>}
>
>
>Now, how would I pick a random Company Name from @row ?
>For reasons, I cannot use the rand fx built into SQL server.
>So, I'll have to do it using perl.
>
>The random code that I was using looks like this:
>
>srand(time ^ $$);
>$num = rand(@row); # Pick a Random Company from @row
># Print Out Random Company
>print "Random Company picked is: $row[$num]\n";
>
>
>A million thanks.
>
>
>To e-mail me, remove "_rm"
To e-mail me, remove "_rm"
------------------------------
Date: 24 Oct 1999 09:33:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How to round a number?
Message-Id: <slrn81664c.fji.abigail@alexandra.delanet.com>
Francois Dupradeau (fyd@u-picardie.fr) wrote on MMCCXLIII September
MCMXCIII in <URL:news:3810B735.41C6@u-picardie.fr>:
__
__ Is there a function in Perl to round off the 2nd or the thrird (or the
__ 5th, etc...) number after the decimal point of a number?
Yes,
RTFM.
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\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: Sun, 24 Oct 1999 05:34:42 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Jeff Murphy Are You Available????
Message-Id: <irjuu7.vt4.ln@magna.metronet.com>
Jonathan Stowe (gellyfish@gellyfish.com) wrote:
: On Sat, 23 Oct 1999 18:35:39 -0000 Natasha Manning wrote:
: > Jeff,
: > We spoke about a Perl / Sybase opening in Chicago about 3+ months ago,
: > are you available????>
: >
: Wow, we are a dating agency now as well ;-}
: This possibly the most unprofessional thing I have ever seen a recruiter
: do. What if this persons current employer were to be reading the group ?
If the recruiter gets their commission in the end, it probably
doesn't matter much what they had to do to get it.
The ends justify the means for a large percentage of head hunters,
hence their less-than-stellar reputation, in general.
: I certainly wouldnt be using your services if you are capable of a gaffe
: like this.
I don't see any notation that this was emailed.
Most spammers don't read the newsgroups that they spam...
... so they don't know that we are laughing at them and
noting their name for future (and perpetual) ignoration.
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 24 Oct 1999 05:37:55 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: numbers only, no text
Message-Id: <j1kuu7.vt4.ln@magna.metronet.com>
Joe Zelwietro (deplib@citytel.net) wrote:
: Anyway, my script finds the appropriate line (eg. below)
: ....
: This line contains the number 1234
: ....
: My first attempt to deal with this was to use the substr function. That
: is, have the script place the final 4 bytes of the line into the variable.
: Such as:
: push (@allNunbers, substr($_-4)."\n";
^ ^^
^ ^^
If you post pseudo-code you should expect a pseudo-answer.
You have a syntax error there (a machine can find that, so there
is no need for a human to spend time finding it).
: But as you probably guessed this only works for numbers of 4 digit width AND
: only those numbers at the end of the line and thus it isn't a suitable method.
: I want a function (or a pattern substitution which strips the variable of all
: NON-numeric elements.
: Any advice as to a good way to do this?
push @allNumbers, $1 if /(\d+)$/;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 24 Oct 1999 10:18:09 -0400
From: "Nelson Nieves" <support@celebritybase.net>
Subject: Perl and cookies
Message-Id: <7uv4h9$21j8@news2.newsguy.com>
I am calling a perl script using shtml from my main index.shtml page. The
callout is the last on this page.
The problem is that the code executes but doesn't read the cookie.
What I am trying to do is not load Netscape's Garage Hitometer code if we
visit the site or start making changes and displaying the page, or when we
want to go to the page to make sure our service provider isn't having
problems. We don't want our hits to count.
Is it because the .pl script is called right after the page headers? I am
confused. I tried adding several headers, but they just print out. I am a
newbie at perl. I know enough to write my own perl scripts, from banner
rotators to hidden counters. But this one has me stumped.
The server is Microsoft's IIS the Perl version is 5 something.
If you have a better way of doing what I am trying to accomplish please let
me know as well.
Thanks.
require 'cookie.lib';
$hitometer = "d:/users/celebritybase/www/_private/hitometer.txt";
#################################
# Display Banner hitometer code #
#################################
# if us then do not insert
# the hitometer code
#print "Content-type: text/html\n";
#print "HTTP/1.0 200 OK\n\rContent-type: text/html\n\r";
&GetCookies('dont-count'); # set cookie scalar if dont-count is set
$valu = $Cookies{'dont-count'};
print "<B>$valu<B>\n";
if ( $Cookies{'dont-count'} ne "1" ) { # print to browser
open(hitometer, $hitometer);
do {
$line = <hitometer>;
print $line;
} until ( $line eq "" );
close(hitometer);
}
#print "\n\r\n\r";
------------------------------
Date: Sun, 24 Oct 1999 13:31:24 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Perl Exam Beta Testers Required - How good are you?
Message-Id: <pudge-2410990931270001@192.168.0.77>
In article <5qYQOIfLDLau7yEv=1npoqlQGWht@4ax.com>, Marcel Grunauer
<marcel.grunauer@lovely.net> wrote:
# On Fri, 22 Oct 1999 09:58:21 -0400, "Munish Suri"
# <msuri@recruitsource.com> wrote:
#
# > My company is working on an online technical screening system that is
# > to-be-shortly released. We are looking for experienced individuals to test
# > our Perl exams.
# >
# > Please respond ASAP if you are interested.
#
# Oh, please let me take the test! They are usually a good reason to
# invite some friends, buy a case of beer and have a good laugh.
#
# Of course, it'd be even more fun if Matt Wright designed the test, but
# I guess you can't have everything...
Speaking of Matt Wright ... I proposed this patch to perl 5.005_62.
*** toke.c-orig Mon Oct 18 11:52:49 1999
--- toke.c Mon Oct 18 13:00:21 1999
***************
*** 453,458 ****
--- 453,468 ----
if (*s++ != '#')
return;
while (*s == ' ' || *s == '\t') s++;
+
+ #ifdef MATTS_SCRIPTS_ARE_EVIL
+ if (strnEQ(s, "Scripts Archive at:
http://www.worldwidemart.com/scripts/", 67)
+ ||
+ strnEQ(s, "Matt's Script Archive, Inc.:
http://www.worldwidemart.com/scripts/", 69)
+ ) {
+ Perl_croak(aTHX_ "Sorry, Matt's Scripts are evil");
+ }
+ #endif
+
if (strnEQ(s, "line ", 5)) {
s += 5;
sawline = 1;
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Sun, 24 Oct 1999 11:11:16 -0400
From: andrew_lee <andrew_lee@earthlink.net>
Subject: Re: Random Number
Message-Id: <38132193.9657D5A1@earthlink.net>
Fungus@hello.net wrote:
> Hi,
> I need a good algorithm that generates a random integer
> between 1 and 14 (inclusive). This needs to run inside a "for" loop.
> So the new random number needs to be different than the previous
> number.
>
> Thanks,
> Leonard
####
# Pseudo Random Number Generator without repeats
####
sub PRNG { #takes num and seed and range
local($num, $seed, $range) = @_;
srand($seed);
undef($i);
$i = 0;
while ($i < $num) {
$rand = int(rand $range);
if($hash{$rand}) { next; }
else { $hash{$rand} = 1; }
$i++;
}
return %hash;
}
------------------------------
Date: 24 Oct 1999 10:01:30 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Redundant POD (was Re: Underlying data structure behind blessed reference.)
Message-Id: <slrn8167pe.fji.abigail@alexandra.delanet.com>
Jeff Pinyan (jeffp@crusoe.net) wrote on MMCCXLIII September MCMXCIII in
<URL:news:Pine.GSO.4.10.9910220755410.15158-100000@crusoe.crusoe.net>:
%% On Oct 22, Jonathan Stowe blah blah blah:
%%
%% > As far as *I* am concerned seeing all this (redundant) stuff at the top
%% > of the post just disinclines me to read the article.
%%
%% I do it to help introduce less experienced Perl folk to the concept of
%% POD, the proximity of the docs via perldoc; but also because I find it
%% helps me structure my response in a way that helps the receiver the most.
%% If people would prefer, I will run my POD answer through pod2text before
%% posting it.
That's the way how it should. Or at least mark up the article with a
correct mime type. text/plain is a lie. text/x-pod would be better.
That allows people to easily killfile, or run it through a decoder.
You're worse than HTML posters; they at least tend to be honest, and
put a text/html in their header.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== 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, 24 Oct 1999 15:57:57 +0100
From: "Richard Cannon" <richard@rcannons.demon.co.uk>
Subject: replacing special characters to %xx for browsers
Message-Id: <940777077.13174.0.nnrp-14.9e985802@news.demon.co.uk>
I am wanting to convert special characters in a string to %xx where xx is
the ascii hex equivalent
e.g ' ' to '%20'
I have tried unpack but blank is converting to 48 for some reason, so I
currently have the following code
#!/usr/bin/perl
%specials = (
' ','%20',
'/','%2F',
'?','%3F',
':','%3A',
';','%3B',
'@','%40',
'#','%23',
'%','%25',
'>','%3E',
'<','%3C',
'{','%7B',
'}','%7D',
'[','%5B',
']','%5D',
'"','%22',
"'",'%27',
'`','%60',
'^','%5E',
'~','%7E',
'\','%5C',
'|','%7C');
$name = 'a:b/ 2 c';
foreach $key (keys (%specials)) {
$value = $specials{$key};
print key $key value $value;
$name =~ s/$key/$value/eg;
}
print $name;
This does not work because of the interpretation of some special characters
in the search.
Please help
------------------------------
Date: Sun, 24 Oct 1999 15:09:15 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: replacing special characters to %xx for browsers
Message-Id: <ly0TOGHGDXbY75s1VFeDd7qdQcFl@4ax.com>
On Sun, 24 Oct 1999 15:57:57 +0100, "Richard Cannon"
<richard@rcannons.demon.co.uk> wrote:
> I am wanting to convert special characters in a string to %xx where xx is
> the ascii hex equivalent
>
> e.g ' ' to '%20'
perldoc URI::Escape
perldoc CGI
e.g.
use CGI;
print CGI::escape($s);
or, taken from CGI::escape():
$s =~ s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: Sun, 24 Oct 1999 15:25:50 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Request style comments (code included - longish)
Message-Id: <3813250C.7C03A313@home.com>
[posted & mailed]
Jonathan Stowe wrote:
>
> On Sun, 24 Oct 1999 08:38:13 GMT Carrie Duffy wrote:
> >
> > Can anyone offer some tips to help make my code
> > easier to parse (for humans, that is :P). Thanks!
...
> > $rcvbufdef= `cat /proc/sys/net/core/rmem_default`;
> > chomp ($rcvbufdef);
> >
>
> Useless use of 'cat' and backticks : you could open these files directly
> in Perl and read them straight in - probably setting $/ to undef to
> slurp the entire contents.
>
> {
> local $/;
> opem(RMEMDEF,'/proc/sys/net/core/rmem_default' ) || die " ... - $!\n";
> chomp($rcvbufdef = <RMEMDEF>);
^^^^^
That's not chomping what it should be chomping.
> close RMEMDEF;
>
> # etc ...
> }
It's a good idea to localize just for the code that needs the local
behaviour so that unfortunate side effects are avoided.
Since C<chomp> chomps $/, its behaviour is altered undesirably in the
above code.
opem(RMEMDEF,'/proc/sys/net/core/rmem_default' ) || die " ... - $!\n";
{
local $/;
$rcvbufdef = <RMEMDEF>;
}
chomp $rcvbufdef;
close RMEMDEF;
or everyone's favourite
opem(RMEMDEF,'/proc/sys/net/core/rmem_default' ) || die " ... - $!\n";
chomp( $rcvbufdef = do { local $/; <RMEMDEF> } );
close RMEMDEF;
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Sun, 24 Oct 1999 05:46:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Something like DEFINE??
Message-Id: <8hkuu7.vt4.ln@magna.metronet.com>
Stephen J Whitfield (rwhitfie@speedlink.com.au) wrote:
: Is there something in Perl similar to DEFINE in C??
C doesn't have any DEFINE!
Perhaps you mean #define ?
In that case, Perl does not have anything merely similar to C.
It has the _same_ cpp as C.
: I haven't seen
: anything in the documentation.
See the -P switch in perlrun.pod.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 24 Oct 1999 15:05:18 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Something like DEFINE??
Message-Id: <slrn8168a8.t3k.bmccoy@moebius.foiservices.com>
Also Sprach Stephen J Whitfield <rwhitfie@speedlink.com.au>:
>Is there something in Perl similar to DEFINE in C?? I haven't seen
>anything in the documentation.
Not really. If you are trying to create constant scalars, you can use
type globs and references like this:
*GRAVITY = \9.8;
If you are trying to play tricks with the precompiler and do conditional
compilation, that's a very different story, and can't be done in Perl,
AFAIK.
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: 24 Oct 1999 09:16:03 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: stealing the news: how hard can it be?
Message-Id: <slrn81654c.fji.abigail@alexandra.delanet.com>
TechGuy (michael@cermak.com) wrote on MMCCXLI September MCMXCIII in
<URL:news:PbnP3.1888$l05.51357@typ11a.deja.bcandid.com>:
&& I'd like to find/modify a script to seek out current headlines (such as
&& Yahoo! news, CNET, CNN, or anything like that) and create a small list
&& (maybe half a dozen) links on a page to those articles. I suppose this
&& would be somewhat similar to the services offered by isyndicate.com. Any
&& suggestions, comments, ideas, urls, etc are greatly appreciated.
"man vi"
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
-----------== 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, 24 Oct 1999 14:36:04 GMT
From: "Web Research" <webresearch@indy-soft.com>
Subject: Re: stealing the news: how hard can it be?
Message-Id: <oPEQ3.10782$PV2.186569@news.rdc1.tn.home.com>
> <Universal truth ;) > Anything with a .com in its name is automatically
> a good investment, especially if you can buy the whole thing.
> </Universal truth ;) >
uh...
uh...
you don't use a browser much do you? ;)
------------------------------
Date: 24 Oct 1999 08:51:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Substitution
Message-Id: <slrn8163m6.fji.abigail@alexandra.delanet.com>
Larry Rosler (lr@hpl.hp.com) wrote on MMCCXLI September MCMXCIII in
<URL:news:MPG.1277ee5e71f1fbab98a0d7@nntp.hpl.hp.com>:
``
`` But the whole problem is being overkilled. How about this:
``
`` #!/usr/bin/perl -w
`` use strict;
``
`` print "Content-Type: text/plain\n\n";
`` open PLAN, '/home/ollie/.plan' or
`` die "could not open plan file $!\n";
`` print <PLAN>;
`` close PLAN or die "could not close plan file $!\n";
Overkill!
perl -pe's!^!Content-Type: text/plain\n\n!if$.<2' /home/ollie/.plan
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
-----------== 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, 24 Oct 1999 15:38:08 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Substitution
Message-Id: <slrn81693d.602.*@dragons.duesouth.net>
Once upon a time (24 Oct 1999 08:51:25 -0500), Abigail) was attempting
to figure out Ilya's new Perl regex features, and accidently sent the
following to comp.lang.perl.misc:
: perl -pe's!^!Content-Type: text/plain\n\n!if$.<2' /home/ollie/.plan
Speaking of whitespace dependency...
perl -pe's!^!Content-Type: text/plain\n\n! if$.<2' /home/ollie/.plan
: Abigail
--Matthew
------------------------------
Date: Sun, 24 Oct 1999 13:51:56 GMT
From: bababozorg@aol.com
Subject: Web based email program
Message-Id: <7uv2tr$bm7$1@nnrp1.deja.com>
Hi
does anyone know a good perl/cgi webbased email program like
yahoo/hotmail?
the program should ables me to sign up for email address online.
i am on a vitrual server.
i have checked the programs like atdot or mailman but they are just a
pop3 checker, i think they dont able me to create an email address.
Thanks for the help
Hamed
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 24 Oct 1999 14:01:21 GMT
From: James Tolley <jtolley@bellatlantic.net>
Subject: Re: why isn't my mod_perl working?
Message-Id: <381310BC.1D8ED56@bellatlantic.net>
David Henry wrote:
> I built apache with mod_perl and added the following to my httpd.conf file
>
> ScriptAlias /perl-bin/ "/usr/local/apache/perl-bin/"
If memory serves, this should not be a ScriptAlias. It should be an Alias.
It's been a while, but I think... Anyway, it should be in the README or
INSTALL files.
hth,
James
------------------------------
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 1166
**************************************