[10578] in Perl-Users-Digest
Perl-Users Digest, Issue: 4170 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 6 20:07:25 1998
Date: Fri, 6 Nov 98 17:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 6 Nov 1998 Volume: 8 Number: 4170
Today's topics:
Re: $a = $a <jplundgren@micron.com>
Re: $a = $a <jbharvey@auspex.net>
Denying repeated submissions... <lrh@kami.com>
Re: Denying repeated submissions... <rootbeer@teleport.com>
DFW.pm meeting Wednesday, November 11th (Brand Hilton)
Re: Example of subclassing in Perl ?? (Joe McMahon)
expr -> bytecode -> stdout - how? edrx@my-dejanews.com
Re: expr -> bytecode -> stdout - how? <rootbeer@teleport.com>
expr -> bytecode -> stdout? edrx@my-dejanews.com
Re: Heterogeneous Data Structures: possible? If so, ho (Joe McMahon)
Re: Index of an element in a list? <ckuskie@cadence.com>
Re: List of files to an array... <stowians@ford.com>
Re: MacPerl Help, Please! (Paul J. Schinder)
Re: Pattern matching (Joe McMahon)
Re: Pattern matching <dean2@mail.biol.sc.edu>
Perl "Too Good" for UCLA's CSUA programming competition (Rich Morin)
Printing contents of stderr <dbh6913@rit.edu>
Re: Processing form (Matthew Bafford)
Search Engine <critize@hotmail.com>
Re: Search Engine <rootbeer@teleport.com>
Re: select case? <rootbeer@teleport.com>
Re: select case? <jdf@pobox.com>
Re: Shared CGI.pm from various directories <marks@webleicester.co.uk>
Re: Shared CGI.pm from various directories <rootbeer@teleport.com>
Re: shift in a list context <due@murray.fordham.edu>
Re: shift in a list context <ckuskie@cadence.com>
Split Variables? bigcheese@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 06 Nov 1998 14:23:31 -0700
From: Joe Lundgren <jplundgren@micron.com>
Subject: Re: $a = $a
Message-Id: <364368D3.B237BEB7@micron.com>
Well, that's not quite accurate, either. The assignment happens either
way, but the behavior with use strict is somewhat different. If one
actually tries it:
use strict;
$a = $a;
print "A = $a\n";
I just get 'A ='. This is an obscure case, but remember that $a and $b
are defined for any package, since these are the variables sort uses.
Trust me, I learned this one the hard way....
And with long identifiers available, why would someone ever *choose* to
use $a outside of a sort routine, anyways?
"Justin B. Harvey" wrote:
>
> It would do the assignment.
>
> It would also fail if you're using strict and you haven't defined $a,
> but that's neither here or there :>
> j
>
> Todd Smith wrote:
> >
> > if Perl saw this line, would it do some assignment or ignore it like it
> > would a comment?
> >
> > $a = $a;
------------------------------
Date: Fri, 06 Nov 1998 23:32:08 GMT
From: "Justin B. Harvey" <jbharvey@auspex.net>
Subject: Re: $a = $a
Message-Id: <364386F7.DB3821BD@auspex.net>
Doh! I forgot about $a!
Tom Phoenix wrote:
>
> On Fri, 6 Nov 1998, Justin B. Harvey wrote:
>
> > It would also fail if you're using strict and you haven't defined $a,
> > but that's neither here or there :>
>
> Did you mean define or declare? A scalar variable is defined in Perl if it
> has any value other than undef, but that's not required to do an
> assignment whether 'use strict' is in force or not.
>
> I think you're thinking of 'use strict "vars"', and meaning that $a has to
> be declared. That turns out not to be the case: $a need not be declared,
> even under 'use strict "vars"', because it's one of Perl's internal
> variables, like @ARGV or %INC. $a and $b are used by Perl in sort.
>
> Hope this helps!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 06 Nov 1998 18:32:07 -0500
From: Larry <lrh@kami.com>
Subject: Denying repeated submissions...
Message-Id: <364386F7.392F@kami.com>
Hi,
I'm new to Perl and "form handling" and was hoping I could
get some help in this NG.
I've written a web page that asks the viewer to submit a choice
(a vote). I'd like to be able to prevent the page viewer from
submitting multiple ballots from one dial-up session.
Is there an "environmental variable" call that would check
the viewers IP address such as "REMOTE_ADDR" and prevent
multiple submissions?
Any help will be appreciated.
Larry
------------------------------
Date: Fri, 06 Nov 1998 23:53:00 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Denying repeated submissions...
Message-Id: <Pine.GSO.4.02A.9811061545570.20411-100000@user2.teleport.com>
On Fri, 6 Nov 1998, Larry wrote:
> I've written a web page that asks the viewer to submit a choice
> (a vote). I'd like to be able to prevent the page viewer from
> submitting multiple ballots from one dial-up session.
Hey, I've got fifteen wives, twenty concubines, and thirty-eight children
who all share my home computer. Why won't you let each of us have a vote?
Seriously, there's no real way to do fair voting over the web, unless you
have an independent means of authenticating registered voters. More than
one person can use one IP address, and one person can use more than one IP
address. Freely replace "IP address" with either "email address", "proxy",
or "computer" if you will.
> Is there an "environmental variable" call that would check the viewers
> IP address such as "REMOTE_ADDR" and prevent multiple submissions?
The use of proxies would prevent that from being reliable, even if there
were exactly one address per person and one person per address.
Of course, this all is the same whether you're programming in Perl or not,
so it's not really about Perl. If you have more questions about CGI
programming, the docs, FAQs, and newsgroups about CGI programming should
be able to help you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 6 Nov 1998 19:48:15 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: DFW.pm meeting Wednesday, November 11th
Message-Id: <71vjpv$1c3@mercury.adc.com>
DFW Perl Mongers' next meeting is this coming Wednesday. Details:
Date: Wednesday, November 11th
Time: 7:00pm
Place: The Tipperary Inn (Skillman and Live Oak)
Agenda: None (as usual)
Stuff: Random drawing for a Perl Mongers T-shirt
Everybody's welcome. If you want to know more about DFW.pm, just send
a message to majordomo@hex.net with the following in the BODY (the
title is ignored)
info dfw-pm
See you there!
--
_____
|/// | Brand Hilton bhilton@adc.com
| ADC| ADC Telecommunications, ATM Transport Division
|_____| Richardson, Texas
------------------------------
Date: Fri, 06 Nov 1998 18:08:19 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: Example of subclassing in Perl ??
Message-Id: <joe.mcmahon-0611981808190001@prtims.stx.com>
In article <71vp41$og2$1@nnrp1.dejanews.com>, rohanoberoi@my-dejanews.com wrote:
>This doesn't seem to work. Any idea why?
See comments below. You've missed several important ideas.
1) @ISA is necessary to define the inheritance structure.
2) You do not understand the 'use' operator.
3) You do not understand how to call a subroutine as a method.
>opal:[~] more Foo.pm
>package Foo;
>sub foo {
> 'qwerty';
>}
>1;
Good so far.
>opal:[~] more Bar.pm
>package Bar;
>use base qw(Foo);
Falls under (1,2). This tries to use base.pm's Foo routine. You mean
use Foo;
You also do not define the inheritance - problem (1). Add the line
@ISA = qw(Foo);
>1;
>
>opal:[~] more foo.pl
>#!/usr/local/bin/perl
>use lib ".";
Not wrong, but not needed. Perl assumes this by default.
>use Foo;
>print &Foo::foo, "\n";
Problem (3). Wrong call syntax, if you want inheritance. You mean
print Foo->foo(),"\n";
>
>opal:[~] more bar.pl
>#!/usr/local/bin/perl
>use lib ".";
>use Bar;
>print &Bar::foo, "\n";
Ditto. Gotta have the arrow or Perl doesn't try to resolve via inheritance.
>
>opal:[~] foo.pl
>qwerty
>
>opal:[~] bar.pl
>Undefined subroutine &Bar::foo called at bar.pl line 4.
Read 'perldoc perltoot'. It will help a lot.
--- Joe M.
------------------------------
Date: Fri, 06 Nov 1998 23:18:25 GMT
From: edrx@my-dejanews.com
Subject: expr -> bytecode -> stdout - how?
Message-Id: <720041$ufj$1@nnrp1.dejanews.com>
How can I show the compiled version (with the opcodes) of a Perl expression?
Is it possible to do that from inside the debugger?
Thanks for any hint,
Edrx
edrx@mat.puc-rio.br
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 06 Nov 1998 23:45:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: expr -> bytecode -> stdout - how?
Message-Id: <Pine.GSO.4.02A.9811061543440.20411-100000@user2.teleport.com>
On Fri, 6 Nov 1998 edrx@my-dejanews.com wrote:
> How can I show the compiled version (with the opcodes) of a Perl
> expression?
Compile perl with -DDEBUGGING, then use the -Dx option. See perlrun for
more info. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 06 Nov 1998 23:53:04 GMT
From: edrx@my-dejanews.com
Subject: expr -> bytecode -> stdout?
Message-Id: <720250$d4$1@nnrp1.dejanews.com>
How do I show the bytecoded version (in a "human" form, with the opcodes) of
a Perl expression? Is it possible to do that from inside the debugger?
Thanks for any hint,
Eduardo Ochs
edrx@mat.puc-rio.br
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 06 Nov 1998 18:13:20 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: Heterogeneous Data Structures: possible? If so, how?
Message-Id: <joe.mcmahon-0611981813200001@prtims.stx.com>
In article <xfkhfwd92z7.fsf@bigger.aa.net>, Charles Roten
<croten@bigger.aa.net> wrote:
>Actually, it's worse than my original post indicated.
>
>Sooner or later, I run into the need for something like _this_ ...
>
> $FireWall_Rule->[7]->{"services"}
>
>has to point to the following wretched sordid _list_-_style_ mess ...
>
> A scalar:
> "IMAP"
> A scalar:
> "pop-3"
> A hash key/value pair, where the key is a string and the value
> is an array-like construct:
> "smtp->In", [ "resource In", "service smtp", \
> {"color", "firebrick}, {"type", "Tcp"}]
>
>This is where matters get ugly. These are three elements in a LIST.
>The first two are _SCALARS_. The third is a _HASH_ key/value PAIR.
>
>
>At this point, I am not at all sure that something like this can be
>done cleanly in Perl. I would _really_ appreciate being proven
>wrong !!
One other note - you might consider wrapping the access to the wretched,
sordid, list-style data structure, however you implement it, in an object.
You can then define your own access functions that don't force you to
scatter the nastiness of accessing this data structure all over your
program.
--- Joe M.
------------------------------
Date: Fri, 6 Nov 1998 16:06:32 -0800
From: Colin Kuskie <ckuskie@cadence.com>
Subject: Re: Index of an element in a list?
Message-Id: <Pine.GSO.3.96.981106155411.17419G-100000@pdxue150.cadence.com>
On 6 Nov 1998, Awrobinson wrote:
> Is there a built-in or effiecient way to determine the index of an
> element in a list? I used the lindex[] function all the time in tcl,
> but I cannot find an equivalent in perl. I know I can build one with a
> for loop or a foreach loop and a counter, but that seems inefficient.
> It would really come in handy for the project I'm working on now.
I'm going to make the dangerous carte-blanche statement:
"Unless your data is sorted, there is no way to improve on the linear
search."
Think about it. Most search algorithms, like binomial depend on the
fact that given information about the current point you can determine
where you want to go next. This implies an order to the data.
lindex is probably just a wrapper around a linear search, so it's no
more efficient than a linear search with foreach. Having said that,
you may want to dig around on CPAN and see if someone has already done
something like this in C and written a module, which will run faster
than Perl.
Good luck,
Colin
------------------------------
Date: Fri, 06 Nov 1998 18:49:37 -0500
From: Stan Towianski <stowians@ford.com>
Subject: Re: List of files to an array...
Message-Id: <36438B10.7CED@ford.com>
I do something like this (where $fpath_to = a directory path):
$cc = "ls -al " . $fpath_to;
#print "cmd to do: =$cc=\n";
#print "output =", `$cc`;
@out = `$cc`;
$maxr = scalar( @out );
$col = 0;
for( $r = 0; $r < $maxr; $r++ )
{
#print "out [", $r, "] =$out[$r]= len =$maxr\n";
@rc = split /\s{1,}/, $out[$r];
...
------------------------------
Date: 6 Nov 1998 23:00:33 GMT
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: MacPerl Help, Please!
Message-Id: <71vv2h$2bn$1@callisto.clark.net>
In <71vo0a$tte$1@news3.icx.net> "Brian Estep" <estepb@ipix.com> writes:
>Hi! I have written a program that checks to see if a website is down, and
>now I need to add functionality to it to page me via email. However, I
>can't seem to get MacPerl to use the standard LIBWWW mail commands (I think
>they are more meant for UNIX.) Has anyone else run into this with MacPerl?
>If so, please help, I'm at a standstill.
What version of MacPerl are you using, and what libwww-perl-5 are you
using? A quick check of the LWP that comes with MacPerl shows it
should do mailto: properly. But you do need to have several $ENV{}
variables set properly for it to work. You can also just directly
send mail using MailTools or Net::SMTP.
If you can't get it to work, at my website,
<http://pobox.com/~schinder/MacPerl.html>, you can find the latest
version of my port of libwww-perl-5 to MacPerl. With the help of
MailTools, it can do mailto: URL's. (However, there shouldn't have
been any changes in that particular part of LWP.)
>Brian Estep
>Interactive Pictures
>--------------------------------------
>DIVX - Watching YOU Watch YOUR Movies!
>--------------------------------------
------------------------------
Date: Fri, 06 Nov 1998 18:19:28 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: Pattern matching
Message-Id: <joe.mcmahon-0611981819280001@prtims.stx.com>
In article <36430894.710694124@news.theplanet.net>, alan@akqa.com wrote:
><<snip>>
>
>Hi, Sorry I forgot to mention that I cannot use modules as the script
>needs to be portable from server to server.
>
As in, you don't want to do the extra work to install the modules in a
directory you have access to, or that the servers you have access to don't
want you to install the modules? If the former, reconsider, please. It'll
save you work. If the latter, my condolences.
It's honestly not a terrible problem to install the modules on multiple
machines if the modules don't use XS (C extensions) code.
--- Joe M.
------------------------------
Date: 06 Nov 1998 17:35:19 -0500
From: Dean Pentcheff <dean2@mail.biol.sc.edu>
Subject: Re: Pattern matching
Message-Id: <m3yapo4fh4.fsf@mail.biol.sc.edu>
alan@akqa.com (Alan Dye) writes:
> <<snip>>
> Hi, Sorry I forgot to mention that I cannot use modules as the script
> needs to be portable from server to server.
>
> >Perl Modules are your friend. You can do something like this with the
> >Text::CSV module:
Note that with a slight bit of hackery, you could incorportate the
necessary parts of the relevant module(s) into your own code. Code
reuse via cut'n'paste lacks the elegance of modules, but it can work.
(Of course, check the licensing arrangements of the modules you wish
to use. Even assuming that you're free to use the code, courtesy
would recommend that you credit the modules' authors in your own
documentation.)
-Dean
--
N. Dean Pentcheff <dean2@mail.biol.sc.edu>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)
------------------------------
Date: Fri, 06 Nov 1998 15:56:36 -0800
From: rdm@cfcl.com (Rich Morin)
Subject: Perl "Too Good" for UCLA's CSUA programming competition...
Message-Id: <rdm-0611981556370001@140.174.42.30>
>From http://www.perl.org/advocacy/chiem.html
Perl "Too Good"
This is a true story. Names have not been changed.
UCLA's Computer Science Undergraduate Association regularly hosts its
programming competition. Contestants are given six complex problems and
have three hours to write programs to solve as many of the problems as
possible. In 1997, the rules stated that any programming language could
be used so long as you solved the problem, so then-undergraduate Keith
Chiem entered and used Perl.
Keith did not merely win, he conquered. He solved five of the six problems
in the three hours allotted. The second-place two-person team solved only
three problems. They, needless to say, were not using Perl.
But if you're a UCLA undergraduate contemplating entering the contest and
using Perl, don't bother. After Keith's conquest, Perl was banned from
the contest.
You've got to admire a language that is banned because it makes problems
too easy to solve.
These days, Keith is a sysadmin at Yahoo! Inc., and is wondering what to do
with the copy of Visual C++ that was his prize.
--
Canta Forda Computer Laboratory | Prime Time Freeware - quality
UNIX consulting, training, & writing | freeware at affordable prices
+1 650-873-7841 | +1 408-433-9662 -0727 (Fax)
Rich Morin, rdm@cfcl.com | www.ptf.com, info@ptf.com
------------------------------
Date: Fri, 06 Nov 1998 17:15:47 -0500
From: dan B hentschel <dbh6913@rit.edu>
Subject: Printing contents of stderr
Message-Id: <36437512.AFD304A9@rit.edu>
I have a program which uses a settings file to deterime how it operates.
This settings file consists only of assignments and comments. Example:
$x = 1;
$y = 'dave';
%ages = ('dave', 22, 'mary', 18, 'fred', 31);
@names = ('kris', 'jim', 'dave', 'nancy', 'mary', 'fred');
The settings file is "require"d in several different perl scripts, all
of which are used together to make a coherent web application. I'd like
to make this settings file editable by someone who doesn't have access
to the web server itself, and so can't edit the text file directly. So I
have a seperate script which will allow someone to edit this file inside
an HTML textarea:
print "<font face=\"Courier\" size=-2>\n";
print "<textarea name=settings rows=20 cols=60>\n";
undef $/;
open(SETTINGS,"idents.cgi") || die $!;
$lines = <SETTINGS>;
close(SETTINGS);
print $lines;
print "</textarea>\n";
print "</font>\n";
Then I have a set of code which will check this edited settings file for
errors before including the changes in the script:
open(SETTINGS,">test.cgi");
print SETTINGS $input{'settings'};
close(SETTINGS);
$output = `./TestIdents`;
if (!$output) { # No output from TestIdents, so there must be
errors
print "You can <a
href=\"moderator.cgi?action=editset&user=$input{'user'}&key=$input{'key'}\">back
up and edit this file</a>.<br><br>\n";
print "There are syntax errors.<br><br>Here is how I interpret
this:<br>\n\n";
open(SETTINGS,"test.cgi");
@lines = <SETTINGS>;
close(SETTINGS);
print "<table border>\n";
foreach $line (@lines) {
$original = $line;
$original =~ s/</</g;
$original =~ s/>/>/g;
$line =~ s/^\n//;
$line =~ s/\$\w*/<font color=green>VARIABLE<\/font>/;
$line =~ s/\@\w*/<font color=green>ARRAY<\/font>/;
$line =~ s/\%\w*/<font color=green>HASH<\/font>/;
$line =~ s/\\'//g;
$line =~ s/\\"//g;
$line =~ s/'[^']*'/<font color=green>VALUE<\/font>/g;
$line =~ s/"[^"]*"/<font color=green>VALUE<\/font>/g;
$line =~ s/#.*\n/<font color=blue>COMMENT<\/font>/;
$line =~ s/;\n//;
$line =~ s/\n/ <font color=red>[NO SEMICOLON]<\/font>/;
print "<tr><td>$original<td>$line\n";;
}
print "</table>\n";
} else { # No syntax errors
print "You can <a
href=\"moderator.cgi?action=editset&user=$input{'user'}&key=$input{'key'}\">back
up and edit this file</a>.\n";
print "<br><br>Or you can <a
href=\"moderator.cgi?action=saveset&user=$input{'user'}&key=$input{'key'}\">use
these settings</a> in the $boardtitle.<br><br>\n";
print $output;
}
And here is the code for the TestIdents script:
#!/usr/local/bin/perl -w
require "test.cgi";
print "No syntax errors!<br><br>\n\n";
print "Here's what I got out of this:<br><br>\n\n";
open(SETTINGS,"test.cgi");
@lines = <SETTINGS>;
close(SETTINGS);
print "<table border>\n";
foreach $line (@lines) {
$line =~ s/#.*//;
if ($line =~ /([\$\@\%]\w*)/) {
if (substr($1,0,1) eq '$') {
$out = eval($1);
} elsif (substr($1,0,1) eq '@') {
@array = eval($1);
$out = '';
foreach (@array) { $out .= " $_," }
chop ($out);
} else {
%hash = eval($1);
$out = '';
foreach (keys(%hash)) { $out .= "($_, $hash{$_}) "; }
}
print "<tr><td>$1<td>$out\n\n";
}
}
print "</table>\n\n";
The way this works is that it trys to run TestIdents, which "require"s
the test settings file which was edited by the user. If there are no
syntax errors, then TestIdents will return a lot of HTML telling about
how the settings files was parsed. If there are syntax errors, then
TestIdents will write an awful lot of helpful information to stderr
about the problems with the settings file. Unfortunately, I don't know
of any way of getting the contents of stderr to go to a web client. So I
have written some code that, in the event of a syntax error, will make
an attempt at analyzing the syntax of the settings file. It works, but I
would still prefer to show the errors written to stderr because they
will often be much more helpful than the code I have written here. Is
there any way that I can put the contents of stderr into a variable so
that I can print them out? I have tried printing the contents of $!
right after calling TestIdents, but that doesn't seem to work. Any help?
dan B hentschel
------------------------------
Date: Fri, 6 Nov 1998 19:23:52 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Processing form
Message-Id: <MPG.10ad5d243b5020889896ff@news.scescape.net>
In article <<36432CDE.D0A486B1@technologist.com>>,
perlguy@technologist.com (Brent Michalski) pounded the following:
=> [snip]
=> #!/usr/bin/perl -w
=>
=> use CGI qw /:standard/;
=> $email = param(email);
=> $msg = param(message);
=> $subj = param(subject);
=>
=> print header;
=>
=> print "<PRE>";
=> print "E-mail: $email\n";
=> print "Msg: $msg\n";
=> print "Subj: $subj\n";
=>
=> #### END OF CODE
=>
=> And here is the output I get:
=>
=> E-mail: e-mail here
=> Msg: this is the message
=> Subj: and I am the subject
=>
AHA! Are you by any chance running via the server? Cause otherwise
you are missing some output (where's the header and <pre>??).
If your running it via the server, the server may be ignoring the
STDERR.
=> [snip]
=> Brent
HTH,
--Matthew
BTW, got 'proper' response on 5.005_02, Windows & Linux.
------------------------------
Date: Sat, 07 Nov 1998 08:17:57 +0800
From: critize <critize@hotmail.com>
Subject: Search Engine
Message-Id: <364391B5.7FC9@hotmail.com>
Hi !
Anybody has any ideas on developing Search Engine with the Perl5 ??
Or any link or resources that I could lay my hands on..>
Thanks..
Bye
------------------------------
Date: Sat, 07 Nov 1998 00:30:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Search Engine
Message-Id: <Pine.GSO.4.02A.9811061629410.20411-100000@user2.teleport.com>
On Sat, 7 Nov 1998, critize wrote:
> Anybody has any ideas on developing Search Engine with the Perl5 ??
It sounds as if you want to write a CGI program. The docs, FAQs, and
newsgroups about CGI programming would be a good place to start. Good
luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 06 Nov 1998 23:04:51 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: select case?
Message-Id: <Pine.GSO.4.02A.9811061504280.20411-100000@user2.teleport.com>
On Fri, 6 Nov 1998, Philip Snyder wrote:
> I was searching for the equivalent of select case in VB or switch
> in C/C++.
Did you do any of your searching in the FAQ? :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 07 Nov 1998 00:21:07 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Philip Snyder <prsnyder@bewley.net>
Subject: Re: select case?
Message-Id: <m31zngs90c.fsf@joshua.panix.com>
Philip Snyder <prsnyder@bewley.net> writes:
> This is a cryptographically signed message in MIME format.
Why on Earth?
> Hi... I was searching for the equivalent of select case in VB or switch
> in C/C++. Does anyone know of such a thing?
perlfaq7 addresses this.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Sat, 07 Nov 1998 00:32:11 +0000
From: Mark Simonetti <marks@webleicester.co.uk>
Subject: Re: Shared CGI.pm from various directories
Message-Id: <3643950B.A6464168@webleicester.co.uk>
okay so I forgot the quotes :p:p
push(@INC, 'whatever');
Mark.
--
Tom Phoenix wrote:
> On Fri, 6 Nov 1998, Mark Simonetti wrote:
>
> > push(@INC, /somepath/somepath/blah/blah);
> > use CGI;
>
> What happened when you tried this before posting. Ouch!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 07 Nov 1998 00:40:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Shared CGI.pm from various directories
Message-Id: <Pine.GSO.4.02A.9811061639180.20411-100000@user2.teleport.com>
On Sat, 7 Nov 1998, Mark Simonetti wrote:
> Tom Phoenix wrote:
>
> > On Fri, 6 Nov 1998, Mark Simonetti wrote:
> >
> > > push(@INC, /somepath/somepath/blah/blah);
> > > use CGI;
> >
> > What happened when you tried this before posting. Ouch!
> okay so I forgot the quotes :p:p
>
> push(@INC, 'whatever');
Okay, so you forgot the quotes. What happened _this_ time when you tried
it before posting? Ouch again!
Hint: 'use' is compile time, 'push' is run time. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 6 Nov 1998 23:25:26 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: shift in a list context
Message-Id: <7200h6$ra6$0@206.165.167.248>
>>Empiricism is dead, it seems...
>
>
>ROTFL, twice in one day. The other was when I was backtracking and read a
>response from brian d foy in which he responded to a question of similar
>intellectual inquisitiveness:
>
>Don't guess, this isn't sociology.
>
Oops correct quote:
you can't just guess at things and expect them to work. this isn't
sociology.
------------------------------
Date: Fri, 6 Nov 1998 16:08:54 -0800
From: Colin Kuskie <ckuskie@cadence.com>
Subject: Re: shift in a list context
Message-Id: <Pine.GSO.3.96.981106160704.17419H-100000@pdxue150.cadence.com>
On 6 Nov 1998, Awrobinson wrote:
> I haven't seen this stated anywhere, so I thought I would ask. Can I use a
> single shift() operation to retrieve more than one element? If I coded
> something like:
>
> sub mysub {
> ( $first, $second ) = shift;
>
> would I get the first two elements of @_?
RTM, shift and pop only return one element. If you want more
than one, then use splice(). Or use shift several times:
my $first = shift;
my $second = shift;
^^
Note the use of my, which is enforced by 'use strict;'. You are using
'use strict' and the '-w' switch, and checking the manual pages (try
using perldoc perlfunc) and the FAQ (www.perl.com) right? :)
Colin
------------------------------
Date: Fri, 06 Nov 1998 23:57:29 GMT
From: bigcheese@my-dejanews.com
Subject: Split Variables?
Message-Id: <7202d9$go$1@nnrp1.dejanews.com>
I've been looking around for a script or something that splits up a variable
(in this case taken from a form)
I need it to take something like
"kamura eta"
and write img srcs for
ka,mu,ra, (space), e, and ta
can anyone help me?
Thanks a bunch,
-Dan
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4170
**************************************