[6917] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 542 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 30 03:08:39 1997

Date: Fri, 30 May 97 00:00:40 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 30 May 1997     Volume: 8 Number: 542

Today's topics:
     *NOT SPAM* Apprentice Perl Hacker, Summer Work Offered <kissel@kissel.spicerack.ibm.com>
     Re: Any non number but not a dot... (Tad McClellan)
     Re: Arg. This isn't a CGI question, really it isn't. (Mike Stok)
     Desparately Seeking Assistance - Numbers Calculation (Earl Curley)
     Re: Desparately Seeking Assistance - Numbers Calculatio (Michael Fuhr)
     Re: Desparately Seeking Assistance - Numbers Calculatio (Hope this helps!)
     Re: Embed perl script in HTML (etta )
     Re: Engineering Format printing <rootbeer@teleport.com>
     Re: Formatting question <rootbeer@teleport.com>
     Re: Formatting question (Hope this helps!)
     Re: From Unix Perl programming to NT Perl Programming.. <jong@pernet.com>
     Re: HELP - Urgent - odbc information <billc@tibinc.com>
     Re: Help with ( (Andrew M. Langmead)
     How do you know is a message sent from sendmail failled (Jason Anthony)
     Re: Installation Problem Perl306/PerlIS on NT 4.0 SP3 <juerg_reimann@ibee.com>
     Re: Making a portable program with flock() <petri.backstrom@icl.fi>
     Re: newbie - perl modules <petri.backstrom@icl.fi>
     Re: PASSING INFO/ RUNNING JAVA APPLICATION FROM PERL SC <rootbeer@teleport.com>
     Re: PERL for win32 question... <dingzq@imedia.com.sg>
     Re: perl with frontpage? <petri.backstrom@icl.fi>
     Please Help with this (easy??) Conditional Statement Pr dilcher@cueva.com
     Re: Please Help with this (easy??) Conditional Statemen (Tung-chiang Yang)
     Re: Please Help with this (easy??) Conditional Statemen (Tad McClellan)
     Re: Please Help with this (easy??) Conditional Statemen dilcher@cueva.com
     prototypes and use subs qw() <friedman@uci.edu>
     Re: prototypes and use subs qw() <rootbeer@teleport.com>
     Re: reading hashes from a file <allenjs@nic.techops.lmco.com>
     Re: script pull images off web pages (Tung-chiang Yang)
     Re: script pull images off web pages (Hope this helps!)
     Socket reading (Nuutti Kotivuori)
     Re: track user (Magnus Bodin)
     Re: Who am I? (I'm a perl script) <jhi@alpha.hut.fi>
     Why is ("a" == 0) true? dchen@interport.net
     Re: Why is ("a" == 0) true? (Tung-chiang Yang)
     Re: Why is ("a" == 0) true? <rootbeer@teleport.com>
     Re: Why is ("a" == 0) true? <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 29 May 1997 19:26:30 -0400
From: "Robert S. Kissel" <kissel@kissel.spicerack.ibm.com>
Subject: *NOT SPAM* Apprentice Perl Hacker, Summer Work Offered
Message-Id: <338E10A6.41C6@kissel.spicerack.ibm.com>

I have suitable work for an apprentice Perl hacker (college student,
or even high-school, if you're real good).  The location is Westchester
County, just north of the Tappan Zee bridge.

Applicant *MUST* be creative and fluent with regular expressions, and a
year of automata theory is a plus; familiarity with UNIX as a
programming environment is required; being a guru is not--what I need
right now is a bright, patient, creative apprentice to write a great
many routines to recognize certain patterns and structures in texts.
It's not fascinating work, but it is excellent practice for a young
programmer, and there's enough to keep you busy this summer.

Lunatics preferred.  You won't need a tie, and you'll be reporting to
other lunatics. e-mail me a resume if you have one, or better yet, a
sample of some work you've done in Perl which you think is cool, and a
way to get in touch with you.

Please do not telephone; and no head-hunters, for this one.

"Experience" not required--if you wrote it for yourself, and it's good,
that's all I care about...if you'd like a "first job," this is an
opportunity.


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

Date: Thu, 29 May 1997 20:55:21 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Any non number but not a dot...
Message-Id: <92clm5.g7e.ln@localhost>

Craig Berry (cberry@cinenet.net) wrote:
: christopher (christopher@wonderlandinorbit.com) wrote:
: : - what could I use to check if a string has any non digit in it, as long
: : as that / those non digit is/aren't a dot.  Don't care where anything
: : appears, I just need to return true if a string is made entirely of
: : numbers and dots.

:   $string =~ /^[0-9\.]+$/;

: This will evaluate true if $string contains only digits and dots.

: I'm not *certain* that the escaping of dot is required inside square 
: brackets, 


Well, I invested the twenty seconds to find out ;-)

It does not matter.

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

$_ = "12.34";

print "matched escaped dot\n" if /^[0-9\.]+$/;

print "matched bare dot\n" if /^[0-9.]+$/;
----------------


: but it can't hurt. :)  If a zero-length string is acceptable, 
: change + to *.  Hope this helps!


"inside square brackets" is more properly called a "character class".

There are _very_ few special chars in a character class:

\         escape char

]         ends the char class

^         special only if it is the first char in the char class (means "not")

-         special only if it is NOT the first or last char in the char class.
          (forms a range of characters)

and the backwacked escapes (eg: \s \n ...)


I think that's all of them...


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


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

Date: 30 May 1997 00:29:30 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Arg. This isn't a CGI question, really it isn't.
Message-Id: <5ml71a$40b@news-central.tiac.net>

In article <338D5839.167E@shef.ac.uk>, Andy Shaw  <a.j.shaw@shef.ac.uk> wrote:
>I would like to be able to test my cgi programs on my stand-alone pc at
>home, without having to set up the ENV{"QUERY_STRING"} and similar each
>time I do it. I would really like to have a program which would act like
>httpd, but I don't have the network services to use one. Any Ideas on
>programs/scripts/daemons I can use to make my PC pretend to be networked
>to itself?

If you like you can use Lincoln Stein's CGI.pm module which (certainly on
the unix systems I've used it on) detects whether it's being run
stand-alone and allows you to enter

name=value

tuples at the keyboard, hitting EOF (^Z on a PC, I think) lets the program
continue and you see the output.

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: Fri, 30 May 1997 00:45:21 +0100
From: psychic@globalserve.net (Earl Curley)
Subject: Desparately Seeking Assistance - Numbers Calculation
Message-Id: <psychic-3005970045210001@dialin1756.globalserve.net>

Boy, do I need a hand.  I'm in a real bind.  I have been trying to
calculate the following with no success.

I need to reduce two number down to no higher than 10 or -10.  As an
example if one of the numbers is 178, the number has to be reduced as
such.  178 - 1 + 7 + 8= 16 =1 + 6= 7  the second number simply is the
opposite direction -178 so therefore it would be:  -1 + -7 + -8 = -16 = -1
+ -6 = -7 .  The high number is a maximum of 210.

If there is a kind soul here, I'd be indebted for life if you could assist
me.  I've read every PERL FAQ and have the whole darn book on PERL and
I'll be darned I can't find how to script this.

I would appreciate help via e-mail since I'm on a time limit here.

Thanks in advance.

-- 
Earl Curley
psychic@globalserve.net

=========== Web.Design.Ca Inc =============
          http://www.webdesign.ca/advertising.html

     Psychic Discoveries Behind The Canadian Curtain
                    http://www.webdesign.ca/

                      The I.R.I.S. Chronicles
            http://www.webdesign.ca/iris.html

                    The 21 Emotions Exercise
  http://www.webdesign.ca/emotions_registration.html
=======================================


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

Date: 30 May 1997 00:10:57 -0600
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Desparately Seeking Assistance - Numbers Calculation
Message-Id: <5mlr1h$ge1@flatland.dimensional.com>

psychic@globalserve.net (Earl Curley) writes:

> I need to reduce two number down to no higher than 10 or -10.  As an
> example if one of the numbers is 178, the number has to be reduced as
> such.  178 - 1 + 7 + 8= 16 =1 + 6= 7  the second number simply is the
> opposite direction -178 so therefore it would be:  -1 + -7 + -8 = -16 = -1
> + -6 = -7 .  The high number is a maximum of 210.

Think "split".

> If there is a kind soul here, I'd be indebted for life if you could assist
> me.  I've read every PERL FAQ and have the whole darn book on PERL and
> I'll be darned I can't find how to script this.

Hmmm...not sure if I believe you :-)  Using PERL instead of Perl is
among the giveaways.

> I would appreciate help via e-mail since I'm on a time limit here.

This is a public newsgroup - if you'd like answers via email, please
indicate that you'll post a summary so others can learn as well.

-- 
Michael Fuhr
http://www.dimensional.com/~mfuhr/


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

Date: 30 May 1997 01:48:26 -0500
From: scribble@wwa.com (Hope this helps!)
Subject: Re: Desparately Seeking Assistance - Numbers Calculation
Message-Id: <5mlt7q$rsr@shoga.wwa.com>

In article <psychic-3005970045210001@dialin1756.globalserve.net>,
Earl Curley <psychic@globalserve.net> wrote:
>I need to reduce two number down to no higher than 10 or -10.  As an
>example if one of the numbers is 178, the number has to be reduced as
>such.  178 - 1 + 7 + 8= 16 =1 + 6= 7  the second number simply is the
>opposite direction -178 so therefore it would be:  -1 + -7 + -8 = -16 = -1
>+ -6 = -7 .  The high number is a maximum of 210.

Perl has foreseen this need and has provided an obscure but
optimized automagic operation for it. All you need to do is:

	$n = ($m % 9) - 9*($m < 0) || 9;

That's it. It will give you the reduced value of any number $m.
I am not surprised you didn't find it since it is undocumented.
But it works very well; try it and see.



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

Date: Fri, 30 May 1997 00:50:07 GMT
From: etta@fyi.com (etta )
Subject: Re: Embed perl script in HTML
Message-Id: <338e2338.4635313@netnews.worldnet.att.net>



<IMG SRC="/CGI-BIN/filename.cgi?">


Hope this helps

etta

On Thu, 29 May 1997 17:22:37 -0600, josephn@mail.mcoe.k12.ca.us wrote:

>I have written a perl counter script. I would like to call it from already
>written html web pages. How do I go about this? Any comments would be
>most appreciated. Thanks Joseph.
>
>-------------------==== Posted via Deja News ====-----------------------
>      http://www.dejanews.com/     Search, Read, Post to Usenet



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

Date: Thu, 29 May 1997 22:59:21 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kevin Earls <kevin@ti.com>
Subject: Re: Engineering Format printing
Message-Id: <Pine.GSO.3.96.970529221108.21066B-100000@kelly.teleport.com>

On 29 May 1997, Kevin Earls wrote:

> Anyone know of a better/faster/cleaner way to get engineering format
> for numbers?  Is there a module or library that can do this?

There otter be, but I've never seen one....

This sub looks worse than it is (improvements are welcome), but I think it
will work everywhere. Hope this helps!

    sub eformat ($) {
        # Convert a number to an engineering-format string.
        # In this format, there's always a two-digit value for
        # the power of ten, and it's always a multiple of 3,
        # as in 3.14159e+00, 620.21367e+21, or 13.8e-24.
        my($num) = 0+shift;	# Force conversion
	my($exp, $esign);	# the exponent, and its sign
	my($off) = 0;		# How far to adjust
	if ( $num =~ m	    # If you can match...
	    { (.*\d)		# any junk and a digit	#1
	      \.		# a decimal point
	      (\d?)		# an optional digit	#2
	      (\d?)		# another		#3
	      (\d*)		# any more digits	#4
	      e			# the telltale mark
	      ([+-]?\d+)	# and an exponent	#5
	    }ix )   {	    # Then...
	      $exp = $5;	# grab the exponent
	      $off++, $exp-- while $exp % 3;	# fix it
	      $esign = '+';
	      if ($exp < 0) {	# fix the exponent's sign
		  $esign = '-';
		  $exp = -$exp;
	      }
	      return "$1$2$3.$4e$esign" . sprintf('%02d', $exp)
		  if $off == 2;
	      return "$1$2.$3$4e$esign" . sprintf('%02d', $exp)
		  if $off;
		     "$1.$2$3$4e$esign" . sprintf('%02d', $exp)
	} else {		# But if it didn't match...
	    $num . "e+00";
	}
    }


-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Thu, 29 May 1997 23:01:33 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Sara Young <syoung@actcom.co.il>
Subject: Re: Formatting question
Message-Id: <Pine.GSO.3.96.970529230040.21066C-100000@kelly.teleport.com>

On Thu, 29 May 1997, Sara Young wrote:

> I want to print out some data, making sure that all lines are no longer 
> than a specific length.
> 
> Does the following make sense, or is there an easier way to do this (I
> want to preserve paragraphs)?

The easy way is probably to use a module. Look in the text processing
section of CPAN for a module that can do word wrapping. Enjoy!

    http://www.perl.com/CPAN/
    http://www.perl.org/CPAN/

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 30 May 1997 01:21:21 -0500
From: scribble@wwa.com (Hope this helps!)
Subject: Re: Formatting question
Message-Id: <5mlrl1$ot2@shoga.wwa.com>

In article <EAyIBy.M97@actcom.co.il>, Sara Young <syoung@actcom.co.il> wrote:
>I want to print out some data, making sure that all lines are no longer 
>than a specific length.

You want to be careful about boundaries. If your data has a
final paragraph without an empty line after it, it will not
get printed. So "write if $text" after the loop's in order...


>format = 
>^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
>$text
>.
>
>while (<>) {
>    if (/^\s*$/) {
>       write;
>       print "\n";
>       $text = "";
>    } else {
>       $text .= $_;
>    }
>}



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

Date: Thu, 29 May 1997 11:55:34 -0400
From: Jonathan Gilbert <jong@pernet.com>
To: snaider@galcom.co.il
Subject: Re: From Unix Perl programming to NT Perl Programming... Help!
Message-Id: <338DA6F6.265C@pernet.com>

> Daniel Schnaider (snaider@galcom.co.il) wrote:
> 
> : I a Unix Perl programmer.
> : I am trying to make a program in Perl for NT that send me mail after it
> : checks some things...
> : I dowloaded a program called postmail that suppose to send mail using
> : pipe.

postmail (i belive, if it's the same as the one I'm using) 
requires you to be running post.office (from www.software.com)
on the same machine as the perl script.

Other than that, make sure that your variables with 
path names in them, such as a var that defines the 
location of postmail, has double escaped backslashes 
in them 
(ie, something like 
$location_to_postmail = "c:\\win32apps\\misc\\postmail.exe";
or non-interpolated as 
$location_to_postmail = 'c:\win32apps\misc\postmail.exe';
because otherwise, perl will choke.)

> : It doesn't seem to work!

It could help if you were a bit more specific.

jong out.

-------------------------
Jonathan Gilbert,
DataMart Computer Systems
http://www.pernet.com/


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

Date: Thu, 29 May 1997 21:23:06 -0400
From: Bill Cowan <billc@tibinc.com>
Subject: Re: HELP - Urgent - odbc information
Message-Id: <338E2BFA.5EA1@tibinc.com>

Jeremie FARCIS wrote:
> 
> Hello!
> 
>         I would like to use win32::odbc on a DEC ALPHA platform. For this, i
> have downloaded the alpha_odbc.pll file on ftp.roth.net/pub/ntperl/. But
> this pll file do not seem to work with
> any odbc release... I always get a 'parse exception' !!
> 
>         Please, could you tell me :
> 
>         * with what release of the win32::odbc package it runs (i
> have           tryed the 960722, 961105, and 970208 versions)
> 
>         * with what build of perl i can use it (i have tried 110, 304
>           and 306).
> 
>         Thank you for your help !
> 
> Jeremie
> jfarcis@ifhamy.insa-lyon.fr

If no response, you may want to try the Win32 Perl mailing list. You can
join the list at ActiveWare web site (http://www.activeware.com/).

-- 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: Thu, 29 May 1997 15:17:44 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Help with (
Message-Id: <EAy7tK.ICz@world.std.com>

Dave Boswell <dave_boswell@nt.com> writes:

>We have just recently moved to 5.004 and I am getting the following
>error, which I am unable to figure out.

>   syntax error at line 2 : `(' unexpected

The perldiag man page lists EVERY error message emitted by the perl
interpreter. (and a few that it doesn't, but are mistaken as perl
errors.)

This is an entry in it:

       syntax error at line %d: `%s' unexpected
           (A) You've accidentally run your script through the
           Bourne shell instead of Perl.  Check the #! line, or
           manually feed your script into Perl yourself.
 
 
-- 
Andrew Langmead


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

Date: Fri, 30 May 1997 05:41:24 GMT
From: oook@deathsdoor.com (Jason Anthony)
Subject: How do you know is a message sent from sendmail failled?
Message-Id: <338e6825.124500157@news.i-way.co.uk>

Can anyone tell me how to get results from failed calls to sendmail
from in a perl script.

Jason.

--
oook@deathsdoor.com
http://www.aquapal.co.uk/discworld/discworld.html


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

Date: Fri, 30 May 1997 01:29:21 +0200
From: "Juerg Reimann" <juerg_reimann@ibee.com>
Subject: Re: Installation Problem Perl306/PerlIS on NT 4.0 SP3
Message-Id: <5ml33m$lnv@dino.active.ch>

Hello Roland

I had the same problem and would say this is a bug somewhere in PerlIS.dll
or a component of SP 3 (more in SP 3 I guess...). A workaround would be if
you associate .pl with perl.exe %s for IIS. This works just fine..

-- Juerg
 Roland Faszauer wrote in article <338AF7AF.972@intershop.de>...
>Hi folks,
>
>I've got a problem using PerlIS.dll (build 306) on NT 4.0 SP 3 running
>IIS 3.0
>When I try to access my perl script I get the following error:
>
>HTTP/1.0 500 Server Error (A dynamic link library (DLL) initialization
>routine failed.)
>
>I used to run Perl110/PerlIS.dll with IIS 2.0 on NT4.0 SP 2 and checked
>- the permission to the path for the dll/executables/scriptes,
>- my script mapping for IIS (.plx to perlis.dll)
>- that I send a HTTP/1.0 200 OK header
>
>Perl itself is working fine on the command line and with IIS (.pl mapped
>to perl.exe).
>I'm clueless ... :-(
>
>Regards
>Christian
>
>PS: What happens to http://www.divinf.it/perl-win32/index.sht the
>Perl-Win32-Archive ?
>The last update was in January.
> 




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

Date: Mon, 26 May 1997 00:25:15 +0200
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: Making a portable program with flock()
Message-Id: <3388BC4B.502A@icl.fi>

Joshua wrote:
> 
> I'm making a program that is developed in Win95 and
> runs primarily in Unix.  There are lots of pitfalls,
> but right now I am looking for advice in using flock().
> 
> Which solution would you recommend:
> 
>   eval('flock(MYFILE, 2)');
> 
> or
> 
>   flock(MYFILE, 2) if $^O !~ /(msdos|mswin)/i;
> 
> or
> 
>   flock(MYFILE, 2);  # Comment this out, Microsoftians
> 
> The command is only executed once, so I'm leaning
> toward the first in case MS ever implements flocking,
> or Activeware pulls flock out of a hat :-)
> 
> --
> Joshua Swink
> joshua@mongoose.demon.co.uk

Maybe you should try your last variant

    flock( MYFILE, 2 );

with the Perl version at

    http://www.activeware.com

It works for me (on Windows NT, I don't know
about Windows 95).

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: Mon, 26 May 1997 00:04:41 +0200
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: newbie - perl modules
Message-Id: <3388B779.4303@icl.fi>

Cathy Huang wrote:
> 
> How do you install a perl module? Any webpages about this?
> 
> Thanks,
> Cathy
> 
> Please email
> cathyh@cs.berkeley.edu

In general, you put it in your ./lib subdirectory under your
Perl installation directory (or depending on how it is named, 
in subdirectory in ./lib), or you put it wherever you want, 
and  do

 use lib '/new/directory';

to add that to the list for directories searched.

On your system look at the ./lib directory (and its
subdirectories) for *.pm files, and then look at what
their documentation - which most often is included in
the files themselves in POD format - says on how to
use them in your scripts, and you should fairly quickly
get a grasp of what's happening.

The Perl on-line documentation would be a good place where
to start reading up on this (then you can also see what
the installation routines for various Perl modules do by
looking at the installation script, which often is the
best way to install a Perl module you've gotten from
somewhere).

See 

    http;//www.perl.com/CPAN/

for _The_ Perl module archive (Comprehensive Perl Archive
Network).

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: Thu, 29 May 1997 23:11:55 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Rajat Aggarwal <rajat@cs.uh.edu>
Subject: Re: PASSING INFO/ RUNNING JAVA APPLICATION FROM PERL SCRIPT
Message-Id: <Pine.GSO.3.96.970529230235.21066E-100000@kelly.teleport.com>

On 28 May 1997, Rajat Aggarwal wrote:

> Newsgroups: comp.lang.perl

If your news administrator still carries comp.lang.perl, please encourage
him or her to check out the frequent posting about bogus newsgroup names
in news.announce.newgroups. You'll be doing yourself and many others a
favor to use comp.lang.perl.misc (and other valid Perl newsgroups)
instead.

    news:news.announce.newgroups

> Subject: PASSING INFO/ RUNNING JAVA APPLICATION FROM PERL SCRIPT

THERE'S NO NEED TO SHOUT.  :-)

> System("rlogin peagus");
> System("cd www/project2");
> System("(java project2 $url) > $output");

That doesn't look like what you really did, but that wouldn't work either.
You're thinking that system() is a shell of its own, but that's not how it
works; system runs a command, waits for it to complete, then returns. 

I think what you want is a two-way connection to your rlogin process, so
you can 'type' to it, maybe via a pseudo-tty. I don't know much about
this, but I know it's not easy. Good luck!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 30 May 1997 01:52:46 GMT
From: "Robert Ding" <dingzq@imedia.com.sg>
Subject: Re: PERL for win32 question...
Message-Id: <01bc6c9c$8bf330c0$12b710ac@Robert.imedia.com.sg>

If you call the script under IIS, you don't need change all "/" to "\", the
IIS will do it
for you!

Greg Chronowski <chronow1@jeflin.tju.edu> wrote in article
<338E062A.69A4@jeflin.tju.edu>...
> I'm new to Windows NT, here's my questions:
> 
> I have written a PERL script which now runs on a Linux server, I need to
> run it on an NT server (IIs).
> 
> I realize that the directory structure for NT and Unix are different
> (one uses forward slashes "/" and one uses backslashes "\") is this
> correct?
> 
> Do I need to change all the directory URLs in the script to backslashes
> to run the script under NT?
> 
> Do I call the script the same way I do under Unix? 
> (i.e. using <A HREF="http://www.somewhere.com/cgi-bin/script.pl">
> (is there even a cgi-bin directory in NT?)
> 
> How are permissions set under NT?
> 
> I'll be doing all of this remotely...the server is far away.
> 
> Does anyone have a resource that can explain what this whole Active
> Server business is about (I have NO idea as of yet)
> 
> These questions are BASIC, so I'd appreciate a REALLY basic, hands on
> response.
> 
> TIA,
> 
> GC
> 


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

Date: Mon, 26 May 1997 00:39:10 +0200
From: Petri Backstrom <petri.backstrom@icl.fi>
Subject: Re: perl with frontpage?
Message-Id: <3388BF8E.642E@icl.fi>

Stephen Cawood wrote:
> 
> Thanks in advance for your time.
> 
> Is it possible to run perl scripts on a frontpage server?
> If so how?
> How would you make a frontpage file executable?
> 
> Frontpage comes with a cgi-bin so it seems as though this should be
> possible.
> 
> -Cawood

You should point your newsreader to msnews.microsoft.com,
and search for the answer in a newsgroup on that server.

See, e.g.,

    microsoft.public.inetserver.misc
    microsoft.public.inetserver.iis
    microsoft.public.inetserver.personalwebserv

for starters.

regards,
 ...petri.backstrom@icl.fi
    ICL Data Oy
    Finland


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

Date: Fri, 30 May 1997 00:36:24 GMT
From: dilcher@cueva.com
Subject: Please Help with this (easy??) Conditional Statement Problem.
Message-Id: <338e1e49.2285091@news.mindspring.com>

	

I have a conditional statement, in my program, of the form:

if (    ) { print "blah blah blah"; }

The expression within the parenthesis will be a list of "sub
expressions", each seperated with the && symbol, such as:

$name =~ /smith/ && $height =~ /tall/ && $eyes =~ /blue/

The individual "sub expressions" will be determined, on the
fly, in the program, so I can not write them into the code.

I thought about stacking them into an array variable (say @stats) and
then, converting the array variable into a scalar, (say, $stats )then
inserting the scalar variable within the parenthesis, in the initial
conditional statement:

if ($stats) { print "blah blah blah"; }

However, obviously,
this won't work, as the conditional only checks to see if the
variable is defined or not.  I thought maybe if I put quotes around
the scalar, it might cause it to expand its contents:

if ("$stats" { print "blah blah blah"; }

However, this doesn't work either.

Can someone give a clue to the clueless on how to do this?
Thanks!!!!

-Jeff Dilcher
dilcher@cueva.com


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

Date: Fri, 30 May 1997 00:45:50 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Please Help with this (easy??) Conditional Statement Problem.
Message-Id: <tcyangEAyy4E.98D@netcom.com>

I believe you can directly use (untested)

$pname = 'smith';
$characteristic = 'tall';
$color = 'blue';
if ($name =! /$pname/ && $height =~ /$characteristic/ && $eyes =~ /$color/){
   foo();
   bar();
}

In fact, if you just need string comparison instead of pattern matching,
you can use

   $name eq $pname && $height eq $characteristic && $eyes eq $color

==========================================
dilcher@cueva.com wrote:

: I have a conditional statement, in my program, of the form:

: if (    ) { print "blah blah blah"; }

: The expression within the parenthesis will be a list of "sub
: expressions", each seperated with the && symbol, such as:

: $name =~ /smith/ && $height =~ /tall/ && $eyes =~ /blue/

: The individual "sub expressions" will be determined, on the
: fly, in the program, so I can not write them into the code.

: (deleted)

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Thu, 29 May 1997 20:45:07 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Please Help with this (easy??) Conditional Statement Problem.
Message-Id: <3fblm5.m5e.ln@localhost>

dilcher@cueva.com wrote:
: 	

: I have a conditional statement, in my program, of the form:

: if (    ) { print "blah blah blah"; }

: The expression within the parenthesis will be a list of "sub
: expressions", each seperated with the && symbol, such as:

: $name =~ /smith/ && $height =~ /tall/ && $eyes =~ /blue/

: The individual "sub expressions" will be determined, on the
                                                       ^^^^^^
: fly, in the program, so I can not write them into the code.
  ^^^                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


see eval() in the perlfunc man page...


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


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

Date: Fri, 30 May 1997 03:29:26 GMT
From: dilcher@cueva.com
Subject: Re: Please Help with this (easy??) Conditional Statement Problem.
Message-Id: <338e496e.7298177@news.mindspring.com>

Thanks! Thats just what I needed!
-Jeff


On Thu, 29 May 1997 20:45:07 -0500, tadmc@flash.net (Tad McClellan)
wrote:

>
>see eval() in the perlfunc man page...



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

Date: 30 May 1997 04:45:49 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: prototypes and use subs qw()
Message-Id: <5mlm1t$sl@news.service.uci.edu>

[perl 5.004; solaris 5.5.1]

I'd like to take advantage of the inlining of functions that return
a constant.  However, I'd also like to be able to call the function
without the ()'s  by including it in a 'use subs qw()' declaration.

This works:

#1
print hello();
sub hello () { return "Hello World"; }

This does not:

#2
use subs qw(hello);
print hello;
sub hello () { return "Hello World"; }

But this does:

#3
use subs qw(hello);
print hello;
sub hello { return "Hello World"; }

How can I get the calling syntax of example #3 AND the inlining of
example #1?

TIA,
Eric
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Thu, 29 May 1997 23:28:54 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: prototypes and use subs qw()
Message-Id: <Pine.GSO.3.96.970529232555.21066I-100000@kelly.teleport.com>

On 30 May 1997, Eric D. Friedman wrote:

> I'd like to take advantage of the inlining of functions that return
> a constant.  However, I'd also like to be able to call the function
> without the ()'s  by including it in a 'use subs qw()' declaration.

If you mean that you'd like a function inlined but you won't define it
until later in the file, I've got bad news. For a function to be inlined,
it has to be compiled before the call to it is compiled, so 'use subs
qw()' isn't really useful for it.

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Thu, 29 May 1997 17:07:24 -0700
From: Jay Allen <allenjs@nic.techops.lmco.com>
Subject: Re: reading hashes from a file
Message-Id: <338E1A3C.312C@nic.techops.lmco.com>

Randall S. Willcox wrote:

> So we have a text file that looks like %01 = ('01', 'a', '02', 'b'); and
> so on up to up %10. Now I want read "foo.txt", grab an individual hash
> from it & plug it into my script.

	Does this scream "array of array" to anyone else??  Maybe you could
simplify your problem by making your text file like this:

a,b,a,c,d,a,b,d,e,c,e
c,d,a,b,d,e,c,e,c,e,b
a,b,d,e,c,e,b,c,d,c,b
d,a,b,d,e,c,e,c,d,c,b
d,e,c,e,d,e,c,e,a,a,b

	Each row is a quiz and each letter is an answer, so when you read in
the file, you'd read Row 1 (read: @{$answers[0]} = split ',',$_), row
two and so on.  You'd end up with an array of arrays...

If you need to access:

Answer 2 of Quiz 3 	-->	$answers[2][1]
Quiz 4 			-->	$answers[3]
etc etc...

	Just a design question.  I know it doesn't really answer your question
directly...  I just wonder why make it harder than it has to be...

  -j-
---------
Jay Allen
allenjs@nic.techops.lmco.com
ICYRA-Internet Coordinator
Lockheed-Martin - Web Page Lead
The Maxim Group - Sr. Programmer/Analyst
(w) (310) 727-1086
(h) (562) 433-7727


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

Date: Thu, 29 May 1997 23:57:58 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: script pull images off web pages
Message-Id: <tcyangEAyvwM.4HM@netcom.com>

You have to define "all" better.  Unless the web page owner grants
world readable status for that directory, nobody can pull "all" the
images there, not Perl, not Unix, because you have no idea what "all"
means.

===================================
Cathy Huang (cathyh@cs.berkeley.edu) wrote:
: Anyone know of any perl scripts that pull all the gif's and jpeg's off
: designated web pages into your directory? This is on Solaris 2.5.1.

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: 30 May 1997 01:25:32 -0500
From: scribble@wwa.com (Hope this helps!)
Subject: Re: script pull images off web pages
Message-Id: <5mlrss$p9e@shoga.wwa.com>

In article <338E0C1D.1F51@cs.berkeley.edu>,
Cathy Huang  <cathyh@cs.berkeley.edu> wrote:
>Anyone know of any perl scripts that pull all the gif's and jpeg's off
>designated web pages into your directory? This is on Solaris 2.5.1.

Use the lwp-rget program which comes with the LWP library.
The man page and usage message tell all...



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

Date: Thu, 29 May 1997 19:40:05 +0300
From: naked@paivola.sci.fi (Nuutti Kotivuori)
Subject: Socket reading
Message-Id: <naked-ya02408000R2905971940060001@news.sci.fi>

Ok... I have this problem. I have a socket that I want to read line by
line... just one line at a time, but I can't just use <FILEHANDLE> because
I need to get back to my program every second on the second. The more
accurate the timing is the better. I looked up sirc:s sources and it has a
buffer in wich it reads data and takes it line by line from there and
selects the inputs. Is there a better way?

-- Naked

-----------------+-------------------------+------------------------------+
Nuutti Kotivuori | tel   : +358 2 2395786  | e-mail: naked@paivola.sci.fi |
Saukonojantie 19 | pager : +358 4800 34853 +-------------------+----------+
20250 TURKU, FIN | homepage : http://www.paivola.sci.fi/naked/ | <spacer> |
-----------------+---------------------------------------------+----------+


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

Date: Fri, 30 May 1997 05:47:21 GMT
From: Magnus.Bodin@tychonides.se (Magnus Bodin)
Subject: Re: track user
Message-Id: <338f69c9.236415878@news1.telenordia.se>

richard ferry <102646.1641@CompuServe.COM> wrote:

>we are instituting a chargeback feature on our intranet server.
>is there a way to track a user coming in from an ip address and
>find out how long he has been on our server until he signs off ?
>
>thanks in advance 

Is this a joke? It's not a perl question			


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

Date: 28 May 1997 16:16:04 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Who am I? (I'm a perl script)
Message-Id: <oeehgfn20vf.fsf@alpha.hut.fi>


: Is this the proper behavior?  If so, how should the script find
: out where it is?

What does $^X contain for you?

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: 29 May 1997 22:42:38 -0400
From: dchen@interport.net
Subject: Why is ("a" == 0) true?
Message-Id: <5mlequ$kpm@interport.net>

Hi.

The following perl behavior baffles me:

perl -e 'if("a" == 0) { print "wow" }'
Output is : wow

Perl thinks that "a" == 0 .
I tried this on Perl 4.0.1.8.36 on SunOS 4.1.3 and Perl 5.003 on Solaris 2.5.

Why is this?

Dave


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

Date: Fri, 30 May 1997 02:50:50 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: Why is ("a" == 0) true?
Message-Id: <tcyangEAz3wq.Go4@netcom.com>

According to another friend here, "==" interprets its arguments into
numbers (or you use "eq").  Since "a" is not a number, it is interpreted
as 0.

===============================
dchen@interport.net wrote:
: Hi.

: The following perl behavior baffles me:

: perl -e 'if("a" == 0) { print "wow" }'
: Output is : wow

: Perl thinks that "a" == 0 .
: I tried this on Perl 4.0.1.8.36 on SunOS 4.1.3 and Perl 5.003 on Solaris 2.5.

: Why is this?

--
Tung-chiang Yang                       tcyang@netcom.com

soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
   http://www.iglou.com/tcyang/Taiwan_faq.shtml, China_faq.shtml


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

Date: Thu, 29 May 1997 23:13:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: dchen@interport.net
Subject: Re: Why is ("a" == 0) true?
Message-Id: <Pine.GSO.3.96.970529231243.21066F-100000@kelly.teleport.com>

On 29 May 1997 dchen@interport.net wrote:

> The following perl behavior baffles me:
> 
> perl -e 'if("a" == 0) { print "wow" }'
> Output is : wow

The comparison operator you have there compares numbers. What other number
would you have "a" be? :-)

If you want to compare strings, use cmp. Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Thu, 29 May 1997 23:16:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: dchen@interport.net
Subject: Re: Why is ("a" == 0) true?
Message-Id: <Pine.GSO.3.96.970529231537.21066G-100000@kelly.teleport.com>

In a big hurry, I wrote:

> If you want to compare strings, use cmp. 

Of course, although that will compare strings, the operator which I meant
to mention is eq. Oops!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

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

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