[31535] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2794 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 28 14:09:53 2010

Date: Thu, 28 Jan 2010 11:09:37 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 28 Jan 2010     Volume: 11 Number: 2794

Today's topics:
        discarding stdout when using 'system(@args)' <justin.0911@purestblue.com>
    Re: discarding stdout when using 'system(@args)' <tadmc@seesig.invalid>
    Re: discarding stdout when using 'system(@args)' <ben@morrow.me.uk>
    Re: discarding stdout when using 'system(@args)' <justin.0911@purestblue.com>
    Re: discarding stdout when using 'system(@args)' <uri@StemSystems.com>
    Re: How to install Math::BigInt::GMP? <here@softcom.net>
    Re: Inconsistent results from (dos)glob <tcmvandenheuvel@gmail.com>
    Re: Inconsistent results from (dos)glob <nospam-abuse@ilyaz.org>
    Re: Inconsistent results from (dos)glob <tcmvandenheuvel@gmail.com>
    Re: Inconsistent results from (dos)glob <nospam-abuse@ilyaz.org>
    Re: Inconsistent results from (dos)glob <tcmvandenheuvel@gmail.com>
    Re: Modules for PDFs especially tables. <justin.0911@purestblue.com>
        Nokia 7610 Supernova <muhammadsalman712@gmail.com>
    Re: Nokia 7610 Supernova <ralph.malph@altavista.com>
        Nokia X3 <muhammadsalman712@gmail.com>
    Re: print array with separator? <derykus@gmail.com>
    Re: print array with separator? <derykus@gmail.com>
    Re: print array with separator? <derykus@gmail.com>
    Re: print array with separator? <rvtol+usenet@xs4all.nl>
        Samsung B3210 CorbyTXT <muhammadsalman712@gmail.com>
        Samsung B7300 OMNIALite <muhammadsalman712@gmail.com>
        should C<++$_ for -1..1> croak?  <rvtol+usenet@xs4all.nl>
    Re: should C<++$_ for -1..1> croak? <smallpond@juno.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 28 Jan 2010 11:17:11 -0000
From: Justin C <justin.0911@purestblue.com>
Subject: discarding stdout when using 'system(@args)'
Message-Id: <1589.4b617237.5eaf@zem>

I have:

    my @args = ("pdflatex", $fnames->{tex});
    system(@args) == 0 or warn "Problem running pdflatex : $?\n";

This dumps a lot to stdout (the user's browser). I've tried the above
with:

    my @args = ("pdflatex", $fnames->{tex}, "1>/dev/null 2>&1");

But I still get unwanted output to the browser. If I run the two
versions of the command directly on a Linux command line, the one that
discards stdout works as expected. It's just under perl/cgi that it's
not discarding it.

I've had a look at the FAQ, specifically "How can I capture STDERR from 
an external command?", and it suggests the change I implemented above. 
Am I missing something? Is there another FAQ I should be reading instead?

Thank you for any help you can give.

	Justin.

-- 
Justin C, by the sea.


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

Date: Thu, 28 Jan 2010 06:59:04 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: discarding stdout when using 'system(@args)'
Message-Id: <slrnhm32a7.85c.tadmc@tadbox.sbcglobal.net>

Justin C <justin.0911@purestblue.com> wrote:
> I have:
>
>     my @args = ("pdflatex", $fnames->{tex});
>     system(@args) == 0 or warn "Problem running pdflatex : $?\n";
>
> This dumps a lot to stdout (the user's browser). I've tried the above
> with:
>
>     my @args = ("pdflatex", $fnames->{tex}, "1>/dev/null 2>&1");
>
> But I still get unwanted output to the browser. 


You should read the documentation for the functions that you use.

The first paragraph of

    perldoc -f system

points out what the problem is.



If you want to use shell redirection, then you must use the
form of system that calls a shell:

    system "pdflatex $fnames->{tex} 1>/dev/null 2>&1";


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"


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

Date: Thu, 28 Jan 2010 13:46:56 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: discarding stdout when using 'system(@args)'
Message-Id: <g3h837-td51.ln1@osiris.mauzo.dyndns.org>


Quoth Tad McClellan <tadmc@seesig.invalid>:
> Justin C <justin.0911@purestblue.com> wrote:
> > I have:
> >
> >     my @args = ("pdflatex", $fnames->{tex});
> >     system(@args) == 0 or warn "Problem running pdflatex : $?\n";
> >
> > This dumps a lot to stdout (the user's browser). I've tried the above
> > with:
> >
> >     my @args = ("pdflatex", $fnames->{tex}, "1>/dev/null 2>&1");
> >
> > But I still get unwanted output to the browser. 
> 
> 
> You should read the documentation for the functions that you use.
> 
> The first paragraph of
> 
>     perldoc -f system
> 
> points out what the problem is.
> 
> 
> 
> If you want to use shell redirection, then you must use the
> form of system that calls a shell:
> 
>     system "pdflatex $fnames->{tex} 1>/dev/null 2>&1";

Or, better use IPC::Run, which will allow you to keep the advantages of
avoiding the shell.

Ben



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

Date: Thu, 28 Jan 2010 16:06:30 -0000
From: Justin C <justin.0911@purestblue.com>
Subject: Re: discarding stdout when using 'system(@args)'
Message-Id: <36b4.4b61b606.6af59@zem>

On 2010-01-28, Tad McClellan <tadmc@seesig.invalid> wrote:
> Justin C <justin.0911@purestblue.com> wrote:
>> I have:
>>
>>     my @args = ("pdflatex", $fnames->{tex});
>>     system(@args) == 0 or warn "Problem running pdflatex : $?\n";
>>
>> This dumps a lot to stdout (the user's browser). I've tried the above
>> with:
>>
>>     my @args = ("pdflatex", $fnames->{tex}, "1>/dev/null 2>&1");
>>
>> But I still get unwanted output to the browser. 
>
>
> You should read the documentation for the functions that you use.
>
> The first paragraph of
>
>     perldoc -f system
>
> points out what the problem is.

It does? It is possible that I'm not understanding the finer points of
what the document says. Here's what it says on my system:

<quote>
Does exactly the same thing as "exec LIST", except that a fork
is done first, and the parent process waits for the child
process to complete.  Note that argument processing varies
depending on the number of arguments.  If there is more than
one argument in LIST, or if LIST is an array with more than one
value, starts the program given by the first element of the
list with arguments given by the rest of the list.  If there is
only one scalar argument, the argument is checked for shell
metacharacters, and if there are any, the entire argument is
passed to the system's command shell for parsing (this is
"/bin/sh -c" on Unix platforms, but varies on other platforms).
If there are no shell metacharacters in the argument, it is
split into words and passed directly to "execvp", which is more
efficient
</quote>

I've read 'man sh' relating to the -c switch, but the more I read
(perldoc or 'man sh') the more I need to read to understand what is
going on.

The bottom line is, I do not understand what it is with "system(@args)"
that means I'm getting STDOUT even though STDOUT is being re-directed.


> If you want to use shell redirection, then you must use the
> form of system that calls a shell:
>
>     system "pdflatex $fnames->{tex} 1>/dev/null 2>&1";

Reading the documentation for system, again, I don't understand how this
differs from what I have. "The argument processing varies depending on
the number of arguments", OK, "starts the program given by the first
element of the list with arguments given by the rest of the list". How
does this differ from your form ("system "pdflatex...") above?

I'm not trying to be difficult here, I just don't get it. Thank you for
taking the time to reply.

	Justin.

-- 
Justin C, by the sea.


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

Date: Thu, 28 Jan 2010 11:37:40 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: discarding stdout when using 'system(@args)'
Message-Id: <87iqamyyln.fsf@quad.sysarch.com>

>>>>> "JC" == Justin C <justin.0911@purestblue.com> writes:

  JC> It does? It is possible that I'm not understanding the finer points of
  JC> what the document says. Here's what it says on my system:

  JC> <quote>
  JC> Does exactly the same thing as "exec LIST", except that a fork
  JC> is done first, and the parent process waits for the child
  JC> process to complete.  Note that argument processing varies
  JC> depending on the number of arguments.  If there is more than
  JC> one argument in LIST, or if LIST is an array with more than one
  JC> value, starts the program given by the first element of the
  JC> list with arguments given by the rest of the list.  If there is
  JC> only one scalar argument, the argument is checked for shell
  JC> metacharacters, and if there are any, the entire argument is
  JC> passed to the system's command shell for parsing (this is
  JC> "/bin/sh -c" on Unix platforms, but varies on other platforms).
  JC> If there are no shell metacharacters in the argument, it is
  JC> split into words and passed directly to "execvp", which is more
  JC> efficient
  JC> </quote>

  JC> I've read 'man sh' relating to the -c switch, but the more I read
  JC> (perldoc or 'man sh') the more I need to read to understand what is
  JC> going on.

  JC> The bottom line is, I do not understand what it is with "system(@args)"
  JC> that means I'm getting STDOUT even though STDOUT is being re-directed.

but you are not redirecting stdout. the > syntax is only understood by
the shell and not by perl or exec. when you pass a list of args to
system (or exec) it BYPASSES the shell and does the fork/exec itself
passing in all the args to the new process. try printing out @ARGV when
you do your form of system (run a trivial perl script in system to do
that). so either you use the single string arg form of system and that
will let the shell parse the command and handle redirection or you run
the process yourself with ipc::run or some other method and handle
stdout yourself. you can also run the command in backticks and grab the
stdout yourself which is the same as redirection if you write that
output to where you want it.

  >> If you want to use shell redirection, then you must use the
  >> form of system that calls a shell:
  >> 
  >> system "pdflatex $fnames->{tex} 1>/dev/null 2>&1";

  JC> Reading the documentation for system, again, I don't understand how this
  JC> differs from what I have. "The argument processing varies depending on
  JC> the number of arguments", OK, "starts the program given by the first
  JC> element of the list with arguments given by the rest of the list". How
  JC> does this differ from your form ("system "pdflatex...") above?

one arg vs many args. simple.

uri

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


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

Date: Wed, 27 Jan 2010 20:15:37 -0800 (PST)
From: Sal <here@softcom.net>
Subject: Re: How to install Math::BigInt::GMP?
Message-Id: <e0dade5c-7e19-4bbc-a387-ffe09c26b03c@w27g2000pre.googlegroups.com>

On Jan 27, 4:05=A0pm, Jim Gibson <jimsgib...@gmail.com> wrote:
> In article
> <0d8c120e-1fdb-4312-a979-859ffa604...@n4g2000yqf.googlegroups.com>, Sal
>
> <h...@softcom.net> wrote:
> > I would like to use Math::BigInt::GMP with my ActivePerl v 5.10 but it
> > doesn't appear in the ppm list. Can someone tell me how to get it?
>
> I've got it (version 1.24) in my ActivePerl v.5.10.0. It looks like its
> available from the repository <http://cpan.uwinnipeg.ca>. Do you have
> that one in your list of repositories?
>
> Edit -> Preferences -> Repositories -> Suggested (UWinnipeg) -> Add in
> your Perl Package Manager (ppm).
>
> --
> Jim Gibson

Thank you.


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

Date: Wed, 27 Jan 2010 18:20:42 -0800 (PST)
From: Theo van den Heuvel <tcmvandenheuvel@gmail.com>
Subject: Re: Inconsistent results from (dos)glob
Message-Id: <fb6ef67b-3a35-4b3b-8f65-5e95db4ed5ec@36g2000yqu.googlegroups.com>

On 28 jan, 02:25, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Theo van den Heuvel <tcmvandenheu...@gmail.com>:
>

>
> Then I'm afraid you need to go grubbing around in File::DosGlob adding
> debug statements until you find where the problem is (or use the
> debugger, if that's your cup of tea).
>
> Ben

Something like that. However it is both DosGlob and the ordinary glob
that misbehaves.
I need to get some sleep first, and will apply the debugger first
thing in the morning.

Theo


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

Date: Thu, 28 Jan 2010 03:42:15 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Inconsistent results from (dos)glob
Message-Id: <slrnhm21sn.41p.nospam-abuse@powdermilk.math.berkeley.edu>

On 2010-01-27, Theo van den Heuvel <tcmvandenheuvel@gmail.com> wrote:
> my $subdir = "$Bin/FIResources";
> my @file = <"$subdir/*">;
> my @file_again = glob("\"$subdir\"/*");

If this works, then ONLY due to bugs in glob() (this is IMO; prove me wrong if
you can).  Use
  bsdglob( "$subdir/*" ) 
instead.

Hope this helps,
Ilya


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

Date: Thu, 28 Jan 2010 00:34:37 -0800 (PST)
From: Theo van den Heuvel <tcmvandenheuvel@gmail.com>
Subject: Re: Inconsistent results from (dos)glob
Message-Id: <62730212-3103-4abf-a697-a9786b325a78@b10g2000yqa.googlegroups.com>

On 28 jan, 04:42, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrote:
> On 2010-01-27, Theo van den Heuvel <tcmvandenheu...@gmail.com> wrote:
>
> > my $subdir =3D "$Bin/FIResources";
> > my @file =3D <"$subdir/*">;
> > my @file_again =3D glob("\"$subdir\"/*");
>
> If this works, then ONLY due to bugs in glob() (this is IMO; prove me wro=
ng if
> you can). =A0Use
> =A0 bsdglob( "$subdir/*" )
> instead.
>
> Hope this helps,
> Ilya

Dear Ilya,

bsd_glob() does work consistently on both systems. This means I have a
solution and that makes me a happy man.

My confusion, however, has increased, because the documentation
suggests that glob is implemented in terms of bsd_glob. I added the
double quotes to avoid that glob splits
the path on the spaces. (Spaces in names IMO is one of the most
unfortunate design mistakes in Windows).

Anyway, thanks a million, Ilya,

Theo


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

Date: Thu, 28 Jan 2010 11:39:40 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Inconsistent results from (dos)glob
Message-Id: <slrnhm2trs.595.nospam-abuse@powdermilk.math.berkeley.edu>

On 2010-01-28, Theo van den Heuvel <tcmvandenheuvel@gmail.com> wrote:
>> > my @file_again = glob("\"$subdir\"/*");
>>
>> If this works, then ONLY due to bugs in glob() (this is IMO; prove me wrong if
>> you can).  Use
>>   bsdglob( "$subdir/*" )
>> instead.

> bsd_glob() does work consistently on both systems. This means I have a
> solution and that makes me a happy man.
>
> My confusion, however, has increased, because the documentation
> suggests that glob is implemented in terms of bsd_glob.

 ... but interprets spaces differently...

> I added the double quotes to avoid that glob splits the path on the
> spaces.

And what made you think that this would "avoid this"?  (Except, maybe,
experiments with a buggy implementation?)

Yours,
Ilya


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

Date: Thu, 28 Jan 2010 11:00:24 -0800 (PST)
From: Theo van den Heuvel <tcmvandenheuvel@gmail.com>
Subject: Re: Inconsistent results from (dos)glob
Message-Id: <48a305f1-6d2f-4be4-ac28-b7ece1f475bf@22g2000yqr.googlegroups.com>

On 28 jan, 12:39, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrote:
> On 2010-01-28, Theo van den Heuvel <tcmvandenheu...@gmail.com> wrote:
>
> >> > my @file_again =3D glob("\"$subdir\"/*");
>

> > My confusion, however, has increased, because the documentation
> > suggests that glob is implemented in terms of bsd_glob.
>
> ... but interprets spaces differently...

Ok. Something I am missing in the documentation.

>
> > I added the double quotes to avoid that glob splits the path on the
> > spaces.
>
> And what made you think that this would "avoid this"? =A0(Except, maybe,
> experiments with a buggy implementation?)

Yes. Naively, surely, I guessed from the fact that you can use double
quotes in a Windows command box in the same way. Prior to your
comments I had no indication that glob was buggy. I am still in shock
about that.

>
> Yours,
> Ilya

Thanks,

Theo


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

Date: Thu, 28 Jan 2010 10:59:01 -0000
From: Justin C <justin.0911@purestblue.com>
Subject: Re: Modules for PDFs especially tables.
Message-Id: <10b5.4b616df5.f513@zem>

On 2010-01-21, Justin C <justin.0911@purestblue.com> wrote:
> I want to produce a PDF containing two tables side by side. Each 51
> rows (including a header) by three columns. Columns 1 and 2 in each 
> table are to contain centred text, and column three is to be
> left-aligned.
>
> I've been experimenting with PDF::API2, and PDF::Table, but PDF::Table
> doesn't appear to do centred text, and PDF::API2 is hard work - the
> documentation leaves a lot to be desired, for example, surfing the web
> for hints on using PDF::API2 I find references to methods not mentioned
> in the PDF::API2 documentation.
>
> Does anyone have any suggestions on how I might proceed? TeX looks like
> it might be the best way forward now, I have Lamport's LaTeX book here
> so can pull together the relevant TeX/LaTeX commands. I suppose that, if
> I can knock up what I want in TeX to start with I won't even need a TeX
> module, I can just use some templating.
>
> I'll probably still need Latex::Driver to get my PDF. 
>
> Thank you for any suggestions.

Thank you to all who replied. Some interesting reading.

I really don't fancy learning PostScript right now, and doing the whole
thing by hand. Maybe I'll save learning PS for another time. 

In the end I've had to ditch LaTeX::Driver, I kept getting errors within
the module itself and couldn't figure out how to fix it. In the end I
made a mock-up Tex document, and used it as a template. I'm running
pdflatex from a perl 'system' command... but this has an unwanted
side-effect (time for another thread). 

Thanks again for your suggestions, I didn't realise there were so many
different solutions to the problem.

	Justin.

-- 
Justin C, by the sea.


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

Date: Thu, 28 Jan 2010 08:27:43 -0800 (PST)
From: Muhammad Salman <muhammadsalman712@gmail.com>
Subject: Nokia 7610 Supernova
Message-Id: <a61110c5-9a8f-4316-82f3-0acfb3d43920@2g2000prl.googlegroups.com>

 Nokia 7610 Supernova - Sleek. Gorgeous. Reflective Nokia 7610
Supernova is Sleek, chic, and colourful with a beautiful mirrored
surface and exchangeable Xpress-onTM covers. For details:
http://infomobilepk.blogspot.com
Note: Don't forget to click on ads.


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

Date: Thu, 28 Jan 2010 11:32:44 -0500
From: Ralph Malph <ralph.malph@altavista.com>
Subject: Re: Nokia 7610 Supernova
Message-Id: <hjse7c$chu$1@speranza.aioe.org>

Muhammad Salman wrote:
[spam snipped]
> Note: Don't forget to click on ads.
This is some awesome spam! I actually laughed out
loud!


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

Date: Thu, 28 Jan 2010 08:27:19 -0800 (PST)
From: Muhammad Salman <muhammadsalman712@gmail.com>
Subject: Nokia X3
Message-Id: <e07fc490-2b2c-45ee-9f15-bb2429b78e57@g8g2000pri.googlegroups.com>

Nokia X3 - Play. Slide. Share. Nokia X3 offers you a complete music
experience, and is also designed to bring you closer to the people in
your life. For details: http://infomobilepk.blogspot.com
Note: Don't forget to click on ads.


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

Date: Wed, 27 Jan 2010 18:41:38 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: print array with separator?
Message-Id: <437f6d96-5fcd-41eb-a051-1a26c94dc9e7@g8g2000pri.googlegroups.com>

On Jan 27, 4:54=A0pm, "Uri Guttman" <u...@StemSystems.com> wrote:
> >>>>> "CD" =3D=3D C DeRykus <dery...@gmail.com> writes:
>
> =A0 CD> =A0 =A0perl -e 'grep ++$_, -2..2'
> =A0 CD> =A0 =A0perl -e 'grep ++$_, [-2..2]'
>
> =A0 CD> grep appears to be creating a temp array in the former case inste=
ad
> =A0 CD> of a list.
>
> the second line makes no sense as it is passing an array ref to grep.

Oops, right, I meant: perl -we "print grep ++$_, @{[0..1]}"

> ...

--
Charles DeRykus


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

Date: Wed, 27 Jan 2010 19:07:51 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: print array with separator?
Message-Id: <69fdb791-72c1-476b-9bf5-178ca17d2128@l24g2000prh.googlegroups.com>

On Jan 27, 5:18=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth "C.DeRykus" <dery...@gmail.com>:
>
> > On Jan 27, 1:43=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> > > Quoth J=FCrgen Exner <jurge...@hotmail.com>:
>
> > > > "C.DeRykus" <dery...@gmail.com> wrote:
> > > > >I prefer the for modifier but wish 'void' was a keyword for side-
> > > > >effects only map use.
>
> > > Dear Lord no. That's as bad as the people who insist on casting
> > > everything to (void) in C. Evaluating a function in void context is a
> > > perfectly ordinary thing to do, so why does it need a redundant keywo=
rd?
>
> > I mentioned "crazies" but you're probably right. Rather than
> > judicious use in cases like map to bridge changed semantics,
> > it'd turn viral.
>
> There are no changed semantics, just an optimisation.

Agreed, "bridge the optimization" would have been the correct
wording.

>
> > > > Doesn't
> > > > =A0 =A0undef =3D map .....
> > > > work (I didn't try it)?
>
> > > No, that's scalar assignment, which gives scalar context to the RHS. =
At
> > > runtime you get 'Modification of a read-only value attempted', of
> > > course.
>
> > Ah. I suppose you could still signal map's only purpose were the
> > side-effects with =A0'() =3D map ...' (added keystrokes+slower though)
>
> That's a list assignment, so the RHS is in list context (it *is*
> possible to try these things before posting, you know).
>

Um, I was addressing the broader issue of using map in scalar
context without generating a LHS list.  I *wanted* to suggest
map could be put in list context and resultant list tossed to
clarify that only the side-effects were of interest.

--
Charles DeRykus


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

Date: Wed, 27 Jan 2010 19:15:11 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: print array with separator?
Message-Id: <c16a3d24-a3c8-46f9-bd99-8b1205373737@t31g2000prh.googlegroups.com>

On Jan 27, 7:07=A0pm, "C.DeRykus" <dery...@gmail.com> wrote:
> On Jan 27, 5:18=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
>
> ...
>
>
> > > > > Doesn't
> > > > > =A0 =A0undef =3D map .....
> > > > > work (I didn't try it)?

Ah,  I think the above is  attributed to me but I didn't say it.

>
> > > > No, that's scalar assignment, which gives scalar context to the RHS=
 . At
> > > > runtime you get 'Modification of a read-only value attempted', of
> > > > course.
>
> > > Ah. I suppose you could still signal map's only purpose were the
> > > side-effects with =A0'() =3D map ...' (added keystrokes+slower though=
)
>
> > That's a list assignment, so the RHS is in list context (it *is*
> > possible to try these things before posting, you know).

I see how the mis-attribution created more confusion now.
>
> Um, I was addressing the broader issue of using map in scalar
> context without generating a LHS list. =A0I *wanted* to suggest
> map could be put in list context and resultant list tossed to
> clarify that only the side-effects were of interest.

And that's why I responded here in this vein.

--
Charles DeRykus



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

Date: Thu, 28 Jan 2010 13:17:41 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: print array with separator?
Message-Id: <4b618065$0$22918$e4fe514c@news.xs4all.nl>

C.DeRykus wrote:

> Ah. I suppose you could still signal map's only purpose were the
> side-effects with  '() = map ...' (added keystrokes+slower though)

That would signal that you don't want map to optimize for void context. 
(map knows when it is in void context)

-- 
Ruud


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

Date: Thu, 28 Jan 2010 08:26:45 -0800 (PST)
From: Muhammad Salman <muhammadsalman712@gmail.com>
Subject: Samsung B3210 CorbyTXT
Message-Id: <5d4420b5-4d9c-47d7-8cae-9f430c6d6e78@u15g2000prd.googlegroups.com>

Samsung B3210 CorbyTXT - Colorful Message Expres Corby TXT=92s
changeable, colorful Fashion Jackets of Samsung B3210 CorbyTXT let you
dress it up and express it all =96 each & every mood you're in. For
details: http://infomobilepk.blogspot.com
Note: Don't forget to click on ads.


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

Date: Thu, 28 Jan 2010 08:26:14 -0800 (PST)
From: Muhammad Salman <muhammadsalman712@gmail.com>
Subject: Samsung B7300 OMNIALite
Message-Id: <01e1f193-8d0f-453a-89e7-d3f8d51cdae6@q2g2000pre.googlegroups.com>

Samsung B7300 OMNIA lite - Simple All-Rounder Powered by TOUCHWiZ 2.0,
Samsung B7300 OMNIALite=92s user-friendly UI gives you easy access to
Windows Platform.For details: http://infomobilepk.blogspot.com
Note: Don't forget to click on ads.


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

Date: Thu, 28 Jan 2010 13:24:53 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: should C<++$_ for -1..1> croak? 
Message-Id: <4b618216$0$22944$e4fe514c@news.xs4all.nl>

Should C<++$_ for -1..1> croak?

Or is it better to leave it as it is?



$ perl -wle'++$_ for 1..1'


$ perl -wle'++$_ for 1'
Modification of a read-only value attempted at -e line 1.


-- 
Ruud


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

Date: Thu, 28 Jan 2010 12:11:32 -0500
From: Steve C <smallpond@juno.com>
Subject: Re: should C<++$_ for -1..1> croak?
Message-Id: <hjsggf$s7k$1@news.eternal-september.org>

Dr.Ruud wrote:
> Should C<++$_ for -1..1> croak?
> 
> Or is it better to leave it as it is?
> 
> 
> 
> $ perl -wle'++$_ for 1..1'
> 
> 
> $ perl -wle'++$_ for 1'
> Modification of a read-only value attempted at -e line 1.
> 
> 

for implicitly aliases $_ to the constant 1, which cannot be incremented.


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

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:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#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 2794
***************************************


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