[7308] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 933 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 27 17:07:24 1997

Date: Wed, 27 Aug 97 14:00:28 -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           Wed, 27 Aug 1997     Volume: 8 Number: 933

Today's topics:
     Re: 'abandon' hope (was: Re: Need help: how to exit a s (Damian Conway)
     /usr/bin/perl wrapper for multiple OS (Don D. Hiatt)
     Re: Assinging values of HASH in to Array <billw@airone.claircom.com>
     Re: Assinging values of HASH in to Array (Mike Stok)
     Re: Automata states limits in Perl (Shaun Flisakowski)
     Re: cgi and stdout (Gerben Vos)
     CGI,perl,NT <jmartola@arrakis.es>
     Re: Dynamic Module Loading <mdc0788@fugue.ca.boeing.com>
     Embedded perl interpreter calling back to C code <gjb@cs.washington.edu>
     Re: File Locking... (Parillo)
     HELP - What is "interpretive" vs. "compiled" <i@hate.spam>
     Re: HELP - What is "interpretive" vs. "compiled" (dmouse)
     Help whit Serial I/O on PERL <jzavala@lsi.net.mx>
     Re: is there a perl compiler ported to NT? (Gurusamy Sarathy)
     Re: Need Help! (Parillo)
     Re: Perl 5 for Win95 (dmouse)
     Re: perl extension in tcl (Bryan Miller)
     Re: perl modules and  OOP (dmouse)
     Re: Perl Regular Expression has a bug? <pc1@scigen.co.uk>
     Re: Perl Win95 (Parillo)
     Re: Scrambling using tr (Justin Masters - remove "Y" to reply)
     Re: Setting the TZ time variable within Perl (Ilya Zakharevich)
     Some Assistance Please... <tbryan@ghz.com>
     Re: Some Assistance Please... (dmouse)
     Re: Some Assistance Please... (Tad McClellan)
     timeout for getc function <tpavlic@netwalk.com>
     type char <eglamkowski@mathematica-mpr.com>
     Re: type char (dmouse)
     Which version of PERL is running on the server? <bobm@tiac.net>
     Re: Which version of PERL is running on the server? <rael@zx81.dnai.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 27 Aug 1997 20:23:59 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: 'abandon' hope (was: Re: Need help: how to exit a sub)
Message-Id: <5u22cv$pgk$1@towncrier.cc.monash.edu.au>

Doug Seay <seay@absyss.fr> writes:

>Damian Conway wrote:
>> 
>> How about extending the "magic goto" a little:
>> 
>>         sub abandon
>>         {
>>                 warn shift;
>>                 goto &return;           # PROPOSED NEW goto MAGIC
>>         }

> return isn't a function, it is an operator.

So much the better! Currently "goto &return" generates an error
("Goto undefined subroutine..."). We're just defining some useful
semantics for that condition. Specifically: performing a magic goto
on any operator causes the current subroutine call to act as if it had
been the specified operator instead. Particularly useful for
debugging:

	sub loudchdir ($)
	{
		print "chdir to $_[0]\n";
		goto &chdir;
	}

	sub warnnext ()
	{
		carp "Skipping remainder of loop";
		goto &next;
	}

Damian
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  who: Damian Conway                 email: damian@cs.monash.edu.au
where: Computer Science Dept.          web: http://www.cs.monash.edu.au/~damian
       Monash University             quote: "The best form of self-defence is
       Clayton 3168, Australia               not being there in the first place"


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

Date: 27 Aug 1997 14:51:18 -0500
From: hiatt@cig.mot.com (Don D. Hiatt)
Subject: /usr/bin/perl wrapper for multiple OS
Message-Id: <v6hen7fh0ax.fsf@cig.mot.com>

Hi,

 I wrote a really brain damaged wrapper(see below) to select between
the sunOS or solaris perl binary. This works fine when invoked from
the command line, however, for scripts that actually invoke the 
wrapper (ie, #!/bin/perl) it fails horrible. In fact, it tries to 
execute the script without invoking perl.

 Could someone give me a clue as to what I am doing wrong (besides using
/bin/sh). :)

 Thank you,

don
 


---- snip (/bin/perl) ---

#!/bin/sh
sunPERL="/usr/test/perl/sparc-sun-sunos4.1.3/bin/perl"
solarisPERL="/usr/test/perl/sparc-sun-solaris2.5/bin/perl"
PERL=${sunPERL} # default

if [ -f /bin/uname ] ; then  # Make sure we have uname
        VERSION=`/bin/uname -r`
        #echo "OS VERSION: ${VERSION}"
        if [ $VERSION -gt 4 ] ; then  # Solaris 
                PERL=${solarisPERL}
        else                          # SunOS
                PERL=${sunPERL}
        fi
else
        echo "Error: Can not find uname"
        exit 1 
fi

exec ${PERL} ${1+"$@"}

exit 1

-- 
"Don Hiatt" <hiatt@cig.mot.com> 
Key fingerprint =  72 83 9B 82 FF DB F5 97  53 78 01 00 22 4C 95 A0 


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

Date: Wed, 27 Aug 1997 10:34:00 -0700
From: William Warner <billw@airone.claircom.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Assinging values of HASH in to Array
Message-Id: <34046508.231A@airone.claircom.com>

And if you want to be sure of the order of the resulting array, try

@ordered_ary = @hash{@ordered_keys};

It's the elegant relationship between lists and hashes that keeps me
coming back to perl.

By the way, is there a module that would allow the application to
determine the order of keys in a hash?

  ww

Tom Phoenix wrote:
> 
> On Fri, 22 Aug 1997, Ajitesh Das wrote:
> 
> > Is there any way to assign values ( NOT KEYS ) in to an array.
> 
> >       @my_array = some_buildin_function_gets_values( %my_Hash );
> 
> > let me know if there is any
> 
> Yes, there is a builtin function like that, and if you search through the
> perlfunc(1) manpage for 'values' you'll find it soon enough. Hope this
> helps!
> 

-- 
   William Warner                           bill.warner@attws.com


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

Date: 27 Aug 1997 20:29:23 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Assinging values of HASH in to Array
Message-Id: <5u22n3$3d9@news-central.tiac.net>

In article <34046508.231A@airone.claircom.com>,
William Warner  <billw@airone.claircom.com> wrote:

>By the way, is there a module that would allow the application to
>determine the order of keys in a hash?

If you use the DB_File module that comes with perl then you can use a
BTREE on an in-memory DB file and use your own comparison routine to order
the keys, or there's the Tie::IxHash module on CPAN which seems a littel
more flexible if you want to maintain the keys asif they were in a perl
array.

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: 27 Aug 1997 18:13:01 GMT
From: flisakow@fontina.cs.wisc.edu (Shaun Flisakowski)
Subject: Re: Automata states limits in Perl
Message-Id: <5u1qnd$7qk@spool.cs.wisc.edu>

In article <34043335.E971BFE8@pdb.pdb.bnl.gov>,
Jiri Koutnik  <koutnik@pdb.pdb.bnl.gov> wrote:
>
>I have trouble with matching very long regular expression in Perl and
>Lex, because of
>implementation of automata has too smal space of states.
>The error is  "regexp too big" !
>
>If anybody knows about some tools with no (or wide) limitations , let me
>know please.
>Any ideas would be greatly appreciated.

  Perl allows for a 32K compiled regexp, do you expect it to be larger
  than that?

  A more likely reason this is occurring is that your complex regular
  expression is not expressed optimally for perl's RE implementation.

  Why don't you post the pattern and maybe we can figure out an 
  equivilent pattern that takes up less space (and is probably faster). 

  Shaun
-- 
  Shaun        flisakow@cs.wisc.edu
  http://www.kagi.com/flisakow  - Shareware Windows Games, and Unix Freeware.
 "In your heart you know its flat."
                           -Flat Earth Society


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

Date: 27 Aug 1997 18:25:09 GMT
From: gerben@cs.vu.nl (Gerben Vos)
Subject: Re: cgi and stdout
Message-Id: <5u1re5$oe7$1@star.cs.vu.nl>

tom van mierlo writes:

>the program i'm using is postmail for windows 95 and windows nt
>When this program send the mail with success it doesn't return any
>output and when it can't send the mail it does returns output.

You can execute a program and catch its output in a variable (only its
"standard output" file handle, not its "standard error"), using

  $caught_output = `program`;

Then you can check whether the string is empty or not.
See the perlop manual page.

It may be more robust to check the value of $? after the backquotes,
it contains the exit value of the program. See the perlvar manual page.

>is there a way that this works, and so how do you use it ?
>also i'm interested in redirecting the STDOUT.

The STDOUT of your Perl script, or of the postmail program?

If the first: open(STDOUT, ">file") or die;
If the second: $exit_value = system("postmail >file");

See the perlfunc manual page, or the documentation of your command shell,
respectively.

g e r b e n @ c s . v u . n l . . . . . . . . . . . . G e r b e n   V o s   <><
Join the Coalition Against Unsolicited Commercial Email!  http://www.cauce.org/
The hedgehog can never be buggered at all.


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

Date: Wed, 27 Aug 1997 20:33:33 +0200
From: "Jeszs M* Fuentes" <jmartola@arrakis.es>
Subject: CGI,perl,NT
Message-Id: <340472FC.2F6B0004@arrakis.es>

We are trying to run and httpd program in winNT. We have some problems
with CGIs.  We have several .pl files, and when we do:   <name>.pl  in
the ms-dos prompt the program runs but when we open the .pl file in the
netscape, we read:" HTTP/1.0 404 Objeto no encontrado"

Do you know why ?

            jmfuentes  mailto:jmfuentes@arrakis.es



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

Date: Wed, 27 Aug 1997 18:04:40 GMT
From: "Marty D. Cudmore" <mdc0788@fugue.ca.boeing.com>
Subject: Re: Dynamic Module Loading
Message-Id: <34046C38.3028@fugue.ca.boeing.com>

Never mind...I got it!  I didn't realize that require can be used for
dynamic module loading...sorry for the bother!

Cheers,
Marty

Marty D. Cudmore wrote:
> 
> Well, I thought I was being quite clever in writing two modules, one to
> be used if my program was running on an HP-UX system, and another if I
> were running on a Solaris system.  Come to find out, it pulls them both
> in during compile time rather than looking at my if statements, thus the
> latter of the two overwrites functions in the first.
> 
> Here's an example of how I attempted to pull in the correct module:
> 
> --- snip ---
> 
> # Check for Brand of OS and include the
> # appropriate print command module.
> use lib "$ARGV[0]/lib";
> if($Config{'osname'} eq 'hpux'){
>    use PSM_HPUX;
> }
> elsif($Config{'osname'} eq 'solaris'){
>    use PSM_Solaris;
> }
> else{
>    die "No lp command module exists for
> $Config{'osname'}-$Config{'osvers'}.\n";
> }
> 
> --- end of snip ---
> 
> Can anyone tell me how to dynamically load one module rather than the
> other?  Remember that I wish to pull in the entire module and not just
> certain functions within it.
> 
> Thanks,
> Marty D. Cudmore
> 
> email:  mdc0788@fugue.ca.boeing.com (preferred)


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

Date: Wed, 27 Aug 1997 18:40:27 GMT
From: Greg Badros <gjb@cs.washington.edu>
Subject: Embedded perl interpreter calling back to C code
Message-Id: <qrroh6jxyec.fsf@chiwawa.cs.washington.edu>

I have a C program which, as described in perlembed, creates and issues
callbacks to perl code.  Additionally, I also need to let that perl code
call functions back in the C code to gain access to some of its data
structures.  I have a little bit of experience using h2xs and can build
separate binary modules without any problems, but what do I need to do
differently to expose a C subroutine that's in the parent C program
(complete with the context of the C program's global variables) to the
perl that that C program itself calls?  What other programs are out
there that do stuff like this?

Thanks in advance for any responses,
Greg J. Badros
gjb@cs.washington.edu
Seattle, WA  USA
http://www.cs.washington.edu/homes/gjb



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

Date: 27 Aug 1997 20:14:48 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: Re: File Locking...
Message-Id: <5u21rp$ahi$1@news01.li.net>

Not that I have done it, since I would prefer a DBMS to handle locking, 
but I have seen postings that say flock is prefered to other techniques.

lparillo at suffolk dot lib dot ny dot us

David Mellors (dgm@globalnet.co.uk) wrote:
: Does perl automatically lock files when writing to them?
: If not, can anyone supply information on the best way of locking files
: using Perl running under Linux and BSDI.

: Many Thanks

: Dave Mellors
: dgm@globalnet.co.uk


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

Date: Wed, 27 Aug 1997 12:36:13 -0700
From: Chemist Box <i@hate.spam>
Subject: HELP - What is "interpretive" vs. "compiled"
Message-Id: <340481AD.7553@hate.spam>

Help.

Can someone explain to me what INTERPRETIVE vs. COMPILED Perl means?

Can Compiled Perl execute with CGI/Webspace?

-CB


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

Date: 27 Aug 1997 19:43:32 GMT
From: gt1535b@acmey.gatech.edu (dmouse)
Subject: Re: HELP - What is "interpretive" vs. "compiled"
Message-Id: <5u2014$8vk@catapult.gatech.edu>

Chemist Box (i@hate.spam) wrote:
: Help.

: Can someone explain to me what INTERPRETIVE vs. COMPILED Perl means?
Most perl scripts are interpreted by the perl interpreter which means
that the code that you write is compiled _and_ executed in one fell swoop.
Compiling of perl is usually done by the interpreter, but if you want
to compile to C, you can try using the new perl compiler 
(http://www.perl.com/CPAN-local/modules/by-module/B/).

Daryl

: Can Compiled Perl execute with CGI/Webspace?

: -CB

--
<>< Daryl Bowen	<><
Georgia Institute of Technology
E-mail: gt1535b@prism.gatech.edu
Siemens Stromberg-Carlson Co-op


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

Date: Wed, 27 Aug 1997 13:26:34 +0600
From: "J. Edgar Zavala Siller" <jzavala@lsi.net.mx>
Subject: Help whit Serial I/O on PERL
Message-Id: <3403D6AA.538AF3D2@lsi.net.mx>

Hello,

     Can anybody giveme an example of Serial I/O comunication in perl?
     (linux).





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

Date: 27 Aug 1997 19:42:50 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: is there a perl compiler ported to NT?
Message-Id: <5u1vvq$8f5@srvr1.engin.umich.edu>

  [ mailed and posted ]

In article <corbeau-2308971358380001@news.smu.edu>,
Dennis Taylor <corbeau@execpc.com> wrote:
>     Don't hold your breath. Malcolm's compiler isn't even out of alpha
>yet on Unix, so hoping that it's been ported to NT is probably premature.

That's not quite accurate, I'm afraid.

Given that perl itself will build and run out of the box on NT,
there's no reason why the compiler itself shouldn't build without
major hacks.  In fact, that is the case with the latest alpha
version of the compiler (some changes to the unix-specific makefiles
are needed, plus a couple of fixes for compiler oddities).  I do have
the C backend producing nice little EXEs from simple perl scripts.

The reason I didn't put the Compiler in the binary distribution
was because the latest alpha had broken CC and bytecode backends
under 5.004 (last I checked), and the C backend was not reliable
for AUTOLOADed/XSed things.

>As much as I hate to say it, you'll probably have to wait until 5.005 is
>ported to NT [...]

Please don't whip out patent untruths like that.  Perl 5.004 and later have
had pretty complete support for Win32.  You ought to try it some time.

 - Sarathy.
   gsar@umich.edu


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

Date: 27 Aug 1997 20:20:45 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: Re: Need Help!
Message-Id: <5u226t$ahi$2@news01.li.net>

How about:

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$mon = $mon + 1;
$attempttime = $year . '/' . $mon . '/' . $mday . " " . $hour . ':' .
               $min . ':' . $sec;

Since you work for an ISP, how about an account? ;-)

lparillo at suffolk dot lib dot ny dot us

Craig Martin (cmartin@interware.net) wrote:
: Hi There!

: My name is Craig Martin and I work for an ISP in Toronto, Ontario,
: Canada. This newsgroup has been very helpful in the past to me and I
: thank everyone involved for this. I have yet another problem which I
: need help with.

: I have a PERL script setup to grab information entered on a form and
: create a nice e-mail message that is legible. The only thing I can't
: seem to figure out is how to put the date in here. I have tried the
: system("date") idea but that gets me nowhere fast. If anyone has any
: ideas on how I can grab the date and then place it in the e-mail message
: I would love to hear them!

: Thanks in advance.
: -- 
: 	Craig Martin
: 	cmartin@interware.net
: 	http://www.interware.net
: 	mailto:cmartin@interware.net


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

Date: 27 Aug 1997 18:45:24 GMT
From: gt1535b@acmez.gatech.edu (dmouse)
Subject: Re: Perl 5 for Win95
Message-Id: <5u1sk4$82n@catapult.gatech.edu>

churley@gte.net wrote:
: I am new to the world of Perl, infact am trying to teach myself the
: language, and am trying to install the Perl compiler on my computer.
Compiler?  I'm guessing you meant to say interpreter, in which case
I can probably help you.  If you're new to perl, I doubt you would want
to be messing with the compiler right now.

: I have downloaded both the 5.03 and 5.04 versions.  5.03 in the form
: of a .exe file and 5.04 as a tar.gz file.  My problem is configuring
: it to work with my system.  I am trying to execute the examples as the
: appear in O'Reilly's Learning Perl nutshell book.
It's been a while since I installed Perl, but I don't really remember any
heavy configuring or big problems.  You want the Activeware Win32 port 
from here:
	http://www.perl.com/CPAN-local/ports/win32/Perl5/Release/

As far as books go, look at this site for some more information:
	http://language.perl.com/critiques/index.html

Hope this helps,
Daryl

: I understand that these were written for a UNIX system, which I do not
: have access to and I will be uploading my scripts to an NT server.

: If anyone can help me set this  up and get started please e-mail me:

: churley@gte.net

: Thank you for any help and please bear with me as I try to learn....I
: doubt this will be my last posting hahahaha...

: Thanks,
: Chris Hurley

--
<>< Daryl Bowen	<><
Georgia Institute of Technology
E-mail: gt1535b@prism.gatech.edu
Siemens Stromberg-Carlson Co-op


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

Date: 27 Aug 1997 20:35:36 GMT
From: millerb@fc.hp.com (Bryan Miller)
Subject: Re: perl extension in tcl
Message-Id: <5u232o$a4d@fcnews.fc.hp.com>

lvirden@cas.org wrote:

[ snippy-snip ]

: Another way of expressing this is

: has anyone tried embedding a perl interpreter into a tcl extension or
: in some way (perhaps using SWIG, etc.) tried to make available
: (as Tcl commands), the perl interpreter.

It might be easier to glue tcl into Perl using the Tcl library.
I have been playing around with gluing the Tcl and Expect libraries
into Perl.  Unfortunately it hasn't been quite that easy although
the Tcl_Eval bit seems to be falling into place.

Bryan


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

Date: 27 Aug 1997 19:00:13 GMT
From: gt1535b@acmez.gatech.edu (dmouse)
Subject: Re: perl modules and  OOP
Message-Id: <5u1tft$82n@catapult.gatech.edu>

M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote:
: dmouse <gt1535b@acmex.gatech.edu> wrote:
: >I just want to import the subroutines.  This is the line I used to
: >import them:
: >
: >  use Scti (scti ls cat rm md);

:    use Scti qw(scti ls cat rm md);
: or
:    use Scti ('scti', 'ls', 'cat', 'rm', 'md');

thanks, that helped, but I'm still getting some other errors.  When you call
the subroutines do you have to qualify them with 'Scti::' every time or can
you just say '&ls' or such.  I was under the impression that the latter was
the case because I imported the symbols into the main package with Exporter.
Yet I still get errors like "Undefined subroutine &main::scti called at
showp.bat line 32."

Any ideas?

: Mike Guy

--
<>< Daryl Bowen	<><
Georgia Institute of Technology
E-mail: gt1535b@prism.gatech.edu
Siemens Stromberg-Carlson Co-op


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

Date: Tue, 26 Aug 1997 22:04:59 +0100
From: Phil Carmody <pc1@scigen.co.uk>
To: dennis@csie.nctu.edu.tw
Subject: Re: Perl Regular Expression has a bug?
Message-Id: <340344FB.66E0@scigen.co.uk>

dennis@csie.nctu.edu.tw wrote:
> if($date = ~/(..):(..):(..)/)

I see a different regular expression to you.
I see one which 'compares' $_ with /(..):(..):(..)/
I then see the result being inverted (~)
I then see an assignment to the variable $date

Did you mean 
if($date =~ /(..):(..):(..)/)
perchance?

Phil
-- 
\|/ ____ \|/   int c,a,x,y;main(){for(;a<2000;c    Phil Carmody,
 @~/ ** \~@    %=80)printf("%c"," .:lU@\nPhil"[    Consultant,
/_( \_ / )_\   x=a%80-40,y=a/80-13,c+=(x=400-x*    Scientific Generics,
   \__U_/      x-y*y*4)>0?x:0,a++%80?c/80:6]);}    Cambridge, UK


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

Date: 27 Aug 1997 20:26:51 GMT
From: lparillo@newshost.li.net (Parillo)
Subject: Re: Perl Win95
Message-Id: <5u22ib$ahi$3@news01.li.net>

I got it to work by following section 6 of:
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
and this M$ document referenced from section 6:
http://www.microsoft.com/kb/articles/q150/6/29.htm

lparillo at suffolk dot lib dot ny dot us

mudd97@nac.net wrote:
: I am trying to test perl stuff on PWS on win95. I can't get anything
: going.
: Not even the "helloworld.pl" script. I set my scripts directory to
: execute and not read but it forbids read-access.
: I added .pl to my registry and the associations in win95. When I click
: on the .pl file a DOS windows comes up and executes the script and then
: disappears. Can anyone please help.
: Thanks in advance
: mudd97@nac.net


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

Date: 27 Aug 1997 12:52:49 -0700
From: jmastYers@pcocd2.intel.com (Justin Masters - remove "Y" to reply)
Subject: Re: Scrambling using tr
Message-Id: <cav67sriesu.fsf@fri001.fm.intel.com>


Stuart Cooper <stuartc@ind.tansu.com.au> writes:

(deleting most of my previous request)
> > I tried using tr/a-z/Z-A/g, but it doesn't like (presumably) the "backwards
> > range" of Z-A. 
> > 
> > Any ideas?
> > 
> > -- 
> > --------------------------------------------------------------------------
> >    Justin Masters   (Sr. Cad Engineer - Design Automation)  PH: 916-356-6735
> >    Intel Corp. FM5-94                                      FAX: 916 356-7874
> >    1900 Prairie City Rd, Folsom, CA 95630          jmastYers@pcocd2.intel.com
> 
> Any ideas? 
> 
> Yeah- 1) get your organisation to stop (pro|per)secuting Randal Schwartz. 
>       2) ask the Intel guy who prosecuted Randal; he's a *real* expert.
>          He unlearned Perl in 40 days!

I'm trying to decide how to respond here.

Let's start with this:

1) I *work* for intel.  I am *NOT* intel.  I don't speak for intel, and 
I'm certainly not paid like one of their lawyers.  Guilt by association
is really a poor logical conclusion.  

2) I have personally contracted Randal to teach Perl at our site years 
ago.  If I didn't think much of his skill, I wouldn't have considered him.

3) I just met Randal last week at the Perl conference.  He remembered my
face, not my name (can't win them all :-), and I kindly asked him to 
disassociate my name and my employer.  I wasn't there to (pro|per)secute
him.  I think he understands that.

4) My own feelings about what Randal did or why cannot be made, as I 
don't have all the facts and I have not investigated it either.  I don't
think it's in the best interest of anybody if I give my uneducated opinion.

5) Your response did nothing to assist me in looking for a solution (which
someone else was able to provide - Thanks!).  Instead, you chose to take a
cheap shot at me, via my employment in a company.  I think if you got to know
me personally, you'd find I was a fairly decent person.  You'll find lots of
decent people working in this company.  You'll find lots of other types too.
Let's not make a blanket statement based upon unfair judgements.

Thanks,

Justin

P.S.  btw, I don't speak for Intel, just myself.  I just thought I'd mention
it once more in case any confusion persists.

> 
> Cheers,
> stuartc!@intel.com
> 
> Stuart Cooper
> stuartc@ind.tansu.com.au

-- 
------------------------------------------------------------------------------
   Justin Masters   (Sr. Cad Engineer - Design Automation)  PH: 916-356-6735
   Intel Corp. FM5-94                                      FAX: 916 356-7874
   1900 Prairie City Rd, Folsom, CA 95630          jmasters@pcocd2.intel.com


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

Date: 27 Aug 1997 20:45:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Setting the TZ time variable within Perl
Message-Id: <5u23kh$bam@agate.berkeley.edu>

In article <34041B54.58074A28@absyss.fr>, Doug Seay  <seay@absyss.fr> wrote:
> Nino Fioretti wrote:
> > 
> > My web server is located in a different time zone to me and when my various
> > CGI scripts send email I get the local Web Server time. Can someone tell me
> > how I can set a different time setting to the one in the server. The server
> > has an environment variable TZ=EST5EDT, whilst my local time has a setting
> > TZ=CST-9:30CDT.
> > How can I make this setting from within a CGI script?
> > Any ideas?
> 
> Do you mean "modify the TZ of the server" or "modify my own TZ
> variable"?  As a rule, modifying the TZ of your server will be bad.  For
> modifying your own, just change it like any other environment variable. 
> The info is in the man pages.

I doubt it very much.  Changine $ENV{TZ} will change the C environment
of the kids, but not of the current process.

Hope this helps,
Ilya









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

Date: 27 Aug 1997 18:22:10 GMT
From: "Tadd Bryan" <tbryan@ghz.com>
Subject: Some Assistance Please...
Message-Id: <01bcb316$30e99c80$dd4887cf@host221.ghz.com>

I'm putting together a simple little perl program for a CGI script, and I
need to know how to put " inside a print statement.

ex:  print "John said "hi, Alice," and the date went on";

How may I accomplish this.

Tadd.
tbryan@ghz.com


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

Date: 27 Aug 1997 18:57:51 GMT
From: gt1535b@acmez.gatech.edu (dmouse)
Subject: Re: Some Assistance Please...
Message-Id: <5u1tbf$82n@catapult.gatech.edu>

Tadd Bryan (tbryan@ghz.com) wrote:
: I'm putting together a simple little perl program for a CGI script, and I
: need to know how to put " inside a print statement.

: ex:  print "John said "hi, Alice," and the date went on";
 print "John said \"hi, Alice,\" and the date went on";

: How may I accomplish this.

: Tadd.
: tbryan@ghz.com

--
<>< Daryl Bowen	<><
Georgia Institute of Technology
E-mail: gt1535b@prism.gatech.edu
Siemens Stromberg-Carlson Co-op


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

Date: Wed, 27 Aug 1997 15:21:57 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Some Assistance Please...
Message-Id: <5922u5.0c5.ln@localhost>

Tadd Bryan (tbryan@ghz.com) wrote:
: I'm putting together a simple little perl program for a CGI script, and I
: need to know how to put " inside a print statement.

: ex:  print "John said "hi, Alice," and the date went on";

: How may I accomplish this.

1)
   print qq!John said "hi, Alice," and the date went on!;

2)
   print "John said \"hi, Alice,\" and the date went on";

3)
   print <<ENDSTRING;
John said "hi, Alice," and the date went on
ENDSTRING


: Tadd.
: tbryan@ghz.com

Cool name!


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


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

Date: Wed, 27 Aug 1997 16:11:00 -0400
From: Ted Pavlic <tpavlic@netwalk.com>
Subject: timeout for getc function
Message-Id: <Pine.LNX.3.96.970827160659.27999C-100000@user.netwalk.com>

Does anyone know how to tell getc to either:

a) Timeout if no data is received after a certain time
b) Return something like \0 when no data is received

For example - if I use open2 to open a process, and this process asks for
input - I have an expect function that uses getc's to read until it gets
the desired input string... 

But if that string changes - say I'm looking for "login" and the process
returns "user: "... I won't ever receive login and getc will just sit
there once the process stops spooling info. ... While the process waits
for input to give output - getc waits for input and halts the program
while it waits.

Is there any way I can set getc to timeout or return some character if
there is no data to get. 

I figured this would be an IOCTL type thing or a FCNTL thing but I have no
idea which IOCTL or FCNTL function to use.

Any help would be much appreciated. Thanks so much -

--
  _____   ___     | Ted Pavlic
 (_   _) | o_)    | <mailto:tpavlic@netwalk.com> 
   |_|ed |_|avlic | h:+1.614.766.2326



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

Date: Wed, 27 Aug 1997 16:00:57 -0400
From: the count <eglamkowski@mathematica-mpr.com>
Subject: type char
Message-Id: <34048779.2F4B@mathematica-mpr.com>

In C you can use type char, which can be treated as a number or a letter
depending on context.  But in perl, it will treat the number as a string
containing those numbers, not as a letter (so if $i = 65, in character
context it is "65" and not "A", of whatever ascii character that is)
Is there a trivial way to force it to behave like C's char type?

In particular, I have a series of fields I am extracting from a dataset,
each of which has almost the same name, but for one letter (e.g.
fnma, fnmb, fnmc, etc.).  Right now I am doing something like:

for ($i = 0; $i < 4; $i++) {
    if ($i == 0) { $a = "a"; }
    if ($i == 1) { $a = "b"; }
    if ($i == 2) { $a = "c"; }
    if ($i == 3) { $a = "d"; }
    if ($i == 4) { $a = "e"; }

    $fname = &field($id, "fnm$a");

    print "$fname\n";
}

But am curious if there is a better way then simply assigning the letter
based on the number, as per the above (I'm sure there is - I just can't
come up with it off the top of my head :)


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

Date: 27 Aug 1997 20:17:56 GMT
From: gt1535b@acmez.gatech.edu (dmouse)
Subject: Re: type char
Message-Id: <5u221k$9co@catapult.gatech.edu>

the count (eglamkowski@mathematica-mpr.com) wrote:
: In C you can use type char, which can be treated as a number or a letter
: depending on context.  But in perl, it will treat the number as a string
: containing those numbers, not as a letter (so if $i = 65, in character
: context it is "65" and not "A", of whatever ascii character that is)
: Is there a trivial way to force it to behave like C's char type?

Try this:

for ($i = 0; $i < 4; $i++) {
    $a = chr($i);
    $fname = &field($id, "fnm$a");
}

: In particular, I have a series of fields I am extracting from a dataset,
: each of which has almost the same name, but for one letter (e.g.
: fnma, fnmb, fnmc, etc.).  Right now I am doing something like:

: for ($i = 0; $i < 4; $i++) {
:     if ($i == 0) { $a = "a"; }
:     if ($i == 1) { $a = "b"; }
:     if ($i == 2) { $a = "c"; }
:     if ($i == 3) { $a = "d"; }
:     if ($i == 4) { $a = "e"; }

:     $fname = &field($id, "fnm$a");

:     print "$fname\n";
: }

: But am curious if there is a better way then simply assigning the letter
: based on the number, as per the above (I'm sure there is - I just can't
: come up with it off the top of my head :)

--
<>< Daryl Bowen	<><
Georgia Institute of Technology
E-mail: gt1535b@prism.gatech.edu
Siemens Stromberg-Carlson Co-op


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

Date: Wed, 27 Aug 1997 14:00:45 +0000
From: Bob Maillet <bobm@tiac.net>
Subject: Which version of PERL is running on the server?
Message-Id: <34043309.1F98A888@tiac.net>

How would I go about finding which version of PERL is running on a unix
server?

Bob



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

Date: 27 Aug 1997 11:56:00 -0700
From: Rael Dornfest <rael@zx81.dnai.com>
Subject: Re: Which version of PERL is running on the server?
Message-Id: <87iuwra20v.fsf@zx81.dnai.com>


% perl -v

This is perl, version 5.004_01

Copyright 1987-1997, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

Rael

---------------------------------------------------------------------------
/Rael Dornfest/                                     <title>Webmaven</title>
                              %company = (DNAI => 'Direct Network Access');
print <<ADDRESS;
2039 Shattuck Avenue, Suite 206                           To: rael@dnai.com
Berkeley, CA 94704                                 atdt 888 321 3624 (DNAI)
ADDRESS                           <a href="http://www.dnai.com">Website</a>





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

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

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