[30210] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1453 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 16 00:14:36 2008

Date: Tue, 15 Apr 2008 21:14:23 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 15 Apr 2008     Volume: 11 Number: 1453

Today's topics:
    Re: modules for nntp client <gerry@nowhere.ford>
    Re: modules for nntp client <1usa@llenroc.ude.invalid>
    Re: modules for nntp client <ben@morrow.me.uk>
    Re: moving unused of a website <benkasminbullock@gmail.com>
    Re: moving unused of a website <1usa@llenroc.ude.invalid>
    Re: moving unused of a website <tadmc@seesig.invalid>
    Re: moving unused of a website <tadmc@seesig.invalid>
    Re: PERL to mean what 'perldoc perl' says is wrong? (wa <get@bentsys.com>
    Re: PERL to mean what 'perldoc perl' says is wrong? (wa <someone@example.com>
    Re: PERL to mean what 'perldoc perl' says is wrong? <get@bentsys.com>
    Re: PERL to mean what 'perldoc perl' says is wrong? <uri@stemsystems.com>
    Re: PERL to mean what 'perldoc perl' says is wrong? <uri@stemsystems.com>
    Re: PERL to mean what 'perldoc perl' says is wrong? <cwilbur@chromatico.net>
    Re: Print a separator between each iteration of a forea <ff0000.it@gmail.com>
    Re: Some questions about q{} and qr{}. <rvtol+news@isolution.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 15 Apr 2008 15:31:45 -0500
From: "Gerry Ford" <gerry@nowhere.ford>
Subject: Re: modules for nntp client
Message-Id: <1208291067_15@news.newsgroups.com>


"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message 
news:Xns9A811A523EFEEasu1cornelledu@127.0.0.1...
> "Gerry Ford" <gerry@nowhere.ford> wrote in
> news:1208239309_8@news.newsgroups.com:
>
>> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
>> news:Xns9A80CC6552B84asu1cornelledu@127.0.0.1...

>>> In any case, I am not sure but I am assuming it is an
>>> version of the following module:
>>>
>>> http://search.cpan.org/~jlmorel/Win32-Console-ANSI-1.00/
>>
>> I don't think it is.
>
> I think it is.

Thanks again for your attention.

It turned out we were somewhat both correct (and errant, but that's glass 
half-empty).  I heard from the author and downloaded what he thought 
ANSIConsole.pm was.  Here's what the first of it looks like:
package Win32::ANSIConsole;

use strict;
use warnings;
use Win32::Console::ANSI qw/SetConsoleSize Title/;

require Exporter;
our @ISA = qw(Exporter);
our %EXPORT_TAGS = ('const' => [qw(BOLD UNDER BLINK REVERSE
    BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE
    BBLACK BRED BGREEN BYELLOW BBLUE BMAGENTA BCYAN BWHITE)]);
our @EXPORT_OK = (@{$EXPORT_TAGS{'const'}}, qw(coninit title attr cls
        clreol curpos));

, so  Win32::Console::ANSI is just a heartbeat away, and this version is a 
home-rolled wrapper that probably makes a sexier layout on windows because 
of what all he stuffs into coninit (it's rows, columns and colors--win32 
specific).

With his version in  /lib/Win32/ and your version in /lib/Win32/Console, 
perl.exe doesn't puke on any of the use statements.  All but this one were 
included in the core.


>>> If you cannot find that through ppm, you might want to
>>> add the following repositories:
>>>
>>> Name: uwinnipeg
>>> URL: http://cpan.uwinnipeg.ca/PPMPackages/10xx/package.xml
>>>
>>> Name: trouchelle
>>> URL: http://trouchelle.com/ppm10/package.xml
>>>
>>> Name: Bribes
>>> URL: http://www.bribes.org/perl/ppm/package.xml
>>
>> I looked at these, and they look like:
>> Common Gateway Interface Class Lincoln D. Stein (lstein@cshl.org)
>
> Those are repositories to add to ppm.
>
>> This looks like it was expecting a program to read text, not a
>> human ambling about, trying to find a module.
>
> Exactly. Add the repositories to ppm.

This was a huge breakthrough for me today.  I was able to use AS's ppm with 
confidence for the first time today.  I got two of those loaded.  AS hangs 
on the trouchelle one. (?)

>>> E:\Home\asu1> ppm install Win32::Console::ANSI
>>> Downloading Win32-Console-ANSI-1.00...done
>>> Unpacking Win32-Console-ANSI-1.00...done
>>> Generating HTML for Win32-Console-ANSI-1.00...done
>>> Updating files in site area...done
>>>   7 files installed
>> How do I replicate this process on windows?  As it is, a file that
>> ends in tar.gz just creates huge problems for me.
>
> Use ppm.

Are you suggesting that if I have a tar.gz creature on my desktop, I can use 
ppm to install it?
-- 
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."

~~  Booman 




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

Date: Tue, 15 Apr 2008 23:37:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: modules for nntp client
Message-Id: <Xns9A81C7B4BDF36asu1cornelledu@127.0.0.1>

"Gerry Ford" <gerry@nowhere.ford> wrote in
news:1208291067_15@news.newsgroups.com: 

> 
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message 
> news:Xns9A811A523EFEEasu1cornelledu@127.0.0.1...
>> "Gerry Ford" <gerry@nowhere.ford> wrote in
>> news:1208239309_8@news.newsgroups.com:

 ...

>>>> E:\Home\asu1> ppm install Win32::Console::ANSI
>>>> Downloading Win32-Console-ANSI-1.00...done
>>>> Unpacking Win32-Console-ANSI-1.00...done
>>>> Generating HTML for Win32-Console-ANSI-1.00...done
>>>> Updating files in site area...done
>>>>   7 files installed
>>> How do I replicate this process on windows?  As it is, a file
>>> that ends in tar.gz just creates huge problems for me.
>>
>> Use ppm.
> 
> Are you suggesting that if I have a tar.gz creature on my desktop,
> I can use ppm to install it?

No, I misunderstood your question.

I have MS VC++ Express 2008 (or version 9, it goes by both names 
apparently) installed. So far, I have run into no problems with

perl Makefile.PL

nmake -f Makefile

nmake -f Makefile test

nmake -f Makefile install

If you do install it, make sure to run the commands in cmd.exe shell 
you start by using the shortcut installed in the Tools subfolder of 
the VC++ folder in the start menu.

So, extract the compressed archive into a directory (preserving the 
directory structure), start the said cmd.exe shell and off you go!

You might find

http://sourceforge.net/projects/console/

useful.

There is also Strawberry Perl http://strawberryperl.com/

I haven't looked at it since last year, but the new site design is 
cute!

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 16 Apr 2008 02:29:35 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: modules for nntp client
Message-Id: <vc1gd5-m361.ln1@osiris.mauzo.dyndns.org>


Quoth "A. Sinan Unur" <1usa@llenroc.ude.invalid>:
> 
> I have MS VC++ Express 2008 (or version 9, it goes by both names 
> apparently) installed. So far, I have run into no problems with

If this is with ActivePerl, you may be better off swiching to gcc.
ActivePerl is built with MSVC 6, and MSVC 9 has a different,
incompatible (differently-named, in fact) msvcrt.dll. This means that if
an extension calls a libc function directly, you will end up trying to
load two different versions of the C library into the same process.
Unsurprisingly, this doesn't work terribly well... gcc uses a MSVC
6-compatible msvcrt.dll, and recent versions of ActivePerl have support
for switching to gcc if it's in your path.

Ben



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

Date: Tue, 15 Apr 2008 22:36:10 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: moving unused of a website
Message-Id: <fu3akp$pl5$1@ml.accsnet.ne.jp>

On Tue, 15 Apr 2008 14:18:38 +0000, A. Sinan Unur wrote:

>> I wrote a perl-script to find all unused pix of a web site. Now I would
>> like to move all those 168! pix from the folder pix to the folder
>> pix_out keeping the same hierarchy as in the original folder. That
>> means:
>> 
>> /Users/xxx/Documents/webpages/www.myproject.de/pix/fotos/
>> thumbnails/tn_munich28.jpg
>> 
>> should be renamed to:
>> 
>> /Users/xxx/Documents/webpages/www.myproject.de/pix_out/fotos/
>> thumbnails/tn_munich28.jpg
> 
> Learn to use the right tool for the job. The command line tool move is
> perfect for this.
> 
> move /Users/xxx/Documents/webpages/www.myproject.de/pix
> /Users/xxx/Documents/webpages/www.myproject.de/pix_out

As far as I can understand the original poster has a list of pictures he 
wants to move to directories with the name changed in the middle of the 
list. What you're suggesting is going to move everything in the 
directories, not just the pictures he wants to move.

>> Only one folder is changing his name: pix -> pix_out And this with all
>> my 168 unused pix in different folders.
> 
> I am not sure what you mean by this.

Well, why post a reply to a question, if you don't understand it?
 
> 
>> I was hoping, that the rename function would create the missing
>> folders, doing:
>> 
>> rename "/Users/xxx/Documents/webpages/www.myproject.de/pix/fotos/
>> thumbnails/tn_munich28.jpg", "/Users/xxx/Documents/webpages/
>> www.myproject.de/pix_out/fotos/thumbnails/tn_munich28.jpg";
>> 
>> But there is even no error message, trying to do it like this with one
>> test file.
> 
> Why would there be an error message if you don't ask for it?

Whether there's an error message depends on the detailed behaviour of the 
function in question.

>> how to test whether a folder is already created? I tried with:
>> 
>> if (-e ! $dir_pix_out)

Here you need to say

if (!-d $dir_pix_out)
 
> However, testing and creation of the directory is not done in a single
> atomic transaction. Therefore, testing the existence of the directory
> before attempting to create it is of dubious use.

Really?

> Just do
> 
> mkdir $dir;
> 
> and make sure to check for errors in subsequent file operations because
> a directory that existed a few statements back can disappear
>  once you reach the file operations.

Really? I've never experienced that.


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

Date: Wed, 16 Apr 2008 00:08:45 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: moving unused of a website
Message-Id: <Xns9A81CCEE73B57asu1cornelledu@127.0.0.1>

Ben Bullock <benkasminbullock@gmail.com> wrote in
news:fu3akp$pl5$1@ml.accsnet.ne.jp: 

> On Tue, 15 Apr 2008 14:18:38 +0000, A. Sinan Unur wrote:
> 
>>> I wrote a perl-script to find all unused pix of a web site. Now
>>> I would like to move all those 168! pix from the folder pix to
>>> the folder pix_out keeping the same hierarchy as in the original
>>> folder. That means:
>>> 
>>> /Users/xxx/Documents/webpages/www.myproject.de/pix/fotos/
>>> thumbnails/tn_munich28.jpg
>>> 
>>> should be renamed to:
>>> 
>>> /Users/xxx/Documents/webpages/www.myproject.de/pix_out/fotos/
>>> thumbnails/tn_munich28.jpg
>> 
>> Learn to use the right tool for the job. The command line tool
>> move is perfect for this.
>> 
>> move /Users/xxx/Documents/webpages/www.myproject.de/pix
>> /Users/xxx/Documents/webpages/www.myproject.de/pix_out
> 
> As far as I can understand the original poster has a list of
> pictures he wants to move to directories with the name changed in
> the middle of the list. What you're suggesting is going to move
> everything in the directories, not just the pictures he wants to
> move. 

Well, I understood differently but your explanation makes more 
sense.

>>> Only one folder is changing his name: pix -> pix_out And this
>>> with all my 168 unused pix in different folders.
>> 
>> I am not sure what you mean by this.
> 
> Well, why post a reply to a question, if you don't understand it?

So that the OP can clarify it if he feels like it.

>>> I was hoping, that the rename function would create the missing
>>> folders, doing:
>>> 
>>> rename
>>> "/Users/xxx/Documents/webpages/www.myproject.de/pix/fotos/ 
>>> thumbnails/tn_munich28.jpg", "/Users/xxx/Documents/webpages/ 
>>> www.myproject.de/pix_out/fotos/thumbnails/tn_munich28.jpg";
>>> 
>>> But there is even no error message, trying to do it like this
>>> with one test file.
>> 
>> Why would there be an error message if you don't ask for it?
> 
> Whether there's an error message depends on the detailed behaviour
> of the function in question.

The caller should check if the function returned an error and 
display the error message if necessary. I also showed how to do 
that.

>> However, testing and creation of the directory is not done in a
>> single atomic transaction. Therefore, testing the existence of
>> the directory before attempting to create it is of dubious use.
> 
> Really?

IMHO, yes. If the directory already exists, nothing will happen. If 
it does not it will created (assuming no permissions issues).
 
>> Just do
>> 
>> mkdir $dir;
>> 
>> and make sure to check for errors in subsequent file operations

This is the important part. Especially in a scenario which I have 
seen occasionally in others' code where the existence of the target 
directory is checked before a lengthy loop of file copy operations.

>> because a directory that existed a few statements back can
>> disappear once you reach the file operations.
> 
> Really? I've never experienced that.

Ahem, I hate to admit it, but I am not sure exactly what I was 
thinking of. I seem to remember such a caution but I am not sure 
now.

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 16 Apr 2008 01:47:20 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: moving unused of a website
Message-Id: <slrng0afm3.1t1.tadmc@tadmc30.sbcglobal.net>

John W. Krahn <someone@example.com> wrote:
> Peter Ludikovsky wrote:

>> for(my $i=0;$i<$#filelist;$i++){
>
> You have an off-by-one error.  You are iterating through the first 
> element of @filelist through the second-to-last element of @filelist.


If you had used the standard Perl idiom

   foreach my $i ( 0 .. $#filelist ) {

instead of a C-style for(;;) loop, you would have had less
chance of inserting such a bug...

(and whitespace is not a scarce resource, so use some!)


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Wed, 16 Apr 2008 01:47:21 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: moving unused of a website
Message-Id: <slrng0aooh.1t1.tadmc@tadmc30.sbcglobal.net>

Marek <mstep@podiuminternational.org> wrote:

> my $pix_unused_pix =
> "/Users/xyz/Documents/webpages/www.myproject.de/pix/fotos/thumbnails/
> tn_munich17.jpg";

Look Ma! No wordwrap!

   my $pix_unused_pix = '/Users/xyz/Documents/webpages/www.myproject.de/'
                      . 'pix/fotos/thumbnails/tn_munich17.jpg';


> if ( !-e $pix_out_folder ) {

   unless ( -e $pix_out_folder ) {


> $first_sub = $pix_out_folder . '/' . $first_sub if $first_sub;

   $first_sub = "$pix_out_folder/$first_sub" if $first_sub;


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Tue, 15 Apr 2008 17:58:28 -0700
From: "Gordon Etly" <get@bentsys.com>
Subject: Re: PERL to mean what 'perldoc perl' says is wrong? (was: Re: perl should be improved and perl6)
Message-Id: <66l19mF2ku7cpU1@mid.individual.net>

Jürgen Exner wrote:
> "Gordon Etly" <get@bentsys.com> wrote:
>> What is so wrong with adding to that list,
>>
>>  "PERL" refers to "Practical Extraction and Report Language" ?
>
> Is there a particular reason, why you prefer that expansion over
> Larry's own suggestion "Pathologically Eclectic Rubbish Lister"?

It's not about what -I- prefer, but what is written in 'perldoc perl'. I 
do know the document that statement comes from, and I understand what 
you are getting at, but in the end it's what is written in 'perldoc 
perl' that I'm looking at.

>> That IS how acronyms work, whether people like you want to admit it
>> or not.
>
> Oh, and BTW: acronyms work exactly the opposite direction: You got a
> name, take the leading letters, and thus create a new artificial word.
> That would be an acronym.

Well if you are looking at pure semantics, then you're probably right, 
but in general, does it matter which end you are looking from, as long 
as you are looking at the same thing? It is written in long form in the 
documentation and thus not explicitly written as "PERL", and I know 
"PERL" is not used in the documentation, but the question remains, what 
is wrong with -using- "PERL" to -refer- to the meaning the documentation 
provides? That's all it is, a simple question.

> Having an artificial word and trying match the lead letters of a
> sequence of words to it is not an acronym but a backronym.

Granted, but please see above.

-- 
G.Etly 




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

Date: Wed, 16 Apr 2008 03:04:40 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: PERL to mean what 'perldoc perl' says is wrong? (was: Re: perl should be improved and perl6)
Message-Id: <c1eNj.465$n63.156@edtnps92>

Gordon Etly wrote:
> J=FCrgen Exner wrote:
>> "Gordon Etly" <get@bentsys.com> wrote:
>>> What is so wrong with adding to that list,
>>>
>>>  "PERL" refers to "Practical Extraction and Report Language" ?
>> Is there a particular reason, why you prefer that expansion over
>> Larry's own suggestion "Pathologically Eclectic Rubbish Lister"?
>=20
> It's not about what -I- prefer, but what is written in 'perldoc perl'. =
I=20
> do know the document that statement comes from, and I understand what=20
> you are getting at, but in the end it's what is written in 'perldoc=20
> perl' that I'm looking at.

There are some papers at the supermarket that have articles about the=20
existence of Bigfoot.  It's written down so it must be true.  There are=20
some books that say that the moon landings were faked.  It's written=20
down so it must be true.  There are some books that claim that the earth =

was created in six days.  It's written down so it must be true.


John
--=20
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Tue, 15 Apr 2008 18:00:48 -0700
From: "Gordon Etly" <get@bentsys.com>
Subject: Re: PERL to mean what 'perldoc perl' says is wrong?
Message-Id: <66l1e2F2l411pU1@mid.individual.net>

Charlton Wilbur wrote:
>>>>>> "GE" == Gordon Etly <get@bentsys.com> writes:
>
>> Yes, we all know that, and that is not the point I have tried
>> to make.
>
>> What is so wrong with adding to that list,
>
>>   "PERL" refers to "Practical Extraction and Report Language"
>> ?
>
> It does not reflect the usage patterns of the core Perl developers or
> Perl experts.

I understand that, honestly I do, but that is not what I was asking. 
Quite simply, 'perldoc perl' gives an expansion, and my question is why 
it should be wrong to use "PERL" as a short hand for that expansion, 
since the expansion is found in the official docs?

-- 
G.Etly 




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

Date: Wed, 16 Apr 2008 03:51:52 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: PERL to mean what 'perldoc perl' says is wrong?
Message-Id: <x7abjuzcbs.fsf@mail.sysarch.com>

>>>>> "GE" == Gordon Etly <get@bentsys.com> writes:

  GE> I understand that, honestly I do, but that is not what I was asking. 
  GE> Quite simply, 'perldoc perl' gives an expansion, and my question is why 
  GE> it should be wrong to use "PERL" as a short hand for that expansion, 
  GE> since the expansion is found in the official docs?

why don't you just shut up about this already like you said you
would? all the people who want to use PERL are those who never help
others here. when is the last time you posted an answer to any perl
questions here? you have no standing in the perl community (here or
elsewhere) so why should your opinion matter? the retronym/backronym of
PERL is known. it is only used as a JOKE in the title and the PERL
spelling is because of the man page macros. larry doesn't use PERL. no
decent perl hacker says PERL. only the lame defenders of it here and who
never show up when real help is asked for defend its use. this isn't 12
angry men and you aren't henry fonda. there is no life on the line but
your reputation is. do you want to be known as someone who defends silly
and unsupported stuff like PERL and for nothing else? just drop this
already (don't even reply if you can help it) and move along. maybe you
will do something in the future to regain what little reputation you
might have had. but until then keep quiet. you are just digging a bigger
hole and you are about to stop seeing any sky above you.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Wed, 16 Apr 2008 03:54:07 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: PERL to mean what 'perldoc perl' says is wrong?
Message-Id: <x763uizc80.fsf@mail.sysarch.com>

>>>>> "JWK" == John W Krahn <someone@example.com> writes:

  JWK> There are some papers at the supermarket that have articles about the
  JWK> existence of Bigfoot.  It's written down so it must be true.  There are
  JWK> some books that say that the moon landings were faked.  It's written
  JWK> down so it must be true.  There are some books that claim that the earth
  JWK> was created in six days.  It's written down so it must be true.

damn you!! you have ruined my decade by exposing my beliefs to
ridicule. i will have to start using PERL from now on!

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Tue, 15 Apr 2008 23:31:46 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: PERL to mean what 'perldoc perl' says is wrong?
Message-Id: <86hce2lbkt.fsf@mithril.chromatico.net>

>>>>> "GE" == Gordon Etly <get@bentsys.com> writes:

    >> It does not reflect the usage patterns of the core Perl
    >> developers or Perl experts.

    GE> I understand that, honestly I do, but that is not what I was
    GE> asking.  Quite simply, 'perldoc perl' gives an expansion, and
    GE> my question is why it should be wrong to use "PERL" as a short
    GE> hand for that expansion, since the expansion is found in the
    GE> official docs?

It's not *wrong*.  It will just mark you as either a novice or a
crank, because people who are not novices will have learned that
'PERL' is widely considered incorrect, and people who are not cranks
do not insist on rationalizing usage that is widely considered
incorrect.

If you do not want people to react to you as if you were a novice or a
crank, don't use 'PERL.'  Otherwise, carry on.  This is the advice
that the FAQ is giving you, if you only have the wit to read it.

Charlton




-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Tue, 15 Apr 2008 15:15:24 -0700 (PDT)
From: ff0000 <ff0000.it@gmail.com>
Subject: Re: Print a separator between each iteration of a foreach loop
Message-Id: <93a6a72d-4c16-4fb9-9298-7423a9769cdb@m36g2000hse.googlegroups.com>

Hi everyone,

> foreach (@ARGV) {
>         print $_;
>         print ',' unless last_element;}
>
> print "\n";
Could this version be useful to you? :

---/cut/---
#!/usr/bin/perl

my @a = qw(1 2 3 4 5);

for my $i (0..$#a) {
  print $a[$i] . (($i < $#a) ? ", " : "\n");
}

1;
---/cut/---

Bye.
ff0000


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

Date: Tue, 15 Apr 2008 22:53:29 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Some questions about q{} and qr{}.
Message-Id: <fu3bln.kk.1@news.isolution.nl>

Robbie Hatley schreef:

> Today I was editing a URL-likifying program I wrote several
> weeks ago, and I ran across some issues with q{} and qr{}
> which are puzzling me.

Consider Regexp::Common. 

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

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 V11 Issue 1453
***************************************


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