HDTenEightyP/NetNews huggingface dataset:
From: tal@Warren.MENTORG.COM (Tom Limoncelli)
Subject: Re: Perl & the new DEC Alpha machines running OSF1
Keywords: Do I need to wait for a new hint file?
Organization: Mentor Graphics -- IC Group
Distribution: usa
Date: Mon, 5 Oct 1992 16:03:05 GMT

In article <1992Oct5.130118.14763@porthos.cc.bellcore.com> wws@iscp.bellcore.com (Wayne Scott) writes:
>I've successfully installed Perl on an OSF1/mips machine.  But soon my development
>environment will be changing underneath me.  We're getting the new DEC Alpha
>machines running OSF1.  Question is, do I need to wait for a new hints file before
>I can port Perl to that platform?  Or will the OSF1 hints files be sufficient?

I believe that if you compile 4.035 and run with the OSF1 hints it will
say something like, "Hey, you're not supposed to have this kind of
hardware yet!" ...and then compiles just fine.

I don't think 4.033 or 4.019 works very well.

If it does, write to me and I'll send you the config.sh we have here.

Tom
-- 
Tom Limoncelli -- tal@warren.mentorg.com (work) -- tal@plts.uucp (play)
"I like Bill Clinton tremendously.  I know him from the governors' conferences.
The Democrats nominated their best person, a very able fellow.  The country is
well served by that choice." -Bush's re-election chair in NJ (Thomas Kean)
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.lang.perl
Subject: Re: Perl & the new DEC Alpha machines running OSF1
Keywords: Do I need to wait for a new hint file?
Date: 5 Oct 92 18:20:28 GMT
Distribution: usa
Organization: NetLabs, Inc.

In article <1992Oct5.130118.14763@porthos.cc.bellcore.com> wws@iscp.bellcore.com (Wayne Scott) writes:
: 
: I've successfully installed Perl on an OSF1/mips machine.  But soon my development
: environment will be changing underneath me.  We're getting the new DEC Alpha
: machines running OSF1.  Question is, do I need to wait for a new hints file before
: I can port Perl to that platform?  Or will the OSF1 hints files be sufficient?
: 
: I suppose I could just wait for the systems, then try it and see what happens.
: But if I need to ask Larry for new files, I'd like to make my request now.

I don't have a DEC Alpha.  I only try to act as a clearinghouse for some
of this stuff, and I'm not that good at clearing houses.  Sigh.

Larry
From: tchrist@convex.COM (Tom Christiansen)
Newsgroups: comp.lang.perl
Subject: Re: Slow pattern match
Date: 29 Sep 92 19:14:54 GMT
Article-I.D.: news.1992Sep29.191454.17433
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
Originator: tchrist@pixel.convex.com
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of alanm@cognos.com (Alan Myrvold):
:I was recently bitten by an attempted pattern match in one of my perl 
:programs that took soooo long I thought it would never finish.  The
:pattern is kinda complicated, and is actually not quite what I want,
:but still, it takes more than 6 cpu minutes on my machine to run these
:three lines:
:
:   $_ = '                                     07 Expiry Date xxxxxxxx';
:   $match = /^ *([^x0-9]*) *([0-9]?[0-9]? *[^x]*) *[^a-zA-Z](x+)(.*)$/;
:   print 'Match is ',0+$match,"\n";
:
:Is this just because pattern matching is tough, or is perl using a
:sub-optimal algorithm in this case?

Pattern matching is tough.   You're using a lot of * cases, 
which is suboptimal.  Try using +'s instead, or little pieces 
at a time.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist


    The computing field is always in need of new cliches.  -- Alan Perlis
Newsgroups: comp.lang.perl
From: hansm@cs.kun.nl (Hans Mulder)
Subject: Re: A novice question
Organization: University of Nijmegen, The Netherlands
Date: Tue, 29 Sep 1992 12:45:34 GMT

In <1992Sep28.174830.10830@spectrum.xerox.com> braven@rx.xerox.com (Brian Raven) writes:
>Your directoy names all have newlines at the end. Try:

>@DIRS = split(/\n/,`ls -1`);

Or use chop:

chop(@DIRS = `ls`);

BTW, the -1 option to ls is the default when output is not a terminal.

--
Hope this helps,

Hans Mulder			hansm@cs.kun.nl
Newsgroups: comp.lang.perl
From: ejk@ux2.cso.uiuc.edu (Ed Kubaitis - CCSO)
Subject: Re: Perl & the new DEC Alpha machines running OSF1
Organization: University of Illinois - Urbana
Distribution: usa
Date: Mon, 5 Oct 1992 14:02:15 GMT
Keywords: Do I need to wait for a new hint file?

wws@iscp.bellcore.com (Wayne Scott) writes:
  |... We're getting the new DEC Alpha machines running OSF1. Question is, 
  |do I need to wait for a new hints file before I can port Perl to that 
  |platform?  Or will the OSF1 hints files be sufficient?
  |
  |I suppose I could just wait for the systems, then try it and see what 
  |happens. But if I need to ask Larry for new files, I'd like to make 
  |my request now.

No need to bother Larry if the OSF hints don't work. Any number of us
would be glad to give you the hints file in exchange for one of those
hummers. Second-day-air will be fine. ;-)

----------------------------------
Ed Kubaitis (ejk@ux2.cso.uiuc.edu)
Computing & Communications Services Office - University of Illinois, Urbana
From: jefftep@cs.utexas.edu (Jeffrey Grills)
Newsgroups: comp.lang.perl
Subject: Re: Perl program grows in size
Date: 30 Sep 1992 20:54:22 -0500
Organization: CS Dept, University of Texas at Austin
NNTP-Posting-Host: ozona.cs.utexas.edu

 tom christiansen writes:
  jeff grills writes:
 >:
 >:I've got a perl program that owns a socket.  It should run all the time,
 >:without interruptions.  However, this program continually grows in
 >:memory.  
 >
 >Look for any local()s.  [...]
 >which as currently implemented will cause an apparent memory leak.
 >
 >--tom


Any local?  Or just in a loop?  Isn't using local() the prefered way
of passing parameters?  Doesn't make sense that this useful construct
for keeping your program sane is faulty in this manner.  The only
alternative I see for being reasonable is excessive use of packages.
Maybe prefix every local with subroutinename'?


-- 
-------------------------+--------------------------------------------------
jeff grills              | "Sometimes i see myself so clearly, because I
jefftep@cs.utexas.edu    |   see nothing at all.  This feeling of emptiness
Undergrad Lab, UT Austin |   flees my soul, leaving even less behind."  -me
From: buboo@alf.uib.no (Ove Ruben R Olsen)
Newsgroups: comp.lang.perl
Subject: Re: "Camel" book [APOLOGY]
Date: 30 Sep 92 20:23:50 GMT
Reply-To: ruben@uib.no
Followup-To: poster
Organization: University of Bergen, Norway

I made the asumption that:

>There is also a New Book out RSN for the beginers written by
>Wall, Christiansen & Schwarts.

Someone was not quite happy with that statement so I need to post
an appology:

  Randal never said who the other two Perl Giants were.  I just took
  a wild guess, but I want everyone to know it was just my guess.

I hope this is going to solve all matters and no more blod is going 
to float :-)

\Ruben


-- 
        Ove Ruben R Olsen a Gnarfer and VI user. EMAIL: ruben@uib.no. 
     Maintaining the EX/VI-archive and a couple of the Comp.Editors FAQs.
    People that are ignorant tend to live a frustrated life, at least when 
     it comes to editing - But I do belive this is a general rule in life
Newsgroups: comp.lang.perl
Subject: what are the two numbers returned by %name in scalar contex?
From: russell@ccu1.aukuni.ac.nz (Russell Fulton)
Date: Thu, 1 Oct 1992 21:56:51 GMT
Organization: University of Auckland, New Zealand.

I am trying to find out the number of items in an associative array.
My first shot was "$n = %assoc;" this gave a value of 2456/4096. I
looked through the Camel Book but could find no reference to what the
numbers meant. I assumed (erroneously) that the first number was the
number of items in the table the second was the memory allocated for the
table. I became suspicious of the numbers then switched to using keys()
to extract a list of keys k and evaluating @k gave quite different and
more sensible answers.

Still, I am curious to know what the two numbers represent. The second is
almost certainly the size of the hash table (since it doubles
periodically) but the meaning of the first number eludes me.

Also is there a better way of finding the number of entries in an
associative array than "@k = keys(%table); $n = @k;" ?

Thanks, Russell.
-- 
Russell Fulton, Computer Center, University of Auckland, New Zealand.
<rj_fulton@aukuni.ac.nz>
Newsgroups: comp.lang.perl
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: Need help with a crazy perl 4.035 problem. Unrecognized character ..
Originator: tchrist@pixel.convex.com
Date: Tue, 6 Oct 1992 19:29:32 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of rickers@cbis.ece.drexel.edu (Rick Wargo):
:Here a problem which I cannot figure out.  I am hoping some bright soul
:may have a clue because I don't yet have enough money saved for this one.
:
:The real problem is that I am writing a huge perl program.  Unfortunately, every
:now and then I get the weirdest errors when I add a few lines of correct code.

:	open(TABLE, "<$file");
:
:		while (<TABLE>) {
:			chop;
:			...
:			sub Problem_Routine;
:			...
:		}
:
:	close(TABLE);

Don't know whether that's literal code, but if so, one calls
the subroutine with the &Problem_Routine syntax.  The other
one will make the parser say funny things.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist

"I think there's a world market for about 5 computers."
	- Thomas J. Watson, Chairman of the Board, IBM (around 1948)
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.lang.perl
Subject: Re: bug, porting problem, or pilot error?
Date: 30 Sep 92 00:02:13 GMT
Organization: NetLabs, Inc.

In article <135@eiffel.eiffel.com> ram@eiffel.com (Raphael Manfredi) writes:
: Quoting wescott@grok67.ColumbiaSC.NCR.COM (Mike.Wescott) from comp.lang.perl:
: |The following causes perl to dump core:
: |
: |	$fin = "/dev/zero";
: |
: |	open(FIN, $fin) || die "can't open $fin\n";
: |
: |	$i = 0;
: |	$r = sysread(FIN, $mpinfo[$i], 169);
: |	print $r,"\n";
: |
: |If the read length is made small enough, core dumps stop.
: |Is an undefined indexed variable not permitted as an argument
: |to read or sysread? Or have I screwed up the port?
: 
: I would imagine you have to pre-extend your strings before attempting to
: call sysread(), since the system call will not do the allocation for you.

Well, actually, Perl does pre-extend on sysread(), but the string needs
to be defined if you're going to read into an array element, or it ends
up pre-extending the value of undef!  Urk.

Perl5 will be smart enough to pre-extend undefined array elements that
are used in an lvalue-ish way.  In fact, Perl 5 is just a whole lot
smarter at compile time about scalarhood, listhood and lvaluehood.  For
instance, it pretty easily falls out from the way things work that you
can say:

    ($huh ? @foo : @bar) = (1,2,3);
or
    ($huh ? $foo : $bar) = "baz";

I think it was Tom who once expected this to work in my general direction.

Larry
Newsgroups: comp.lang.perl
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: what are the two numbers returned by %name in scalar contex?
Originator: tchrist@pixel.convex.com
Date: Sun, 4 Oct 1992 23:33:48 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of przemek@rrdstrad.nist.gov (Przemek Klosowski):
:if ( ($var1,$var2,$var3) = /(pat1*) (pat2*) (pat3*)/ ) {
:	print "match found";
:}
:
:but this does not work ( is the 'if' expression evaluates to $var3?).

From the man page:

     Array assignment in a scalar context returns the number of
     elements produced by the expression on the right side of the
     assignment:

          $x = (($foo,$bar) = (3,2,1)); # set $x to 3, not 2

Correlating this with the section on m/PATTERN/gio in the 
man page, it makes sense that what you have written there 
should work just fine.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist

    s = (char*)(long)retval;                /* ouch */
        --Larry Wall in doio.c from the perl source code
Newsgroups: comp.lang.perl
From: dominic@onions.natcorp.ox.ac.uk (Dominic Dunlop)
Newsgroups: comp.lang.perl
Subject: __END__ comment confusing in man-page-in-perl-script
Date: 5 Oct 92 17:00:53 GMT
Organization: British National Corpus, Oxford University, GB
Originator: dominic@onions.natcorp.ox.ac.uk

Deciding that it was time that I had my cake and ate it, I set out to
see if I could have a perl program with an embedded man page AND
embedded data (using __END__ and the <DATA> filehandle).  Well, yes, I
can -- but the current examples of self-documenting programs, such as
ex/rename  in the perl 4.035 distribution, are (even?) more obfuscated
than they need to be, and suggest that the job is more difficult than
in fact it is.

Consider the following (not shar-ed so that you can run this mail with
perl -x):

#!/usr/local/bin/perl
'di';
'ig00';
# faker -- demonstrate that the __END__ in self-documenting
#          perl template is ignored
##############################################################################

while (<DATA>)
{
	print;
}

	# These next few lines are legal in both Perl and nroff.

.00;			# finish .ig
 
'di			\" finish diversion--previous line must be blank
.nr nl 0-1		\" fake up transition to first page again
.nr % 0			\" start at page 1
';<<'.ex'; #__END__ ############# From here on it's a standard manual page ############
.TH RENAME 1 "5 October, 1992"
.AT 3
.SH NAME
faker \- come to a spurious __END__
.SH SYNOPSIS
.B faker
.SH DESCRIPTION
.I Faker
.SH AUTHOR
Dominic Dunlop
.SH "SEE ALSO"
.IR "The Camel Book" ,
chapter 6.
.SH BUGS
Probably manifold
.ex
__END__
And this is where the story really begins...

The __END__ in the line ``From here on it's...'' is part of a comment,
and so is not seen by perl's tokener.  I suspect it's there because,
in a previous incarnation of the hack (see camel book, page 315 ff),
it was not in a comment, and was really needed.  It certainly threw
me, as I remembered the camel book saying that the trick was carried
off by making perl see the man page as data.  In fact, it currently
sees it as a here document hanging off a null statement.  The second
__END__ in  faker  is outside a comment, is seen by the tokener, and
does flag the start of stuff one can read via <DATA>.  Wheee!
-- 
Dominic Dunlop
Newsgroups: comp.lang.perl
From: tanaka@til.til.com (Yokichi Tanaka)
Subject: Beginner question
Organization: Togai InfraLogic, Inc.
Date: Fri, 2 Oct 1992 23:19:00 GMT

I have a simple question.  If I use the -i switch, is there
any way to direct output to the target file outside of the
<> loop?

    #!/usr/bin/perl -i.bak
    while (<>) {
       ... do something here ...
    }
    print "\n";

In the above case, I want an extra \n to be appended to the
end of the file.

If it can be done, is there any way to do it (append at end
of file) if I use a -pi switch?

-- 
Yoke (Yokichi) Tanaka      Togai InfraLogic, Inc.    "fuzzy"
tanaka@til.com             Irvine, California, USA
uunet!til!tanaka           714-975-8522
In case you're wondering ... I am male.
"The more you drive, the less intelligent you are."
From: tchrist@convex.COM (Tom Christiansen)
Newsgroups: comp.lang.perl
Subject: Re: redirect STDERR
Date: 2 Oct 92 13:05:10 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
Originator: tchrist@pixel.convex.com
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of mcook@melkur.dev.cdx.mot.com (Michael Cook):
:Another way would be to use "-|"
:
:  $kid = open(FIND, "-|");
:  $kid eq "" && die "oops: $!";

I usually phrase that:

    die "can't fork: $!" unless defined ($kid = open(FIND, "-|"));
    $kid ? &run_parent : &run_kid; 
    exit;

:  unless ($kid)
:  {
:    open(STDERR, "/dev/null");

I don't really thing you meant to open STDERR for reading, eh? :-)

    open(STDERR, ">/dev/null");

One could also 
    
    close(STDERR);

which is 2>&- in shellish, but that's probably not a good idea.

:    exec "find / -name hello -print";
:    die "oops: $!";
:  }
:

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist


    "That must be wonderful!  I don't understand it at all."
From: kc@hpscit.sc.hp.com (Kwok Cheung)
Date: Wed, 30 Sep 1992 23:41:26 GMT
Subject: Re: question of building array of arrays
Organization: Hewlett-Packard, Santa Clara, CA
Newsgroups: comp.lang.perl

	Thank you AJS for answering the questions, I try his
code, it did what I want to do. But I have a question about one line
of his code. The code works, I just want to understanding the syntex.

foreach(@food)
{
       *array = @_;  # <<<<<<<< this line
       print "Food of class \"$_\":\n\t", join(', ',@array), "\n";
}

	Apparently, this assign the LIST @food to @array. I look up the
Camel book (p. 101 .. Jan, 1991 version), this is call "type glob", 
* represent all the funny characters that prefix variables. It is 
recommended for using inside local() of the subroute. In my case, it 
work inside the foreach loop. I try to look at the effect of changing it
to 

     *array = @_;
 
	When I run it,  it output 

Food of class "fruit":

Food of class "meat":

Food of class "vegetable":

instead of 

Food of class "fruit":
        orange, apple
Food of class "meat":
        pork, beef
Food of class "vegetable":
        cabbage, lettice

	I don't understand the different of $_ and @_ , Would somebody explain?

Another question I have is:

Can we assign a LIST to an associative array
        %day = ( 'weekday', 'Monday,Tuesday,Wedneday,Thurday,Friday' 
                 'weekend', 'Saturday,Sunday' 
               );
and use the foreach loop to access the member of the LIST
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.lang.perl
Subject: Re: ~~ in Format causes infinite loop.
Date: 5 Oct 92 20:11:06 GMT
Organization: NetLabs, Inc.

~~ will not look at "trim" in 5.0.  The 4.0 implementation (actually,
the 1.0 implementation...) is stupider than that and just checks to see
if the whole line is blank.  I've already got the code in there, so
you can be sure it'll make it into 5.0.

Larry
From: fhd@panix.com (Frank Deutschmann)
Newsgroups: comp.lang.perl
Subject: Re: Need help with regexp problem
Date: 6 Oct 92 20:52:32 GMT
Organization: PANIX Public Access Unix & Internet, NYC


Small error in earlier post: sample SGML should be as follows:
==========================
<LetterHead_PhoneExtension>8064</LetterHead_PhoneExtension>

<LetterDate>30 June 1992</LetterDate>

<Addressee>Frank H. Deutschmann</Addressee>

<ToAddress>Sumitomo Bank Capital Markets
1 World Trade Center, Suite 9651
New York, N.Y. 10048</ToAddress>

<figure-block>

<graphic Filename="testing" Res="39" ProcType="Built In"
BuiltIn="IslandDraw" example="test a quote:""Now is the time...""">
</graphic>
</figure-block>
===========================

The problems in the earlier post were NOT the cause of the Perl
problems.....

Thanks again (and my appologies for the 2nd posting)...
-- 
-frank
(fhd@panix.com)
Newsgroups: comp.lang.perl
From: ayman@eecs.umich.edu (Ayman I. Kayssi)
Subject: Re: math functions
Organization: ACAL, EECS, University of Michigan, Ann Arbor
Distribution: usa
Date: Tue, 29 Sep 1992 20:35:15 GMT

tchrist@convex.COM (Tom Christiansen) wrote:
>From the keyboard of hdnea@usho0e.hou281.chevron.com (David Neal):
>:Atan2 is included in perl but asin is not?
>Given sin(), cos(), and atan2(), the other trig functions are
>derivable, or so I dimly recall.  But I don't have the formulae.

acos(x) = atan2(sqrt(1-x*x) , x)
asin(x) = atan2(x , sqrt(1-x*x))

--
Ayman I. Kayssi                               |    ayman@eecs.umich.edu
EECS Department                               +------------------------
University of Michigan                        |          (313) 764-8033
From: lwall@netlabs.com (Larry Wall)
Newsgroups: comp.lang.perl
Subject: Re: A novice question
Date: 29 Sep 92 17:36:01 GMT
Organization: NetLabs, Inc.

In article <BvCBFz.7L1@sci.kun.nl> hansm@cs.kun.nl (Hans Mulder) writes:
: In <1992Sep28.174830.10830@spectrum.xerox.com> braven@rx.xerox.com (Brian Raven) writes:
: >Your directoy names all have newlines at the end. Try:
: 
: >@DIRS = split(/\n/,`ls -1`);
: 
: Or use chop:
: 
: chop(@DIRS = `ls`);

Or use globbing:

	@DIRS = <*>;

Or use readdir:

	opendir(DOT, ".");
	@DIRS = grep(!/^\./, readdir(DOT));
	closedir(DOT);

Larry
Xref: sparky comp.lang.perl:6333 comp.unix.aux:3676
From: Tom Christiansen <tchrist@convex.COM>
Subject: Re: Using Perl to manipulate UNIX(tm) quota files
Originator: tchrist@pixel.convex.com
Date: Tue, 6 Oct 1992 19:02:03 GMT
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of ehrlich@cs.psu.edu (Dan Ehrlich):
:I need to be able to do massive edits on a UNIX(tm) file system quota file
:and would like to do it in Perl if possible.  My biggest obstacle is
:building the patterns for pack/unpack so I have munge the quota structure.
:Is there a utility that will do this for me or am I fated to do it by hand?

Yup, run h2ph and c2ph on ufs/quota.h; you'll also need to run h2ph 
on syscall.h to get &SYS_quotactl defined.

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist
A Law of Computer Programming:
        Make it possible for programmers to write in English and you
        will find the programmers cannot write in English.
From: tchrist@convex.COM (Tom Christiansen)
Newsgroups: comp.lang.perl
Subject: Re: formatted read (beginner's question)
Keywords: read
Date: 29 Sep 92 19:23:26 GMT
Article-I.D.: news.1992Sep29.192326.19158
Reply-To: tchrist@convex.COM (Tom Christiansen)
Organization: Convex Computer Corporation, Colorado Springs, CO
Originator: tchrist@pixel.convex.com
X-Disclaimer: This message was written by a user at CONVEX Computer
              Corp. The opinions expressed are those of the user and
              not necessarily those of CONVEX.

From the keyboard of majidi@rwja.umdnj.edu (Masoud Majidi):
:Dear netters,
:
:I just started learning perl and actually was able to write a couple of
:useful programs. I am using the Camel book as tutorial/reference.
:I got into a simple problem and I appreciate it very much if somebody
:could help me with it.
:
:All I want to do is prompt the user for an integer and be able to read
:in the integer from stdin. I was looking for something like scanf in C
:but apparently read() is the only function that perl has for reading
:and the problem is that read() is good when you know the length of the
:input. Am I supposed to write my own routine to read in an integer?
:i.e. read in characters from stdin till the eoln and then convert the
:string to int? There got to be a easier solution for this trivial
:problem ...

    print "Gimme a number: ";
    $num1 = <STDIN>;
    print "Gimme another number: ";
    $num2 = <STDIN>;
    $prod = $num1 * $num2;
    print "$product is $prod\n";

Add chop()s if you like:

    chop $num1;
    chop $num2;

--tom
-- 
    Tom Christiansen      tchrist@convex.com      convex!tchrist

Perle, plesaunte to prynces paye/ To clanly clos in golde so clere,
Oute of oryent, I hardyly saye/ Ne proued I neuer her precios pere.
Newsgroups: comp.lang.perl