[32178] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3443 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 13 21:15:48 2011

Date: Wed, 13 Jul 2011 18:09:10 -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           Wed, 13 Jul 2011     Volume: 11 Number: 3443

Today's topics:
        How do I know I am running on Windows command line ? <ang.usenet@gmail.com>
    Re: How do I know I am running on Windows command line  <uri@StemSystems.com>
    Re: How do I know I am running on Windows command line  <ang.usenet@gmail.com>
    Re: How do I know I am running on Windows command line  <jimsgibson@gmail.com>
    Re: How do I know I am running on Windows command line  <ang.usenet@gmail.com>
    Re: How do I know I am running on Windows command line  <uri@StemSystems.com>
    Re: How do I know I am running on Windows command line  <ang.usenet@gmail.com>
    Re: How do I know I am running on Windows command line  <jimsgibson@gmail.com>
        perl file extension in emacs <xahlee@gmail.com>
    Re: perl file extension in emacs <rweikusat@mssgmbh.com>
    Re: remove undefined values witout warnings <jl_post@hotmail.com>
    Re: style?: how to convert to boolean: false,no -> 0, y <kst-u@mib.org>
    Re: style?: how to convert to boolean: false,no -> 0, y <uri@StemSystems.com>
    Re: test two hash(refs) for equality <derykus@gmail.com>
    Re: test two hash(refs) for equality <tadmc@seesig.invalid>
    Re: test two hash(refs) for equality <derykus@gmail.com>
    Re: test two hash(refs) for equality <rweikusat@mssgmbh.com>
    Re: test two hash(refs) for equality <tadmc@seesig.invalid>
    Re: What Programing Language are the Largest Website Wr <cartercc@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 13 Jul 2011 22:38:49 +0100
From: "Aaron Gray" <ang.usenet@gmail.com>
Subject: How do I know I am running on Windows command line ?
Message-Id: <986hkdF9pU1@mid.individual.net>

I have an existing perl script that does a "chmod" via "system()".

I need to know I am running on Windows to no do the chmod.

How do I detect whether perl is being run on the command line ?

Many thanks in advance,

Aaron



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

Date: Wed, 13 Jul 2011 18:24:22 -0400
From: "Uri Guttman" <uri@StemSystems.com>
To: "Aaron Gray" <ang.usenet@gmail.com>
Subject: Re: How do I know I am running on Windows command line ?
Message-Id: <87aachlsyx.fsf@quad.sysarch.com>

>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:

  AG> I have an existing perl script that does a "chmod" via "system()".

why are you using system when perl has chmod builtin?

  AG> I need to know I am running on Windows to no do the chmod.

check the value of $^O. read perldoc perlvar for more.

  AG> How do I detect whether perl is being run on the command line ?

that is not the same as knowing which OS you are running under. why do
you need to know this? and this is running from a command line vs what?

uri


-- 
Uri Guttman  --  uri AT perlhunter DOT com  ---  http://www.perlhunter.com --
------------  Perl Developer Recruiting and Placement Services  -------------
-----  Perl Code Review, Architecture, Development, Training, Support -------


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

Date: Wed, 13 Jul 2011 23:34:15 +0100
From: "Aaron Gray" <ang.usenet@gmail.com>
Subject: Re: How do I know I am running on Windows command line ?
Message-Id: <986ksjFnsoU1@mid.individual.net>

"Uri Guttman" <uri@StemSystems.com> wrote in message 
news:87aachlsyx.fsf@quad.sysarch.com...
>>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:
>
>  AG> I have an existing perl script that does a "chmod" via "system()".
>
> why are you using system when perl has chmod builtin?

Its an existing project I am porting to Windows.

>  AG> I need to know I am running on Windows to no do the chmod.
>
> check the value of $^O. read perldoc perlvar for more.

Sorry I am very new to Perl so this means nothing to me.

>  AG> How do I detect whether perl is being run on the command line ?
>
> that is not the same as knowing which OS you are running under. why do
> you need to know this? and this is running from a command line vs what?

Okay, I think using the builtin chmod is the way forward. How do I do this ?

Many thanks,

Aaron



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

Date: Wed, 13 Jul 2011 15:44:15 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: How do I know I am running on Windows command line ?
Message-Id: <130720111544150158%jimsgibson@gmail.com>

In article <986ksjFnsoU1@mid.individual.net>, Aaron Gray
<ang.usenet@gmail.com> wrote:

> "Uri Guttman" <uri@StemSystems.com> wrote in message 
> news:87aachlsyx.fsf@quad.sysarch.com...
> >>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:
> >
> >  AG> I have an existing perl script that does a "chmod" via "system()".
> >
> >  AG> I need to know I am running on Windows to no do the chmod.
> >
> > check the value of $^O. read perldoc perlvar for more.
> 
> Sorry I am very new to Perl so this means nothing to me.

$^O is a variable just as $x is a variable. You can print it:

  print "OS is $^O\n";

or use it in expressions:

  if( $^O eq 'WINDOWS' ) {
    ...

> Okay, I think using the builtin chmod is the way forward. How do I do this ?

  chmod 0755, 'file';

-- 
Jim Gibson


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

Date: Wed, 13 Jul 2011 23:55:04 +0100
From: "Aaron Gray" <ang.usenet@gmail.com>
Subject: Re: How do I know I am running on Windows command line ?
Message-Id: <986m3lFq5U1@mid.individual.net>

"Jim Gibson" <jimsgibson@gmail.com> wrote in message 
news:130720111544150158%jimsgibson@gmail.com...
> In article <986ksjFnsoU1@mid.individual.net>, Aaron Gray
> <ang.usenet@gmail.com> wrote:
>
>> "Uri Guttman" <uri@StemSystems.com> wrote in message
>> news:87aachlsyx.fsf@quad.sysarch.com...
>> >>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:
>> >
>> >  AG> I have an existing perl script that does a "chmod" via "system()".
>> >
>> >  AG> I need to know I am running on Windows to no do the chmod.
>> >
>> > check the value of $^O. read perldoc perlvar for more.
>>
>> Sorry I am very new to Perl so this means nothing to me.
>
> $^O is a variable just as $x is a variable. You can print it:
>
>  print "OS is $^O\n";
>
> or use it in expressions:
>
>  if( $^O eq 'WINDOWS' ) {
>    ...

I am getting 'MSWin32' for $^O. Is there some library function for dealing 
with this as I would like it to run on 64 bit machines too.

>
>> Okay, I think using the builtin chmod is the way forward. How do I do 
>> this ?
>
>  chmod 0755, 'file';

I need to do a 'u+w' and an 'a-w'

Thanks for the help,

Aaron



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

Date: Wed, 13 Jul 2011 19:00:00 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: How do I know I am running on Windows command line ?
Message-Id: <874o2plrbj.fsf@quad.sysarch.com>

>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:

  AG> "Uri Guttman" <uri@StemSystems.com> wrote in message
  AG> news:87aachlsyx.fsf@quad.sysarch.com...
  >>>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:
  >> 
  AG> I have an existing perl script that does a "chmod" via "system()".
  >> 
  >> why are you using system when perl has chmod builtin?

  AG> Its an existing project I am porting to Windows.

so change the code to use perl's builtin chmod.

  AG> I need to know I am running on Windows to no do the chmod.
  >> 
  >> check the value of $^O. read perldoc perlvar for more.

  AG> Sorry I am very new to Perl so this means nothing to me.

why then did you get a project porting a perl program?

anyhow, you can read perl documents online at perldoc.perl.org or by
running the command 'perldoc perlvar' on your console or terminal
window.


  AG> How do I detect whether perl is being run on the command line ?
  >> 
  >> that is not the same as knowing which OS you are running under. why do
  >> you need to know this? and this is running from a command line vs what?

  AG> Okay, I think using the builtin chmod is the way forward. How do I do this ?

you need to learn basic perl at least if you are going to do this
project. go to learn.perl.org and read the free beginning perl book
there. also there are a bunch of very good perl tutorial documents to
read. perldoc.perl.org has them all if you like reading on the web.

uri


-- 
Uri Guttman  --  uri AT perlhunter DOT com  ---  http://www.perlhunter.com --
------------  Perl Developer Recruiting and Placement Services  -------------
-----  Perl Code Review, Architecture, Development, Training, Support -------


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

Date: Thu, 14 Jul 2011 01:13:12 +0100
From: "Aaron Gray" <ang.usenet@gmail.com>
Subject: Re: How do I know I am running on Windows command line ?
Message-Id: <986qmeFv5aU1@mid.individual.net>

"Uri Guttman" <uri@StemSystems.com> wrote in message 
news:874o2plrbj.fsf@quad.sysarch.com...
>>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:
>
>  AG> "Uri Guttman" <uri@StemSystems.com> wrote in message
>  AG> news:87aachlsyx.fsf@quad.sysarch.com...
>  >>>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:
>  >>
>  AG> I have an existing perl script that does a "chmod" via "system()".
>  >>
>  >> why are you using system when perl has chmod builtin?
>
>  AG> Its an existing project I am porting to Windows.
>
> so change the code to use perl's builtin chmod.
>
>  AG> I need to know I am running on Windows to no do the chmod.
>  >>
>  >> check the value of $^O. read perldoc perlvar for more.
>
>  AG> Sorry I am very new to Perl so this means nothing to me.
>
> why then did you get a project porting a perl program?
>
> anyhow, you can read perl documents online at perldoc.perl.org or by
> running the command 'perldoc perlvar' on your console or terminal
> window.
>
>
>  AG> How do I detect whether perl is being run on the command line ?
>  >>
>  >> that is not the same as knowing which OS you are running under. why do
>  >> you need to know this? and this is running from a command line vs 
> what?
>
>  AG> Okay, I think using the builtin chmod is the way forward. How do I do 
> this ?
>
> you need to learn basic perl at least if you are going to do this
> project. go to learn.perl.org and read the free beginning perl book
> there. also there are a bunch of very good perl tutorial documents to
> read. perldoc.perl.org has them all if you like reading on the web.

Uri,

Its just part for a larger C++ based project and is used as a small part of 
the build system, which is mainly 'make' based. I am porting from Linux to 
MS Visual Studio.

Aaron



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

Date: Wed, 13 Jul 2011 17:44:26 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: How do I know I am running on Windows command line ?
Message-Id: <130720111744261078%jimsgibson@gmail.com>

In article <986m3lFq5U1@mid.individual.net>, Aaron Gray
<ang.usenet@gmail.com> wrote:

> "Jim Gibson" <jimsgibson@gmail.com> wrote in message 
> news:130720111544150158%jimsgibson@gmail.com...
> > In article <986ksjFnsoU1@mid.individual.net>, Aaron Gray
> > <ang.usenet@gmail.com> wrote:
> >
> >> "Uri Guttman" <uri@StemSystems.com> wrote in message
> >> news:87aachlsyx.fsf@quad.sysarch.com...
> >> >>>>>> "AG" == Aaron Gray <ang.usenet@gmail.com> writes:
> >> >

> 
> I am getting 'MSWin32' for $^O. Is there some library function for dealing 
> with this as I would like it to run on 64 bit machines too.

From 'perldoc perlvar':

$^O     The name of the operating system under which this copy of Perl
        was built, as determined during the configuration process.  The
        value is identical to $Config{'osname'}.  See also Config and
        the -V command-line switch documented in perlrun.

        In Windows platforms, $^O is not very helpful: since it is
        always "MSWin32", it doesn't tell the difference between
        95/98/ME/NT/2000/XP/CE/.NET.  Use Win32::GetOSName() or
        Win32::GetOSVersion() (see Win32 and perlport) to distinguish
        between the variants.


> >> Okay, I think using the builtin chmod is the way forward. How do I do 
> >> this ?
> >
> >  chmod 0755, 'file';
> 
> I need to do a 'u+w' and an 'a-w'

'a' stands for 'ugo', so those two are incompatible.

Unfortunately, the built-in Perl chmod uses absolute numerical mode
values.

'u+w' would be ($mode | 0200)
'a-w' would be ($mode & 0555)

You can get the current mode of a file from the stat function:

my($mode) = (stat($file)[2];


Maybe you just want to use

  chmod 0644, $file

-- 
Jim Gibson


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

Date: Wed, 13 Jul 2011 04:56:37 -0700 (PDT)
From: Xah Lee <xahlee@gmail.com>
Subject: perl file extension in emacs
Message-Id: <551dce00-e7f9-43ff-82b6-3a17775ba77a@d8g2000prf.googlegroups.com>

emacs's 'auto-mode-alist has this value
("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode)

the regex there seems a bit wild. If i didn't get it wrong, then its
like this

 . ([pP] ( [Llm] | erl | od ) | al )

so it covers:

 .pal
 .pl
 .perl
 .pod
 .pm

plus SOME case variations. e.g. {.pL , .PL}.

Seems am wrong about =93.pal=94 there because opening a file ending in
=93.pal=94 doesn't work. But i don't get it.

is it necessary to include the =93.pod=94? because the perl-mode doesn't
do any coloring with =93.pod=94 files, nor cperl-mode. If there's a mode
handing =93.pod=94 file am guessing it won't be perl-mode.

also, is the =93.perl=94 there necessary? Is that a accepted perl file
suffix? (Just checked it's not in perl v5.10.1.)

would it be better if it's just

("\\.\\(p\\([lm]\\)\\)\\'" . perl-mode)

?

 Xah


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

Date: Wed, 13 Jul 2011 13:50:24 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: perl file extension in emacs
Message-Id: <8739ia4a5r.fsf@sapphire.mobileactivedefense.com>

Xah Lee <xahlee@gmail.com> writes:
> emacs's 'auto-mode-alist has this value
> ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode)
>
> the regex there seems a bit wild. If i didn't get it wrong, then its
> like this
>
> . ([pP] ( [Llm] | erl | od ) | al )
>
> so it covers:
>
> .pal
> .pl
> .perl
> .pod
> .pm
>
> plus SOME case variations. e.g. {.pL , .PL}.
>
> Seems am wrong about “.pal” there because opening a file ending in
> “.pal” doesn't work. But i don't get it.

You are misreading the outer |: The extension is actually .al and
(AFAIK) files with this extension are generated by AutoSplit and
supposed to be used via AutoLoader (both are 'standard' Perl modules).

> is it necessary to include the “.pod”?

Actually, it seems to be wrong: The emacs version I'm using (22.2.1)
has a POD mode which does some 'fancy rendering' for .pod files (and
presumably, other stuff as well).


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

Date: Wed, 13 Jul 2011 17:01:11 -0700 (PDT)
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: remove undefined values witout warnings
Message-Id: <a2942439-f288-4737-b9c2-4a2d9bbeba3f@g12g2000yqd.googlegroups.com>

> On 2011-07-10 16:02, George Mpouras <nospam.gravital...@hotmail.com.nospa=
m> wrote:
>
> > # I want to remove whitespace or undef values from an array without
> > warnings. No luck so far

On Jul 10, 10:50=A0am, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
>
> @array =3D grep { defined && ! /^\s*$/ } @array;

   Nice, but I'd simplify the regular expression just a bit more:

      @array =3D grep { defined and m/\S/ } @array;

   -- Jean-Luc


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

Date: Wed, 13 Jul 2011 12:10:32 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: style?: how to convert to boolean: false,no -> 0, yes, true -> 1
Message-Id: <ln7h7mro7r.fsf@nuthaus.mib.org>

"Uri Guttman" <uri@StemSystems.com> writes:
>>>>>> "g" == gry  <georgeryoung@gmail.com> writes:
>
>   g> BTW, the reason for
>   g>    die "Can't open stress suites file \"$file_name\": $!";
>   g> is that I don't trust users not to use a file name like "file name",
>   g> which would make the die message confusing.
>
> no, you didn't get my comment. use single quotes around $file_name so
> you don't need to escape the " chars which makes for harder to read
> code.

I (mildly) disagree with you on this one.  I find this:
    Can't open stress suites file "foo.txt": No such file or directory
slightly more readable than this:
    Can't open stress suites file 'foo.txt': No such file or directory

and I consider the backslashes in the source code an acceptable price to
pay to get the former rather than the latter.

(I *think* US English tends to use double quotes where UK English tends
to use single quotes; that might be the difference.)

Of course you can use qq(...) and avoid the backslashes.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"


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

Date: Wed, 13 Jul 2011 15:52:31 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: style?: how to convert to boolean: false,no -> 0, yes, true -> 1
Message-Id: <87hb6qm000.fsf@quad.sysarch.com>

>>>>> "KT" == Keith Thompson <kst-u@mib.org> writes:

  KT> "Uri Guttman" <uri@StemSystems.com> writes:
  >>>>>>> "g" == gry  <georgeryoung@gmail.com> writes:
  >> 
  g> BTW, the reason for
  g> die "Can't open stress suites file \"$file_name\": $!";
  g> is that I don't trust users not to use a file name like "file name",
  g> which would make the die message confusing.
  >> 
  >> no, you didn't get my comment. use single quotes around $file_name so
  >> you don't need to escape the " chars which makes for harder to read
  >> code.

  KT> I (mildly) disagree with you on this one.  I find this:
  KT>     Can't open stress suites file "foo.txt": No such file or directory
  KT> slightly more readable than this:
  KT>     Can't open stress suites file 'foo.txt': No such file or directory

  KT> and I consider the backslashes in the source code an acceptable price to
  KT> pay to get the former rather than the latter.

  KT> Of course you can use qq(...) and avoid the backslashes.

which is the correct other solution. i have no problem reading 'foo.txt'
for a filename. all i need is to see some quotes around it to mark it
off. in my diag prints i usually use [] around data so i can see exactly
what i am printing. i see others use quotes and it is harder to see then
and when you have multiple things to print, which is the open vs close
quote. so paired delims work better there.

uri

-- 
Uri Guttman  --  uri AT perlhunter DOT com  ---  http://www.perlhunter.com --
------------  Perl Developer Recruiting and Placement Services  -------------
-----  Perl Code Review, Architecture, Development, Training, Support -------


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

Date: Tue, 12 Jul 2011 18:27:37 -0700 (PDT)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: test two hash(refs) for equality
Message-Id: <bf358d1c-7684-434c-ad90-5a17779020a6@k23g2000pri.googlegroups.com>

On Jul 12, 5:39=A0pm, "C.DeRykus" <dery...@gmail.com> wrote:

> Hm, =A0sprintf's prototype is '$@' so @a gets
> coerced to an array.
                ^^^^^
                scalar

> That results in a print output of '3'. Are you =A0
> suggesting that perl could/should alter sprintf's
> prototype to be just '@' =A0?

--
Charles DeRykus


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

Date: Tue, 12 Jul 2011 21:50:11 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: test two hash(refs) for equality
Message-Id: <slrnj1q1hk.3do.tadmc@tadbox.sbcglobal.net>

C.DeRykus <derykus@gmail.com> wrote:
> On Jul 12, 5:39 pm, "C.DeRykus" <dery...@gmail.com> wrote:
>
>> Hm,  sprintf's prototype is '$@' so @a gets
>> coerced to an array.
>                 ^^^^^
>                 scalar
>
>> That results in a print output of '3'.

Both

    my @a = ("%s: %d\n", 'Zementmischer', 100);

and the original

    my @a = ("%s: %d\n", 'Zementmischer', 3);

make the same output.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.


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

Date: Tue, 12 Jul 2011 21:50:49 -0700 (PDT)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: test two hash(refs) for equality
Message-Id: <b7508b2a-ec28-43a6-81a8-22701a96fce3@g3g2000prf.googlegroups.com>

On Jul 12, 7:50=A0pm, Tad McClellan <ta...@seesig.invalid> wrote:
> C.DeRykus <dery...@gmail.com> wrote:
> > On Jul 12, 5:39=A0pm, "C.DeRykus" <dery...@gmail.com> wrote:
>
> >> Hm, =A0sprintf's prototype is '$@' so @a gets
> >> coerced to an array.
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 scalar
>
> >> That results in a print output of '3'.
>
> Both
>
> =A0 =A0 my @a =3D ("%s: %d\n", 'Zementmischer', 100);
>
> and the original
>
> =A0 =A0 my @a =3D ("%s: %d\n", 'Zementmischer', 3);
>
> make the same output.
>

And... ?   Yes, the array-to-scalar coercion
results in these same sized arrays printing 3
each time.


--
Charles DeRykus


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

Date: Wed, 13 Jul 2011 11:37:06 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: test two hash(refs) for equality
Message-Id: <87sjqa4gbx.fsf@sapphire.mobileactivedefense.com>

"C.DeRykus" <derykus@gmail.com> writes:
> On Jul 11, 5:13am, Rainer Weikusat <rweiku...@mssgmbh.com> wrote:
>> >> Why do you believe that an array evaluated in a scalar context would
>> >> be equivalent to passing two scalar values when the evaluation returns
>> >> only one?
>>
>> > But it works correctly without the prototype:
>>
>> It will work 'correctly' whenever what you want to do actually happens
>> to be correct. A much more interesting example would be the following:
>>
>> -----------
>> #!/usr/bin/perl
>> #
>> #
>>
>> my @a = ("%s: %d\n", 'Zementmischer', 3);
>> print(sprintf(@a));
>> -----------
>>
>> [assuming that the formatted string was supposed to be printed]
>>
>> This, too, will 'work correctly' once you have perl changed so that it
>> behaves like you would like it to behave.
>
> Hm,  sprintf's prototype is '$@' so @a gets
> coerced to an array. That results in a print
> output of '3'. Are you  suggesting that perl
> could/should  alter sprintf's prototype to be
> just '@'  ?

I'm "suggesting" that the person I was replying to always has two
options when something doesn't work because he is using it wrongly:

	- use it correctly
        - change that something so that it works how he would like it
          to work


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

Date: Wed, 13 Jul 2011 12:55:09 -0500
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: test two hash(refs) for equality
Message-Id: <slrnj1rmic.5n7.tadmc@tadbox.sbcglobal.net>

C.DeRykus <derykus@gmail.com> wrote:
> On Jul 12, 7:50 pm, Tad McClellan <ta...@seesig.invalid> wrote:
>> C.DeRykus <dery...@gmail.com> wrote:
>> > On Jul 12, 5:39 pm, "C.DeRykus" <dery...@gmail.com> wrote:
>>
>> >> Hm,  sprintf's prototype is '$@' so @a gets
>> >> coerced to an array.
>> >                 ^^^^^
>> >                 scalar
>>
>> >> That results in a print output of '3'.
>>
>> Both
>>
>>     my @a = ("%s: %d\n", 'Zementmischer', 100);
>>
>> and the original
>>
>>     my @a = ("%s: %d\n", 'Zementmischer', 3);
>>
>> make the same output.
>>
>
> And... ?   


It was provided for those playing along at home who may
have not caught the implications of your followups.


> Yes, the array-to-scalar coercion
> results in these same sized arrays printing 3
> each time.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.


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

Date: Wed, 13 Jul 2011 13:04:47 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: What Programing Language are the Largest Website Written In?
Message-Id: <cd983e08-daef-433e-8a97-789a5fe0c2bf@v7g2000vbk.googlegroups.com>

On Jul 12, 7:54 am, Xah Lee <xah...@gmail.com> wrote:
> maybe this will be of interest.
>
> =A1=B4What Programing Language Are the Largest Website Written In?=A1=B5h=
ttp://xahlee.org/comp/website_lang_popularity.html

About five years ago, I did some pretty extensive research, and
concluded that the biggest sites were written serverside with JSP.
Obviously, this wouldn't include The Biggest site, but if you were a
big, multinational corporation, or listed on the NYSE, you used JSP
for your web programming.

I doubt very seriously PHP is used for the biggest sites -- I'd still
guess JSP, or maybe a MS technology (not VB), but it's only a guess.

CC.


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

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


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