On Wed, May 09, 2001 at 12:25:01AM -0700, Bob Miller wrote:
> Jacob Meuser wrote:
>
> > No variables in perl?!?!?!?
>
> I think Rob meant that Perl subroutines don't have named arguments.
Ah, I thought I was missing something there.
> Whereas in (non-ANSI) C you would write:
>
> myfunc(first, second, third)
> { /* ... */ }
>
> In Perl you have to do the this.
>
> sub myfunc($$$) {
> my ($first, $second, $third) = @_;
> # ...
> }
>
> Or, you can avoid the second line and use $_[0] or shift to access
> $first without naming it.
>
> My opinion: skipping the line that names the arguments is just ugly.
> When other people do it, they make their code hard to read. (I very
> rarely do it.)
>
True, relying on perl's special variables can be confusing, although
I do like $_, especially in short loops that just iterate over arrays.
foreach (@list) {
print "$_\n";
}
A little confusing, but also quite elegant ;) Isn't perl for admittedly
lazy people anyway? I mean, lazy as in work smart, not hard.
> > One other thing to note - perl is standard on almost every Unix-like
> > OS. Python is not, at least not yet. I would venture to say that mod_perl
> > is in wider use than mod_python, if you're looking for web usage.
>
> I think I read that mod_php is the most popular Apache extension.
>
Probably so. Has anyone used php-gtk? How does it compare to perl/tk?
> > The interactive interpreter in python is kewl though. It would be nice
> > to have a kind of "perlsh" ... maybe for perl 6 ...
>
> Try "perl -de0".
>
Cool! That beats the hell out of trying out stuff in long "perl -e ''"
lines. Is there a quick way to unset all the variables used in a session?
<[EMAIL PROTECTED]>
> --
> Bob Miller K<bob>
> kbobsoft software consulting
> http://kbobsoft.com [EMAIL PROTECTED]
>