[10499] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4091 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 28 11:05:50 1998

Date: Wed, 28 Oct 98 08:00:25 -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           Wed, 28 Oct 1998     Volume: 8 Number: 4091

Today's topics:
    Re: ActiveState Perl: problem with PerlPacketManager: p massimobalestra@my-dejanews.com
    Re: ActiveState Perl: problem with PerlPacketManager: p <rkoch@sbs.de>
        clean interupt !!! <michaelr@lndn.tensor.pgs.com>
        Confused by the shebang thang <c960901@aix5.kbar.dtu.dk>
    Re: Confused by the shebang thang <barnett@houston.Geco-Prakla.slb.com>
        Curious about return undef; <stuart@ludwig.ucl.NO_JUNK.ac.uk>
    Re: Curious about return undef; (Larry Rosler)
    Re: Date 2 Num (Joergen W. Lang)
        Difficulties accessing the Registry when lacking Admini <smithr@lexma.meitech.com>
    Re: getopts question <r28629@email.sps.mot.com>
    Re: getopts question (Larry Rosler)
        grabbing timezone withing cgi environ using perl (Daniel Beckham)
        How do I determine a directory separator??? <ple@mitra.com>
    Re: Integer to hex conversion problem. (Snowhare)
    Re: Integer to hex conversion problem. <erhmiru@erh.ericsson.se>
        new to perl (maybe) <spam@spam.spam>
    Re: new to perl (maybe) <dgris@rand.dimensional.com>
    Re: Not to start a language war but.. (John Klassa)
    Re: Perl & Y2K - booby trap code (I R A Aggie)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 28 Oct 1998 14:10:14 GMT
From: massimobalestra@my-dejanews.com
Subject: Re: ActiveState Perl: problem with PerlPacketManager: ppm.pl (proxy/internet)
Message-Id: <7178k6$5n0$1@nnrp1.dejanews.com>



  dave@mag-sol.com wrote:
>   ..........................
> If your connection is thru an HTTP Proxy, then you need to have a environment
> variable set to tell ppm.pl where the proxy is.
>
> The env variable is called %HTTP_Proxy%.

Thank you Dave but they was already set

HTTP_PROXY
HTTP_PROXY_USER
HTTP_PROXY_PASS

And it still does not work .

Any other clue?



--
 Massimo Balestra
 System Engineer
 Torino Italy

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Wed, 28 Oct 1998 15:43:41 +0100
From: rk <rkoch@sbs.de>
To: Jan Dubois <jan.dubois@ibm.net>
Subject: Re: ActiveState Perl: problem with PerlPacketManager: ppm.pl (proxy/internet)
Message-Id: <36372D9D.1E694A8C@sbs.de>

Thanks,

yes I tried "install Tk". But ActiveState confirmed today

    See http://www.ActiveState.com/ActivePerl/ppmproxy.htm for proxy
    firewall instructions. :-)

It means that ppm.pl can have problems with proxies and firewalls.

They suggested to download the packages from

    http://www.ActiveState.com/packages/zips/,

to unzip them and perform localy package update. My problem was, I didn't find
where and if these package were downloadable.

I was tempted to mail the question direct to You and so I enjoyed to see your
answer.

    - r|diger -




Jan Dubois wrote:

> [mailed & posted]
>
> rk <rkoch@sbs.de> wrote:
>
> >I need to install the tk package for Active State Perl.
> >Has anybody an idea, how this could work (or where else I could download
> >the packages)  ???
>
> [snip]
>
> >PPM> search
> >Packages available from http://www.ActiveState.com/packages:
> >
> >   <== No packages / no error displayed
> >PPM>
> >
> >So, how can I get the packages?
>
> Did you try just "install Tk". The "search" command may be broken. Also the
> ActiveState server is rather temperamental; sometimes it works and sometimes
> it doesn't. You might just try again later/next day etc.
>
> -Jan





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

Date: Wed, 28 Oct 1998 15:28:00 +0000
From: Michael Renshaw <michaelr@lndn.tensor.pgs.com>
Subject: clean interupt !!!
Message-Id: <36373800.1B73@lndn.tensor.pgs.com>

if anyone has ever used csh they will know that a useful command
was "onitr" which basically when you interupted a program with CTR-C
you could do some cleaning up of files/processes that would be active
at the time of the interupt, eg. deleting temporary files. 

Does anyone know how to emulate this is perl ? as I need to delete temp
files.

thanx

Mike


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

Date: Wed, 28 Oct 1998 15:35:35 +0100
From: Morten <c960901@aix5.kbar.dtu.dk>
Subject: Confused by the shebang thang
Message-Id: <Pine.A41.3.95.981028152816.11902B-100000@aix5.kbar.dtu.dk>


Well, just as I thought I was beginning to get a slight grip on
what was going on, I get confused by the #!, oops.

1) If #!/usr/local/bin/perl is necessary, how come I have scripts
   that run without that line?

2) I haven't been able to find any more specific info on the shebang's
   but aren't they supposed to be understood like directions to the
   perl compiler? When can you leave them out?

3) What is the #!/opt/internet/bin/perl then? I found that somewhere
   as well.

Thanks

Morten




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

Date: Wed, 28 Oct 1998 09:14:48 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: Morten <c960901@aix5.kbar.dtu.dk>
Subject: Re: Confused by the shebang thang
Message-Id: <363734E8.1CE4AE24@houston.Geco-Prakla.slb.com>

[courtesy cc to cited author]

Morten wrote:
> 
> Well, just as I thought I was beginning to get a slight grip on
> what was going on, I get confused by the #!, oops.
D'oh!


> 1) If #!/usr/local/bin/perl is necessary, how come I have scripts
>    that run without that line?
That entirely depends on the script, and how they are executed.

A script that is run as:
perl script_name
doesn't require the #! line inside script_name.  If it is there, it is
parsed for options (like -w), if it isn't there, perl doesn't care,
since perl already knows it is to interpret this file.

> 2) I haven't been able to find any more specific info on the shebang's
>    but aren't they supposed to be understood like directions to the
>    perl compiler? When can you leave them out?
The shebang line is a directive to whatever 'shell' is interpreting the
file.  #!/usr/local/bin/perl at the beginning, when invoked from a shell
tells your shell (sh, csh, ksh, tcsh, bash, whatever) to run
/usr/local/bin/perl and pass in this script.

#!/usr/local/bin/perl -Tw
tells perl to run with taint-checking enabled, and with warnings
enabled.  If you have that in your file, and run perl script_name, perl
will complain that it is too late to run with taint-checking because it
has already started up by the time it reads that line.  perl -Tw
script_name is acceptable, though.

 
> 3) What is the #!/opt/internet/bin/perl then? I found that somewhere
>    as well.
Same as
#!/usr/bin/perl
#!/usr/local/bin/perl
#!/opt/bin/perl

It simply tells the shell to start up /opt/internet/bin/perl (instead of
whatever you normally use), and pass the script to that executable.

Does that help?

> 
> Thanks
> 
> Morten

Cheers,
Dave

-- 
Dave Barnett	Software Support Engineer	(281) 596-1434


If you ate pasta, and antipasta, would you still be hungry?


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

Date: Wed, 28 Oct 1998 13:05:23 GMT
From: "Stuart Rison" <stuart@ludwig.ucl.NO_JUNK.ac.uk>
Subject: Curious about return undef;
Message-Id: <stuart-2810981305230001@lud190.ludwig.ucl.ac.uk>

Dear all,

I'm having a problem with the undef function (more accurately with the undef
within a function).

Consider the eg below:

#!/usr/local/bin/perl5

@matching_ids=get_matching_ids();

(!defined(@matching_ids)) and (print "Array UNDEFINED!\n");

print "Array matching_ids is: @matching_ids with ",scalar(@matching_ids),"
elements.\n";

sub get_matching_ids {
  # here is use Pg.pm to connect to a postgreSQL using $conn->exec, assume
no hits and therefore $results->ntuples = 0
  (!$variable_worth_0) and ( return undef ); # in my code actually
(!$results->ntuples) and ... which would be true
  return 'actually a list of matching ids';
}

which gives:

merlin::postgres 5% test.pl
Array matching_ids is:  with 1 elements.

however, with the following code ( return undef ) changed to ( return )

#!/usr/local/bin/perl5

@matching_ids=get_matching_ids();

(!defined(@matching_ids)) and (print "Array UNDEFINED!\n");

print "Array matching_ids is: @matching_ids with ",scalar(@matching_ids),"
elements.\n";

sub get_matching_ids {
  # here is use Pg.pm to connect to a postgreSQL using $conn->exec, assume
no hits and therefore $results->ntuples = 0
  (!$variable_worth_0) and ( return ) ); # in my code actually
(!$results->ntuples) and ... which would be true
  return 'actually a list of matching ids';
}

merlin::postgres 3% test.pl
Array UNDEFINED!
Array matching_ids is:  with 0 elements.

OK, so it works and it's shorter but can anyone explain why return undef
does not work.

The way I see it, undef returns undef which is then returned by
get_matching_ids and then becomes the rvalue for @matching_ids...

I know it's a silly question (since i've found a way around the problem) but
I'm really curious about why this is happening (and perhaps it will crop up
in other circumstances).

Regards,

Stuart.

PS.  Could you please cc: to me (stuart@NO_JUNK_MAIL_ludwig.ucl.ac.uk with a
bit removed) as I check the newsgroup rarely (no but I'll start again soon,
promise)


+-------------------------+--------------------------------------+
| Stuart Rison            | Ludwig Institute for Cancer Research |   
| Tel. (0171) 878 4127    | Courtauld Building                   | 
| Fax. (0171) 878 4040    | 91 Riding House Street               |
+-------------------------+ London, W1P 8BT                      |
| e-mail is in the PS.    | UNITED KINGDOM.                      |
+-------------------------+--------------------------------------+
  



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

Date: Wed, 28 Oct 1998 07:08:01 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Curious about return undef;
Message-Id: <MPG.10a0d32de9f3aca29898e6@nntp.hpl.hp.com>

In article <stuart-2810981305230001@lud190.ludwig.ucl.ac.uk> on Wed, 28 
Oct 1998 13:05:23 GMT, Stuart Rison <stuart@ludwig.ucl.NO_JUNK.ac.uk> 
says...
> I'm having a problem with the undef function (more accurately with the undef
> within a function).
> 
<SNIP> of code which returns nothing or undef and is assigned to an  
array.
> 
> The way I see it, undef returns undef which is then returned by
> get_matching_ids and then becomes the rvalue for @matching_ids...
> 
> I know it's a silly question (since i've found a way around the problem) but
> I'm really curious about why this is happening (and perhaps it will crop up
> in other circumstances).

It isn't a silly question.  In list context, bare 'return' returns an 
empty list () [a list with zero elements], while 'return undef' returns 
a list of one element, the value of which is undefined.

`perldoc -f return`:

If no EXPR is given, returns an empty list in list context, an undefined
value in scalar context, or nothing in a void context.
 
> PS.  Could you please cc: to me (stuart@NO_JUNK_MAIL_ludwig.ucl.ac.uk with a
> bit removed) as I check the newsgroup rarely (no but I'll start again soon,
> promise)

If you want an email response, please provide a return address that can 
be handled conveniently by the newsreader without requiring manual 
editing.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 28 Oct 1998 14:55:33 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: Date 2 Num
Message-Id: <1dhm3sl.1lgetan1fgi1ryN@[194.97.197.4]>

Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:

> Joergen W. Lang <jwl@_munged_worldmusic.de> wrote:
> 
> > Craig Pickles <pickles_c@hotmail.com> wrote:
> > 
> > > I know the Date:Calc module would do this, but unofrtunately, I am
> > > running my site from a cheap server that doesnt allow me access to C
> > > for compiling......
> 
> > BTW, you don't have to access C for compiling. [...]
> 
> I think you missed Craig's point...  From the INSTALL file for the
> DateCalc package:
> 
> 
>     Prerequisites:
>     --------------
> 
>     Perl version 5.000 or higher,
>     a C compiler capable of the ANSI C standard (!)
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> [original emphasis]
> 
> 
> So, you do need access to C to compile the Date::Calc module.

Hmpf, you're right. 
So, if I get it right, you precompile the modules to C but you don't
_really_ compile them ? More like a translation to a different language
so access is faster when the modules are "use"d ?

Sometimes Mac makes it too easy...

sorry 'bout that,

Joergen
-- 
  To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
   "Everything is possible - even sometimes the impossible"
             HOELDERLIN EXPRESS - "Touch the void"


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

Date: Wed, 28 Oct 1998 08:19:39 -0500
From: "Ray Smith" <smithr@lexma.meitech.com>
Subject: Difficulties accessing the Registry when lacking Administrator privledge
Message-Id: <7175if$q99$1@client2.news.psi.net>

I'm trying to build tools for general use in my company.  In general the
user's environment is Microsoft Windows NT 4.0.  In programming for
Microsoft
Word document processing I found the following problem:
Test Script to access the Registry (for Microsoft Word constants):
    use Win32::OLE::Const;
    my $wd = Win32::OLE::Const->Load("Microsoft Word 8.0 Object Library");
    foreach my $key (keys %$wd) {
        printf "$key = %s\n", $wd->{$key};
    }
    printf "wdGreen = %s\n", $wd->{wdGreen};
Works when run as administrator.
Gives the following error message when run as a normal user:
S:/CRS/PERL[5485] perl wdconst.pl
Cannot access HKEY_CLASSES_ROOT\Typelib at wdconst.pl line 3
wdGreen =

Has anybody have any ideas or suggestions?
Thanks,
Ray Smith
PS:
The following are a pair of debugging output scripts which I was able to
obtain under the two different cases (non-admin, admin).  The output is
pared down to just show the place I think things are definitely going wrong
in the user scenario and the corresponding success in the administrator
case.

When running test case with normal (non-administrator)
S:/CRS/PERL[5480] perl -d wdconst.pl
Loading DB routines from perl5db.pl version 1
Emacs support available.
Enter h or `h h' for help.
main::(wdconst.pl:3):       my $wd = Win32::OLE::Const->Load("Microsoft Word
8.0
Object Library");
 . . .
Win32::Registry::Create(s:\perl5402\lib\site/Win32/Registry.pm:240):
240:        return 0 unless $_[1];
  DB<1> x @_
0  'TypeLib'
1  undef
  DB<2>
When running test case as administrator:
S:/CRS/PERL[87] perl -d wdconst.pl
 . . .
Win32::Registry::Create(s:\perl5402\lib\site/Win32/Registry.pm:240):
240:        return 0 unless $_[1];
  DB<1> x @_
0  'TypeLib'
1  Win32::Registry=HASH(0xab93c4)
   'handle' => 60





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

Date: Wed, 28 Oct 1998 08:25:15 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: getopts question
Message-Id: <3637294B.23BA42CB@email.sps.mot.com>

[ posted and copy emailed ]
Larry Rosler wrote:
> > If @ARGV = () (IE The @ARGV list equals an empty list) then there are no
> > more arguments.
> 
> It is difficult to test for @ARGV to equal an empty list, as your non-
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
just curious, why is it difficult?

-tk


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

Date: Wed, 28 Oct 1998 07:24:24 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: getopts question
Message-Id: <MPG.10a0d706d94238379898e7@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <3637294B.23BA42CB@email.sps.mot.com> on Wed, 28 Oct 1998 
08:25:15 -0600, Tk Soh <r28629@email.sps.mot.com> says...
> [ posted and copy emailed ]
> Larry Rosler wrote:
> > > If @ARGV = () (IE The @ARGV list equals an empty list) then there are no
> > > more arguments.
> > 
> > It is difficult to test for @ARGV to equal an empty list, as your non-
>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> just curious, why is it difficult?

s/difficult/awkward/;


#!/usr/local/bin/perl -w
use strict;

my @a = ();
my @b = ();

if (@a == ()) { print "empty\n"; } # produces 'uninitialized' warning!!!
if (@a == @b) { print "empty\n"; } # the awkward fix
if (@a == 0)  { print "empty\n"; } # the right way, or:
if (!@a)      { print "empty\n"; } # a neater way, or:
unless (@a)   { print "empty\n"; } # the neatest way
     
-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 28 Oct 1998 10:23:53 -0500
From: danbeck@eudoramail.com (Daniel Beckham)
Subject: grabbing timezone withing cgi environ using perl
Message-Id: <MPG.10a101179d79a3e79896af@news.supernews.com>

Ok, I've searched high and low, but the answer to this, seemingly 
simple, task eludes me.

I need to find out what the server's timezone is.

I know that I can check $ENV{'TZ'} for the server's timezone, but some 
servers don't honor this convention.  It's also a problem inside a CGI 
environment because most of the system environment variables are hidden.  
I've taken a look at the Time::Timezone module from CPAN, but it relies 
on the TZ variable to do it's work.

Can someone point me in the correct direction to work this problem out?  
Anyone have any experience in this area?

Regards,

Daniel Beckham


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

Date: Wed, 28 Oct 1998 10:33:24 -0500
From: Phuong Le <ple@mitra.com>
Subject: How do I determine a directory separator???
Message-Id: <36373944.7E44856F@mitra.com>

I want to create a directory structure on difference OS using Perl.  But
the directory separator for each OS are difference.  How can I find out
this directory separator using Perl???

Thanks


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

Date: 28 Oct 1998 14:16:40 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: Integer to hex conversion problem.
Message-Id: <717908$nu5$1@nnrp3.snfc21.pbi.net>



Nothing above this line is part of the signed message.

In article <717115$fff$1@freyja.bart.nl>,
Jouke Dijkstra <jouke@impact.nl.com> wrote:
>Hail, O Mighty Perl Hackers!
>
>I need a (big) integer to hex conversion sub. I've been trying the
>printf("%X", $i); method, but that seems only able to convert 32-bit
>integers. I need to convert 48 bit unsigned ints, and I fail constantly.
>
>Anyone has a little example at hand?

perldoc Math::BigInt

Benjamin Franz


Version: 2.6.2

iQCVAwUBNjcnn+jpikN3V52xAQHZlwP+POdSSbjCP3fEqFxQR9P1HvRCgZdQ+x2D
mtuPGS0bIX8RJTXXvB6mJHxfMW7tppf1YzHH6fkmju5cxsWTaOP79bWKEiNKFVyX
Pga6HMYqqndCmI6FtduOCpta9EaLtnZn+TcOAZF+yMpy2HKfmgbFZNZWpQ0awnYX
PV1q+BMqSsM=
=Z6ZB
-----END PGP SIGNATURE-----


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

Date: 28 Oct 1998 16:17:19 +0100
From: Michal Rutka <erhmiru@erh.ericsson.se>
To: "Jouke Dijkstra" <jouke@impact.nl.com>
Subject: Re: Integer to hex conversion problem.
Message-Id: <lad87c90n4.fsf@erh.ericsson.se>

"Jouke Dijkstra" <jouke@impact.nl.com> writes:
> Hail, O Mighty Perl Hackers!
> 
> I need a (big) integer to hex conversion sub. I've been trying the
> printf("%X", $i); method, but that seems only able to convert 32-bit
> integers. I need to convert 48 bit unsigned ints, and I fail constantly.

This code should do what you want:

use Math::BigInt;
print  bigintf(64424509440),"\n",bigintf(257698037760),"\n",
       bigintf(281474976710640),"\n";

sub bigintf{
    my $i = Math::BigInt->new(shift);     # Create big integer
    my($q,$r) = $i->bdiv('4294967296');   # Take higer and lower 32 bits
    return substr(unpack("H*",pack("I*",$q,$r)),-12); # Return formated string;
}

> Anyone has a little example at hand?

I've just made it ;-).

> Regards,
> 
> Jouke Dijkstra

mvg

Michal


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

Date: Wed, 28 Oct 1998 09:56:37 -0500
From: no-spam <spam@spam.spam>
Subject: new to perl (maybe)
Message-Id: <363730A5.49A649E9@spam.spam>

Hi, I'm comming from a total Microsoft background (NT,IIS,ASP,VC++, etc
etc) and am considering a job which uses Perl exclusively (on NT). I'm
confused about the functionaliy perl offers as I've never even seen the
code.

Does it offer similar functionality to ASP? CGI? is it for server side
scripting only? Is there an equivalient to ASP where requests will run
in the same process space? or is it more like CGI?

realistically, is perl becomming obsolete as more people get assimilated
into the microsoft void?

is perl predominately a UNIX thing and does it lack functionality on NT?

I'm not trying to start flame wars, but am concerned about whether I'm
making a good decision career wise.


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

Date: Wed, 28 Oct 1998 15:38:50 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: new to perl (maybe)
Message-Id: <m31znsogi2.fsf@rand.dimensional.com>

no-spam <spam@spam.spam> writes:

> Hi, I'm comming from a total Microsoft background (NT,IIS,ASP,VC++, etc
> etc) and am considering a job which uses Perl exclusively (on NT). I'm
> confused about the functionaliy perl offers as I've never even seen the
> code.

Do you mean that you've never seen code written in perl, or that
you've never seen the source to the perl compiler and interpreter?
Either way, point your broswer at http://ww.perl.com/CPAN/.

> Does it offer similar functionality to ASP? CGI? 

It provides the same functionality as C or C++.  It is a complete
programming language, not a braindead protocol like CGI or an utter
waste of time like ASP.

>                                                  is it for server side
> scripting only?

No, perl is for general programming tasks.  I use it to handle database
connections, process management, user interface, and every other area
that I normally code in.  I don't, generally speaking, ever use it for
web work (we hire interns to handle that).

>                  Is there an equivalient to ASP where requests will run
> in the same process space? or is it more like CGI?

It isn't even vaguely related to ASP in any way.  It's only relation
to CGI is that most programs that adhere to the CGI protocol are
written in perl.  You can't think of perl as a web tool, it's not.
It's a general purpose programming language.

> realistically, is perl becomming obsolete as more people get assimilated
> into the microsoft void?

No, Microsoft is becoming obsolete as more companies realize that NT
is completely worthless as a platform for any sort of high performance
or high reliability computing.

> is perl predominately a UNIX thing and does it lack functionality on NT?

Yes, perl is predominantly a unix thing.  This is because serious computing
is predominantly a unix thing and is likely to stay that way for quite
some time.

> I'm not trying to start flame wars, but am concerned about whether I'm
> making a good decision career wise.

Perl is a good decision career wise.

dgris
-- 
Daniel Grisinger              dgris@rand.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 28 Oct 1998 13:26:46 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: Not to start a language war but..
Message-Id: <71762m$n6p$2@aurwww.aur.alcatel.com>

On Mon, 26 Oct 1998 11:37:13 -0800, James Logajan <JamesL@Lugoj.Com> wrote:
  > Even if Python had been a statically typed language, it probably has
  > far too many structured and built-in types to take advantage of the
  > use of special characters. The concept may be valid, but the
  > execution in Perl is obviously not entirely successful for many
  > people. Also, Perl only seems to apply this syntax to the top level
  > references only. As soon as you start dereferencing something like a
  > record structure, one can't tell by the dereference syntax the
  > type of the object being dereferenced. So for any non-trivial
  > data structure, it would appear that Perl provides no more information
  > to the programmer than does Python. In fact since neither language
  > provides variable declarations, one has to rely on comments, mnemonic
  > variable name, or the original assignment to determine the type of
  > the object.

The $, @ and % tell you what you're getting when all the dereferencing is
done...  Thus, @a is an array and $a[0] is the 0th element of @a, which is
a scalar.  Something like @a[0,1] is itself an array, so it's prefixed by
@. The information is useful -- when you see a $ in front of something,
you've got a scalar; when you see an @, you've got an array; when you've
got a %, you've got a hash.

-- 
John Klassa / Alcatel / Raleigh, NC, USA / $perl_monger{Raleigh}[0] / <><


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

Date: Wed, 28 Oct 1998 10:27:34 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <fl_aggie-2810981027340001@aggie.coaps.fsu.edu>

In article <716r2r$lqn$1@nnrp1.dejanews.com>, finsol@ts.co.nz wrote:

+ Of course Perl is Y2K compliant - so is just about any other language,
+ including COBOL!  But the applications developed in Perl can have Y2K issues
+ associated with them - as does every other language.

And this is a language problem _how_? is not, instead, a programming
problem?

+ Logic would say that with such an ambiguous year handling method

Really? You mean when I do 'perldoc -f localtime' I don't get:

  Also, $year is the number of years since 1900, that is, $year is 123
  in year 2023.

This information leads me to believe that if I want the current year,
in all its glory, that I need to simply:

$year = 1900 + $year ; # a tad more obvious than the += operator

Is that wrong? I am incorrect?

+ Anyone can get it wrong - and none of the 'experts', who have been so scathing
+ of others' abilities in this debate, could honestly state that they have never
+ put a bug into production, unless they live in an ivory tower and have never
+ produced code for the real world.  We're only human, after all.

But I don't blame the language of choice for MY MISTAKES.

I think its time for a Larry Wallism...

Many computer scientists have fallen into the trap of trying to define
languages like George Orwell's Newspeak, in which it is impossible to
think bad thoughts. What they end up doing is killing the creativity
of programming.
 -- Larry Wall

James


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

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 4091
**************************************

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