[22092] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4314 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 26 18:05:47 2002

Date: Thu, 26 Dec 2002 15:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 26 Dec 2002     Volume: 10 Number: 4314

Today's topics:
        Fashion Show - Designer Bian Variani <bian@variani.com>
    Re: File::Find module ; want to resume search from poin <bik.mido@tiscalinet.it>
        generate a line of code on the fly (squillion)
    Re: generate a line of code on the fly <NO.koos.JUNK.pol.MAIL@raketnet.nl>
    Re: generate a line of code on the fly <squillion@hotmail.com>
    Re: generate a line of code on the fly (Jay Tilton)
        Getting Connecting Host Info from inetd <gk@pobox.com>
    Re: help missing module  <jaster@home.still>
    Re: I can't remove the \n please help me! (Mala Ananthamurthy)
    Re: invoking labelnation.pl - unknown error message (steveR)
    Re: invoking labelnation.pl - unknown error message <mgjv@tradingpost.com.au>
    Re: Is there a perl command equivalent to su - user ? <spamtrap@bd-home-comp.no-ip.org>
        pre declare a split variables <blnukem@hotmail.com>
    Re: Simple array problem (Stephen Adam)
    Re: Stat() function not working.  Kind of... <dha@panix3.panix.com>
    Re: The Superiority of PHP over Perl <mgjv@tradingpost.com.au>
    Re: The Superiority of PHP over Perl (=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=)
    Re: The Superiority of PHP over Perl <emdelNOSPAM@noos.fr>
    Re: The Superiority of PHP over Perl <murat.uenalan@gmx.de>
        What does symlink point to? <jmchambers@rcn.com>
    Re: What does symlink point to? <tony_curtis32@yahoo.com>
    Re: What does symlink point to? <spamtrap@bd-home-comp.no-ip.org>
    Re: What does symlink point to? <spamtrap@bd-home-comp.no-ip.org>
    Re: which UI for Perl? <murat.uenalan@gmx.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 26 Dec 2002 11:17:35 GMT
From: Bian Variani<bian@variani.com>
Subject: Fashion Show - Designer Bian Variani
Message-Id: <jzBO9.169139$Qr.4204576@news3.calgary.shaw.ca>

Experience acclaimed fashion designer Bian Variani   http: //www.bianvariani.com

(Fashion Design Council of Canada) as he introduces the catwalk as never
seen before. 

High energy entertainment featuring 2003 collection of Urban, Couture and
Lingerie. Reciently back from Milan, Bian Variani, introduces Euro-Fashion
for trendsetters & stylists. 

Special guest appearance by Kiara Hunter http://www.kiarahunter.com returning
from her highly successful 22 city UK promotional tour with Virgin's "Atomic
Kitten”. 

A must see for fashion enthusiasts in both the local and the international
scene. 

Tickets are $10 in advance or $15 at the door. (Tickets available at Au Bar)

Show Details:

Where: Au Bar - 674 Seymour (At Georgia), Vancouver 
When: Friday, January 17, 2003
Time: 8:00 PM 
Age: 19 and over 
Dress Code: Formal
Scene: Euro, Fashion, Hipster/Stylish 
Music: Hip Hop , Pop/Top 40 



------------------------------

Date: Thu, 26 Dec 2002 14:26:23 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: File::Find module ; want to resume search from point of failure.
Message-Id: <s2vl0v82a89tdhs5kroa9l3v9b48h82ua7@4ax.com>

On Tue, 24 Dec 2002 11:07:05 GMT, Bart Lateur <bart.lateur@pandora.be>
wrote:

>The *order* in which the files per directory are processed, is almost
>random: it's the same order as readdir() returns the files in, for a not

If he is concerned about *order*, he could preprocess the files for
each directory (as I suggested in my other post wrt a slightly
different matter):

#!/usr/bin/perl -lw

use strict;
use File::Find;

File::Find::find({ preprocess => 
		       sub { return sort {lc $a cmp lc $b} @_  },
		   wanted => 
		       sub { print $File::Find::name } 
                 }, '.');
__END__


Michele
-- 
>It's because the universe was programmed in C++.
No, no, it was programmed in Forth.  See Genesis 1:12:
"And the earth brought Forth ..."
- Robert Israel on sci.math, thread "Why numbers?"


------------------------------

Date: 26 Dec 2002 09:41:20 -0800
From: squillion@hotmail.com (squillion)
Subject: generate a line of code on the fly
Message-Id: <81016f2d.0212260941.47581a5e@posting.google.com>

my subroutine get_ref returns a reference to an anonymous subroutine. 
sometimes the parameters to be passed to the anonymous subroutine are
known at compile time.  sometimes the parameters to be passed to the
anonymous subroutine are not known until runtime.  get_ref caters for
the two cases thusly:

use strict;
use warnings;

my $f1=get_funcref("compile-time");
my $f2=get_funcref();

$f1->("this string is ignored");
$f2->("run-time");

sub get_funcref {
  my $arg=shift();
  if ($arg) {
    sub {
      print "compile time arg: >$arg<\n";
    };
  }else{
    sub {
      my $arg=shift();
      print "runtime arg: >$arg<\n";
    }
  }
}

output -
compile time arg: >compile-time<
runtime arg: >run-time<

this does what i need.  but in reality the two anonymous subroutines
which can be returned by get_funcref are huge and identical except for
the sole difference that the second anonymous subroutine has as its
first line

      my $arg=shift();

whereas the first anonymous subroutine does not.  so i would like for
get_funcref to generate that line dynamically depending upon whether
an argument was supplied to get_funcref.  conceptually it would look
something like this:

sub get_funcref {
  my $arg=shift();
  my $line=$arg?"":"my \$arg=shift()";
  sub {
    $line;
    print "arg: >$arg<\n";
  };
}

but that doesn't work as written, nor can i find a way to do it with
eval ... can it be done?


------------------------------

Date: Thu, 26 Dec 2002 20:13:15 +0100
From: Koos Pol <NO.koos.JUNK.pol.MAIL@raketnet.nl>
Subject: Re: generate a line of code on the fly
Message-Id: <aufkcc$6r3qc$1@ID-171888.news.dfncis.de>

On donderdag 26 december 2002 18:41 squillion wrote:

> my subroutine get_ref returns a reference to an anonymous subroutine.
> sometimes the parameters to be passed to the anonymous subroutine are
> known at compile time.  sometimes the parameters to be passed to the
> anonymous subroutine are not known until runtime.  get_ref caters for
> the two cases thusly:
> 
> use strict;
> use warnings;
> 
> my $f1=get_funcref("compile-time");
> my $f2=get_funcref();
> 
> $f1->("this string is ignored");
> $f2->("run-time");


You make a thinking error here. The compile/runtime concept is irrelevant 
for this case. The arguments do not count or matter in creating the 
function ref. Thus, conceptually:

  $f1 == $f2 == get_funcref() == get_funcref(@arguments);


> ...
> this does what i need.  but in reality the two anonymous subroutines
> which can be returned by get_funcref are huge and identical except for
> the sole difference that the second anonymous subroutine has as its
> first line
> 
>       my $arg=shift();


You can shift the world back and forth if you like: when nothing is passed, 
nothing is gotten. So you can safely run something like:

f1 = sub {
    my @args = @_;
    if ( @ args ) {
        # i did get arguments, so lets do someting with them
    } else {
        # no arguments. can to to sleep again.
    }
}


Does this answer your question, or have I misunderstood you?

HTH,
-- 
KP
koos _ pol @ raketnet nl


------------------------------

Date: Thu, 26 Dec 2002 21:21:24 +0000 (UTC)
From: "squillion" <squillion@hotmail.com>
Subject: Re: generate a line of code on the fly
Message-Id: <aufrsk$h57$1@helle.btinternet.com>

> You make a thinking error here. The compile/runtime concept is irrelevant
> for this case. The arguments do not count or matter in creating the
> function ref. Thus, conceptually:
>
>   $f1 == $f2 == get_funcref() == get_funcref(@arguments);

you misunderstand.  consider again my original function:

sub get_funcref {
  my $arg=shift();
  if ($arg) {
    sub {
      print "compile time arg: >$arg<\n";
    }
  }else{
    sub {
      my $arg=shift();
      print "runtime arg: >$arg<\n";
    }
  }
}

(i am misusing the term "compile time".  by "compile time" i am not
referring to the moment when the perl script is compiled, but rather to the
moment when the reference to the anonymous subroutine is created - whereas
by "run time" i mean the moment when the anonymous subroutine is executed).

get_funcref returns one of two completely different anonymous subroutines.
the first anonymous subroutine takes no arguments (or ignores any which are
passed), in this anonymous subroutine the $arg is the $arg which is in scope
at the moment the reference to the anonymous subroutine is created.  it so
happens that the $arg here is taken from the arguments passed to
get_funcref.  the second anonymous subroutine ignores the $arg which is in
scope when it is created, and instead declares its own $arg which gets its
value from the arguments passed to the anonymous subroutine each time it is
run.

get_funcref could be broken into two completely different subroutines, for
clarity i add return statements:

sub get_funcref_runtime {
    my $funcref=sub {
#    the shift below picks up the arguments passed to the anonymous
subroutine when it is invoked
      my $arg=shift();
#    the $arg below takes its value from arguments passed to the anonymous
subroutine
      print "runtime arg: >$arg<\n";         };
    return $funcref;
}

sub get_funcref_compiletime {
# the shift below picks up the arguments passed to get_funcref_compiletime
  my $arg=shift();
      my $funcref=sub {
#    the $arg below takes its value from arguments passed to
get_funcref_compiletime
      print "compile time arg: >$arg<\n";
    };
    return $funcref;
}

these two mechanisms are substantially different.  no offense but it's
evident that that you haven't grasped the difference, you should try to work
through this.

in my application, instead of just printing out the arguments, the two
anonymous subroutines are quite long.  they only differ in that one of the
anonymous subroutines has as its first line "my $arg=shift();" while the
other does not.  so i'm looking for some clever trickery to create this line
on the fly rather than typing in two near-identical routines in their
entirety.




------------------------------

Date: Thu, 26 Dec 2002 22:56:51 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: generate a line of code on the fly
Message-Id: <3e0b88b4.160943406@news.erols.com>

squillion@hotmail.com (squillion) wrote:

: my subroutine get_ref returns a reference to an anonymous subroutine. 
: sometimes the parameters to be passed to the anonymous subroutine are
: known at compile time.  sometimes the parameters to be passed to the
: anonymous subroutine are not known until runtime.  

I get it, but I would discourage that use of "compile time" and "run
time."  Their meanings do not sync with the meanings Perl users expect
them to have.  Bending old terms into new meanings will always cause
confusion.

I'd probably change them to something like "anonymous subroutine
definition time" and "anonymous subroutine call time."

: get_ref caters for the two cases thusly:
: 
: use strict;
: use warnings;
: my $f1=get_funcref("compile-time");
: my $f2=get_funcref();
: $f1->("this string is ignored");
: $f2->("run-time");
: sub get_funcref {
:   my $arg=shift();
:   if ($arg) {
:     sub {
:       print "compile time arg: >$arg<\n";
:     };
:   }else{
:     sub {
:       my $arg=shift();
:       print "runtime arg: >$arg<\n";
:     }
:   }
: }
: 
: output -
: compile time arg: >compile-time<
: runtime arg: >run-time<
: 
: this does what i need.  but in reality the two anonymous subroutines
: which can be returned by get_funcref are huge and identical except for
: the sole difference that the second anonymous subroutine has as its
: first line
: 
:       my $arg=shift();
: 
: whereas the first anonymous subroutine does not.  so i would like for
: get_funcref to generate that line dynamically depending upon whether
: an argument was supplied to get_funcref.

How's this grab you:

    sub get_funcref {
        my $orig_arg = shift;
        sub{
            my $arg = defined $orig_arg ? $orig_arg : shift;
            print $arg
        }
    }



------------------------------

Date: Thu, 26 Dec 2002 11:11:13 -0500
From: George Kuetemeyer <gk@pobox.com>
Subject: Getting Connecting Host Info from inetd
Message-Id: <auf9l5$5kl$1@omle.tju.edu>

I want to use inetd to kick off a Perl script. How can the script itself 
determine connecting host info, since inetd is brokering connections?

TIA.

GK



------------------------------

Date: Thu, 26 Dec 2002 15:15:37 GMT
From: "jaster" <jaster@home.still>
Subject: Re: help missing module 
Message-Id: <t2FO9.1093$6z5.622285889@newssvr11.news.prodigy.com>

Thanks for the reply.   Yes it is perl-Digest-MD5-2.20.1 and MIME::Base64 is
another missing module although these are shown as installed.

$ rpm -qa perl*
perl-HTML-Tagset-3.03-3
perl-Parse-Yapp-1.04-3
perl-XML-Encoding-1.01-2
perl-libxml-enno-1.02-5
perl-CPAN-1.59_54-26.72.3
perl-Digest-MD5-2.20-1
perl-HTML-Parser-3.25-2
perl-MIME-Base64-2.12-6
perl-Storable-0.6.11-6
perl-libwww-perl-5.53-3
perl-XML-Grove-0.46alpha-3
perl-libxml-perl-0.07-5
perl-XML-Dumper-0.4-5
perl-DB_File-1.75-26.72.3
perl-SGMLSpm-1.03ii-4
perl-5.6.1-26.72.3
perl-IO-stringy-2.108-2
perl-DateManip-5.39-5
perl-libnet-1.0703-6
perl-URI-1.12-5
perl-XML-Parser-2.30-7
perl-XML-Twig-2.02-2
perl-NDBM_File-1.75-26.72.3
perl-CGI-2.752-26.72.3
perl-MailTools-1.44-2
$


"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:3E0A7BB1.2050506@rochester.rr.com...
> jaster wrote:
>
> > Happy holiday to everyone.
> > I'm using RH7.2 w/ Perl 5.6.1 but now if I " use Digest::MD5 "  I get an
> > error module not found.   I installed perl-Digest-2.20 and my rpm -qa
perl*
> > shows the module is installed.   Any idea what I need to do to fix this
> > problem?   Thanks for all help.
>
>
> Are you sure that it isn't Digest-MD5-2.20 that you want?
>
> --
> Bob Walton
>




------------------------------

Date: 26 Dec 2002 11:09:06 -0800
From: mala_mukund@yahoo.com (Mala Ananthamurthy)
Subject: Re: I can't remove the \n please help me!
Message-Id: <11729251.0212261109.23fa1c88@posting.google.com>

DUCLOS <rduc@apogee-com.fr> wrote in message news:<20021224-10583-156362@foorum.com>...
> Yes, many thanks, It's Ok.

Actually, I meant to type in the ~m match operator instead of substitution.


------------------------------

Date: 26 Dec 2002 02:02:21 -0800
From: steve@richsoft.fsbusiness.co.uk (steveR)
Subject: Re: invoking labelnation.pl - unknown error message
Message-Id: <b4667172.0212260202.42ffdb6f@posting.google.com>

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnb0jcqk.3l7.tadmc@magna.augustmail.com>...
> steveR <steve@richsoft.fsbusiness.co.uk> wrote:
> 
> > hi, when I run labelnation.pl on SuSE 8.1 (perl 5.8) (standard
> > installation)
> 
> 
> What is labelnation.pl?
> 
> 
> > I get the following error messages:
> > labelnation.pl: line 27: use: command not found
> > labelnation.pl: line 31: my: command not found
> 
> 
> Those messages are not from perl, you can tell because they
> do not appear in perldiag.pod.
> 
> They are shell error messages.
> 
> 
> > In the distant passed I have had this script running on FreeBSD - so I
> > am at a loss to see why it will not work now.
> 
> 
> perl is probably installed in a different place.
> 
> 
> > ps. I do not understand the first three line of this script
> 
> 
> If you show us the first 3 lines of that script, then we might
> be able to help debug it.
> 
> Debugging unseen code is Really Hard.  :-)
> 
> 
> > it seems to suggest that various shells can run it!!
> 
> 
> Apparently so, since you are getting messages from the shell.
> 
> Since you didn't give us the code, we can only guess what is happening:
> 
> 1) there is no shebang (#!) line, so the file is fed to the
>    default interpreter, such as /bin/sh
> 
> 2) the program uses the chicanery described in perlrun.pod in
>    an attempt to run perl without knowing where perl is installed.
> 
> 
> > any help greatfully appreciated - Steve
> 
> 
> Either:
> 
> 1) invoke without using the shebang line:
> 
>    perl labelnation.pl
> 
> or:
> 
> 2) modify the program with a shebang line appropriate for your system:
> 
>    #!/usr/bin/perl
> 
> try "which perl" or "whereis perl" to find out what is appropriate 
> for your system.

hi, thanks for a quick response, I have found it, some how I had put a
# on line 2.....

it now works

I still fail to understand for the need of lines 1 and 2 - most
confusing

thanks to all

steve

ps: the prog produces mailing labels via postscript - really good

#!/bin/sh
exec perl -w -x $0 ${1+"$@"} # -*- mode: perl; perl-indent-level: 2;
-*-
#!perl -w

### Label Nation (labelnation.pl): command-line label printing
### Copyright (C) 2000  Karl Fogel <kfogel\@red-bean.com>
### 
### This program is free software; you can redistribute it and/or
modify
### it under the terms of the GNU General Public License as published
by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.
### 
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
### 
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
02111-1307  USA
###
### Run with "--help" flag to see options.
### 
### By "label", I mean address labels, business cards, or any other
### rectangles arranged regularly on a printer-ready sheet.

use strict;

################ Globals ###################

my $Type              = "";      # A predefined label type
my $Infile            = "";      # Holds PostScript code or text lines
my $Line_Input        = 0;       # One kind of input $Infile can hold.
my $Code_Input        = 0;       # Another kind of input $Infile can
hold.
my $Param_File        = "";      # Holds label dimensions
my $Delimiter         = "";      # Separates labels in multi-label
files
my $Show_Bounding_Box = 0;       # Set iff --show-bounding-box option

my $Left_Margin       = -1;      # First label from left starts here.
my $Bottom_Margin     = -1;      # First label from bottom starts
here.
my $Label_Width       = -1;      # Does not include unused inter-label
space.
my $Label_Height      = -1;      # Does not include unused inter-label
space.
my $Horiz_Space       = -1;      # Unused inter-label horizontal
space.
my $Vert_Space        = -1;      # Unused inter-label vertical space.
my $Horiz_Num_Labels  = -1;      # How many labels across?
my $Vert_Num_Labels   = -1;      # How many labels up and down?
my $First_Label       = 1;       # Start printing here.
my $Font_Name         = "";      # Defaults to Times-Roman
my $Font_Size         = "";      # Defaults to 12
my $Outfile           = "";      # Defaults to labelnation.ps

# The version number is automatically updated by CVS.
my $Version = '$Revision: 1.38 $';
$Version =~ s/\S+\s+(\S+)\s+\S+/$1/;

my $Inner_Margin = 1;

############## End Globals #################



### Code.

&parse_options ();


------------------------------

Date: Thu, 26 Dec 2002 21:32:52 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: invoking labelnation.pl - unknown error message
Message-Id: <slrnb0lmmj.4tt.mgjv@martien.heliotrope.home>

On 26 Dec 2002 02:02:21 -0800,
	steveR <steve@richsoft.fsbusiness.co.uk> wrote:

[snip discussion of Perl program being run as shell program]

> hi, thanks for a quick response, I have found it, some how I had put a
> # on line 2.....
> 
> it now works
> 
> I still fail to understand for the need of lines 1 and 2 - most
> confusing

> #!/bin/sh
> exec perl -w -x $0 ${1+"$@"} # -*- mode: perl; perl-indent-level: 2;
> -*-
> #!perl -w

See the perlrun documentation for an explanation of this, even though
this particual instance of it is odd. You also seem to have some editor
directives in that second line (emacs?).

This means that a bourne shell will be used to run the program. The
first thing the bourne shell does is exec perl with the given arguments.
The -x argument tells perl to skip all lines until the first line that
starts with #! and has perl in it. You use this sort of thing if your OS
refuses to execute scripts with anything but a standard set of
interpreters, or if you want to make sure that whichever perl is in the
path first gets executed, instead of a hardcoded path.

I think that all that stuff after "# -*- mode:" tells emacs what sort of
code this file contains and how to indent it.

Normally, the above three lines would be replaced by a single line:

#!/path/to/perl -w

> use strict;

Good.

[snip of very large list of lexically scoped variables]

> &parse_options ();

Don't call subroutines this way, unless you really need that ampersand.
See the perlsub documentation for an explanation of the difference
between what you do, and what most people would do:

parse_options();

Martien
-- 
                        | 
Martien Verbruggen      | The Second Law of Thermodenial: In any closed
                        | mind the quantity of ignorance remains
                        | constant or increases.


------------------------------

Date: Thu, 26 Dec 2002 20:09:42 GMT
From: bd <spamtrap@bd-home-comp.no-ip.org>
Subject: Re: Is there a perl command equivalent to su - user ?
Message-Id: <2infua-0ju.ln@ID-151211.user.cis.dfn.de>

Mitchell Laks wrote:

>> Anno Siegel wrote:
>> 
>>> According to Mitchell Laks <mlaks2000@yahoo.com>:
> 
>>> If you are running under root, you can change the effective userid
>>> through Perl's $> variable.  (You can also change the real userid ($<),
>>> but then you won't be able to switch back to root.)  Whether that will
>>> convince your database that you are the right user must be seen.
>>> 
>>> Anno
>> 
> bd wrote:
>> There's probably a flag that can be passed to the database.
> Thanks for the suggestions. I tried the $> variable setting, and it didn't
> work, because Postgres rejected me as root, however with setting the
> $< variable as well it worked. Unfortunately, as Anno pointed out, then I
> am locked in to being the nonsuperuser...

Have you tried -U?
-- 
Replace spamtrap with bd to reply.
It is clear that the individual who persecutes a man, his brother, because
he is not of the same opinion, is a monster.
- Voltaire



------------------------------

Date: Thu, 26 Dec 2002 21:59:48 GMT
From: "Blnukem" <blnukem@hotmail.com>
Subject: pre declare a split variables
Message-Id: <oZKO9.160371$a8.28592@news4.srv.hcvlny.cv.net>

When I pre declare a split variables "$data_sting" why do they not work ?

Snipped Code:

open DBASE, ("<users.dat");
@allusers = <DBASE>;
close(DBASE);

my $data_sting = "$name,$age,$phone";

foreach $user (@allusers){
chomp($user);
($data_sting) = split (/\|/, $user);

print "Name:$name Phone:$phone<br>";

}




------------------------------

Date: 26 Dec 2002 06:51:37 -0800
From: 00056312@brookes.ac.uk (Stephen Adam)
Subject: Re: Simple array problem
Message-Id: <945bf980.0212260651.72a0f20d@posting.google.com>

Cheers for the help guys!

I have kinda got the hang of the difference between $array and @array,
odd syntax but then perl seems to be quite a eclectic languge. Not
going to woory about hashes just yet as I am only going to compare a
small range of some arrays to search for a small string. Anyways
cheers Bob and Andrew.


Festive farewellels 

Steve


------------------------------

Date: Thu, 26 Dec 2002 08:21:47 +0000 (UTC)
From: "David H. Adler" <dha@panix3.panix.com>
Subject: Re: Stat() function not working.  Kind of...
Message-Id: <slrnb0lf0q.eid.dha@panix3.panix.com>

In article <slrnb0kd9b.43e.tadmc@magna.augustmail.com>, Tad McClellan wrote:
> 
> The first sentence of my followup would have helped with many
> future problems, as well as with just the problem de jure.

Surely you mean "du jour".

Well, it's not like I'll ever get the chance to correct your perl. :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
And finally, it appears that Schwern, Michael is an Alien Drag Queen
    - Leon Brocard, London.pm List Weekly Summary 2001-03-19
    (This has *something* to do with http://us.imdb.com/Title?0103645)


------------------------------

Date: Thu, 26 Dec 2002 20:13:30 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: The Superiority of PHP over Perl
Message-Id: <slrnb0li1q.4tt.mgjv@martien.heliotrope.home>

On Thu, 26 Dec 2002 03:39:31 GMT,
	bd <spamtrap@bd-home-comp.no-ip.org> wrote:
> Martien Verbruggen wrote:
> 
>> On Thu, 26 Dec 2002 01:23:33 GMT,
>> cybear <cybear@pacbell.net> wrote:
>>> Egg Troll wrote:
>>> 
>>>> Hello Usenet,
>>>> 
>>>> Recently I've had a chance to do some web design with PHP. Previously
>>>> I'd used Perl because I'd heard from many people that Perl was the end
>>>> all and be all of scripting languages for the web. Imagine my suprise
>>>> to discover that PHP was vastly superior! I know this is a bold
>>>> statement, but I have solid arguements to support it.
>>>> 
>>> 
>>> I like using PHP as a web scripting language, BUT, web scripting is NOT
>>> the only scripting that is done. Perl works well for all my other
>>> scripting language. If a person wants to learn just one scripting
>>> language to do everything, Perl wins.
>> 
>> Don't respond to this troll.
>> 
>> Martien
> 
> I fail to see how it's a troll. It's an informed opinion. You may not agree 
> with it. If so, please state your reasons. Don't just accuse them of being 
> a troll.

History. Do a google search. Also check the crosspostings.

Martien
-- 
                        | 
Martien Verbruggen      | We are born naked, wet and hungry. Then
                        | things get worse.
                        | 


------------------------------

Date: 26 Dec 2002 11:32:45 +0100
From: mru@users.sourceforge.net (=?iso-8859-1?q?M=E5ns_Rullg=E5rd?=)
Subject: Re: The Superiority of PHP over Perl
Message-Id: <yw1xy96doysy.fsf@gladiusit.e.kth.se>

                                  ___________________
                          /|  /|  |                  |
                          ||__||  |      Please do   |
                         /   O O\__         NOT      |
                        /          \     feed the    |
                       /      \     \     trolls     |
                      /   _    \     \ ______________|
                     /    |\____\     \     ||
                    /     | | | |\____/     ||
                   /       \|_|_|/   \    __||
                  /  /  \            |____| ||
                 /   |   | /|        |      --|
                 |   |   |//         |____  --|
          * _    |  |_|_|_|          |     \-/
       *-- _--\ _ \     //           |
         /  _     \\ _ //   |        /
       *  /   \_ /- | -     |       |
         *      ___ c_c_c_C/ \C_c_c_c____________

-- 
Måns Rullgård
mru@users.sf.net


------------------------------

Date: 26 Dec 2002 21:34:57 GMT
From: Emmanuel Delahaye <emdelNOSPAM@noos.fr>
Subject: Re: The Superiority of PHP over Perl
Message-Id: <Xns92F0E5B93DA9hsnoservernet@130.133.1.4>

In 'comp.lang.c', eggtroll@yahoo.com (Egg Troll) wrote:

> Recently I've had a chance to do some web design with PHP. Previously
> I'd used Perl because I'd heard from many people that Perl was the end

<snip OT on clc>

Please don't post that stuff to comp.lang.c. We don't ever know what Pearl or 
PHP mean...

-- 
-ed- emdel at noos.fr ~]=[o
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
C-library: http://www.dinkumware.com/manuals/reader.aspx
"Mal nommer les choses c'est ajouter du malheur au monde."
-- Albert Camus.


------------------------------

Date: Thu, 26 Dec 2002 23:29:46 +0100
From: "Murat Ünalan" <murat.uenalan@gmx.de>
Subject: Re: The Superiority of PHP over Perl
Message-Id: <aufvtl$41p$00$1@news.t-online.com>

> Perl's OO already supports introspection, reflection, and
> self-replication to a degree.

 ..to a degree. Did you introspect methods (not subs) and attributes
from a give class/package.

> For introspection/reflection, one can use the UNIVERSAL:: methods "can"
> and "isa"; also, one can look at the @ISA tree of a class directly, and
> the %SymbolTable:: of a class directly.

Aaargh... this is mostly not helpfull. Show me how you introspect module
methods (not funcs/subs) and attributes ?! Its impossible.

> I've never had a problem with this.  It's possible to go out of your way
> to write *unportable* code, of course, but writing portable code isn't
> the least bit difficult.

I bang my head nearly weekly against my monitor, because *nix-vs-win
compability.
Any statistics from the cpantesters would reveal that. This is mostly
because of ignorance.

Murat





------------------------------

Date: Thu, 26 Dec 2002 11:20:26 -0500
From: John Chambers <jmchambers@rcn.com>
Subject: What does symlink point to?
Message-Id: <3E0B2C4A.4080509@rcn.com>


Funny that I can't seem to find anything mentioning this in any of
the docs or FAQs.  Maybe I just can't guess the right keywords?
Searches for "symlink" or "sym *link" don't seem to find anything
remotely helpful.

Anyhow, the problem is reading the contents of a symlink. Not the
data of the file that it points to; I'm trying to get the name of
the file that a symlink points to.

One obvious way is to run
   @lines = `ls -l foo`;
and then grovel through ls's output, using pattern matching to
extract the file name.  This isn't difficult, of course, but it's
kinda slow.  It requires firing up a subprocess and running matches
on the output.  All this to read the contents of a file.  In the
case that I'm looking at, doing this approximately triples the
run time of the program.

It seems like there oughta be a simple, elegant way to get this
information directly, without running subprocesses. (After all,
ls returns the link's contents, and it probably doesn't run an
ls subprocess to get the string. ;-)

Is there some place that lstat puts the string?

Is this answered in some FAQ that I haven't found?




------------------------------

Date: Thu, 26 Dec 2002 11:13:55 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: What does symlink point to?
Message-Id: <87y96cya7g.fsf@limey.hpcc.uh.edu>

>> On Thu, 26 Dec 2002 11:20:26 -0500,
>> John Chambers <jmchambers@rcn.com> said:

> Anyhow, the problem is reading the contents of a
                         ^^^^
> symlink. Not the data of the file that it points to; I'm
     ^^^^
> trying to get the name of the file that a symlink points
> to.

perldoc -f readlink

hth
t


------------------------------

Date: Thu, 26 Dec 2002 20:09:42 GMT
From: bd <spamtrap@bd-home-comp.no-ip.org>
Subject: Re: What does symlink point to?
Message-Id: <cenfua-0ju.ln@ID-151211.user.cis.dfn.de>

John Chambers wrote:

> 
> Funny that I can't seem to find anything mentioning this in any of
> the docs or FAQs.  Maybe I just can't guess the right keywords?
> Searches for "symlink" or "sym *link" don't seem to find anything
> remotely helpful.
> 
> Anyhow, the problem is reading the contents of a symlink. Not the
> data of the file that it points to; I'm trying to get the name of
> the file that a symlink points to.

Try readlink.
-- 
Replace spamtrap with bd to reply.
BOFH Excuse #423:

It's not RFC-822 compliant.



------------------------------

Date: Thu, 26 Dec 2002 20:09:42 GMT
From: bd <spamtrap@bd-home-comp.no-ip.org>
Subject: Re: What does symlink point to?
Message-Id: <nfnfua-0ju.ln@ID-151211.user.cis.dfn.de>

Koos Pol wrote:

> On donderdag 26 december 2002 18:13 Tony Curtis wrote:
> 
>>>> On Thu, 26 Dec 2002 11:20:26 -0500,
>>>> John Chambers <jmchambers@rcn.com> said:
>> 
>>> Anyhow, the problem is reading the contents of a
>>                          ^^^^
>>> symlink. Not the data of the file that it points to; I'm
>>      ^^^^
>>> trying to get the name of the file that a symlink points
>>> to.
>> 
>> perldoc -f readlink
>> 
>> hth
>> t
> 
> 
> If I understand the OP correctly "readlink" is exactly opossite his needs.
> 

No, he's looking for the 'destination' of a symlink, that's what readlink 
returns.
-- 
Replace spamtrap with bd to reply.
serendipity, n.:
        The process by which human knowledge is advanced.



------------------------------

Date: Thu, 26 Dec 2002 23:41:08 +0100
From: "Murat Ünalan" <murat.uenalan@gmx.de>
Subject: Re: which UI for Perl?
Message-Id: <aug0iu$gn5$04$1@news.t-online.com>

> I found some Modules (Dialog, Perlmenu, Cdk, Curses), but did not test

Did you tried perl-Tk ? Goto search.cpan.org..

Murat




------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.  

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 V10 Issue 4314
***************************************


home help back first fref pref prev next nref lref last post