[7203] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 827 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 8 11:27:17 1997

Date: Fri, 8 Aug 97 08:00:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 8 Aug 1997     Volume: 8 Number: 827

Today's topics:
     Re: ? decimal to hex / and binary conversion <rootbeer@teleport.com>
     Re: [Q] Converter between ELM filter-rules file to proc (Martin Ramsch)
     Re: Calculating distances in Perl? (Clay Irving)
     Can perl return more than one gif? <robbob@u.washington.edu>
     Re: equivalent to map function <rootbeer@teleport.com>
     Re: executing shell commands from perl. bug?! (Tad McClellan)
     Re: File locking <merlyn@stonehenge.com>
     Re: Filter-1.12 for NT (Paul Marquess)
     graphics, why doesn't this work <rmcguigan@ramresearch.com>
     Re: HELP: 2-D Arrays? <lilly@fedex.com>
     Re: HELP: htpasswd <dougm@osf.org>
     How to interpret file mode parameter from stat ? (Mats Larsson)
     Re: How-to cut the last characters of a varibles <blb@fedex.com>
     Re: How-to cut the last characters of a varibles <lilly@fedex.com>
     Re: html --> perl <daveh@dhcs.demon.co.uk>
     Re: Idiotic Perl Problem, can anyone help.... <rootbeer@teleport.com>
     Re: Learn the SECRET to Attract Women Easily (Clay Irving)
     New To Perl/Prog.:Please Help (Blue)
     Re: New To Perl/Prog.:Please Help (Bill Napier)
     Re: New To Perl/Prog.:Please Help <rootbeer@teleport.com>
     Opening tcp connections.... <vidyanan@pilot.msu.edu>
     Re: Pack / Unpack of IEEE floating point? <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 7 Aug 1997 06:53:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Rich Owens <richowens@tomah.com>
Subject: Re: ? decimal to hex / and binary conversion
Message-Id: <Pine.GSO.3.96.970807064732.18326G-100000@kelly.teleport.com>

On Wed, 6 Aug 1997, Rich Owens wrote:

> I am a realitively new to Perl.  

Well, that's okay. We help even realitivelies here, whether they're new to
Perl or not. :-)

> I am trying to write a perl cgi to do decimal to hex and binary
> conversion.  I for what ever reason ( probably lack of knowledge ) am
> not easily finding the solution to my problem. 

How far have you gotten? There are many steps to solving that problem, and
I'm not sure which one has you stumped. You may want to use CGI.pm,
though, and the pack and unpack functions (documented in the perlfunc(1)
manpage) may help as well. Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 8 Aug 97 10:13:09 GMT
From: ramsch@forwiss.uni-passau.de (Martin Ramsch)
Subject: Re: [Q] Converter between ELM filter-rules file to procmailrc file?
Message-Id: <slrn5uls9j.b0a.ramsch@melian.forwiss.uni-passau.de>

[Followup-To: comp.mail.elm,alt.fan.e-t-b only,
 to trim down the list of newsgroups a bit ...]

On 7 Aug 1997 20:15:37 GMT, Sven Guckes <guckes@math.fu-berlin.de> wrote:

>How about a page with a litle text explaining what this is all about?  :-)

By chance I've been starting such a seperate page only minutes before
I read your suggestion :-)

  http://www.forwiss.uni-passau.de/~ramsch/Software/ef2p/

(The old URLs are properly redirected.)

I haven't added much explanations yet, but - hey - I've still to do
other things, too, so please patient.

>> - todo: %1, %2, %3, ... submaches (how can I do this?)
>> - todo: mimic Filter's handling of X-Filtered-By: headers.
>
>Eli?  Randall?  Larry?
>
>Sven  [don't look at me]

Why not? :-)))) You could be an ideal tester knowing both filter end
procmail, aren't you? .-)

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@ieee.org> <URL: http://home.pages.de/~ramsch/ >


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

Date: 8 Aug 1997 07:59:32 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Calculating distances in Perl?
Message-Id: <5sf1n4$k35@panix.com>

In <33E2FCD8.F7F30E0@sloan.salk.edu> Javier Vegas <javier@sloan.salk.edu> writes:

>In order not to reinvent the wheel, I am 
>looking for a function/package/library/thingy
>that calculates the distance between two points
>on earth when I know their latitude and longitude.
>I couldnt find anything like that in CPAN.
>Anyone knows some code I can recicle?

Perl Modules are your friend (I don't know why the author hasn't 
submitted it to CPAN).

Location.pm 
-----------
ftp://ftp.jagunet.com/pub/users/kodis/locator.tar.gz
Translates a user-entered location into a latitude-longitude coordinate 
pair. It was designed to very liberal about accepting user input in a 
wide variety of formats, and providing robust translation and good error
reporting with a minimum of muss and fuss. 

ObShamelessPlug:
Found at http://www.panix.com/~clay/perl/query.cgi?geographical

-- 
Clay Irving <clay@panix.com>                   http://www.panix.com/~clay/


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

Date: Wed, 6 Aug 1997 23:24:37 -0700
From: "R. Terpilowski" <robbob@u.washington.edu>
Subject: Can perl return more than one gif?
Message-Id: <Pine.A41.3.96a.970806231938.14612A-100000@dante11.u.washington.edu>

Hi, I'm pretty new to programming with perl. Right now I am trying to
write a script that will return more than one image back to a web page. Is
this possible?  I am calling the script with a <img src="program.cgi> tag.
and in the program I have a line that says print 
"Location: dir/of/image.gif\n\n"; that prints one image.  But can I output
another image to that page also with the same program.  Thanks for your
help.

Rob

robbob@u.washington.edu



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

Date: Thu, 7 Aug 1997 07:07:32 -0700
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: equivalent to map function
Message-Id: <Pine.GSO.3.96.970807070625.18326I-100000@kelly.teleport.com>

On Wed, 6 Aug 1997, Sean Henriques wrote:

> I need to map the output of a function that works on an array to a new
> array...is there a map function of some type that will do this??

Yes. If you have more questions about Perl after you've read the docs and
FAQs, please post those here. Thanks!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 6 Aug 1997 07:39:52 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: executing shell commands from perl. bug?!
Message-Id: <oar9s5.bt.ln@localhost>

Elias Pinto (ep05673@sbi.com) wrote:
: After trying this few lines of code as part of a project, perl keeps
: exiting at the 'exec' commands without any warning. It compiles under
: 'perl -c' but at execution it doesn't even complaint! Even though there
: is a 'die' statement. It's strange because doesn't go beyong that point
: of execution. 

: everything is in variables because of other parts of the program. 

: 	$year = "1998";
:         $dir = "./archive/".$year."/";
:         $command = 'cp *.html '.$dir;
:        exec $command
:            or die "the copy func of *.html failed\n";
:        exec 'cp some.report $dir'
:            or die "the copy func of data... failed\n";

: I just want to execute these commands to the shell. 

: What am I doing
: wrong? 


Not reading about exec() when exec() does not do what you expected.

from the perlfunc man page:

-------------------------------------
=item exec LIST

The exec() function executes a system command I<AND NEVER RETURNS>,
unless the command does not exist and is executed directly instead of
via C</bin/sh -c> (see below).  Use system() instead of exec() if you
want it to return.
-------------------------------------

There. You could have had the answer in 20-30 seconds.

That is likely less time than it took for you to type in your post...

Work smart. Use the docs.


: any ideas? 

When "something" doesn't do what you expected, read the relevant 
description of "something" in the documentation that was included
with the perl distribution.


: email to ep05673@sbi.com

Nope.


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 07 Aug 1997 07:06:04 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
Subject: Re: File locking
Message-Id: <8ciuxinl4j.fsf@gadget.cscaper.com>

>>>>> "Casper" == Casper H S Dik <Casper.Dik@Holland.Sun.COM> writes:

Casper> I think that this the security bugs found in perl have proven
Casper> once and for all that the main argument against writing
Casper> set-uid scripts, "You never know what the interpreter will to
Casper> do you" holds for perl as well as for C-shell (and less so for
Casper> sh/ksh).

Really?  Might as well insert <any major program in use> in place of
"perl" there.  Perl has had far fewer CERTs against it.  The reason I
blanketed "all versions of Perl prior to 5.004" is that there were a
number of potential-buffer-overruns specifically removed in 5.004
because no-one had bothered to do it before.  (Thanks to the 5.004
release manager, Chip Salzenberg, for that.)

Casper> Set-uid scripts, not in any language.

Since 95% of the CERT warnings have been about code written in C,
I could follow that up with:

	"Privileged and proxy C programs.  Not on any system."

:-)

See, you just can't make blanket statements like that without being a
little ridiculed.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 390 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 8 Aug 1997 08:02:47 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: Filter-1.12 for NT
Message-Id: <5sejr7$6hp$1@pheidippides.axion.bt.co.uk>

[ Posted & Mailed ]

Carine Boneh (qeren@dotshop.com) wrote:
: I try to install the module Filter-1.12. Everything seems to be fine but
: when I run nmake I have the following:

: Exec.c
: Exec.xs(145) : error C2065: 'F_GETFL' : undeclared identifier
: Exec.xs(151) : error C2065: 'O_NONBLOCK' : undeclared identifier
: Exec.xs(152) : error C2065: 'F_SETFL' : undeclared identifier
: Exec.xs(363) : warning C4113: 'long (__cdecl *)(void)' differs in
: parameter list
: s from 'long (__cdecl *)(int ,struct sv *,int )'
: NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
: Stop.
: NMAKE : fatal error U1077: 'cd' : return code '0x2'
: Stop.

: Can somebody help me?

The Filters module has not been ported to NT yet. Basically I don't
have access to an NT box.

Paul


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

Date: 7 Aug 1997 13:41:15 GMT
From: "Ryan" <rmcguigan@ramresearch.com>
Subject: graphics, why doesn't this work
Message-Id: <01bca338$80c7e010$6e6fa1cd@www>

I know this may not be the right newsgroup, but for some reason I'm having
trouble posting messages to a cgi newsgroup.


Why doesn't this work?  I just want to output a graphic to a browser! 
Please help me...

$file = 'f:/www/htdocs/rbm_pic.gif';
open (FILE, $file) || die "Cant do it Captain";
binmode FILE;
print "Content-type: image/gif\n";
$len = -s $file;
print "Content-length: $len\n\n";
binmode STDOUT;
print STDOUT <FILE>;
close FILE;




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

Date: Thu, 07 Aug 1997 10:35:21 -0500
From: Dave Lilly <lilly@fedex.com>
Subject: Re: HELP: 2-D Arrays?
Message-Id: <33E9EB39.59E2@fedex.com>

Chim Jason wrote:
> 
> Can Perl do 2-D arrays?
> 
> If yes, please show me a line of
> code assigning a value to a 2-D array.
> 
> Thanks,
> 
> Jason

Try this:

$my_array[$x][$y] = $some_value

-dave

-- 
Dave Lilly
Federal Express
lilly@fedex.com


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

Date: Thu, 07 Aug 1997 09:08:47 -0400
From: Doug MacEachern <dougm@osf.org>
To: mscyspc@scs.leeds.ac.uk
Subject: Re: HELP: htpasswd
Message-Id: <33E9C8DF.758F@osf.org>

Shun-Ping Chan wrote:
> 
> I'm trying to write a Perl script that's accepts a user's username and
> password from a HTML form and then uses the htpasswd to store this data
> in crypted format.
> 
> I have piping it, but with no luck:
> 
>         open(FILE, "| htpasswd .htpassword $username") || ...
>         print FILE "password";
>         print FILE "password";
>         close FILE;
> 
> I've also tried using the crypt command in perl which does give me a
> crypt password.  However, when I try to access a dir with my user ID, it
> compares my ID to that crypted password and refuses me access.
> 
>         ($username,$password) = @_;
> 
>         $salt = time % $$;
>         $string = crypt($ARGS[0],$salt);
> 
>         print "$username:$password\n";
> 
> Can anyone help?  Any help would be much appreciated.

>From the Perl FAQ (perlfaq9.pod):

=head2 How do I edit my .htpasswd and .htgroup files with Perl?

The HTTPD::UserAdmin and HTTPD::GroupAdmin modules provide a
consistent OO interface to these files, regardless of how they're
stored.  Databases may be text, dbm, Berkley DB or any database with a
DBI compatible driver.  HTTPD::UserAdmin supports files used by the
`Basic' and `Digest' authentication schemes.  Here's an example:

    use HTTPD::UserAdmin ();
    HTTPD::UserAdmin
          ->new(DB => "/foo/.htpasswd")
          ->add($username => $password);          

---

-Doug


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

Date: 8 Aug 1997 06:04:09 GMT
From: matlar@rsv.se (Mats Larsson)
Subject: How to interpret file mode parameter from stat ?
Message-Id: <5secsq$fb$1@u30039.rsv.svskt.se>

How do You interpret the file mode parameter from stat and where
is it documented ?

Mats Larsson



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

Date: Thu, 07 Aug 1997 09:38:24 -0600
From: Bryan Blackburn <blb@fedex.com>
Subject: Re: How-to cut the last characters of a varibles
Message-Id: <33E9EBF0.7F15@fedex.com>

Stephane Robertson wrote: 
> How can I cut the last characters of a variable?
> 
> For example: I need to use printf "%20s", $variable;
>              and if the $variable is more than 20 characters I want it
>              to be cut to the 20th characters. Even if the variable is
> more then 20 characters
>              I want 20 characters to be printed on the screen.
> 
> How do I do that?
> 
> Thanks in advance
> 
> Stephane
>
How about,

printf "%20.20s", $variable;

----
Bryan Blackburn     <blb@rmi.net>
                    <blb@fedex.com>


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

Date: Thu, 07 Aug 1997 10:37:53 -0500
From: Dave Lilly <lilly@fedex.com>
Subject: Re: How-to cut the last characters of a varibles
Message-Id: <33E9EBD1.1CFB@fedex.com>

> Stephane Robertson wrote:
> > How can I cut the last characters of a variable?
> >
> > For example: I need to use printf "%20s", $variable;
> >              and if the $variable is more than 20 characters I want it
> >              to be cut to the 20th characters. Even if the variable is
> > more then 20 characters
> >              I want 20 characters to be printed on the screen.
> >
> > How do I do that?
> >
> > Thanks in advance
> >
> > Stephane

Try this:

printf "%20s", substr($variable, 0, 20);

-dave

-- 
Dave Lilly
Federal Express
lilly@fedex.com


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

Date: Fri, 08 Aug 97 09:11:35 GMT
From: Dave Hodgkinson <daveh@dhcs.demon.co.uk>
Subject: Re: html --> perl
Message-Id: <871031495snz@dhcs.demon.co.uk>

In article <Pine.BSI.3.93.970805155843.14272A-100000@u1.abs.net>
           tomh@u1.abs.net "Tom Halligan" writes:

>   Hi does anyone know a sharwware or freeware program for converting html
> to perl

The HTML Stream module on CPAN has a program that takes an HTML
page and converts it to a perl script the spits out the same HTML.
Good for taking the stuff that the "creatives" produce and
turning it into something workable

-- 
We don't give a damn if they like it or not
We don't give a damn 'cause we know it's really HOT
   Dig! - Hans Dulfer
   (But it could be my company's developers)



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

Date: Thu, 7 Aug 1997 07:16:30 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Julian Rose <Julian@productivity-group.co.uk>
Subject: Re: Idiotic Perl Problem, can anyone help....
Message-Id: <Pine.GSO.3.96.970807071511.18326K-100000@kelly.teleport.com>

On Thu, 7 Aug 1997, Julian Rose wrote:

> I believe I will have to use a readdir command, but I have no idea how
> to start,

Check out the entries on readdir and friends in the perlfunc(1) manpage,
and you might find some good stuff in stat while you're there. If you
still have questions after you've read the docs and FAQs, post again. Hope
this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 8 Aug 1997 08:27:28 -0400
From: clay@panix.com (Clay Irving)
Subject: Re: Learn the SECRET to Attract Women Easily
Message-Id: <5sf3bg$n8i@panix.com>

In <5s20ih$2e1@chronicle.concentric.net> Want More Dates???<tracy78@kilgrona.com> writes:

>Learn the SECRET to Attract Women Easily

>The SCENT(tm)  Pheromone Sex Attractant For Men to Attract Women

Damn. All this time I thought the secret was Perl...

-- 
Clay Irving <clay@panix.com>                   http://www.panix.com/~clay/


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

Date: Fri, 08 Aug 1997 12:13:53 GMT
From: blueboyd@mis.net (Blue)
Subject: New To Perl/Prog.:Please Help
Message-Id: <33eb0615.82065@netnews.mis.net>

Greetings:

I am new to Perl and programming in general. I am trying to teach
myself Perl as I think that it will be a *very* useful tool if I am
ever able to work in the IS field as a programmer or net admin. I have
purchased a couple of books including "Learning Perl" (1st edition)
and I am aware of the existence of the FAQs at www.perl.com. I am,
however, asking for a bit of help. I probably could continue studying
and eventually answer my own question (maybe), but I was hoping for a
jump start. 

I have a file that contains dozens of lines (which will eventually
grow to thousands). The first 9 characters of each line is a user
social security number. The next character is a colon. The rest of
each line is info about the user such as phone number, office
location, etc. This list is updated weekly by an office/department
when there is a change in personnel. This means that there will be
duplicate lines scattered throughout the file. The file is appended to
each week. If a line has a duplicate (some will, some won't), the last
entry will be the most current.  I want to process the file and write
each line to a new file that will not have any duplicates and will
have the most recent info (the last submission for a particular ss#). 

The approach I have taken, so far, using the colon as a delimiter for
the line, is to write each ss# of my file into an array, reverse the
array, and write this out to another file. This is as far as I have
been able to get but I would guess that I should actually be trying to
use an associative array maybe. Using the ss# as the key and the rest
of the line as the element, I could do some sort of compare (for the
existence of a duplicate line already written to the new file) and
write the line to a new file. If the original file is first reversed,
the newest info would be in order from top to bottom. If a duplicate
entry is found, I would need my script to ignore that entry or atleast
not write it to the new file. If this file grows to several thousand
lines, would an array and a comparison be a bad way to process the
file for whatever reason? The following is what I have been able to
put together so far. 

Thanks, in advance, to everyone willing to point me in the right
direction. OK, its not much but it took me a while to get this far. 
____________________

#!/usr/local/bin/perl
$i = 0;
open(IN,"list");
while(<IN>) {
	@soc[$i++] = split (/\:/);
}
close(IN);
@soc = reverse(@soc);
print @soc;

___________________

Thanks again,

Blue


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

Date: 8 Aug 1997 14:20:01 GMT
From: napier@seas.upenn.edu (Bill Napier)
Subject: Re: New To Perl/Prog.:Please Help
Message-Id: <slrn5umaog.4k4.napier@blue.seas.upenn.edu>

On Fri, 08 Aug 1997 12:13:53 GMT, Blue <blueboyd@mis.net> wrote:
>I have a file that contains dozens of lines (which will eventually
>grow to thousands). The first 9 characters of each line is a user
>social security number. The next character is a colon. The rest of
>each line is info about the user such as phone number, office
>location, etc. This list is updated weekly by an office/department
>when there is a change in personnel. This means that there will be
>duplicate lines scattered throughout the file. The file is appended to
>each week. If a line has a duplicate (some will, some won't), the last
>entry will be the most current.  I want to process the file and write
>each line to a new file that will not have any duplicates and will
>have the most recent info (the last submission for a particular ss#). 

[description of your approach snipped]

I would use a hash (like you suggested) with SSN's as the keys.  If
you work through from the beginning of the file, you're guaranteed to
only have the most recent entries in the hash (since you said the most
recent entries will be at the end of the file).

>#!/usr/local/bin/perl
>$i = 0;
>open(IN,"list");
>while(<IN>) {
	($ssn,$rest) = split(/:/);
	$hash{"$ssn"} = $rest;
>}
>close(IN);
for (keys %hash) {
    print "$_:",$hash{$_},"\n";
}

Bill Napier - CSE '98 | e-mail: napier@seas.upenn.edu
----------------------| WWW:    http://www.seas.upenn.edu/~napier
 This space for rent  | finger for more information (phone, PGP, etc.)
-----------------------------------------------------------------------
No! Try not. Do. Or do not. There is no try.		-Yoda


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

Date: Fri, 8 Aug 1997 07:37:26 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Blue <blueboyd@mis.net>
Subject: Re: New To Perl/Prog.:Please Help
Message-Id: <Pine.GSO.3.96.970808072747.9049J-100000@kelly.teleport.com>

On Fri, 8 Aug 1997, Blue wrote:

[ One and one-half large, dense screenfuls of text snipped. I'm sure it
was wonderful prose, but I couldn't bring myself to read it! If you can
cut it down to one small, relevant paragraph, I could try again. :-)  I'm
not trying to be mean or anything; but like many of us on the newsgroup,
if we can't read and reply to your inquiry in a minute or two, we'll move
on to the next message. ]

> #!/usr/local/bin/perl

You should probably use -w and maybe 'use strict'.

> $i = 0;
> open(IN,"list");

You must check the return value of open!

    open IN, "list"
	or die "Can't open 'list' for input: $!";

> while(<IN>) {
> 	@soc[$i++] = split (/\:/);

You probably wanted something different there, but I'm not sure just what.
I'm sure that you didn't want that line of code, though. Here are some
possibilities.

    push @soc, split /:/;

    $soc[$i++] = split /:/;

    unshift @soc, reverse split /:/;

> }
> close(IN);
> @soc = reverse(@soc);
> print @soc;

Is that what you want, or could you need to put a join in there somewhere?

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/




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

Date: Wed, 6 Aug 1997 15:52:48 -0400
From: Premgith  Vidyanandan <vidyanan@pilot.msu.edu>
Subject: Opening tcp connections....
Message-Id: <Pine.GSO.3.96.970806154725.28393A-100000@arctic.cps.msu.edu>



Hi I'm new to perl programming and I am starting to get the hang of the
stuff slowly, however I'm still having trouble understanding socket
connections.. Can anyone please tell me how I can open up a tcp connection
with another machine and read or write to it.. I tried a perl script
given in my book but it does not seem to work and I can't seem to
understand some of the stuff either.. 

When $sockaddr = 'S n a4 x8' , what do they mean by it?? 

thanks a lot...


Premgith Vidyanandan
E-mail - vidyanan@pilot.msu.edu





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

Date: Thu, 7 Aug 1997 20:54:56 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Irving Reid <irving@sys.toronto.edu>
Subject: Re: Pack / Unpack of IEEE floating point?
Message-Id: <Pine.GSO.3.96.970807205042.5101C-100000@kelly.teleport.com>

On 7 Aug 1997, Irving Reid wrote:

> We have an application (actually the 'COPE' CORBA IIOP implementation,
> http://www.lunatech.com/cope/) that needs to pack and unpack floats and
> doubles in IEEE format. 
> 
> I prowled through all the modules I could find, but there doesn't seem
> to be any existing IEEE format mangling tools. 
> 
> If nobody else knows of them, I'll go bug the Perl5-porters with a
> feature request.  This seems like a prime candidate for new format
> designators for the pack() functions.. 

The existing docs for pack tell me that the IEEE format may vary from one
machine to another. But there's no reason you can't make a module which
packs data in whatever format you wish, and you should naturally do so in
a machine-independant way. (I'm not saying that you can't make this happen
with pack and unpack. But if you want it right away, making your own
module would be a good way to go.) Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 827
*************************************

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