[6297] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 919 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 9 18:13:47 1997

Date: Sun, 9 Feb 97 15:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 9 Feb 1997     Volume: 7 Number: 919

Today's topics:
     Re: "Scalar-list context magic sucks" and other sins of aaron_watters@msn.com
     ??? Formating numbers <kreitzd@atlantic.net>
     Re: apedding to a list... (Andrew M. Langmead)
     Re: apedding to a list... (Bennett Todd)
     Re: DDE calls under NT Perl 5 <rothd@roth.net>
     Diffuculty writing carriage-return to file <doobry@doobry.demon.co.uk>
     Re: Diffuculty writing carriage-return to file (Mike Stok)
     Re: Grabbing Html via perl from the web (Phil Gross)
     Re: Help is anyone any good with sockets (Mike Stok)
     Help please <magnus@grasberg.se>
     Re: Help please (Nathan V. Patwardhan)
     HELP. Loading file from script <tan@kontex.se>
     Re: HELP. Loading file from script (Nathan V. Patwardhan)
     Re: How do I make a Perl program a .exe <tchrist@mox.perl.com>
     Re: How do I make a Perl program a .exe (Andrew M. Langmead)
     IMPORTANT-ONLINE CHARGES (Rick Figley)
     Re: Is this a bug in perl???  (Missing newlines) (....What Is?....)
     Re: Is this a bug in perl???  (Missing newlines) (Ilya Zakharevich)
     Re: Loops in perl (Tad McClellan)
     Re: Need Perl Script to Telnet (Sitaram Chamarty)
     opening a URL from my perl script (Mike Russ)
     Re: PERL / ODBC <rothd@roth.net>
     Re: Perl rand() function on solaris SPARC (Thomas J. Forbes)
     POP Mail module. PLEASE HELP! <mojo@oregoncoast.com>
     Problems formating the number to be printed <lcm@dcc.unicamp.br>
     Re: Problems formating the number to be printed (Mike Stok)
     Re: sybperl for the MacIntosh ? <billc@tibinc.com>
     Using $ENV{'QUERY_STRING'} (Kevin Woodward)
     Re: Win32::ODBC for build 303 <rothd@roth.net>
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Sun, 09 Feb 1997 15:41:14 -0600
From: aaron_watters@msn.com
Subject: Re: "Scalar-list context magic sucks" and other sins of Perl (was: Re: Q: opening a file...)
Message-Id: <855523415.15377@dejanews.com>



From:         king@cogsci.ucsd.edu (Jonathan King)
 ... munch munch gulp ...

 ... mention of Unix World Python Tutorial by me ...

The matrix multiplication/Perl stuff was from tchrist  (with permission)
as attributed in my Unix World Online article, and the matrix
multiplication Python code by me is now entirely historical since
Numerical Python now permits matrices to be multiply by m1 * m2 (ie,
matrices are builtin numeric types, if the extension is present). 
Nevertheless I sympathize with the sentiments of the poster.  -- Aaron
Watters === I know, it's only rock and roll, but I like it.  -- Mick
Jagger

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 9 Feb 1997 22:56:20 GMT
From: "Daniel L. Kreitz" <kreitzd@atlantic.net>
Subject: ??? Formating numbers
Message-Id: <01bc16d2$962b61e0$42ffd7cc@default>

How do I get my variables to print out in a special format--specifically,
currency formats? The output removes the extra zeros (i.e., $3.5 instead of
$3.50). How do I fix this?

Do I use the format function? And if so, how?

Thanks in advance for your help

Dan Kreitz -- kreitzd@atlantic.net


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

Date: Sun, 9 Feb 1997 17:38:05 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: apedding to a list...
Message-Id: <E5CJnH.HHL@world.std.com>

Phil Williams <williams@irc.chmcc.org> writes:

>Phil Williams wrote:
>> 
>> Sorry for the basic question.
>> 
>> I want to append to a list only if the thing being appended isn't
>> already an element in the list.

>Hate to answer my own question, but...

>I just figured out one way to do this:

>@junk = (@junk, $newjunk) if grep($newjunk, @junk) eq 0;

One thing you might want to do is use push(@junk, $newjunk) to append
to the original list instead of making copies of the old list to
assign to a new one.

Also, you might want to say "grep /^\Q$newjunk\E$/o, @junk" to avoid
problems with regular expression metacharacters and substring
matching, or you could just say "grep {$_ eq $newjunk} @junk" and use
the string equality operator. (Do you realize that the format for grep
is "grep EXPRESSION, LIST" or "grep BLOCK LIST", not 
"grep RE-PATTERN, LIST"?)

Also, more of a stylistic issue, you might want to chnage the "if ... eq 0"
to "unless ..."

>Is there a better way?

If the FAQ still existed, there was an entry for determining if an
element existed in an array. (I'd point you to the entry number, but I
destroyed my copy of the FAQ when instructed to. If you hurry, you
might be able to still grab a copy from
<http://www.perl.com/CPAN/doc/FAQs/FAQ/FAQ.gz> before the CPAN sites
comply with the instructions.)

I think it had something to do with using a parallel hash to store the
information, and checking if the key existed in the hash. Something like:

@blues = ('Elmore James', 'Buddy Guy', 'Robert Johnson', 'BB King',
          'Sonny Boy Williamson');
undef %is_blues_artist;
for(@blues) {$is_blues_artist{$_} = 1;}

Then checking if $is_blues_artist{$_} is true to determine if it
existed in @blues.

Of course if you can fill the hash as you fill the array, you'll
probably be better off. You might even find that you don't need the
original array at all. (In cases where the order of the items don't
matter, or you are going to sort the items later.)

I think there where other suggestions if the items in the array were
small integers, but its all starting to get hazy.

Questions like this get asked frequently. You know, it would be really
great if someone compiled a list of the answers to these questions. It
would be a great resource. I wonder why no one has ever thought of
this before.
-- 
Andrew Langmead


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

Date: Sun, 9 Feb 1997 18:57:51 GMT
From: bet@nospam.interactive.net (Bennett Todd)
Subject: Re: apedding to a list...
Message-Id: <slrn5fs7hf.pv4.bet@onyx.interactive.net>

On Sat, 08 Feb 1997 18:30:42 -0500, Phil Williams <williams@irc.chmcc.org> wrote:
>@junk = (@junk, $newjunk) if $newjunk not already in @junk

push @junk, $newjunk unless grep { $_ eq $newjunk } @junk;

However, that's not very efficient if you're gonna be doing very many
insertions. An associative array is liable to be a better way of doing the
check. If you don't need to preserve the order of the elements, then just
collect them with

	$junk{$newjunk}++;

and then when you need the list pull it out with "keys %junk". If you do have
to preserve the order, then use a helper associative array for the
duplicate-checking anyway: e.g.

	push @junk, $newjunk unless $junk{$newjunk}++;

-Bennett


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

Date: 9 Feb 1997 15:41:07 GMT
From: "Roth Consulting" <rothd@roth.net>
Subject: Re: DDE calls under NT Perl 5
Message-Id: <01bc169f$3d8bbb30$0100a8c0@www>

Someone had written a win32 perl 5 extension called DDE.ZIP and there is a
copy of it at Activeware's ftp site:
	ftp://ftp.activeware.com/contrib.old/dde.zip

I once played with it but did not get it to work -- if I had had more time
maybe I could have.
If you get it working please repost the working version of it. This is
something that I had been eager to play with.
dave

PS: I use the Activeware's Win32 Perl not MKS.
-- 
================================================================
Dave Roth                             ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                        the illusion of integrity

****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.


Jeff Groves <groves@goodnet.com> wrote in article
<32FBF761.1413@goodnet.com>...
> Is there a version of perl (or a module) for NT 4.0 that will let me do
> DDE calls.  Currently, I'm using Visual Basic to make DDE calls in order
> to communicate with another application.
> 
> Unfortunately, most of the program does text parsing and Visual Basic
> sucks at doing this kind of work.  I've spent days writing routines to
> handle text, when I could do the same thing in perl in just a few hours
> (or minutes).
> 
> If I could figure out how to make perl do DDE calls, my job would be
> much easier.
> 
> I have a MKS perl 5.0 for NT, but I can't find any mention of DDE calls
> anywhere.  Could someone offer any help?
> 
> Thanks.
> 
> Jeff
> 


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

Date: Sun, 9 Feb 1997 20:43:48 +0000
From: Dave Wilkinson <doobry@doobry.demon.co.uk>
Subject: Diffuculty writing carriage-return to file
Message-Id: <PLwyzHAEcj$yEw4i@doobry.demon.co.uk>

In article <32F96619.3830@amagicstore.com>, A MAGIC STORE
<max@amagicstore.com> writes
>I've programmed a couple of scripts in Perl, I've uploaded them to my
>server (UNIX) but they are not working. My server said that there is a
>^M (new line) at the end of each line. I'm using Win95 Notepad.
>Does anybody know any FTP client or other program that transform MS-DOS
>based text files into UNIX text files (basically without the ^M at the
>end of each line)??
>
>Thank you.
>
>Max

I have recently had this problem too and tried for some time to write a
Perl script which replaced every occurence of 0x0D0x0A in a DOS file
with an 0x0A to convert it to UNIX format.

However - no matter what method I tried, when I tried to write a single
0x0A to the file it wrote it as 0x0D 0x0A . I had to write it in C in
the end!

(Im running Perl v5.0x on an NT platform BTW)

So then, how do you write binary characters to a file without this
happening?

Dav.

-- 
Dave Wilkinson
Cyrus Videographic


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

Date: 9 Feb 1997 21:04:59 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Diffuculty writing carriage-return to file
Message-Id: <5dle5r$lqt@news-central.tiac.net>

In article <PLwyzHAEcj$yEw4i@doobry.demon.co.uk>,
Dave Wilkinson  <doobry@doobry.demon.co.uk> wrote:
>In article <32F96619.3830@amagicstore.com>, A MAGIC STORE
><max@amagicstore.com> writes
>>I've programmed a couple of scripts in Perl, I've uploaded them to my
>>server (UNIX) but they are not working. My server said that there is a
>>^M (new line) at the end of each line. I'm using Win95 Notepad.
>>Does anybody know any FTP client or other program that transform MS-DOS
>>based text files into UNIX text files (basically without the ^M at the
>>end of each line)??

Can you try setting the file transfer mode to binary (image) with a
command at the client end?  Most ftp clients let you say 

 binary

at the prompt and then the transfer shouldn't mess with ends of line. 

>I have recently had this problem too and tried for some time to write a
>Perl script which replaced every occurence of 0x0D0x0A in a DOS file
>with an 0x0A to convert it to UNIX format.
>
>However - no matter what method I tried, when I tried to write a single
>0x0A to the file it wrote it as 0x0D 0x0A . I had to write it in C in
>the end!

>So then, how do you write binary characters to a file without this
>happening?

Have you tried doing

  binmode (FH);

before doing any IO on the filehandle FH?

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: 9 Feb 1997 16:21:29 -0500
From: philbo@bronze.lcs.mit.edu (Phil Gross)
Subject: Re: Grabbing Html via perl from the web
Message-Id: <5dlf4p$nr8@bronze.lcs.mit.edu>

I'm using wwwmir to do just that; grab a file off a web server. It can
do much more, as well. Check it out at
http://www.ifi.uio.no/~janl/w3mir.html


--Phil Gross
  Philbo's Omnibus
  www.philbo.com


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

Date: 9 Feb 1997 14:29:13 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Help is anyone any good with sockets
Message-Id: <5dkmvp$ho2@news-central.tiac.net>

In article <5dkkhk$dkf@dunlop.cs.strath.ac.uk>,
Ruth Ann Davidson CS93 <rdavidso@cs.strath.ac.uk> wrote:
>I am trying to download a web page to a file through 
>a perl script, does anyone know how i can do this
>
>Please Help i am at my wits end

If you're using perl 5 you might want to use libwww-perl modules which can
be grabbed from a CPAN (Comprehensive Perl Archive Network) site.  The
master site is at ftp.funet.fi under /pub/languages/perl/CPAN and this has
a list of mirror sites.  Tom Christiansen's CPAN multiplexor is at
http://www.perl.com/CPAN/ and will bounce you to an archive.  One of the
things that comes with the libwww-perl distribution is lwp-download

NAME
       lwp-download - fetch large files from the net

SYNOPSIS
        lwp-download <url> [<local file>]

DESCRIPTION
       The lwp-download program will down load the document
       specified by the URL given as the first command line
       argument to a local file.  The local filename used to save
       the document is guessed from the URL unless specified as
       the second command line argument.

which might be a little general, but shows what the module can do, for
just grabbing the contents of a web page can be done thus (which makes
liberal use of an example in the manual page...)

#!/usr/local/bin/perl -w

use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);

my $req = new HTTP::Request GET => 'http://www.perl.com/perl/';

my $res = $ua->request($req);

if ($res->is_success) {
  print $res->content;
}
else {
  print "Bad luck this time\n";
}

__END__

One other resource you might explore is www.dejanews.com, it can save some
time if you're prepared to mess around with searches to discover the
"right" keywords.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Sun, 09 Feb 1997 17:50:22 +0100
From: Magnus Grdsberg <magnus@grasberg.se>
Subject: Help please
Message-Id: <32FE004E.B36@grasberg.se>

Is it possible to send PARAMS from a text fil to a java applet instead
of giving the params in the HTML code???

Can this be done with perl???

Pleae mail me the answer..........

Magnus Grdsberg
magnus@grasberg.se


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

Date: 9 Feb 1997 19:37:06 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Help please
Message-Id: <5dl912$ndt@fridge-nf0.shore.net>

Magnus Grdsberg (magnus@grasberg.se) wrote:
: Is it possible to send PARAMS from a text fil to a java applet instead
: of giving the params in the HTML code???

Check comp.infosystems.www.authoring.cgi.  This group has *nothing* to
do with Java.

--
Nathan V. Patwardhan
nvp@shore.net
"What is the wind speed of a sparrow?"


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

Date: 9 Feb 1997 11:29:24 GMT
From: "Tommy Esin" <tan@kontex.se>
Subject: HELP. Loading file from script
Message-Id: <01baf6e1$9c14e700$470264c3@ny>

I have gotten a script to log the users that come to my homepage, but i am
wondering if i can load a perl script into one of the frames, and upon
completion of the script make it load the desired html file into the same
frame.

Can someone plese help me with this?

Tommy Esin


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

Date: 9 Feb 1997 16:02:42 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: HELP. Loading file from script
Message-Id: <5dksf2$af5@fridge-nf0.shore.net>

Tommy Esin (tan@kontex.se) wrote:
: I have gotten a script to log the users that come to my homepage, but i am
: wondering if i can load a perl script into one of the frames, and upon
: completion of the script make it load the desired html file into the same
: frame.

It can be done, and you'll find the answer in 
comp.infosystems.www.authoring.cgi.  HTH!


--
Nathan V. Patwardhan
nvp@shore.net
"What is the wind speed of a sparrow?"


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

Date: 9 Feb 1997 21:35:38 GMT
From: <tchrist@mox.perl.com>
Subject: Re: How do I make a Perl program a .exe
Message-Id: <5dlfva$58h$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    djk490s@nic.smsu.edu (Dave) writes:
:Let's say I write a simple script, call it renames.pl that runs on
:Win95.  I want to make it an executable, call it renames.exe.  Is this
:possible and how do I do it?  

No, it's not possible.  Use source code or die.

:If anyone knows the answer to this, I would love to know!  I really
:want to know for a cgi that I have running on a NT server.  I want to
:make it executable to protect the source code from being read.  I
:don't want the source code available because I don't want people
:looking for security holes.  In anycase, I could even think of more
:applications than this one for having my Perl programs turned into
:.exe files.

Listen, if you think that hiding source code is any way to provide
security, you're a nut.  That's security through obscurity, and
it's not just stupid, it's dnageorus.

--tom
-- 
Tom Christiansen      		tchrist@perl.com
    "I have many friends who question authority.  For some reason most of 'em
    limit themselves to rhetorical questions."
    	--Larry Wall


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

Date: Sun, 9 Feb 1997 21:45:26 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: How do I make a Perl program a .exe
Message-Id: <E5Cv3q.CBv@world.std.com>

djk490s@nic.smsu.edu (Dave) writes:

>If anyone knows the answer to this, I would love to know!  I really
>want to know for a cgi that I have running on a NT server.  I want to
>make it executable to protect the source code from being read.  I
>don't want the source code available because I don't want people
>looking for security holes.  In anycase, I could even think of more
>applications than this one for having my Perl programs turned into
>.exe files.

This is often referred to as "security through obscurity", and it
isn't generally considered a good security plan. (Have you tried the
"-T" switch? That is your very best first step to security.) How do
you expect someone to get your CGI source code? Through your http
server?  (That would imply that your http server isn't very secure.)
If you know how the thieves will attack your system, fix the real
problem. If you don't know how they will attack, start figuring it
out. If you don't know how to start figuring it out, then hire someone
who can.

Besides, what makes you think that a NE Executable file is very
secure? Constants strings (possibly pathnames) should still be visible
in the executable image. Disassemblers exist. Perl's -D flag can give
a lot of useful information on what a script is doing, (The "-d" flag
as well.)

There is work being done on a Perl Compiler, that will either emit
perl bytecodes or compile the script into a C executable, but as far
as I know, no work as been done porting it to Activeware's Win32 port
of perl. If it works, it requires you to compile the source code into
an extesion module.

If I haven't convinced you, then take a look at
<http://www.perl.com/cgi-bin/cpan_mod?module=Filter::decrypt> This
module will encrypt the source code and decript it before it gets
run. This also requires the ability to compile extension modules.

(And like I said in another article, if we had a regularly posted
article of answers to Frequently Asked Questions, this would probably
be in it. It may not have been up to date enough to include
Filter::decrypt, and may have been a little sparse about the perl
compiler, which are both fairly recent developments.  It we had one,
it probably would be kept on the web as well. Like maybe at a URL like
<http://www.perl.com/CPAN/doc/FAQs/FAQ/FAQ.gz>. Oh, it is such a shame
that we don't have a FAQ list.)
-- 
Andrew Langmead


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

Date: Sun, 9 Feb 1997 05:49:22 -0500 (EST)
From: rick@aii.net (Rick Figley)
Subject: IMPORTANT-ONLINE CHARGES
Message-Id: <199702091049.FAA11936@home.aii.net>

Got this today. I'm forwarding it to everyone I correspond with. We need to
do what we can to fight this.



  I am writing you this to inform you of a very important matter
  currently under review by the FCC. Your local telephone company has
  filed a proposal with the FCC to impose per minute charges for your
  internet service. They contend that your usage has or will hinder the
  operation of the telephone network.

  It is my belief that internet usage will diminish if users were
  required to pay additional per minute charges. The FCC has created an
  email box for your comments, responses must be received by February
  13, 1997. Send your comments to isp@fcc.gov and tell them what you
  think.

  Every phone company is in on this one, and they are trying to sneak
  it in just under the wire for litiagation. Let everyone you know here
  this one. Get the e-mail address to everyone you can think of.

  isp@fcc.gov

  Please forward this email to all your friends on the internet so all
  our voices may be heard!



Rick Figley

rick@aii.net




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

Date: 9 Feb 1997 17:14:39 GMT
From: whatis@nic.cerf.net (....What Is?....)
Subject: Re: Is this a bug in perl???  (Missing newlines)
Message-Id: <5dl0lv$sb3@news.cerf.net>

In article <5dhact$sac@vixen.cso.uiuc.edu> mheins@prairienet.org (Mike Heins) writes:
>Do you think something this basic could have gotten through all those
>updates?

Sure, why not -- I found earlier that NDBM's implementation of "each"
screws up if you "delete" something, which the book says isn't supposed
to happen with "each"...

Steven Boswell
whatis@yyz.com
<http://www.cerfnet.com/~whatis/>


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

Date: 9 Feb 1997 21:20:38 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Is this a bug in perl???  (Missing newlines)
Message-Id: <5dlf36$9jf$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to ....What Is?....
<whatis@nic.cerf.net>],
who wrote in article <5dl0lv$sb3@news.cerf.net>:
> In article <5dhact$sac@vixen.cso.uiuc.edu> mheins@prairienet.org (Mike Heins) writes:
> >Do you think something this basic could have gotten through all those
> >updates?
> 
> Sure, why not -- I found earlier that NDBM's implementation of "each"
> screws up if you "delete" something, which the book says isn't supposed
> to happen with "each"...

Then the book is wrong. There is no guarantie at all what "each" will
do, since it can result in a call to an *arbitrary* piece of Perl or C
code. 
	man perltie

Ilya


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

Date: Sun, 9 Feb 1997 06:32:44 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Loops in perl
Message-Id: <c5gkd5.ql.ln@localhost>

Thomas Patrick Bailey (baile934@harrier.csrv.uidaho.edu) wrote:
: I am fairly new to perl, but I have been doing ok in it.  What I need to
: know is how to do a simple loop.  
                    ^        ^^^^

What kind of loop?


: A simple example would be very helpful.
                            ^^^^^^^^^^^^

Reading the documentation that is *included with the perl distribution*
would be very helpful.

Try spending a few minutes in the perlsyn man page...




perl -e 'for ($i=0; $i<10; $i++) {print "$i\n"}'    # for

perl -e 'foreach (0..9) {print "$_\n"}'             # foreach

perl -e '$i=0; while ($i<10) {print "$i\n"; $i++}'  # while

perl -e 'while(1) {print "RTFM\n"}'                 # test your patience ;-)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Sun, 09 Feb 1997 21:03:42 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Need Perl Script to Telnet
Message-Id: <32fe3b70.250701164@news.diac.com>

eric.arnold@sun.com (Eric Arnold) wrote:

>Please elaborate.  How is Comm.pl deficient?  I'm not exactly sure what
>your smiley means there.  You seem to be saying that you'd rather use
>TCL/Expect than Perl/Comm.pl.  If you have suggestions, please voice them.
>
>As far as I know, Comm.pl allows you do all the same things that the
>TCL/Expect does, though it delegates all the mundane TCL/Expect functions
>(i.e. IO/logging/etc) to the Perl langauge, since Perl does all that
>much better anyway.

Possibly unrelated question:  Was I dreaming or was there at some time
somewhere a program called expect.pl?  I recently needed expect functionality
(but didnt have and didnt want to load and learn Tcl), so I went hunting for
expect.pl.  Couldnt find it anywhere.  Did find comm.pl eventually, but by
then the need had passed.

If and when I need it again, I'll go by what you say above and use comm.pl,
but meanwhile I'm curious: where and what is expect.pl?  Does anyone know?

Sitaram


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

Date: 9 Feb 1997 20:50:37 GMT
From: miker@lainet.com (Mike Russ)
Subject: opening a URL from my perl script
Message-Id: <5dldat$7qs@lori.zippo.com>

Help!

I used to use

if ("lainet" eq "lainet") {
     print "location: http://www.lainet.com";
    }

and it would open the URL www.lainet.com but now it only prints 
  locaction: http://www.lainet.com on the browser instead of actually 
going to the page..

any help is very appreciated

Mike Russ
laurus@lainet.com



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

Date: 9 Feb 1997 15:46:11 GMT
From: "Roth Consulting" <rothd@roth.net>
Subject: Re: PERL / ODBC
Message-Id: <01bc169f$f27f4750$0100a8c0@www>

Brian Shepard <brian@shepmark.com> wrote in article
<01bc149e$daa3fde0$a154b5cf@default>...
> I am having problems connecting to any dsn, the code I'm using is part of
> the test program that comes with the Perl extensions for ODBC.
 ... 
> Opening ODBC connection for "ebeem_music" Error opening a connection.
 
If you run perl test.pl without specifying a DSN does the script
successfully execute using the test access database?
dave
-- 
================================================================
Dave Roth                             ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                        the illusion of integrity

****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.



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

Date: Sun, 09 Feb 1997 18:33:49 GMT
From: tforbes@ix.netcom.com (Thomas J. Forbes)
Subject: Re: Perl rand() function on solaris SPARC
Message-Id: <32fe1850.241070908@nntp.ix.netcom.com>

I have the same problem - when I run:

srand();

$num = int(rand(7)); # Pick a Random Number

print "$num\n";

I get back numbers like 56,798
 WHY IS THIS????????

On Wed, 05 Feb 1997 15:36:28 -0800, Paul Austin <paustin@gw.ford.com>
wrote:

>Hi,
>
>I am trying to use the rand() function to obtain a random number between
>0 and 39. This works fine on a HP UX system but when I run it on
>solaris the numbers being returned are in the order of 100,000's
>any ideas why this occurs?
>
>The command I am using is:
>
>$index = int(rand(39));
>
>regards,
>paul
>------------------------------------------------------------------
>Paul Austin, Analyst, WPPS Supplier Data.
>40/432, Trafford House, 8 Station Way, Basildon, Essex SS16 5XX 
>PROFS: PAUSTIN, INTERNET: paustin@gw.ford.com, UNI: pda1@ukc.ac.uk
>Tel.44-1268-703016/718-3016 Fax.44-1268-703673/718-3673



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

Date: Sun, 09 Feb 1997 13:55:59 -0800
From: mojo <mojo@oregoncoast.com>
Subject: POP Mail module. PLEASE HELP!
Message-Id: <32FE47EF.6DB6E80@oregoncoast.com>

Is there a POP mail module for perl?
I know that there is an FTP and a PING one.
Net::FTP
and
Net::Ping
But is there a POP mail one?
PLEASE HELP!


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

Date: 06 Feb 1997 11:44:22 -0200
From: Leonardo Chaves Machado <lcm@dcc.unicamp.br>
Subject: Problems formating the number to be printed
Message-Id: <2teneuf3rd.fsf@dcc.unicamp.br>


	Hi, everybody,

		I am trying to format he number to be printed, and
	I am using the variable $#, to make it, but it seems not to
	work. A very simple test program could be:

------------------ Code begins here ---------------------
#!/usr/bin/perl

$number = 1.2387;
$# = "%.2f";
print "This is the number: $number\n";

------------------ Code ends here -----------------------

		I tried many things for the value of $# (%1.2f,
	%.2i, %.2g, etc.) but it didn't work. I just want to
	print the number with 2 decimal digits!

		My Perl is 5.003.

		Could anybody help me?!

		Thanks in advance! Aufwiedersehen ...

						:-) Leonardo



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

Date: 9 Feb 1997 16:09:24 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Problems formating the number to be printed
Message-Id: <5dksrk$p6i@news-central.tiac.net>

In article <2teneuf3rd.fsf@dcc.unicamp.br>,
Leonardo Chaves Machado  <lcm@dcc.unicamp.br> wrote:

>		I am trying to format he number to be printed, and
>	I am using the variable $#, to make it, but it seems not to
>	work. A very simple test program could be:

The perlvar manual page has a little to say about $#, in general I usually
end up using sprintf or printf to explicitly format numeric output.

       $#      The output format for printed numbers.  This
               variable is a half-hearted attempt to emulate
               awk's OFMT variable.  There are times, however,
               when awk and Perl have differing notions of what
               is in fact numeric.  The initial value is %.ng,
               where n is the value of the macro DBL_DIG from
               your system's float.h.  This is different from
               awk's default OFMT setting of %.6g, so you need to
               set "$#" explicitly to get awk's value.
               (Mnemonic: # is the number sign.)

               Use of "$#" is deprecated.

Hope this helps,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Sun, 09 Feb 1997 15:45:11 -0500
From: Bill Cowan <billc@tibinc.com>
To: Roger Smith <rsmith@proteus.arc.nasa.gov>
Subject: Re: sybperl for the MacIntosh ?
Message-Id: <32FE3757.5E96@tibinc.com>

Roger Smith wrote:
> 
> Greetings All
> 
> I just joined this list, so my apologies if this question has been asked
> in the past (although I did a search back through november).
> 
> We are looking for a perl interface to the MacIntosh Sybase client. We
> have the client package and the developers package which includes a c
> library interface. I have visited the mac-perl web sites for both
> distribution and faq, searching for references tosybase or sybperl, but
> with no success.
> 
> Can someone please shed some light on this?
> 
> Cheers,
> 
> Roger Smith,
> NASA-Ames Research center

Just a thought:

The doc with perl/sybase interface module on CPAN used to include a list
of ports for sybperl.  From sybperl doc, you may also get mailing list
for sybperl (and/or mail archive) to try. 

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: Sun, 09 Feb 1997 20:51:35 GMT
From: kevin@redsun.com (Kevin Woodward)
Subject: Using $ENV{'QUERY_STRING'}
Message-Id: <32fe35ed.4628818@news.demon.co.uk>

Hi,

I'm having trouble with $ENV variables. I'd like to set a variable
($quy) to the string entered after the ? when called.=20

I assume (from what I've read on the web) that the line should look
like:

$quy =3D $ENV{'QUERY_STRING'};

However this fails. I've tried printing $ENV{'QUERY_STRING'} to the
UNIX prompt, but had no luck. I've have been attempting this simple
task for many hours this weekend and this is my last resort.

Is they some command to set up these variable, or to pass them to the
process? Or anm I simply implementing it wrong?

I apologies for the 'non-technical' terms; I blame it on my newness to
the language.=20



Kevin.




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

Date: 9 Feb 1997 15:50:51 GMT
From: "Roth Consulting" <rothd@roth.net>
Subject: Re: Win32::ODBC for build 303
Message-Id: <01bc16a0$99520900$0100a8c0@www>

Thomas Winzig <tsw@pvo.com> wrote in article <32FD2DFD.6D58@pvo.com>...
> Hello,
> 
> I've got build 303 of ActiveWare's Perl for Win32. I'm
> trying to either find a version of Win32::ODBC recompiled
> for build 303 (the latest I can find is for 302), or a
> way to recompile it myself. I've got VC++ 4, but I can't
> locate all of the Win32::ODBC headers that the odbc.cpp
> source 'include's. 
> 

Patience, patience. I've compiled yet another version for both builds 110
and 303. It should be out this week.
I kind of wish that Win32 Perl could finalize on an extension interface
once and for all instead of changing it ever so many builds. ;)
dave
-- 
================================================================
Dave Roth                             ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                        the illusion of integrity

****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.



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

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

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 V7 Issue 919
*************************************

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