[31263] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2508 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 7 00:14:19 2009

Date: Mon, 6 Jul 2009 21:14:11 -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           Mon, 6 Jul 2009     Volume: 11 Number: 2508

Today's topics:
    Re: Perl scalars as numbers or character strings sln@netherlands.com
    Re: Perl scalars as numbers or character strings <uri@stemsystems.com>
    Re: Perl scalars as numbers or character strings <uri@stemsystems.com>
    Re: Perl scalars as numbers or character strings sln@netherlands.com
    Re: Perl scalars as numbers or character strings sln@netherlands.com
    Re: Perl scalars as numbers or character strings <cwilbur@chromatico.net>
    Re: Perl scalars as numbers or character strings sln@netherlands.com
    Re: Perl scalars as numbers or character strings <cwilbur@chromatico.net>
    Re: Perl scalars as numbers or character strings <paul@peschoen.com>
    Re: Perl scalars as numbers or character strings <jurgenex@hotmail.com>
    Re: Perl scalars as numbers or character strings <cwilbur@chromatico.net>
    Re: Perl scalars as numbers or character strings <jurgenex@hotmail.com>
    Re: Perl scalars as numbers or character strings sln@netherlands.com
    Re: Perl scalars as numbers or character strings <jurgenex@hotmail.com>
    Re: Perl scalars as numbers or character strings sln@netherlands.com
    Re: Perl scalars as numbers or character strings <kst-u@mib.org>
    Re: Perl scalars as numbers or character strings sln@netherlands.com
    Re: Perl scalars as numbers or character strings <tadmc@seesig.invalid>
    Re: Perl scalars as numbers or character strings <tadmc@seesig.invalid>
    Re: Perl scalars as numbers or character strings <jondk@FAKE.EMAIL.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 06 Jul 2009 15:14:27 -0700
From: sln@netherlands.com
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <cpt4551i3r3v5pohbskrn38tcbbtd91j2i@4ax.com>

On Mon, 06 Jul 2009 16:37:56 -0500, Tad J McClellan <tadmc@seesig.invalid> wrote:

>sln@netherlands.com <sln@netherlands.com> wrote:
>
>
>> I work for Google as a Perl manager.
>
>
>Pffft!
>
>Daydreaming of having a position is not actually the
>same as having acquired that position...

sln@google.com

-sln


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

Date: Mon, 06 Jul 2009 18:16:11 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <871vot1mqc.fsf@quad.sysarch.com>

>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:

  PES> "Uri Guttman" <uri@stemsystems.com> wrote in message 
  PES> news:87zlbh1q0x.fsf@quad.sysarch.com...
  >>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
  >> 
  >> as for you, how you are learning perl is bizarre given your claim to
  >> know c and other langs. do you know shell at all? awk even? unix in
  >> general? perl is best understood as being born of that environment
  >> (including c) and stealing the best of breeds from each.

  PES> I think I have a general aversion to languages that make
  PES> assumptions about variables, and that includes JavaScript and
  PES> VB. I know enough C and Delphi to make fairly complex Windows GUI
  PES> applications that operate on a nearly real-time basis with serial
  PES> communication and data analysis, and I use a version of C for
  PES> some PIC projects, but mostly I use assembly.

then you have an aversion to most popular languages today. c is still
used and is useful but it isn't good for dynamic data which is what web
apps typically need.

  PES> I don't know shell. I found this:
  PES> http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html

  PES> I have seen awk programs. I am not familiar with the syntax.

  PES> I know a few unix commands and I have used FTP and Telnet, but
  PES> that's about it. It seems similar to MSDOS but with more powerful
  PES> features (like grep).

what rock did you live under if you think unix is ftp and telnet? do you
still code on punch cards? i gave that up in 1975.

  PES> I think it will not be worth it for me to learn enough Perl to do
  PES> even the simple things I may want to do. I should probably just
  PES> hire an expert or use some canned scripts and web apps, and stick
  PES> with what I know.

your choice but don't hack it if you don't want to learn it. canned apps
are hit or miss and you won't know enough to know if they are any
good. and changing them still requires some programming skill in the
language.

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: Mon, 06 Jul 2009 18:17:18 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <87ws6lzcb5.fsf@quad.sysarch.com>

>>>>> "s" == sln  <sln@netherlands.com> writes:

  s> On Mon, 06 Jul 2009 17:10:07 -0400, Uri Guttman <uri@stemsystems.com> wrote:
  >>>>>>> "s" == sln  <sln@netherlands.com> writes:
  >> 
  s> On Mon, 06 Jul 2009 17:05:02 -0400, Uri Guttman <uri@stemsystems.com> wrote:
  >> >>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
  >> >> 
  >> >> as for you, how you are learning perl is bizarre given your claim to
  >> >> know c and other langs. do you know shell at all? awk even? unix in
  >> >> general? perl is best understood as being born of that environment
  >> >> (including c) and stealing the best of breeds from each.
  >> 
  s> Whats your claim, apparently you know everything, sort of a jack-off
  s> of all trades.
  >> 
  >> i know enough to not help you get a perl job. that is all i need to
  >> know.
  >> 
  >> uri

  s> I work for Google as a Perl manager. Don't let your resume pass my desk!

even funnier since they use little perl. mostly python and other stuff.

and wtf is a perl manager? in any company, that would be a strange
title.

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: Mon, 06 Jul 2009 15:20:48 -0700
From: sln@netherlands.com
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <avt455tvc1mmft2r3ltim1d7nj254fmfu2@4ax.com>

On Mon, 06 Jul 2009 18:16:11 -0400, Uri Guttman <uri@stemsystems.com> wrote:

>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
>
>  PES> "Uri Guttman" <uri@stemsystems.com> wrote in message 
>  PES> news:87zlbh1q0x.fsf@quad.sysarch.com...
>  >>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
>  >> 
>  >> as for you, how you are learning perl is bizarre given your claim to
>  >> know c and other langs. do you know shell at all? awk even? unix in
>  >> general? perl is best understood as being born of that environment
>  >> (including c) and stealing the best of breeds from each.
>
>  PES> I think I have a general aversion to languages that make
>  PES> assumptions about variables, and that includes JavaScript and
>  PES> VB. I know enough C and Delphi to make fairly complex Windows GUI
>  PES> applications that operate on a nearly real-time basis with serial
>  PES> communication and data analysis, and I use a version of C for
>  PES> some PIC projects, but mostly I use assembly.
>
>then you have an aversion to most popular languages today. c is still
>used and is useful but it isn't good for dynamic data which is what web
>apps typically need.

WTF is a Web App, lol !!!!
There it is, throw away C++, no need for that when you got Perl.

Do they raise these pigs on Iowa corn or what?

-sln


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

Date: Mon, 06 Jul 2009 15:23:19 -0700
From: sln@netherlands.com
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <28u45514tei1g2d6lb1o429571hpend8nd@4ax.com>

On Mon, 06 Jul 2009 18:17:18 -0400, Uri Guttman <uri@stemsystems.com> wrote:

>>>>>> "s" == sln  <sln@netherlands.com> writes:
>
>  s> On Mon, 06 Jul 2009 17:10:07 -0400, Uri Guttman <uri@stemsystems.com> wrote:
>  >>>>>>> "s" == sln  <sln@netherlands.com> writes:
>  >> 
>  s> On Mon, 06 Jul 2009 17:05:02 -0400, Uri Guttman <uri@stemsystems.com> wrote:
>  >> >>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
>  >> >> 
>  >> >> as for you, how you are learning perl is bizarre given your claim to
>  >> >> know c and other langs. do you know shell at all? awk even? unix in
>  >> >> general? perl is best understood as being born of that environment
>  >> >> (including c) and stealing the best of breeds from each.
>  >> 
>  s> Whats your claim, apparently you know everything, sort of a jack-off
>  s> of all trades.
>  >> 
>  >> i know enough to not help you get a perl job. that is all i need to
>  >> know.
>  >> 
>  >> uri
>
>  s> I work for Google as a Perl manager. Don't let your resume pass my desk!
>
>even funnier since they use little perl. mostly python and other stuff.
>
>and wtf is a perl manager? in any company, that would be a strange
>title.
>
>uri

We at Google do %95 Perl, us managers make sure the applicants know that.

-sln


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

Date: Mon, 06 Jul 2009 18:21:35 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <86zlbhcv0w.fsf@mithril.chromatico.net>

>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:

    PES> Sorry for the noobish questions, but I am used to C and Delphi
    PES> Pascal, where I am familiar with the syntax.

It's not the syntax you're having trouble with, it's the semantics.
Perl doesn't have strongly typed variables the way the languages you
insist on comparing it with do.

A scalar holds one data value, such as a string or a number.  If you
treat a scalar as if it has a number in it, Perl will do its best to
interpret that scalar as a number.  If you treat a scalar as if it has a
string in it, Perl will do its best to interpret that scalar as a
string.

So yes, you can say $x = "57"; and Perl will dutifully put the string
"57" into $x.  Then, when you say $y = $x + 7; Perl will interpret $x as
if it contains a number and add 7 to it.  And then, when you say print
$y; -- well, Perl will convert $y to a string to print it for you.
   
Charlton





-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Mon, 06 Jul 2009 15:38:27 -0700
From: sln@netherlands.com
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <hpu455telkif1rta9nu1m1majgnb56sdb5@4ax.com>

On Mon, 06 Jul 2009 18:21:35 -0400, Charlton Wilbur <cwilbur@chromatico.net> wrote:

>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
>
>    PES> Sorry for the noobish questions, but I am used to C and Delphi
>    PES> Pascal, where I am familiar with the syntax.
>
>It's not the syntax you're having trouble with, it's the semantics.
>Perl doesn't have strongly typed variables the way the languages you
>insist on comparing it with do.
>
>A scalar holds one data value, such as a string or a number.  If you
>treat a scalar as if it has a number in it, Perl will do its best to
>interpret that scalar as a number.  If you treat a scalar as if it has a
>string in it, Perl will do its best to interpret that scalar as a
>string.
>
>So yes, you can say $x = "57"; and Perl will dutifully put the string
>"57" into $x.  Then, when you say $y = $x + 7; Perl will interpret $x as
>if it contains a number and add 7 to it.  And then, when you say print
>$y; -- well, Perl will convert $y to a string to print it for you.
>   
>Charlton

Total confusion. A vaiable contains a value that is typed. How you
use it depends on its TYPE not visa versa. Don't go down that road
with a C person.

Do give C people credit for knowing what a Union is. Because, that
is what Perl uses.

You obviously, never, ever, programed in a structured language.
If you did, describe Perl's actual usage to somebody who has.

And don't sugar coat, and lay off beginner crap, superiority shit
you and others keep foaming about via insinuation.

And since PERL is actually written upon C, try to learn it.
I realize you don't know C/C++, or structured language, but
try to make it sound like you do, at least.

-sln


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

Date: Mon, 06 Jul 2009 19:44:32 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <86r5wtcr6n.fsf@mithril.chromatico.net>

>>>>> "sln" == sln  <sln@netherlands.com> writes:

    sln> Total confusion. A vaiable contains a value that is typed. How
    sln> you use it depends on its TYPE not visa versa. Don't go down
    sln> that road with a C person.

You appear to be the one who's confused; if your assertion here is to be
believed, then saying something like:

          $x = "42";
          print $x + 7;

would result in a type mismatch error of some sort.

The values in scalars do have types, but the value and the type are
implicitly converted whenever it's appropriate.  It's a lot less
confusing if you don't worry about the implicit type and value
conversion until you get a grasp on the basics, just as it's a lot less
confusing if you don't worry about reference counts and garbage
collection until you get a grasp on the basics.

    sln> Do give C people credit for knowing what a Union is. Because,
    sln> that is what Perl uses.

Except that it's a good deal more complicated than that, and explaining
it at that level is not likely to make things any clearer.

Consider:

        union foo 
        {
          int i;
          char *str;
        };

        struct foo x;

If I then say
  
        x.i = 27;

I can't then say 

        printf ("%s", x.str);

and expect to see a nice neat 27.

Likewise, I can't say

        x.str = malloc (20);
        strcpy (x.str, "27");
        printf ("%d", x.i + 3);

and expect to see a nice neat 30.  

Explaining scalars to a C programmer as if they were unions is unlikely
to be productive because the resemblance is only superficial.  If he
understands unions well, the differences are going to trip him up far
more than the similarities are going to help him, and if he does not
understand unions well, then it's just going to confuse him further.

    sln> You obviously, never, ever, programed in a structured language.
    sln> If you did, describe Perl's actual usage to somebody who has.

Perl's implementation details are irrelevant to someone working at the
level of the original poster, and they're unlikely to help him
understand the language itself.

And what you seem to think is obvious is, frankly, wrong.  This should
be obvious to most of the people who have read your postings, but it
doesn't hurt to reiterate it.

    sln> And since PERL is actually written upon C, try to learn it.  I
    sln> realize you don't know C/C++, or structured language, but try
    sln> to make it sound like you do, at least.

What you "realize" is utter nonsense; among other things, if you had the
remotest clue about either C or C++ you'd realize that calling it
"C/C++" shows idiocy to the C aficionados that's roughly comparable to
the idiocy you demonstrate by calling Perl "PERL."

And given your confusion about how Perl implements its data structures
internally -- they're structs, not unions -- and your misconception that
Perl scalars are usefuly analogous to C unions, I daresay I most likely
have a better grasp of C than you do.

Charlton




-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Mon, 06 Jul 2009 23:50:20 GMT
From: "Paul E. Schoen" <paul@peschoen.com>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <05w4m.1205$P5.17@nwrddc02.gnilink.net>


<sln@netherlands.com> wrote in message 
news:hpu455telkif1rta9nu1m1majgnb56sdb5@4ax.com...
> On Mon, 06 Jul 2009 18:21:35 -0400, Charlton Wilbur 
> <cwilbur@chromatico.net> wrote:
>
>>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
>>
>>    PES> Sorry for the noobish questions, but I am used to C and Delphi
>>    PES> Pascal, where I am familiar with the syntax.
>>
>>It's not the syntax you're having trouble with, it's the semantics.
>>Perl doesn't have strongly typed variables the way the languages you
>>insist on comparing it with do.
>>
>>A scalar holds one data value, such as a string or a number.  If you
>>treat a scalar as if it has a number in it, Perl will do its best to
>>interpret that scalar as a number.  If you treat a scalar as if it has a
>>string in it, Perl will do its best to interpret that scalar as a
>>string.
>>
>>So yes, you can say $x = "57"; and Perl will dutifully put the string
>>"57" into $x.  Then, when you say $y = $x + 7; Perl will interpret $x as
>>if it contains a number and add 7 to it.  And then, when you say print
>>$y; -- well, Perl will convert $y to a string to print it for you.

I think I understand. But I don't like it. I am really more used to Delphi, 
where it is easy to concatenate strings such as '5'+'7' := '57';


> Total confusion. A vaiable contains a value that is typed. How you
> use it depends on its TYPE not visa versa. Don't go down that road
> with a C person.
>
> Do give C people credit for knowing what a Union is. Because, that
> is what Perl uses.

My understanding of a Union is allowing a certain block of memory to be 
interpreted in more than one way. So an integer of 32 bits may also be 
addressed as an array of bytes, or a multipart record may also be addressed 
as a single string. It is essentially a predefined typecast. I really have 
not used it often, and it's done differently in Delphi, which uses a Case 
statement to refer to the same data in different ways.

But a string in C, such as "1234", will always be just four ASCII 
characters, and a NULL terminator. You use a function like atol() or atoi() 
or atof() to assign the result to a numerical variable in a different 
memory space.

Now a Variant may hold various kinds of information, and is used when the 
data type is known only at runtime. But once it is set to a specific type, 
it remains as such until explicitly reassigned to another type with new 
data. It is essentially a pointer to an object that is created at runtime.

In Perl I don't know enough about the internals, but since it is 
essentially an interpreted language it may perform its interpretations of 
the data type on the fly, by applying appropriate conversions, or perhaps 
the data is stored in a structure which contains parts that are string, 
integer, and floating point.

Paul 




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

Date: Mon, 06 Jul 2009 17:55:18 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <o665555au84tem3kkjhn2klsvfnudvshl2@4ax.com>

Charlton Wilbur <cwilbur@chromatico.net> wrote:
>>>>>> "sln" == sln  <sln@netherlands.com> writes:
>
>    sln> Total confusion. A vaiable contains a value that is typed. 

Right. 
And in Perl those types are scalar, array, hash, file handle, and
directory handle (did I forget any?).

>    sln>How
>    sln> you use it depends on its TYPE not visa versa. 

Right. In general you cannot use e.g. an array instead of a file handle.

Now, what does that have to do with the numerical versus the string
versus the boolean value of a scalar?

>    sln> Do give C people credit for knowing what a Union is. Because,
>    sln> that is what Perl uses.
>
>Except that it's a good deal more complicated than that, and explaining
>it at that level is not likely to make things any clearer.

Actually it is WAAAAYYY easier than that. Perl has scalars. 
And when used in numerical context then the numerical value of the
scalar will be used, when in string context then the string value will
be used, when in boolean context then the boolean value will be used. 
That's it. Nothing compicated about it unless you insist on making it
complicated.

And it has nothing whatsoever to do with a union in C. And scalars
aren't implemented using C unions (set sum in mathematics), either.
Actually quite the opposite, they are more like a struct in C (cross
product in mathematics), where the system ensures that the different
representation of the value (numerical, text, ...)  are automatically
kept in sync with each other whenever needed.

jue


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

Date: Mon, 06 Jul 2009 20:54:13 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <86my7hcnyi.fsf@mithril.chromatico.net>

>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:

    PES> I think I understand. But I don't like it. I am really more
    PES> used to Delphi, where it is easy to concatenate strings such as
    PES> '5'+'7' := '57';

You can concatenate strings in Perl too; it uses the . operator.

    sln> Do give C people credit for knowing what a Union is. Because,
    sln> that is what Perl uses.

    PES> My understanding of a Union is allowing a certain block of
    PES> memory to be interpreted in more than one way. 

 ...which is *not* what a Perl scalar is.  sln is tragically confused,
and probably best ignored.

    PES> In Perl I don't know enough about the internals, but since it
    PES> is essentially an interpreted language 

Er, no.  Perl is compiled to an intermediate representation, which is
then executed.  It's no more "essentially an interpreted language" than
Java is -- the principal difference is that you can store the
intermediate representation in Java, and you can't in Perl.

You *really* need to get yourself a good basic book on Perl.  Beginning
Perl is available online for free at
http://www.perl.org/books/beginning-perl/, and odds are good that it's
better than any other tutorial you're likely to find free online.  Work
through it -- if you're an experienced programmer with a clue, it will
go quickly, and you'll spare yourself a lot of the fumbling around that
you're doing now.

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


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

Date: Mon, 06 Jul 2009 18:05:23 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <987555pcdep43em6goft2nnbc92e5b7mb6@4ax.com>

"Paul E. Schoen" <paul@peschoen.com> wrote:
><sln@netherlands.com> wrote in message 
>>>So yes, you can say $x = "57"; and Perl will dutifully put the string
>>>"57" into $x.  Then, when you say $y = $x + 7; Perl will interpret $x as
>>>if it contains a number and add 7 to it.  And then, when you say print
>>>$y; -- well, Perl will convert $y to a string to print it for you.

Well, I'd rather rephrase this as 

Then, when you say $y = $x + 7; Perl will determine the numerical value
of $x and add 7 to it.  And then, when you say print
$y; -- well, Perl will determine the string value of $y and print it for
you.
This "determine the xxx value of" doesn't change the value of the
scalar. It just creates (and actually even stores for later re-use) an
additional representation of that value in the scalar data item.

>I think I understand. But I don't like it. I am really more used to Delphi, 
>where it is easy to concatenate strings such as '5'+'7' := '57';

What's the problem? In Perl you use + to add numbers and . to
concatenate strings: 
	my $foo = '5' . '7';
It's just a different operator (. instead of +).

>In Perl I don't know enough about the internals, but since it is 

And you don't have to. Just remember that in Perl a scalar always has a
numerical, a string, a float, a boolean value and Perl will
automatically choose the right representation for the task at hand.

>essentially an interpreted language it may perform its interpretations of 
>the data type on the fly, by applying appropriate conversions, or perhaps 
>the data is stored in a structure which contains parts that are string, 
>integer, and floating point.

Both. 

jue


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

Date: Mon, 06 Jul 2009 18:16:52 -0700
From: sln@netherlands.com
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <hc8555psmqmki7fggktl5hqs5n130428b3@4ax.com>

On Mon, 06 Jul 2009 18:21:35 -0400, Charlton Wilbur <cwilbur@chromatico.net> wrote:

>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
>
>    PES> Sorry for the noobish questions, but I am used to C and Delphi
>    PES> Pascal, where I am familiar with the syntax.
>
>It's not the syntax you're having trouble with, it's the semantics.
>Perl doesn't have strongly typed variables the way the languages you
>insist on comparing it with do.
>
>A scalar holds one data value, such as a string or a number.  If you
>treat a scalar as if it has a number in it, Perl will do its best to
>interpret that scalar as a number.  If you treat a scalar as if it has a
>string in it, Perl will do its best to interpret that scalar as a
>string.
>
>So yes, you can say $x = "57"; and Perl will dutifully put the string
>"57" into $x.  Then, when you say $y = $x + 7; Perl will interpret $x as
>if it contains a number and add 7 to it.  And then, when you say print
>$y; -- well, Perl will convert $y to a string to print it for you.
>   
>Charlton

A Perl variable is probably most closely related to a structure.
I achieved my intended purpose. C programmer, now u know and have
some respect.

Good luck!

-sln


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

Date: Mon, 06 Jul 2009 18:17:17 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <7e855553bhhsvg141a6fu8sgu4klsgi1bi@4ax.com>

Charlton Wilbur <cwilbur@chromatico.net> wrote:

> sln is tragically confused,

That is no news at all. 

>and probably best ignored.

which pretty much everyone does anyway.

jue


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

Date: Mon, 06 Jul 2009 18:21:26 -0700
From: sln@netherlands.com
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <on8555tu8nlmcvpomfr7hgb7ffimhi8um0@4ax.com>

On Mon, 06 Jul 2009 18:17:17 -0700, Jürgen Exner <jurgenex@hotmail.com> wrote:

>Charlton Wilbur <cwilbur@chromatico.net> wrote:
>
>> sln is tragically confused,
>
>That is no news at all. 
>
>>and probably best ignored.
>
>which pretty much everyone does anyway.
>
>jue

Tweedle de, tweedle dum, lol.

-sln


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

Date: Mon, 06 Jul 2009 18:26:21 -0700
From: Keith Thompson <kst-u@mib.org>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <lnhbxp2shu.fsf@nuthaus.mib.org>

sln@netherlands.com writes:
> On Mon, 06 Jul 2009 18:16:11 -0400, Uri Guttman <uri@stemsystems.com> wrote:
[...]
>>then you have an aversion to most popular languages today. c is still
>>used and is useful but it isn't good for dynamic data which is what web
>>apps typically need.
>
> WTF is a Web App, lol !!!!

<http://lmgtfy.com/?q=web+app>

[...]

-- 
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: Mon, 06 Jul 2009 18:31:59 -0700
From: sln@netherlands.com
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <f69555579a5fjchei9hs2i72bgs7vgj1c6@4ax.com>

On Mon, 06 Jul 2009 18:26:21 -0700, Keith Thompson <kst-u@mib.org> wrote:

>sln@netherlands.com writes:
>> On Mon, 06 Jul 2009 18:16:11 -0400, Uri Guttman <uri@stemsystems.com> wrote:
>[...]
>>>then you have an aversion to most popular languages today. c is still
>>>used and is useful but it isn't good for dynamic data which is what web
>>>apps typically need.
>>
>> WTF is a Web App, lol !!!!
>
><http://lmgtfy.com/?q=web+app>
>
>[...]

You know i won't explore any links anybody types here.
Wanna know why? Cause some jack-off like you points to a page that
will load my machine with a virus.

In lieu of a voice, I suggest you recant to yourself just exactly what
C/C++/api's writtine on them (fuckin all of them) are fucking good for
you moron.

-sln


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

Date: Mon, 06 Jul 2009 20:51:34 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <slrnh55a9i.f1i.tadmc@tadmc30.sbcglobal.net>

Jürgen Exner <jurgenex@hotmail.com> wrote:
> Charlton Wilbur <cwilbur@chromatico.net> wrote:
>>>>>>> "sln" == sln  <sln@netherlands.com> writes:
>>
>>    sln> Total confusion. A vaiable contains a value that is typed. 
>
> Right. 
> And in Perl those types are scalar, array, hash, file handle, and
> directory handle (did I forget any?).


format, subroutine


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


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

Date: Mon, 06 Jul 2009 20:55:56 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <slrnh55aho.f1i.tadmc@tadmc30.sbcglobal.net>

Charlton Wilbur <cwilbur@chromatico.net> wrote:

> sln is tragically confused,
> and probably best ignored.


Yet more good advice.


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


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

Date: Mon, 06 Jul 2009 23:32:31 -0400
From: Jon Du Kim <jondk@FAKE.EMAIL.net>
Subject: Re: Perl scalars as numbers or character strings
Message-Id: <h2ufkr$756$1@aioe.org>

sln@netherlands.com wrote:
> On Mon, 06 Jul 2009 17:05:02 -0400, Uri Guttman <uri@stemsystems.com> wrote:
> 
>>>>>>> "PES" == Paul E Schoen <paul@peschoen.com> writes:
>> as for you, how you are learning perl is bizarre given your claim to
>> know c and other langs. do you know shell at all? awk even? unix in
>> general? perl is best understood as being born of that environment
>> (including c) and stealing the best of breeds from each.
> 
> Whats your claim, apparently you know everything, sort of a jack-off
> of all trades.
I am essentially a lurker but will uncloak briefly to
provide some information.
Here is the deal with U. Guttman:
	(1) He is chronically unemployed(i.e. he "works
for himself" but has no clients)
	(2) He is a loud boorish oaf. Picture the "comic
book guy" from The Simpsons. He is morbidly obese with a
constant stench of faeces.
	(3) He was a smart kid (he went to harvard or
mit or someplace of that caliber) but has been a failure 
as an adult.
Rumor mill at yapc this year held that he is losing his
house to foreclosure after many long years of
professional failure.
Bottom line, take his advice but with no more weight
given to it than that from any other enthusiastic
amateur or academic. He doesn't seem to have much
understanding of(or aptitude for) real life. I have seen 
him irl at yapc the several times I have gone since he 
always seems to be a presence there. I think he is from 
Boston(Not that it matters at all). I don't think I have 
ever spoken to him but people do make fun of him behind 
his back quite a bit and he seems to have few real 
friends in the community anymore. You should probably 
should just feel sad for him and leave him alone. Just 
another internet weirdo...


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

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


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