[7480] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1106 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 30 18:07:19 1997

Date: Tue, 30 Sep 97 15:00:32 -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           Tue, 30 Sep 1997     Volume: 8 Number: 1106

Today's topics:
     re: Advanced Perl Programming <sriram@weblogic.com>
     Announce: Http Server Programming with Persistent Perl  tdarugar@binevolve.com
     Re: Announce: Http Server Programming with Persistent P (brian d foy)
     Answer Found Sort of (Testing for non existance) (Grey Cloak)
     changing characters in filenames (Steve Brant)
     Re: commercial packages w/ perl?  Tivoli, ClearCase, DD <selden@NOSPAM.instinet.com>
     Re: Die and the Web <gareth@webbar.fr>
     File Transfer with Perl <dmercer@isr.umd.edu>
     Re: HELP! on Attaching files to email. (Grey Cloak)
     MUD's in Perl? (Nigel Reed)
     Re: Newbie ques: How to concatenate two strings? (Faust Gertz)
     NEWBIE: How  do you check for Non existance of a file. (Grey Cloak)
     Re: NEWBIE: How  do you check for Non existance of a fi (brian d foy)
     regex for one "two three" four (Mark Haskamp)
     Re: Reverse Engineer Time strings <psrc@corp.airmedia.com>
     schwartz story in wired (Donald Lingle)
     Socket problems in 5.001, not in 5.003 <may@ims.nci.nih.gov>
     splitting a tab delimited line <tcm@tcmd.com>
     Re: splitting a tab delimited line (Dan Greenblatt)
     Unix -> NT conversion <aaron@soltec.net>
     Re: Where is perl/Tk for Win32 <youngej@magpage.com>
     Re: WHILE LOOP LOGIC <rootbeer@teleport.com>
     XS: sv_2mortal (when is it necessary?) (Pete Ratzlaff)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 30 Sep 1997 14:27:02 -0700
From: Sriram Srinivasan <sriram@weblogic.com>
Subject: re: Advanced Perl Programming
Message-Id: <34316EA6.3697D3A3@weblogic.com>

Woody Jin and Tony Baldassare had pointed out an error in 
my book .. using "PeerHost" instead of "PeerAddr" (p. 193)
It turns out that PeerHost was available in the early 
IO::Socket stuff that I was using when I wrote the networking
chapters. This was changed in 5.004, but I missed it in 
the final flurry of book production. 
This will be corrected in the next printing.

Thanks for pointing out the error.

- Sriram 

________________________________________________________________________
Principal Engineer      WebLogic, San Francisco        www.weblogic.com 
"Advanced Perl Programming" : http://www.ora.com/catalog/advperl/


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

Date: Tue, 30 Sep 1997 14:36:19 -0600
From: tdarugar@binevolve.com
To: info@binevolve.com
Subject: Announce: Http Server Programming with Persistent Perl and Tcl
Message-Id: <875647795.24348@dejanews.com>

Announce: Http Server Programming with Persistent Perl and Tcl

  Two of the most popular scripting languages on the web, Perl and
TCL,
can now be used to program the Netscape suite of http servers.
Binary Evolution is pleased to announce two new NSAPI based server
plugins: the Velocity Engine for Perl (VEP) and the Velocity Engine
for TCL (VET).

  These products allow you to embed Perl and Tcl code within
your html documents, greatly simplifying server side programming
and obviating the need for CGI. Create dynamic html pages with
today's most popular databases, including Oracle, Sysbase, Informix,
mSQL, mySQl, and ODBC compliant databases. VEP and VET outperform
CGI solutions by as much as 25 times.

  Please visit our web site at http://www.binevolve.com/ ,
look over the demos, and download a free evaluation copy.

  I hope you will agree that the Velocity Engines provide the
most powerful and easy to use means of http server programming
today.

Sincerely,
        Tony Darugar
        tdarugar@binevolve.com
        http://www.binevolve.com

Press Release:
--------------

For Immediate Release
=====================

Contact: Binary Evolution
  info@binevolve.com
  http://www.binevolve.com
  619-481-7438


Binary Evolution Makes Next Generation Web Server Development Software
Available for Free Download

The Velocity Engine for Perl (VEP) and TCL (VET) integrate web server
application development with database connectivity allowing software
developers to create dynamic HTML pages which outperform CGI scripting
by as much as 25 times.


San Diego, California, September 29, 1997 --
Binary Evolution has made two new Internet development products
available for free download: the Velocity Engine for Perl (VEP) and
the Velocity Engine for TCL (VET).  The Velocity Engines are server
side plugins for the Netscape or Microsoft Web Server that allow the
creation of dynamic web pages based on database content.  These
products embed a thread safe, persistent Perl or TCL interpreter into
the Web Server, giving you the power and ease of a modern high level
language without the performance loss found in Common Gateway
Interface (CGI) based solutions.  Early testing shows improved memory
utilization and code execution speeds that are 25 times faster than
CGI scripts.

The ability to quickly and easily access information from database
engines is essential for today's web applications.  VEP and VET
enable developers to query the database using industry standard
Structure Query Language (SQL) statements, then parse and format
results

using Perl, TCL and HTML.

The Velocity Engines provide a powerful and easy to use interface to
the web server.  Common tasks such as form processing, HTTP cookies,
HTTP file uploading, page redirection, and URL escaping are greatly
simplified by taking advantage of advanced data structures provided by
Perl and TCL.  Database queries can be made by incorporating a few
lines of Perl or TCL code into your HTML page.  With VEP and VET
pages,
the layout of the page can be created in HTML, or with your favorite
HTML editor.  The content of page can then be loaded from the
database.

Veteran Internet developers will make an effortless transition from
CGI programming to VEP and VET pages.  The Velocity Engine is
backward compatible with the CGI protocol, thus existing CGI
scripts will immediately benefit from substantial performance
enhancements attained when using Velocity Engine Technology.

According to Alex Shah, Founder of Binary Evolution,  "The
Velocity Engine takes well proven Internet technologies: HTML, Perl,
TCL, SQL, integrates them and increases their performance.  Binary
Evolution is not interested in promoting unproven, proprietary
languages, forcing developers to spend their time on the learning
curve.

Rather, our goal is to provide tools to turn that three month project
into an afternoon workshop."

The Velocity Engine installs on Unix and Microsoft NT Servers and
interacts with database engines via industry-standard protocols such
as ODBC and SQL.  Perl and TCL extensions exist for many commercial
and freely available database servers, including: Oracle, Informix,
Sybase, DB2, Mysql and Msql, or any other ODBC compliant database.
Extensions also exist for manipulating GIF images and generating
graphs and charts.  Software based on VET and VEP can be developed
once on a single platform, then deployed onto nearly any platform, any
operating system and any database.

System Requirements

The Velocity Engine Beta Release requires the Netscape Fasttrack or
Enterprise Server running on Windows NT Intel, Solaris Sun, or Linux
Intel.  Beta releases for SGI IRIX, and Digital Alpha are planned.
Support for the Microsoft Internet Information Server and Apache will
be

available in 90 days.  The product and the technology are available
for licensing.

Binary Evolution

Binary Evolution is a leading software technology company offering
innovative Internet and Intranet tools for development of web
applications.
The company's mission is to develop, deliver, and service easy to use,
high performing, and robust web development tools and applications.
Binary Evolution can be reached by email: info@binevolve.com,
http://www.binevolve.com, or telephone 619-481-7438, or write us at
P.O. Box 3258, Rancho Sante Fe, CA 92067.


                              ###

September 1997
Binary Evolution, Velocity Engine, Velocity Engine for Perl, Velocity
Engine for Tcl, VEP, VET, are all trademarks of Binary Evolution.  All
other products or service names mentioned herein are trademarks of
their respective companies.
--------------

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


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

Date: Tue, 30 Sep 1997 15:55:09 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Announce: Http Server Programming with Persistent Perl and Tcl
Message-Id: <comdog-ya02408000R3009971555090001@news.panix.com>

In article <875647795.24348@dejanews.com>, info@binevolve.com wrote:

>Announce: Http Server Programming with Persistent Perl and Tcl

no sooner do i delete this spam from my mailbox does it come back to
haunt me in usenet.  just another killfile entry :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 30 Sep 1997 20:44:22 GMT
From: spamtrap@greycloak.access.one.net (Grey Cloak)
Subject: Answer Found Sort of (Testing for non existance)
Message-Id: <slrn632q04.l5o.spamtrap@greycloak.access.one.net>

Found a work around. Here the script as it stands Now to test the \2's. :)
------------cut here------------
#!/bin/perl
#----------If your perl is not here you can symlink it to where it is
#          to save editing the bang bang on perl scripts.
#
#---------- Wav Player for IRCii
#
# usage in your IRCii scripts:
#	on ^ctcp "% % SOUND ?*" {
#		exec /path/to/wavplayer $0 $3 " $4 "
#	}
$pathtowav="/home/grycloak/";
$who=$ARGV[0];
$whatfile="$pathtowav$ARGV[1]";
$action=$ARGV[2];

#--Display the action part if the string
print "* \2 $who $action \2 \n";

#File exist test

open(FILE1, $whatfile)  ||  die 
	"[WARN] $whatfile from $who not found\n";
close;

#---It does great let hear that baby
exec "/usr/bin/sox $whatfile -t .au - > /dev/audio";

--------------end cut--------------------
-- 
Grey Cloak

         ---------------------------------------------
  .###########.   Change spamtrap to grycloak, to email me.
 ##'___   ___`##   Wizard.FAQ v2.0 send blank Email to:
 ##  * > < *  ##    wizardfaq@greycloak.access.one.net     
 ### ) | | ( ###    For other documents served
 ###\_-===-_/###    Docslist@greycloak.access.one.net
   #  ~!!!~  #    

http://www.geocities.com/Area51/7614
http://w3.one.net/~grycloak/dreams/dream.htm


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

Date: Tue, 30 Sep 1997 16:02:21 -0400
From: srbrant@mmm.com (Steve Brant)
Subject: changing characters in filenames
Message-Id: <MPG.e9b24d4d0fba83e989680@news.mmm.com>

Hello all-
	Here's the situation:
I run a WindowsNT network that used to have quite a few Macs connected to 
it.  The Mac users were saving files on the network that contained 
invalid filename characters (mainly slashes).  Now, we're moving out all 
of the Mac clients and replacing them with Win95 machines.  The problem 
is that the Win95 clients cannot access those files.  I can, however, 
access them from an NT machine and rename them but there are quite a few 
and they are spread all over.  What I would like to do is write a Perl 
script to go through and replace all of the invalid characters with a 
dash.  Unfortunately, I am an extreme novist with Perl.  Any suggestion 
on how this script should go would be appreciated.

Thanks,
Steve Brant
srbrant@mmm.com



Opinions expressed herein are my own and may not represent those of my employer.



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

Date: Tue, 30 Sep 1997 15:48:21 -0400
From: Michael Shael O'Neill Selden <selden@NOSPAM.instinet.com>
Subject: Re: commercial packages w/ perl?  Tivoli, ClearCase, DDTS, ... :-)
Message-Id: <34315785.6360@NOSPAM.instinet.com>

Richard A. Stewart wrote:
> 
> Are there any lists of commercial packages that formally
> include and/or utilize perl?  Could folks please post
> such lists (URL's) or the names of other packages like
> Tivoli, ClearCase & DDTS that now include & use perl.
> 
> ... stuff snipped ...
> 
> -ras Richard A Stewart
>      Lucent Technologies, BCS
>      MT/3D441, (732) 957-2782
>      rs@lucent.com
> 
Richard,

	As per the vendor, "Oracle Web Application Server 3.0
provides a standards-based, portable application platform for the Web. 
Through its open cartridge API, it supports a diverse class of 
languages and applications, including: Java, PERL, and C++."  Also, the
"PERL Cartridge" contains "PERL Version 5 interpreter ", "Oracle 
DBI/DBD Extensions", and "OraPerl Emulation" features.

	I'm not really sure what a "open cartridge API" is or what a
"PERL Cartridge" might be, but it sounds to me like Oracle has embedded 
the ability to run Perl code in the Web Application Server product.

	Not being an Oracle DBA, I am unfamiliar with their product
set, however a data sheet on this product can be found at:

	http://www.oracle.com/st/o8collateral/html/xweb6ds.html

Michael.
-- 
Michael Shael O'Neill Selden, DBA, JAPH, DADDY
Remove "NOSPAM." From Address To Return Mail
Computing <-> Sculpture | Two Lobes, One Mind


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

Date: Tue, 30 Sep 1997 20:25:37 +0200
From: Gareth JAMES <gareth@webbar.fr>
Subject: Re: Die and the Web
Message-Id: <34314421.786E037A@webbar.fr>

Jon Hedley wrote:
> 
> Greetings
> 
> All of the programming I do in Perl is for output to Web Browsers. I
> cannot access error logs for my server. Therefore, die is of little
> help, and I have been getting around this by making my own sub for
> each program that prints the contents of $! and shuts down the
> program. Is there a way that I can set die to output to STDOUT rather
> than the error log?

Use module CGI.pm , and include the line:

use CGI::Carp qw(fatalsToBrowser);

at the top of your script.  This should output the errors to the
browser.

See the "Echo fatal script errors to the browser" example at

http://www-genome.wi.mit.edu/ftp/pub/software/WWW/examples/

Hope this helps, it works for me anyway!


> 
> Thanks,
> Jon.
> 
>    ,-,_|\   Jon Hedley - Mustang Computer Services
>   /      \  Email: jhedley@REMOVEmustangpcs.com
>   \_,--\_/  WWW:   http://www.mustangpcs.com
>         v   Ask the Oracle: http://mustangpcs.com/oracle


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

Date: Tue, 30 Sep 1997 16:17:45 -0400
From: Dennis Mercer <dmercer@isr.umd.edu>
Subject: File Transfer with Perl
Message-Id: <34315E69.6528@isr.umd.edu>

I'm using the CGI.PM module to do file transfers with PERL.  The only
problem that I am having is that one of our users is coming through a
firewall and is having problems uploading files.  Any thoughts on what
might be causing this problem?  Another user is using the file transfer
system to upload files and he is not having any problems at all.  I have
no idea what the problem could be.  I'm running PERL 5.004_03 on a
Solaris machine.  Thoughts?  Suggestions?  This is something that I need
to get running soon, but these problems are starting to bother me. 
Thanks.

Dennis


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

Date: 30 Sep 1997 20:16:43 GMT
From: spamtrap@greycloak.access.one.net (Grey Cloak)
Subject: Re: HELP! on Attaching files to email.
Message-Id: <slrn632oce.l5o.spamtrap@greycloak.access.one.net>

On Sat, 27 Sep 1997 20:51:29 GMT,
Rob Nedelcu cause to appear:
>Hi!
>
>I need some help on attaching files when emailing individuals who have
>filled in their email adress in a form. Collecting it and sending a
>message is no problem, but I need to send 2 files along with it as
>word documents. How do I do this one? I've tried almost anything!
>
>I'm using sendmail...
>
>Please, any help would be very appreciated...
A while back I gotten a perl mailbot. If you look over the code you might be 
able to fit it to your needs. I post the email that I got the script in.

-----------------cut------------------
>From bin@otp.illuminet.net  Thu Aug 21 17:41:29 1997
Date: Thu, 21 Aug 1997 16:58:56 -0400
Message-Id: <199708212058.QAA13981@otp.illuminet.net>
Return-Receipt-To: bin <bin@otp.illuminet.net>
From: Autoresponder <russ@otp.illuminet.net>
To: Grey Cloak <grycloak@greycloak.access.one.net>
Subject: Here's your mailbot.pl
Status: RO
X-Status: 

Here's the copy of mailbot.pl that you requested. As you can see its a
simple autoresponder script written in perl. It assumes that your perl
executable is located in /usr/bin/, if not then edit the pound-bang on the
first line to show the correct path to your copy of perl.

Save this message to your disk, cut out the top where shown, and make it
executable. I put the script in /usr/local/bin/ then made a directory
called /mailbot just off the root, and placed all the text files it will
send out in there.

Here's a sample of my /etc/aliases so you can see how I run it:

# MAILBOT (AUTORESPONDER)
info:		root, "|/usr/local/bin/mailbot.pl /mailbot/info.txt"
test:		root, "|/usr/local/bin/mailbot.pl /mailbot/test.txt"
mailbot:	root, "|/usr/local/bin/mailbot.pl /mailbot/mailbot.txt"

The remaining instructions are in the script itself. Have fun!
Russ.

----------------- CUT HERE ----------------
#!/usr/bin/perl
#
# mailbot.pl -- a simple mailbot program
# By Chris Candreva <chris@westnet.com>
# Stardate 0709.95
#
# This program is now public domain, copy it, change it, do whatever you
# want with it. If you add features, I would like to know about them.
#
# usage: mailbot.pl mailfile
#
# This is usually placed in a sendmail aliases file, such as the following:
#
# support: chris, "|/usr/local/bin/mailbot.pl /home/chris/techmail.txt"
#
# Put any real people who should also receive the mail in front.
# The mailfile should start as follows:
#
# From: A Real Name <username@machine.com>
# Subject: The Subject of the message
# <a blank line>
# Your message starts here, to the end of the file
#
#

unless ($ARGV[0]) {
	open (OUT,"|/bin/mail -s 'Error!' postmaster");
	print OUT "There is a misconfigured mailbot. Please fix.\n\n\n";
	close OUT;
	exit 1;
}

$mailfile = $ARGV[0];

while(<STDIN>) {
	if (s/^From: //) {
		s/[\012\015]|^ *//g;  #Remove all CR and LF
		$to = $_;
		open (OUT, "|/usr/lib/sendmail -oi -t");
		open (IN, $mailfile );

		#Read and display FROM line.		
		$_ = <IN>;
		print OUT $_;

		print OUT "To: $to\n";

		while (<IN>) { print OUT $_; }
		close IN;
		close OUT;
	}
}

exit 0;
----------------- CUT HERE ----------------
For information send an empty mail to: info@otp.illuminet.net


----------------end cut---------------



-- 
Grey Cloak

         ---------------------------------------------
  .###########.   Change spamtrap to grycloak, to email me.
 ##'___   ___`##   Wizard.FAQ v2.0 send blank Email to:
 ##  * > < *  ##    wizardfaq@greycloak.access.one.net     
 ### ) | | ( ###    For other documents served
 ###\_-===-_/###    Docslist@greycloak.access.one.net
   #  ~!!!~  #    

http://www.geocities.com/Area51/7614
http://w3.one.net/~grycloak/dreams/dream.htm


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

Date: 30 Sep 1997 18:55:23 GMT
From: nigelr@convex.hp.com (Nigel Reed)
Subject: MUD's in Perl?
Message-Id: <60rhur$4um$1@news.rsn.hp.com>

Has anyone written, or started to write, a MUD
(multi-user dungeon) type game in perl? I'd be
interested in hearing your experiences.

Regards
Nigel


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

Date: Tue, 30 Sep 1997 19:05:03 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Newbie ques: How to concatenate two strings?
Message-Id: <34314c94.3112599@news.wwa.com>

On Tue, 30 Sep 1997 08:32:13 GMT, ben@reser.org (Ben Reser) wrote:

>Also, join is another bad choice for whoever posted that, though a bit
>better than the interpolation method.
>
>Basically unless you have a need to do otherwise:
>$x = $y . $z;
>is the best code.

Just for my own information, why is 
"$x = $y . $z;" a _better_ choice than
"$x = join ('', $y, $z);"?  

Streben nach Wahrheit

Faust Gertz
Philosopher at Large


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

Date: 30 Sep 1997 20:08:12 GMT
From: spamtrap@greycloak.access.one.net (Grey Cloak)
Subject: NEWBIE: How  do you check for Non existance of a file.
Message-Id: <slrn632nsb.l5o.spamtrap@greycloak.access.one.net>

I am trying to create a script that will play a wav file. I stumpped on
figuring out how to check to see if a file don't exist.

Perl: perl-5.003-8
OS: RedHat Linux 4.2

I posting the script I have so far, I want to change the commented if/else/if
to the correct systax. A pointer in the right man page to look (And string to 
search) would be better for me, then the actual code to put. I want to learn 
it. Or is it a module I looking for.

Anyways here the script, you should be able to see what I after. It will be
called from an IRCii script.

--------------cut here-------------
#!/bin/perl
#----------If your perl is not here you can symlink it to where it is
#          to save editing the bang bang on perl scripts.
#
#---------- Wav Player for IRCii
#
# usage in your IRCii scripts:
#	on ^ctcp "% % SOUND ?*" {
#		exec /path/to/wavplayer $0 $3 " $4- "
#	}

$who=$ARGV[0];
$whatfile=$ARGV[1];
$action=$ARGV[2];
$pathtowav="/home/grycloak/";

#--Display the action part if the string
print "* \2 $who $action \2\n";
#        ^^^-- think that will do ^B need to test first

#Find a file exist test
#if exist $whatfile ;
	#---It does great let hear that baby
	exec "/usr/bin/sox ~/$whatfile -t .au - > /dev/audio";
#else;
	#---Bummer it doesn't let them know they need to get it.
	print "[WARN] $whatfile doesn't exist" ; || die;
#fi;


---------end cut-----------


-- 
Grey Cloak

         ---------------------------------------------
  .###########.   Change spamtrap to grycloak, to email me.
 ##'___   ___`##   Wizard.FAQ v2.0 send blank Email to:
 ##  * > < *  ##    wizardfaq@greycloak.access.one.net     
 ### ) | | ( ###    For other documents served
 ###\_-===-_/###    Docslist@greycloak.access.one.net
   #  ~!!!~  #    

http://www.geocities.com/Area51/7614
http://w3.one.net/~grycloak/dreams/dream.htm


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

Date: Tue, 30 Sep 1997 17:02:43 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: NEWBIE: How  do you check for Non existance of a file.
Message-Id: <comdog-ya02408000R3009971702430001@news.panix.com>

In article <slrn632nsb.l5o.spamtrap@greycloak.access.one.net>, spamtrap@greycloak.access.one.net (Grey Cloak) wrote:

>I am trying to create a script that will play a wav file. I stumpped on
>figuring out how to check to see if a file don't exist.

you'll want to use the file test operators, which are explained in
the perlfunc manpage.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Tue, 30 Sep 1997 19:57:35 GMT
From: haskamp@lexis-nexis.com (Mark Haskamp)
Subject: regex for one "two three" four
Message-Id: <60rlig$oam@mailgate.lexis-nexis.com>

I need a regular expression for a string that may or may not have
quotes.  For example:

one two three
"one" "two" "three"
"one" two three
 ... you get the picture
  should be parsed as 'one', 'two', 'three'

one "two three" four
"one" "two three" four
"one" "two three" "four"
 ...
  should be parsed as 'one', 'two three', 'four'

Thanks for the help.


------------
Mark Haskamp       
http://w3.one.net/~mhaskamp

"Freedom of the press is for those who own one."
   -- A.J.Liebling



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

Date: Tue, 30 Sep 1997 13:59:03 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
To: Godfrey Smith <godfrey@hnashe.com>
Subject: Re: Reverse Engineer Time strings
Message-Id: <34313DE7.32AA@corp.airmedia.com>

Godfrey Smith wrote:
> I have to take a string and translate it into the
> numerical time format. (since the epoch)
>...
> the strings look like this:
> 22/Sep/1997:12:23:26

Once you've parsed the string, try "timelocal.pl" (a non-module part of
the standard Perl libraries since Perl 4 days).  --PSRC


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

Date: 30 Sep 1997 20:21:25 GMT
From: ulingdg@lexis-nexis.com (Donald Lingle)
Subject: schwartz story in wired
Message-Id: <60rn05$hc5@mailgate.lexis-nexis.com>

Randall told us at LISA 96 that wired was doing a story on his
case against Intel.  Has anyone heard anything about when/if
this will be published by Wired.



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

Date: Tue, 30 Sep 1997 17:32:45 -0400
From: "Chuck May" <may@ims.nci.nih.gov>
Subject: Socket problems in 5.001, not in 5.003
Message-Id: <60rr61$f9i$1@news1.radix.net>

I have a simple socket client which works fine under 5.003, but does not
work under 5.001.  Does anyone know the differences?  Is there an older way
to connect to a socket which is safe under both versions?  Thanks,

--
Chuck May
IMS, Inc.
may@ims.nci.nih.gov

Here is the snippet:

# set up host and port
my $remote = 'localhost';
my $port   = 2942;

# set up and connect to the socket
$iaddr = inet_aton($remote) or die "no host: $remote";
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');
socket(SOCK, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
connect(SOCK, $paddr) or die "connect: $!";






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

Date: Tue, 30 Sep 1997 15:46:13 -0700
From: "Ernie Johnson" <tcm@tcmd.com>
Subject: splitting a tab delimited line
Message-Id: <60rkkj$nmt$1@nr1.toronto.istar.net>

 Anyone have some thoughts on what I need to do to be able to split a tab
delimited text file?

It has a format of

partnumber<tab>part description<tab>category<tab>stock<tab>price

I'd have no problem using split( ) but don't know what to tell split() to
split on.

please cc replies to tcm@tcmd.com

ernie johnson





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

Date: Tue, 30 Sep 1997 14:42:34 -0700
From: danielg@ea.com (Dan Greenblatt)
Subject: Re: splitting a tab delimited line
Message-Id: <danielg-ya02408000R3009971442340001@nntp2.ba.best.com>

In article <60rkkj$nmt$1@nr1.toronto.istar.net>, "Ernie Johnson"
<tcm@tcmd.com> wrote:

>  Anyone have some thoughts on what I need to do to be able to split a tab
> delimited text file?
> 
> It has a format of
> 
> partnumber<tab>part description<tab>category<tab>stock<tab>price
> 
> I'd have no problem using split( ) but don't know what to tell split() to
> split on.

Well, \t == tab, so, split(/\t/, $foo) ought to work on each line.

> please cc replies to tcm@tcmd.com
> 
> ernie johnson

-- 
Dan Greenblatt                               danielg@ea.com
Lord of the Snow Monkeys                     Electronic Arts
These are MY opinions, not my employer's.  Capiche?


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

Date: 30 Sep 1997 21:37:00 GMT
From: "Aaron" <aaron@soltec.net>
Subject: Unix -> NT conversion
Message-Id: <01bccde8$ffa15080$b5910a9f@aurora.cna.com>

Hi all

I know this has been beaten to death

but I have some Perl scripts on Unix
they use CGI.pm

I want to move them over to NT
because the people with the web server didn't ask me what I thought

Has anyone else out here attempted such a feat?  What kind of problems did
you find?

I know there are some crazy differences, but I am going to work a lot of
this out on a 95 machine and then move it over to NT.

Any advice is appreciated.


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

Date: 30 Sep 1997 21:41:15 GMT
From: Ed Young <youngej@magpage.com>
Subject: Re: Where is perl/Tk for Win32
Message-Id: <60rrlr$9bq$0@204.179.92.85>

Tony Baldassare wrote:
> 
> In article <609lfu$6fg$1@204.179.92.76>, youngej@magpage.com wrote:
> :>Weihan Chang wrote:
> :>>
> :>> Hi,
> :>> I saw someone mentioned about a version of perl/Tk on Win32(Windows
> :>> NT). Does anyone know where I can get a binary copy ?
> :>> Thanks a lot.
> :>
> :>ftp://ftp.sedl.org/pub/mirrors/CPAN/ports/win95/Standard/x86/
> :> perl5.00402-bindist04-bc.tar.gz                    (5014 Kb)
> :>
> :>This excellent binary distribution of perl 5.004_02 by
> :>Gurusamy Sarathy (Just Another Perl Porter)
> :>includes perl/TK for Win32.  Install this version, get your PATH set,
> :>then run widget for a perl/TK widget demonstration that is more or less
> :>the same as the TCL/TK demo (not to mention very impressive)...
> 
> Excellent binary distribution ???
> Isn't that the SPUDIEST distribution which doesn't install in Windows 95
                 ????????
> just because it considers lowercase and uppercase filenames differently ?

I haven't had any install problems with this distribution, or
upper/lower case problems.  Though I don't use upper case much for file
naming.

Perhaps you are having a spelling problem, unrelated to upper/lower case
;-)


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

Date: Tue, 30 Sep 1997 11:21:24 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mazda Hewitt <Mazda.Hewitt@bbsrc.ac.uk>
Subject: Re: WHILE LOOP LOGIC
Message-Id: <Pine.GSO.3.96.970930111425.16316Z-100000@usertest.teleport.com>

On Tue, 30 Sep 1997, Mazda Hewitt wrote:

>   open(LISTFILE,<external_file_name>);

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check of the return value after opening a
file. 

>   while ($LISTVAR=<LISTFILE>) {

You should really check with defined(). Recent versions of Perl will even
warn about this, if you use -w.

>         if ($LISTVAR=~ /line/ ) {
> ($linename)  = $LISTVAR =~ /(line\d)/;

Generally, it's good to indent the body of an if statement. (And did you
mean to grab just one digit after the word 'line'?)

> ($x) = $LISTVAR =~ /line\d\s+(\w+)\s+/;

I'm not sure about this at all.

> ($y) = $LISTVAR =~ /\w+\s+\w+\s+(\w+)/;

Nor this. I think you could (should?) have done this all in one match,
though.

> print ("line = $linename \nx = $x \ny = $y \n");

Of course, you could get warnings about those variables being undefined if
your pattern matches failed.

> }

This is why proper indenting is helpful: Whose closing brace was that? I
think it belongs to the if block. In any case, one closing brace is
missing.

> or
> 
> open(LISTFILE,<external_file_name>);
>   while ($LISTVAR=<LISTFILE>) {
>         if ($LISTVAR=~ /line/ ) {
> $LISTVAR =~ /(\w+)\s+(\w+)\s+(\w+)/;
> $linename = $1;
> $x = $2;
> $y = $3;

That's another way to do it. (But, since you're using a different pattern
here than before, I'm not sure which of these, if either, is doing what
you want. :-)

> print ("line = $linename \nx = $x \ny = $y \n");
> }

Again with the missing braces! 

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/
              Ask me about Perl trainings!



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

Date: 30 Sep 97 18:28:13 GMT
From: rpete@ascda3.harvard.edu (Pete Ratzlaff)
Subject: XS: sv_2mortal (when is it necessary?)
Message-Id: <343144bd.0@cfanews.harvard.edu>

Just wrote my first real XS. Fantastic!

The routine involved creating C strings and passing them
back to Perl as scalars. Something like...

>void
>my_1st_xs(...)
>
>   PPCODE:
>   char *str1="Perl scalar 1";
>   char *str2="Perl scalar 2";
>
>   EXTEND(sp,2);
>   PUSHs(sv_2mortal(newSVpv(str1,length(str1))));
>   PUSHs(sv_2mortal(newSVpv(str2,length(str2))));
>
(No, this is not my XS routine, but just an example of how
I passed the C strings back to Perl)

The question:

Is 'sv_2mortal' really necessary here? If so, then why?

-------------
Peter Ratzlaff                    Harvard-Smithsonian Center for Astrophysics
Office B102                       60 Garden St, MS 21, Cambridge MA 02138 USA
<pratzlaff@cfa.harvard.edu>       phone: 617 496 7714


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

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

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