[24051] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6248 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 12 06:05:43 2004

Date: Fri, 12 Mar 2004 03:05:06 -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           Fri, 12 Mar 2004     Volume: 10 Number: 6248

Today's topics:
        [OT] Re: Spreadsheet::WriteExcel - Excel 97 install pro <thens@NOSPAMti.com>
        ANNOUNCE: Inline::Java 0.47 released! (Patrick LeBoutillier)
    Re: Extracting directories in a path - TMBABWTDI <krahnj@acm.org>
    Re: Extracting directories in a path - TMBABWTDI <fifo@despammed.com>
    Re: How to redirect headers in Perl? <gnari@simnet.is>
        HTTP 1.1 module <chatiman@free.fr>
    Re: IMAP via ssl? <josef.moellers@fujitsu-siemens.com>
    Re: IO::Pipe::close returns wrong value (Charles DeRykus)
    Re: IO::Pipe::close returns wrong value (Heinrich Mislik)
    Re: Ordering large files (in perl?) (Oeln)
    Re: Ordering large files (in perl?) (Oeln)
    Re: Parsing from file (Toni)
    Re: Parsing from file <tore@aursand.no>
    Re: perlfunc.pod and perlvar.pod <gnari@simnet.is>
        Posting Guidelines for comp.lang.perl.misc ($Revision:  tadmc@augustmail.com
        R_E_A_D    T_H_I_S susan.thornburn@stees.nhs.uk
    Re: Regex doesn't match - what am I doing wrong? (Sriram)
    Re: Regex doesn't match - what am I doing wrong? <roel-perl@st2x.net>
        Spreadsheet::WriteExcel - Excel 97 install problem <rbin.kor901209@in.bosch.com>
    Re: Spreadsheet::WriteExcel - Excel 97 install problem <kz15@earthling.net>
    Re: Text editor implemented in Perl <nospam@bigpond.com>
    Re: Text editor implemented in Perl <fifo@despammed.com>
        Tricky Perl Bug (amusing/unamusing) <david@tvis.co.uk>
    Re: using an assoc. array as a 'set' <bik.mido@tiscalinet.it>
    Re: variable initialization question <jgibson@mail.arc.nasa.gov>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 12 Mar 2004 16:12:00 +0530
From: Thens <thens@NOSPAMti.com>
Subject: [OT] Re: Spreadsheet::WriteExcel - Excel 97 install problem
Message-Id: <20040312161200.6de7e876.thens@NOSPAMti.com>

On 12 Mar 2004 09:02:08 GMT
Bhaskar Reddy <rbin.kor901209@in.bosch.com> wrote:

# MyPrj
#  |
#  |----csv2xls.pl  (My pl file which calls the write() method)
#  |
#  |----Spreadsheet
#           |
#           |----WriteExcel.pm
#           |----WriteExcel
#                    |----BIFFwriter.pm
#                    |----Big.pm
#                    |----Format.pm
#                    |----Formula.pm
#                    |----OLEwriter.pm
#                    |----Utility.pm
#                    |----Workbook.pm
#                    |----WorkbookBig.pm
#                    |----Worksheet.pm

Bhaskar, 

Do you have a perl script/utility that generates this kind of a tree
structure or was this hand created. Just out of curiosity !!

Regards,
Thens.


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

Date: Fri, 12 Mar 2004 00:57:47 GMT
From: patrick_leboutillier@hotmail.com (Patrick LeBoutillier)
Subject: ANNOUNCE: Inline::Java 0.47 released!
Message-Id: <HuFv5r.1836@zorch.sf-bay.org>

Hi all,

Get it from CPAN...

Patrick

-------------------------------------------------------------------------------
FEATURES FOR THIS VERSION:

Inline::Java version 0.47 is a minor upgrade that includes:
+ Fixed bugs in portability code and added HPUX and Solaris specifics
+ Tweaked CLASSPATH directory order
+ Changed port numbers for SHARED_JVM tests in order to avoid clashes
  with running installations
+ Made PerlNatives optional

See CHANGES for a full change list.

-------------------------------------------------------------------------------
INTRODUCTION:

Inline::Java - Write Perl classes in Java.

Inline::Java lets you write Perl classes in Java.

Example:

    use Inline Java => <<'END';
        class JAxH {
            public JAxH(String x){
                System.out.println("Just Another " + x + " Hacker") ;
            }
        }
    END
    
    new JAxH('Inline') ;

When run, this complete program prints:

    Just Another Inline Hacker


-------------------------------------------------------------------------------
INFORMATION:

= For more information on Inline::Java, see 'perldoc Inline::Java'.
= For information about Inline, see 'perldoc Inline'.
= For information on using Java, visit http://java.sun.org.

Inline::Java's mailing list is inline@perl.org. 
To subscribe, send an email to inline-subscribe@perl.org.

Inline::Java's home page is http://inline.perl.org/java/.

Please send questions and comments to Patrick LeBoutillier <patl@cpan.org>.

Copyright (c) 2001-2003, Patrick LeBoutillier. All Rights Reserved.




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

Date: Fri, 12 Mar 2004 01:12:32 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Extracting directories in a path - TMBABWTDI
Message-Id: <40510E58.A571D1F8@acm.org>

Anno Siegel wrote:
> 
> John W. Krahn <krahnj@acm.org> wrote in comp.lang.perl.misc:
> > Henry Law wrote:
> 
> > Instead of removing the stuff you don't want you should extract the
> > stuff you do want.
> >
> > @nodes = $path =~ m|[^/]+|;
> 
> That needs a /g.

I know.  :-)  I realised it about 5 seconds after I posted.


John
-- 
use Perl;
program
fulfillment


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

Date: Fri, 12 Mar 2004 09:12:16 +0000
From: fifo <fifo@despammed.com>
Subject: Re: Extracting directories in a path - TMBABWTDI
Message-Id: <20040312091213.GA18297@fleece>

At 2004-03-11 21:17 +0000, Henry Law wrote:
> On Thu, 11 Mar 2004 19:55:48 +0000 (UTC), Ben Morrow
> <usenet@morrow.me.uk> wrote:
> 
> >> fifo's 
> >> 	@nodes = map { $_ or () } split '/', $path;
> >> 
> >> blew me away and I'm not sure I understand it yet.
> >
> >true (if it's not an empty string[1]) then it adds $_ to the list; if it
> >is false then it adds (), the empty list, which has no effect. 
>                        ^^^^^^^^^^^^^^^^^^
> Aha ... that's the bit I missed.  How elegant.
> 

It's not that elegant: as Anno pointed out, I should really have used
grep here, as that's what grep is for.  Also, the test should have been
for $_ being non-null, not for it being true, otherwise entries called
exactly '0' are removed.  Thus

  @nodes = grep { $_ ne '' } split '/', $path;


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

Date: Thu, 11 Mar 2004 23:05:02 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: How to redirect headers in Perl?
Message-Id: <c2qrgf$t01$1@news.simnet.is>

"Crazy Monkey" <wlin98004@hotmail.com> wrote in message
news:db81df92.0403111429.794f107e@posting.google.com...
>
> If someone has an idea on how to do windows Basic authentication on a
> server and make it stick on a client, I am still interested for future
> reference.

I am afraid I do not exactly follow what you are trying to do.

basic authentication works roughly like this
a) client does a request to a page
b) server replies with a header to prompt for
    authentication for its Realm
c) client (browser) prompts user for this
d) client resends request, with auth info
e) if auth successful, page returned
f) client takes note of this, and silently sends same
   auth info to all subsequent pages in session to same server
   when the server requests it (or, i believe, some clients may
   preemptively send auth info with all page requests to same server
   in session)
 ...
x) when session closes (browser window closed, browser exits,...)
   the auth info is discarded by client

hope this helps
gnari





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

Date: Fri, 12 Mar 2004 11:39:09 +0100
From: "chatiman" <chatiman@free.fr>
Subject: HTTP 1.1 module
Message-Id: <40519357$0$292$626a14ce@news.free.fr>

Hello,

I've started to write a HTTP 1.1 module in perl which supports pipelining.
 Will there be some interest to publish it ?






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

Date: Fri, 12 Mar 2004 09:24:05 +0100
From: =?ISO-8859-1?Q?Josef_M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: IMAP via ssl?
Message-Id: <c2rs22$jf8$1@nntp.fujitsu-siemens.com>

Josef M=F6llers wrote:
> Hi,
>=20
> according to IMAPClient's manual page, it should be possible to access =

> an IMAP server via an SSL connection.
> I tried:
> ($server is the right server name and $prot is "imaps", $user and=20
> $password are also correct)
>=20
> if ($prot eq "imaps") {
>     $port =3D getservbyname($prot, 'tcp');
>     my $s =3D IO::Socket::SSL->new(PeerAddr=3D>$host,
>                 PeerPort =3D> $port,
>                 Proto =3D> 'tcp');
>     die $@ unless defined $s;
>=20
>     $imap =3D Mail::IMAPClient->new(Socket   =3D> $s,
>                                   User     =3D> $user,
>                                   Password =3D> $password,);
>     $imap->State($imap->Connected());
>     $imap->login or die $@;
>=20
> but I get the error message
> Use of uninitialized value in string eq at=20
> /usr/lib/perl5/site_perl/5.8.1/Mail/IMAPClient.pm line 1435.
> and then
> Error sending '1 Login "XXXXXXXX" {12}
> YYYYYYYYYYYY
> ' to IMAP:  at Perl/IMAP.pl line 45
> Error sending '1 Login "XXXXXXXX" {12}
> YYYYYYYYYYYY
> ' to IMAP:  at Perl/IMAP.pl line 45.
>=20
> What am I doing wrong?
>=20

Digging through IMAPClient.pm, I discovered that when I used a Socket=20
parameter, I had to receive the initial greeting message of the server=20
explicitly. Leaving it in the input buffer confused the login function:

     my $s =3D IO::Socket::SSL->new(PeerAddr=3D>$host,
                 PeerPort =3D> $port,
                 Proto =3D> 'tcp');
     die $@ unless defined $s;
+   my $resp =3D <$s>;

That fixed it.

--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett



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

Date: Fri, 12 Mar 2004 03:52:28 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: IO::Pipe::close returns wrong value
Message-Id: <HuG2rG.KvC@news.boeing.com>

In article <404d8f93$0$16036$3b214f66@usenet.univie.ac.at>,
Heinrich Mislik <Heinrich.Mislik@univie.ac.at> wrote:
>IO::Pipe::close is not documented. IO::Handle says that close is just a frontend to perl's close. So I expected close to a pipe to return false, if a child  returns nonzero. Truth is, that IO::Pipe has it's own close, which doesn't return the code from waitpid. Here is a program to demonstrate it (assuming that ls -Z is an error):
>
>pipe.pl:
>
>#!/bin/perl
>
>use warnings;
>use strict;
>use IO::Pipe;
>
>my @prog = qw(ls -Z);
>
>open(my $pipe,'-|',@prog) or die;
>while(<$pipe>)
>{
>    print
>}
>
>close $pipe or warn "command @prog filed";
>
>$pipe = new IO::Pipe;
>$pipe->reader(@prog) or die;
>
>while(<$pipe>)
>{
>    print
>}
>
>$pipe->close or warn "command @prog filed";
>
>######################
>
>This gives me:
>
>~>./pipe.pl
>ls: invalid option -- Z
>Try `ls --help' for more information.
>command ls -Z filed at ./pipe.pl line 15.
>ls: invalid option -- Z
>Try `ls --help' for more information.
>


I'm confused when you mention:

 "Truth is, that IO::Pipe has it's own close, which doesn't return the 
  code from waitpid." 


A quick glance at the code seems to indicate that's not the case.
IO::Pipe subclasses IO::Handle within its inner class IO::Pipe::End
and inherits its close method which is from waitpid.

Have I missed something...

--
Charles DeRykus


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

Date: 12 Mar 2004 10:43:47 GMT
From: Heinrich.Mislik@univie.ac.at (Heinrich Mislik)
Subject: Re: IO::Pipe::close returns wrong value
Message-Id: <40519459$0$29350$3b214f66@usenet.univie.ac.at>

In article <HuG2rG.KvC@news.boeing.com>, ced@bcstec.ca.boeing.com says...

>I'm confused when you mention:
>
> "Truth is, that IO::Pipe has it's own close, which doesn't return the 
>  code from waitpid." 
>
>
>A quick glance at the code seems to indicate that's not the case.
>IO::Pipe subclasses IO::Handle within its inner class IO::Pipe::End
>and inherits its close method which is from waitpid.
>
>Have I missed something...

This is from IO/Pipe.pm:

      1 # IO::Pipe.pm
      2 #
      3 # Copyright (c) 1996-8 Graham Barr <gbarr@pobox.com>. All rights reserved.
      4 # This program is free software; you can redistribute it and/or
      5 # modify it under the same terms as Perl itself.
      6
      7 package IO::Pipe;
      8
      9 use 5.006_001;
     10
     11 use IO::Handle;
     12 use strict;
     13 our($VERSION);
     14 use Carp;
     15 use Symbol;
     16
     17 $VERSION = "1.122";

 .....

    139 package IO::Pipe::End;
    140
    141 our(@ISA);
    142
    143 @ISA = qw(IO::Handle);
    144
    145 sub close {
    146     my $fh = shift;
    147     my $r = $fh->SUPER::close(@_);
    148
    149     waitpid(${*$fh}{'io_pipe_pid'},0)
    150         if(defined ${*$fh}{'io_pipe_pid'});
    151
    152     $r;
    153 }
    154

The returned code from waitpid is ignored.

-- 
Heinrich Mislik
Zentraler Informatikdienst der Universitaet Wien
A-1010 Wien, Universitaetsstrasse 7
Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140



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

Date: 11 Mar 2004 23:26:38 -0800
From: ohmy9od@yahoo.com (Oeln)
Subject: Re: Ordering large files (in perl?)
Message-Id: <ffde43bc.0403112326.71921910@posting.google.com>

Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrnc50q07.3fe.tadmc@magna.augustmail.com>...
> Oeln <ohmy9od@yahoo.com> wrote:
> > Jim Gibson <jgibson@mail.arc.nasa.gov> wrote in message news:<090320041322458099%jgibson@mail.arc.nasa.gov>...
> >> In article <ffde43bc.0403081722.6fdc2988@posting.google.com>, Oeln
> >> <ohmy9od@yahoo.com> wrote:
>  
> >> > One idea I came upon implied that exec(sort) would be a good option.
>  
> >> Try 'system("sort infile -o outfile"). The exec command won't return
> >> execution to your program, probably not what you want. 
> > 
> > I guess it isn't only that exec() only
>             ^^^
> > fails if the command itself is non-existent. 
>                                  ^^^
> 
> The double negative has left me not sure that I understand
> what you mean there...
> 

Only that I guess there's other issues with it, too (or not).

> 
> > I guess it won't wait for
>        ^^
> > the exec() to complete, either? 
> 
> 
> I guess the "it" refers to your Perl program?
> 
> "it" won't wait because "it" *no longer exists* after a successful exec().
> 
> After exec(), your Perl program has been replaced by the sort program.
> 

Okay, yes in my case that would be an issue, certainly. I get it now;
I'd originally gotten the impression that 'it' - I wasn't clear there
but you inferred correctly - it would only go on to other things, not
that it would no longer exist. It would be an issue either way, of
course; but I've got a clearer imagine in my head now of what's going
on..

> 
> > I'll continue looking for info on it 
> 
> 
> It isn't really a Perl issue, it is an issue with the Unix process model.
> 
> You may have better luck looking for more info in a Unix-place 
> rather than a Perl-place.
> 
> 
> > (if nothing else I'm gonna look
> > for an example of why one would ever go with exec instead) 
> 
> 
> When used in conjunction with fork().
> 
> (I don't see any way that exec() can help solve your sorting problem.)

It would only be idle curiosity that would inspire me to look into
fork() then; but I'm not certain I won't be. ;)

Thanks for the info.

- Oeln


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

Date: 11 Mar 2004 23:28:58 -0800
From: ohmy9od@yahoo.com (Oeln)
Subject: Re: Ordering large files (in perl?)
Message-Id: <ffde43bc.0403112328.4816e925@posting.google.com>

dcutter@gmx.de (Daniel Cutter) wrote in message news:<d536227a.0403110656.1c905160@posting.google.com>...
> ohmy9od@yahoo.com (Oeln) wrote in message news:<ffde43bc.0403102200.15ece154@posting.google.com>...
> > Jim Gibson <jgibson@mail.arc.nasa.gov> wrote in message news:<090320041322458099%jgibson@mail.arc.nasa.gov>...
> > > In article <ffde43bc.0403081722.6fdc2988@posting.google.com>, Oeln
> > > <ohmy9od@yahoo.com> wrote:
> > > 
> > > > I've got a large file in which there is one word on each line. I've
> > > > got to output each word it includes to a new file, in order. I've
> > > > currently got the following:
> > > > 
> > > >  @order = <INFILE>;
> > > >  @ordered = sort(@order);
> > > > 
> > > >  foreach $o (@ordered) {
> > > >     print OUTFILE "$o";
> > > >  }
> > > > 
> > > > In general this is working fine; but if I've got to open a larger file
> > > > (over 1gb, for example, or even 10 gb..whatever) it fails.
> > > > 
> > > > I've found this issue being gone over to an extent; but the
> > > > information is not clear to me. I've got a few ideas on how to get
> > > > this to work (for instance, if I could get one word out of the infile
> > > > at a time and insert it to the outfile, in order in the first place;
> > > > but I'd imagine this would be incredibly inefficient).
> > > 
> > > Yes. Do not reinvent the wheel. If you are on linux, use the sort
> > > command. 'man sort'.
> > > 
> > > > 
> > > > One idea I came upon implied that exec(sort) would be a good option.
> > > > I'd imagine like exec(sort INFILE -o OUTFILE); but I'm not certain, or
> > > > clear on the other options it offers. Is that good enough by itself
> > > > for large files? I get the impression there is a way to output to a
> > > > group of temp files, and then 'integrate' them into one file, etc.
> > > > etc.
> > > 
> > > Try 'system("sort infile -o outfile"). The exec command won't return
> > > execution to your program, probably not what you want. 
> > 
> > On looking further into this, I guess it isn't only that exec() only
> > fails if the command itself is non-existent. I guess it won't wait for
> > the exec() to complete, either? I'm not overly clear on this, only
> > cause with exec() I've not gotten the impression this is the case.
> > 
> > I'll continue looking for info on it (if nothing else I'm gonna look
> > for an example of why one would ever go with exec instead) - for now
> > I've got:
> > 
> > @order = ("sort", "-u", "$infile", "-o", "$oufile"); system(@order);
> > 
> > > If you have one word per line, that should be all you need. Try it from
> > > the command line and see if it does what you want, then run with it. I
> > > am sure you have better things to worry about than implementing a merge
> > > sort method. You might want '-b' option to sort to ignore leading
> > > whitespace, -i to ignore non-ascii characters, and -f to use
> > > case-insensitive sorting.
> > > 
> > 
> > Thank you for the info.
> > 
> > - Oeln
> 
> 
> Far more appropriate is
> use File::Sort;
> 
> It also swaps to temp if needed be. Just read the documentation on CPAN.
> 
> Daniel

I've got the original issue I had worked out now; but I'll certainly
get info on this, too.

- Oeln


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

Date: 11 Mar 2004 23:51:45 -0800
From: ante.cepic@siemens.com (Toni)
Subject: Re: Parsing from file
Message-Id: <8b22fe57.0403112351.239a6340@posting.google.com>

OK, sorry!

Until now I have this code:
  my %config;
  open INPUT, $config_file;
  my @lines = <INPUT>;
  my ($option, $array, $i);

  foreach $i (0 .. $#lines){
    ($option, $array)=split(/ /, $lines[$i], 2);
  	$config{$option}=$array;
  }
So, in $array I get a string "Par1 Val1 Par2 Val2 ...".
And now I want to have this.

my $var1 =
[
    { name => 'Par1',   value => 'Val1'  },
    { name => 'Par2',  value => 'Val2'  },
 ...
];

my $var2 =
[
    { name => 'Par3',   value => 'Val3'  },
    { name => 'Par4',  value => 'Val4'  },
    { name => 'Par5',  value => 'Val5'  },
 ...
];

I hope this is more clear now.
Thank you!


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

Date: Fri, 12 Mar 2004 12:00:34 +0100
From: Tore Aursand <tore@aursand.no>
Subject: Re: Parsing from file
Message-Id: <pan.2004.03.12.10.07.20.954493@aursand.no>

On Thu, 11 Mar 2004 23:51:45 -0800, Toni wrote:
> Until now I have this code:
>   my %config;
>   open INPUT, $config_file;
>   my @lines = <INPUT>;
>   my ($option, $array, $i);
> 
>   foreach $i (0 .. $#lines){
>     ($option, $array)=split(/ /, $lines[$i], 2);
>   	$config{$option}=$array;
>   }
> So, in $array I get a string "Par1 Val1 Par2 Val2 ...".
> And now I want to have this.
> 
> my $var1 =
> [
>     { name => 'Par1',   value => 'Val1'  },
>     { name => 'Par2',  value => 'Val2'  },
> ...
> ];
> 
> my $var2 =
> [
>     { name => 'Par3',   value => 'Val3'  },
>     { name => 'Par4',  value => 'Val4'  },
>     { name => 'Par5',  value => 'Val5'  },
> ...
> ];
> 
> I hope this is more clear now.

Not really.  In your original posted you said that the input format was
something like this:

  Option1 Par1 Val1 Par2 Val2 Par3 Val3
  Option2 Par4 Val4 Par5 Val5 Par6 Val6

In addition, your hashes (above) seems poorly designed;  Why do you want
'name' and 'value' as keys in them?  You could easily let 'Parx' point to
'Valuex'.

I _think_ that you are better off with a HoH [1] where the outer key is
'Optionx';

  my %hash;
  open( INPUT, '<', $cfg_file ) or die "$!\n";
  while ( <INPUT> ) {
      chomp;
      my ($option, %data) = split;
      $hash{$option} = \%data;
  }
  close( INPUT );

[1] HoH = Hash of Hashes


-- 
Tore Aursand <tore@aursand.no>
"Every man usually has something he can do better than anyone else.
 Usually it is reading his own handwriting." -- Unknown


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

Date: Thu, 11 Mar 2004 22:51:56 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: perlfunc.pod and perlvar.pod
Message-Id: <c2qqga$spg$1@news.simnet.is>


"Martin L." <mjpliv@eastlink.ca> wrote in message
news:36fd063b.0403111343.b6ee375@posting.google.com...
> I have been refered to these and I am afraid I have no idea what they
> are or where to find them. A google search only returns links to
> additional documents that make reference to the term but not the
> source.
>
> Can someone point me in the correct direction.

these (perlfunc.pod and perlvar.pod) are part
of the standard perl documentation, and should be installed along
with perl.

they are accessed from command line with the program perldoc:
  perldoc perlvar
  perldoc perlfunc

while you are at it take a look at
  perldoc perl
  perldoc perldoc

alternatively, on unixlike systems
  man perlvar

with activestate perl, take a look at the html
documentation

if all else fails, go visit
  http://perldoc.com/


good reading,
gnari









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

Date: Fri, 12 Mar 2004 02:22:05 -0600
From: tadmc@augustmail.com
Subject: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.5 $)
Message-Id: <PM6dnWpG3eWw7szdRVn-jA@august.net>

Outline
   Before posting to comp.lang.perl.misc
      Must
       - Check the Perl Frequently Asked Questions (FAQ)
       - Check the other standard Perl docs (*.pod)
      Really Really Should
       - Lurk for a while before posting
       - Search a Usenet archive
      If You Like
       - Check Other Resources
   Posting to comp.lang.perl.misc
      Is there a better place to ask your question?
       - Question should be about Perl, not about the application area
      How to participate (post) in the clpmisc community
       - Carefully choose the contents of your Subject header
       - Use an effective followup style
       - Speak Perl rather than English, when possible
       - Ask perl to help you
       - Do not re-type Perl code
       - Provide enough information
       - Do not provide too much information
       - Do not post binaries, HTML, or MIME
      Social faux pas to avoid
       - Asking a Frequently Asked Question
       - Asking a question easily answered by a cursory doc search
       - Asking for emailed answers
       - Beware of saying "doesn't work"
       - Sending a "stealth" Cc copy
      Be extra cautious when you get upset
       - Count to ten before composing a followup when you are upset
       - Count to ten after composing and before posting when you are upset
-----------------------------------------------------------------

Posting Guidelines for comp.lang.perl.misc ($Revision: 1.5 $)
    This newsgroup, commonly called clpmisc, is a technical newsgroup
    intended to be used for discussion of Perl related issues (except job
    postings), whether it be comments or questions.

    As you would expect, clpmisc discussions are usually very technical in
    nature and there are conventions for conduct in technical newsgroups
    going somewhat beyond those in non-technical newsgroups.

    The article at:

        http://www.catb.org/~esr/faqs/smart-questions.html

    describes how to get answers from technical people in general.

    This article describes things that you should, and should not, do to
    increase your chances of getting an answer to your Perl question. It is
    available in POD, HTML and plain text formats at:

     http://mail.augustmail.com/~tadmc/clpmisc.shtml

    For more information about netiquette in general, see the "Netiquette
    Guidelines" at:

     http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

    A note to newsgroup "regulars":

       Do not use these guidelines as a "license to flame" or other
       meanness. It is possible that a poster is unaware of things
       discussed here.  Give them the benefit of the doubt, and just
       help them learn how to post, rather than assume 

    A note about technical terms used here:

       In this document, we use words like "must" and "should" as
       they're used in technical conversation (such as you will
       encounter in this newsgroup). When we say that you *must* do
       something, we mean that if you don't do that something, then
       it's unlikely that you will benefit much from this group.
       We're not bossing you around; we're making the point without
       lots of words.

    Do *NOT* send email to the maintainer of these guidelines. It will be
    discarded unread. The guidelines belong to the newsgroup so all
    discussion should appear in the newsgroup. I am just the secretary that
    writes down the consensus of the group.

Before posting to comp.lang.perl.misc
  Must
    This section describes things that you *must* do before posting to
    clpmisc, in order to maximize your chances of getting meaningful replies
    to your inquiry and to avoid getting flamed for being lazy and trying to
    have others do your work.

    The perl distribution includes documentation that is copied to your hard
    drive when you install perl. Also installed is a program for looking
    things up in that (and other) documentation named 'perldoc'.

    You should either find out where the docs got installed on your system,
    or use perldoc to find them for you. Type "perldoc perldoc" to learn how
    to use perldoc itself. Type "perldoc perl" to start reading Perl's
    standard documentation.

    Check the Perl Frequently Asked Questions (FAQ)
        Checking the FAQ before posting is required in Big 8 newsgroups in
        general, there is nothing clpmisc-specific about this requirement.
        You are expected to do this in nearly all newsgroups.

        You can use the "-q" switch with perldoc to do a word search of the
        questions in the Perl FAQs.

    Check the other standard Perl docs (*.pod)
        The perl distribution comes with much more documentation than is
        available for most other newsgroups, so in clpmisc you should also
        see if you can find an answer in the other (non-FAQ) standard docs
        before posting.

    It is *not* required, or even expected, that you actually *read* all of
    Perl's standard docs, only that you spend a few minutes searching them
    before posting.

    Try doing a word-search in the standard docs for some words/phrases
    taken from your problem statement or from your very carefully worded
    "Subject:" header.

  Really Really Should
    This section describes things that you *really should* do before posting
    to clpmisc.

    Lurk for a while before posting
        This is very important and expected in all newsgroups. Lurking means
        to monitor a newsgroup for a period to become familiar with local
        customs. Each newsgroup has specific customs and rituals. Knowing
        these before you participate will help avoid embarrassing social
        situations. Consider yourself to be a foreigner at first!

    Search a Usenet archive
        There are tens of thousands of Perl programmers. It is very likely
        that your question has already been asked (and answered). See if you
        can find where it has already been answered.

        One such searchable archive is:

         http://groups.google.com/advanced_group_search

  If You Like
    This section describes things that you *can* do before posting to
    clpmisc.

    Check Other Resources
        You may want to check in books or on web sites to see if you can
        find the answer to your question.

        But you need to consider the source of such information: there are a
        lot of very poor Perl books and web sites, and several good ones
        too, of course.

Posting to comp.lang.perl.misc
    There can be 200 messages in clpmisc in a single day. Nobody is going to
    read every article. They must decide somehow which articles they are
    going to read, and which they will skip.

    Your post is in competition with 199 other posts. You need to "win"
    before a person who can help you will even read your question.

    These sections describe how you can help keep your article from being
    one of the "skipped" ones.

  Is there a better place to ask your question?
    Question should be about Perl, not about the application area
        It can be difficult to separate out where your problem really is,
        but you should make a conscious effort to post to the most
        applicable newsgroup. That is, after all, where you are the most
        likely to find the people who know how to answer your question.

        Being able to "partition" a problem is an essential skill for
        effectively troubleshooting programming problems. If you don't get
        that right, you end up looking for answers in the wrong places.

        It should be understood that you may not know that the root of your
        problem is not Perl-related (the two most frequent ones are CGI and
        Operating System related), so off-topic postings will happen from
        time to time. Be gracious when someone helps you find a better place
        to ask your question by pointing you to a more applicable newsgroup.

  How to participate (post) in the clpmisc community
    Carefully choose the contents of your Subject header
        You have 40 precious characters of Subject to win out and be one of
        the posts that gets read. Don't waste them. Take care while
        composing them, they are the key that opens the door to getting an
        answer.

        Spend them indicating what aspect of Perl others will find if they
        should decide to read your article.

        Do not spend them indicating "experience level" (guru, newbie...).

        Do not spend them pleading (please read, urgent, help!...).

        Do not spend them on non-Subjects (Perl question, one-word
        Subject...)

        For more information on choosing a Subject see "Choosing Good
        Subject Lines":

         http://www.cpan.org/authors/id/D/DM/DMR/subjects.post

        Part of the beauty of newsgroup dynamics, is that you can contribute
        to the community with your very first post! If your choice of
        Subject leads a fellow Perler to find the thread you are starting,
        then even asking a question helps us all.

    Use an effective followup style
        When composing a followup, quote only enough text to establish the
        context for the comments that you will add. Always indicate who
        wrote the quoted material. Never quote an entire article. Never
        quote a .signature (unless that is what you are commenting on).

        Intersperse your comments *following* each section of quoted text to
        which they relate. Unappreciated followup styles are referred to as
        "top-posting", "Jeopardy" (because the answer comes before the
        question), or "TOFU" (Text Over, Fullquote Under).

        Reversing the chronology of the dialog makes it much harder to
        understand (some folks won't even read it if written in that style).
        For more information on quoting style, see:

         http://web.presby.edu/~nnqadmin/nnq/nquote.html

    Speak Perl rather than English, when possible
        Perl is much more precise than natural language. Saying it in Perl
        instead will avoid misunderstanding your question or problem.

        Do not say: I have variable with "foo\tbar" in it.

        Instead say: I have $var = "foo\tbar", or I have $var = 'foo\tbar',
        or I have $var = <DATA> (and show the data line).

    Ask perl to help you
        You can ask perl itself to help you find common programming mistakes
        by doing two things: enable warnings (perldoc warnings) and enable
        "strict"ures (perldoc strict).

        You should not bother the hundreds/thousands of readers of the
        newsgroup without first seeing if a machine can help you find your
        problem. It is demeaning to be asked to do the work of a machine. It
        will annoy the readers of your article.

        You can look up any of the messages that perl might issue to find
        out what the message means and how to resolve the potential mistake
        (perldoc perldiag). If you would like perl to look them up for you,
        you can put "use diagnostics;" near the top of your program.

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.

    Provide enough information
        If you do the things in this item, you will have an Extremely Good
        chance of getting people to try and help you with your problem!
        These features are a really big bonus toward your question winning
        out over all of the other posts that you are competing with.

        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

        Describe *precisely* the input to your program. Also provide example
        input data for your program. If you need to show file input, use the
        __DATA__ token (perldata.pod) to provide the file contents inside of
        your Perl program.

        Show the output (including the verbatim text of any messages) of
        your program.

        Describe how you want the output to be different from what you are
        getting.

        If you have no idea at all of how to code up your situation, be sure
        to at least describe the 2 things that you *do* know: input and
        desired output.

    Do not provide too much information
        Do not just post your entire program for debugging. Most especially
        do not post someone *else's* entire program.

    Do not post binaries, HTML, or MIME
        clpmisc is a text only newsgroup. If you have images or binaries
        that explain your question, put them in a publically accessible
        place (like a Web server) and provide a pointer to that location. If
        you include code, cut and paste it directly in the message body.
        Don't attach anything to the message. Don't post vcards or HTML.
        Many people (and even some Usenet servers) will automatically filter
        out such messages. Many people will not be able to easily read your
        post. Plain text is something everyone can read.

  Social faux pas to avoid
    The first two below are symptoms of lots of FAQ asking here in clpmisc.
    It happens so often that folks will assume that it is happening yet
    again. If you have looked but not found, or found but didn't understand
    the docs, say so in your article.

    Asking a Frequently Asked Question
        It should be understood that you may have missed the applicable FAQ
        when you checked, which is not a big deal. But if the Frequently
        Asked Question is worded similar to your question, folks will assume
        that you did not look at all. Don't become indignant at pointers to
        the FAQ, particularly if it solves your problem.

    Asking a question easily answered by a cursory doc search
        If folks think you have not even tried the obvious step of reading
        the docs applicable to your problem, they are likely to become
        annoyed.

        If you are flamed for not checking when you *did* check, then just
        shrug it off (and take the answer that you got).

    Asking for emailed answers
        Emailed answers benefit one person. Posted answers benefit the
        entire community. If folks can take the time to answer your
        question, then you can take the time to go get the answer in the
        same place where you asked the question.

        It is OK to ask for a *copy* of the answer to be emailed, but many
        will ignore such requests anyway. If you munge your address, you
        should never expect (or ask) to get email in response to a Usenet
        post.

        Ask the question here, get the answer here (maybe).

    Beware of saying "doesn't work"
        This is a "red flag" phrase. If you find yourself writing that,
        pause and see if you can't describe what is not working without
        saying "doesn't work". That is, describe how it is not what you
        want.

    Sending a "stealth" Cc copy
        A "stealth Cc" is when you both email and post a reply without
        indicating *in the body* that you are doing so.

  Be extra cautious when you get upset
    Count to ten before composing a followup when you are upset
        This is recommended in all Usenet newsgroups. Here in clpmisc, most
        flaming sub-threads are not about any feature of Perl at all! They
        are most often for what was seen as a breach of netiquette. If you
        have lurked for a bit, then you will know what is expected and won't
        make such posts in the first place.

        But if you get upset, wait a while before writing your followup. I
        recommend waiting at least 30 minutes.

    Count to ten after composing and before posting when you are upset
        After you have written your followup, wait *another* 30 minutes
        before committing yourself by posting it. You cannot take it back
        once it has been said.

AUTHOR
    Tad McClellan <tadmc@augustmail.com> and many others on the
    comp.lang.perl.misc newsgroup.



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

Date: Friday, 12 Mar 2004 06:28:41 -0600
From: susan.thornburn@stees.nhs.uk
Subject: R_E_A_D    T_H_I_S
Message-Id: <12030406.2841@stees.nhs.uk>

Could you please send me an email about the above subject.

Any pictures appreciated too.

susan.thornburn@stees.nhs.uk

Thanks.



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

Date: 11 Mar 2004 22:42:45 -0800
From: mailsb04-posts@yahoo.com (Sriram)
Subject: Re: Regex doesn't match - what am I doing wrong?
Message-Id: <1bada5a3.0403112242.372e795d@posting.google.com>

Hi, 

My Perl book says "The $ and \Z assertions can match not only at the
end of the string, but also one character earlier than that, if the
last character of the string happens to be a newline."  This is also
how I'm used to regexs working in grep/sed etc.

Anno suggested the pattern !/[0-9]$/ to get what I want, but can
someone explain what's wrong with my way? The regex I was really after
is to match strings that start with a digit but don't end with one. I
tried this and it doesn't work for me (the following grep works
great):

bash-2.05b:10$perl -e 'while (<>) { if (/^\d(.*)[^\d]$/) {print;}}'

bash-2.05b:36$grep '^[0-9].*[^0-9]$'

Thanks for any pointers,
Sriram

Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrnc4v8b4.2ad.tadmc@magna.augustmail.com>...
> Sriram <mailsb04-posts@yahoo.com> wrote:
> 
> > I am having trouble matching a regex that combines a negated character
> > class and an anchor ($). Basically, I want to match all strings that
> > don't end in a digit. So I tried:
> > 
> > bash-2.05a@bermuda:15$perl -e 'while (<STDIN>) { if (/[^0-9]$/) {
> > print;}}'
> > skdsklds
> > skdsklds
> > sklskl2 <== why does this match? it ends in a digit.
> 
> 
> No it doesn't.
> 
> It ends with a newline character (which will match the [^0-9]). 
> 
> 
>    /[^0-9]\n/
> 
> ought to do it.


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

Date: 12 Mar 2004 07:45:57 GMT
From: Roel van der Steen <roel-perl@st2x.net>
Subject: Re: Regex doesn't match - what am I doing wrong?
Message-Id: <slrnc52qnt.j19.roel-perl@localhost.localdomain>

On Fri, 12 Mar 2004 at 06:42 GMT, Sriram wrote:
> The regex I was really after
> is to match strings that start with a digit but don't end with one. I
> tried this and it doesn't work for me (the following grep works
> great):
> 
> bash-2.05b:10$perl -e 'while (<>) { if (/^\d(.*)[^\d]$/) {print;}}'
                                                  ^^^^^
It's just as you explained yourself: the marked part matches the
newline character. So either chomp, or include the newline in your
regex. Both will work:


  perl -e 'while (<>) { chomp; print "$_\n" if /^\d(.*)[^\d]$/ }'

  perl -e 'while (<>) { print if /^\d(.*)[^\d]\n$/ }'
 
And yes, this behaviour appears to be different from grep's.


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

Date: 12 Mar 2004 09:02:08 GMT
From: Bhaskar Reddy <rbin.kor901209@in.bosch.com>
Subject: Spreadsheet::WriteExcel - Excel 97 install problem
Message-Id: <c2ruag$cg1$2@ns2.fe.internet.bosch.com>


Hello All,

 This is a problem regarding the module Spreadsheet::WriteExcel by 
jmcnamara@cpan.org

I had the old version of the module which worked fine. But due to the
increase in the size of the string in each cell, I had to move to the
new version (0.49.7). I unzipped the tar file and copied the files as 
shown
below..

MyPrj
 |
 |----csv2xls.pl  (My pl file which calls the write() method)
 |
 |----Spreadsheet
          |
          |----WriteExcel.pm
          |----WriteExcel
                   |----BIFFwriter.pm
                   |----Big.pm
                   |----Format.pm
                   |----Formula.pm
                   |----OLEwriter.pm
                   |----Utility.pm
                   |----Workbook.pm
                   |----WorkbookBig.pm
                   |----Worksheet.pm

This folder structure worked fine till I copied the new version
0.49.7.
After copying the new version I get this following error

Can't locate File/Temp.pm in @INC (@INC contains: lib
/tools/perl/5.005/lib/5.00501/sun4-solaris
/tools/perl/5.005/lib/5.00501
/tools/perl/5.005/lib/site_perl/5.005/sun4-solaris
/tools/perl/5.005/lib/site_perl/5.005 .) at
lib/Spreadsheet/WriteExcel/Worksheet.pm line 21.
BEGIN failed--compilation aborted at
lib/Spreadsheet/WriteExcel/Worksheet.pm line 21.
BEGIN failed--compilation aborted at
lib/Spreadsheet/WriteExcel/Workbook.pm line 20.
BEGIN failed--compilation aborted at lib/Spreadsheet/WriteExcel.pm
line 17.
BEGIN failed--compilation aborted at
/home/dbh2fe/arte/scripts/em2xls.pl line 36


Can anyone please help me where I am going wrong ?
I did not understand where to create the temp directory and where this
temp.pm is located..

-- 
TIA & Best Regards
Bhaskar Reddy

reddy dot bhaskar at bosch dot com


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

Date: Fri, 12 Mar 2004 11:34:16 +0100
From: "kz" <kz15@earthling.net>
Subject: Re: Spreadsheet::WriteExcel - Excel 97 install problem
Message-Id: <Zug4c.1$ih6.1940@news.uswest.net>

"Bhaskar Reddy" <rbin.kor901209@in.bosch.com> wrote in message
news:c2ruag$cg1$2@ns2.fe.internet.bosch.com...
>
> Hello All,
>
>  This is a problem regarding the module Spreadsheet::WriteExcel by
> jmcnamara@cpan.org
>
> I had the old version of the module which worked fine. But due to the
> increase in the size of the string in each cell, I had to move to the
> new version (0.49.7). I unzipped the tar file and copied the files as
> shown
> below..
>
> MyPrj
>  |
>  |----csv2xls.pl  (My pl file which calls the write() method)
>  |
>  |----Spreadsheet
>           |
>           |----WriteExcel.pm
>           |----WriteExcel
>                    |----BIFFwriter.pm
>                    |----Big.pm
>                    |----Format.pm
>                    |----Formula.pm
>                    |----OLEwriter.pm
>                    |----Utility.pm
>                    |----Workbook.pm
>                    |----WorkbookBig.pm
>                    |----Worksheet.pm
>
> This folder structure worked fine till I copied the new version
> 0.49.7.
> After copying the new version I get this following error
>
> Can't locate File/Temp.pm in @INC (@INC contains: lib
> /tools/perl/5.005/lib/5.00501/sun4-solaris
> /tools/perl/5.005/lib/5.00501
> /tools/perl/5.005/lib/site_perl/5.005/sun4-solaris
> /tools/perl/5.005/lib/site_perl/5.005 .) at
> lib/Spreadsheet/WriteExcel/Worksheet.pm line 21.
> BEGIN failed--compilation aborted at
> lib/Spreadsheet/WriteExcel/Worksheet.pm line 21.
> BEGIN failed--compilation aborted at
> lib/Spreadsheet/WriteExcel/Workbook.pm line 20.
> BEGIN failed--compilation aborted at lib/Spreadsheet/WriteExcel.pm
> line 17.
> BEGIN failed--compilation aborted at
> /home/dbh2fe/arte/scripts/em2xls.pl line 36
>
>
> Can anyone please help me where I am going wrong ?
> I did not understand where to create the temp directory and where this
> temp.pm is located..
>
> -- 
> TIA & Best Regards
> Bhaskar Reddy
>
> reddy dot bhaskar at bosch dot com

The module File::Temp is a prerequisite to install Spreadsheet::WriteExcel,
so you have to install it as well. Also, where did you get version 0.49.7
from? The latest version available on CPAN is 0.42...
You might need also:
Date::Calc
Date::Manip
OLE::Storage_Lite
Parse::RecDescent

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-0.42/

HTH,

Zoltan Kandi, M. Sc.




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

Date: Fri, 12 Mar 2004 13:43:39 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Text editor implemented in Perl
Message-Id: <3262543.eed3zGlcXm@GMT-hosting-and-pickle-farming>

James Taylor wrote:

> I just wondered whether anyone has thought to write a programmers'
> text/data editor in Perl and allow the full power of Perl's s///eg
> operator for manipulating the file being edited. The ability
> to perform this kind of day to day manipulation visually using
> my favourite language would be quite sincerely and deeply cool.
> 
> Ideally, I'd like the editor itself to be hackable in Perl too.
> 
> Is there such a thing? If not, what's the closest alternative?
> 

Vi & emacs already support regular expressions in searches, and have done
for 20 years.

gtoomey


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

Date: Fri, 12 Mar 2004 09:26:25 +0000
From: fifo <fifo@despammed.com>
Subject: Re: Text editor implemented in Perl
Message-Id: <20040312092621.GB18297@fleece>

At 2004-03-12 13:43 +1000, Gregory Toomey wrote:
> James Taylor wrote:
> > I just wondered whether anyone has thought to write a programmers'
> > text/data editor in Perl and allow the full power of Perl's s///eg
> > operator for manipulating the file being edited. The ability
> > to perform this kind of day to day manipulation visually using
> > my favourite language would be quite sincerely and deeply cool.
> > 
> 
> Vi & emacs already support regular expressions in searches, and have done
> for 20 years.
> 

Yes, but they don't normally have support for arbitrary perl expressions
in a substitution.  It's possible though to use the editor's shell
command feature.  In Emacs for example, you can select a region and do

  C-u M-| perl -pe 's/this/that/g' RET


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

Date: Fri, 12 Mar 2004 11:04:10 +0000
From: zzapper <david@tvis.co.uk>
Subject: Tricky Perl Bug (amusing/unamusing)
Message-Id: <8q535018uusim12qqa25j5e4g8oneg4mtm@4ax.com>

Hi Y'All
 ...
$
$phone=($phonelocal =~ /\d\d/) ? "$phonelocal":"$phonecentral";
 ...

In the above code snippet $phone was always being assigned
SCALAR(0x18ef230) this drove me crazy until I FINALLY noticed the
STRAY DOLLAR on the previous line (not so easy to spot in 100's of
lines of code)

presumably Perl saw this as a process number ie

$$phone=($phonelocal =~ /\d\d/) ? "$phonelocal":"$phonecentral";

perl -w did not indicate anything amiss

Posted to warn others; comments,commiserations,critiques welcome

zzapper (vim & cygwin & zsh)
--

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"

http://www.vim.org/tips/tip.php?tip_id=305  Best of Vim Tips


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

Date: Fri, 12 Mar 2004 08:58:15 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: using an assoc. array as a 'set'
Message-Id: <h6l1505804v8cr5v88nq720mt92932iv27@4ax.com>

On 11 Mar 2004 09:09:25 GMT, "Tassilo v. Parseval"
<tassilo.parseval@rwth-aachen.de> wrote:

>> Of course, even provided that (some) people agree with me, how one
>> would go about to integrate new syntax for these "sets" consistently
>> is beyond my imagination!
>
>I suppose it should be done on top of simple hashes. Note that this is

And not the other way round...

>already possible right now with the help of tied hashes. With a simple
>
>    FETCH { $_[0]->EXISTS($_[1]) }
>
>you can just write
>
>    if ($h{key}) {
>
>and this will return true even if $h{key} is undefined (but existant).

At first I thought you misunderstood me, but thinking of this better:
Cool! Basically AIUI %h is "automatically" restricted to a
charachteristic function, on the set of "all" strings, thus being
identificable with a finite subset of it, i.e. exactly a (generic)
finite set of strings...


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: Thu, 11 Mar 2004 16:02:16 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: variable initialization question
Message-Id: <110320041602166470%jgibson@mail.arc.nasa.gov>

In article <FoL3c.7518$xL3.215@bignews1.bellsouth.net>, Alexander
Stremitzer <stremitz@consultant.com> wrote:

> I found that the following statement only initializes the first variable.
> my ($a,$b,$c) = 0;
> A way that works is:
> my ($a,$b,$c) = (0,0,0);
> 
> Is there a simpler way to initialize all variables with the same value 0 ?
> 
> Thanks,
> Alex
> 

There's always 

   my $a = my $b = my $c = 0;

:)


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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