[8097] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1716 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 23 18:07:23 1998

Date: Fri, 23 Jan 98 15:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 23 Jan 1998     Volume: 8 Number: 1716

Today's topics:
    Re: /x regex mystery <gbarr@ti.com>
    Re: ? random text string (brian d foy)
    Re: @ == @, comparing arrays (Charles DeRykus)
    Re: Apache:  Using SSI within perl script-generated web <rootbeer@teleport.com>
    Re: character comparison... <doug1@weboneinc.com>
    Re: conditionally use a module <Hendrik.Klompmaker@net.iend.wau.nl>
    Re: Finding the missing bracket? <rootbeer@teleport.com>
    Re: Having Perl output to a specific html form field <rootbeer@teleport.com>
    Re: Help w/ regexp <doug1@weboneinc.com>
    Re: Help with Stripping charactes from strings based up <barnett@houston.Geco-Prakla.slb.com>
        Help!!! simple problem (Hiu-Man Cheung)
    Re: HOw to check for file existence in each home direct <rootbeer@teleport.com>
        Looking to establish alliance with PERL programmer(s) John@3line.com
    Re: NS Communicator wrong filename extention with file  <Hendrik.Klompmaker@net.iend.wau.nl>
    Re: Perl-script to binary? <rootbeer@teleport.com>
    Re: Please please help a beginner... <rootbeer@teleport.com>
    Re: possible reasons for broken pipe? <rootbeer@teleport.com>
    Re: relational operators and negative numbers <rootbeer@teleport.com>
    Re: Setting up a LaTeX->file->printer system... (Jeeves)
    Re: Simple Question - Hopefully! (brian d foy)
    Re: Simple Question - Hopefully! <rets@meta3.com>
    Re: Sys::Syslog <walts@nortel.ca>
    Re: UNIX to %$$@! Win: Script Won't Go <rootbeer@teleport.com>
    Re: Win32 Perl date time ??? (Raul Nohea Goodness)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 23 Jan 1998 16:18:55 -0600
From: Graham Barr <gbarr@ti.com>
Subject: Re: /x regex mystery
Message-Id: <34C9174F.9B658C19@ti.com>

John M. Klassa wrote:
> 
> Can somebody explain why this happens?
> 
>         % ./testing-2
>         yes
>         no
> 
> The script is:
> 
>         #!/usr/local/bin/perl -w
> 
>         $string = 'Tom Christiansen < tchrist@mox.perl.com >';
> 
>         print (($string =~ /Tom Christiansen.*perl.*com/)
>               ? "yes\n" : "no\n");
> 
>         print (($string =~ /Tom Christiansen .* perl .* com/x)
>               ? "yes\n" : "no\n");
> 
> Shouldn't the /x just make the spaces around ".*" go away, effectively?
> Perl is "5.004_03" running on Solaris 5.5.1, FWIW.

The /x makes *all* spaces be ignored, so your expression above
is the same as

         print (($string =~ /TomChristiansen.*perl.*com/)
               ? "yes\n" : "no\n");

which will print "no" as the space in Tom's name will cause
it to fail. What you probably want is

         print (($string =~ /Tom \s Christiansen .* perl .* com/x)
               ? "yes\n" : "no\n");

Graham.


-- 
Originality is the ability to conceal your source.


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

Date: Fri, 23 Jan 1998 17:03:41 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: ? random text string
Message-Id: <comdog-ya02408000R2301981703410001@news.panix.com>
Keywords: from just another new york perl hacker

In article <Pine.GSO.3.96.980123134250.17597P-100000@user2.teleport.com>, Tom Phoenix <rootbeer@teleport.com> posted:

>On Thu, 22 Jan 1998, Lars Kr. Lundin wrote:
>
>> Can anybody tell me how to produce a random text string that matches
>> /^\w{8}$/ ?
>> 
>> I would be surprised if it is difficult...
>
>It's not difficult at all, as others have shown. But it's not a trivial
>task to generate good secure passwords, as you may know. Cheers! 

oh, it's not that bad - we use a script to generate initial passwords
that pass Crack's tests.  you just have to know what you are doing :)

[wonders if Tom's passwd is "Cheers!" :) ]

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 21:39:46 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: @ == @, comparing arrays
Message-Id: <En9AuB.L6y@bcstec.ca.boeing.com>

In article <6a9aai$s93$1@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
 > Clay Irving (clay@panix.com) wrote on 1605 September 1993 in
 > <URL: news:6a8hp4$imo@panix.com>:
 > ++   
 > ++   if ( @arrayone == @arraytwo and "@arrayone" eq "@arraytwo") {
 > ++    ....   # arrays are same   
 > ++   
 > 
 > Not!
 > 
 > perl -we '@a1 = ("a b", "c"); @a2 = ("a", "b c");
 >           print "Equal\n" if @a1 == @a2 && "@a1" eq "@a2"'
 > 
 > prints "Equal" for me. 
 > 
 > Furthermore, beside the problems you have with $" appearing in your
 > array elements, you need to decide how to deal with multi dimensional
 > arrays. Should (1, [2, 3]) be considered the same as (1, [2, 3])?
 > The fragment you give says they are not equal, but is that what you
 > want?
 > 
 > You can write a recursive function that takes the ref() of the elements
 > into account, but then what are you going to do with:
 > @a1 = (sub {1}); @a2 = (sub {1}); ?
 > 
 > As long as you don't have coderefs, you could use Data::Dumper and
 > compare strings.
 > 


Ahem... yes.

But, with more careful qualification, a less comprehensive test 
might have at least some redeeming social value :)

How about:

The following array equality test works well for small 
arrays that don't contain code or anonymous array refs:


if (@array1 == @array2 and "@array1" eq "@array2" and  
    "@{[reverse @array1]}" eq "@{[reverse @array2]}")  {
       # arrays are same
}


Or, does the qualification need more work ;)  


--
Charles DeRykus


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

Date: Fri, 23 Jan 1998 13:58:23 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Gail Hunn <hunngai@fast.net>
Subject: Re: Apache:  Using SSI within perl script-generated web page
Message-Id: <Pine.GSO.3.96.980123135530.17597R-100000@user2.teleport.com>

On Thu, 22 Jan 1998, Gail Hunn wrote:

> I have a perl script that generates a web page, and the generated web
> page includes a "virtual include" SSI. 

It sounds as if you don't have a problem with the Perl code, then. 

> At the moment, this doesn't work.  The dynamic page is generated, and
> it contains the "virtual include" line as a comment, but it doesn't
> execute it.

Then Apache isn't doing what you want it to do. If you can't find what you
want in the Apache docs, you may need to ask in a newsgroup about servers.
Since there's nothing Perl-specific about this (that is, since you could
get the same results by writing your programs in C or in another language) 
people in a server-specific newsgroup can give you more and better
information than we can here. Good luck! 

-- 
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: Fri, 23 Jan 1998 13:10:16 -0500
From: Douglas Clifton <doug1@weboneinc.com>
Subject: Re: character comparison...
Message-Id: <34C8DD08.182E214F@weboneinc.com>

Dane Christensen wrote:

> Is there a way to alphebetically compare single characters?
> I've tried ...elsif ($char1> $char2) {... but, unlike C, they don't
> seem to be simply represented by numbers.  Thx.

Use ord():
if (ord($c1) == ord($c2))    { print "characters are the same"; }

--
Douglas Clifton
Unix/C/Perl/CGI/HTML Programmer

===================
Web One Inc.
Website Development
Phone: 888-699-WEB1
Phone: 616-552-9999
Fax:   616-552-9920
sales@weboneinc.com
www.weboneinc.com
===================




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

Date: Fri, 23 Jan 1998 23:15:38 +0100
From: Hendrik Klompmaker <Hendrik.Klompmaker@net.iend.wau.nl>
Subject: Re: conditionally use a module
Message-Id: <34C9168A.3A29DC44@net.iend.wau.nl>

Thanks for the reply's. Got what I wanted ;-)

Hendrik

Dave Barnett wrote:

> Hendrik Klompmaker wrote:
> >
> > Hi,
> >
> > Is it possible to conditionally USE a module or not ?
> > eg. based on the availability of a module.
> >
> > Something like this
> >
> > $UseMD5 = 1;
> > if ($UseMD5) {
> >   use MD5;
> > }
> >
> > Obviously this doesn't work if MD5 isn't installed but how should it be
> > solved ?
> >
> Look up eval.
>
> eval 'use MD5';
> if ($@) {
>         print "Error!\n";
> } else {
>         print "Fount!\n";
> }
>
> HTH.
>
> > TIA
> >
> > Hendrik.
> > --
>
> Dave
>
> --
> "Security through obscurity is no security at all."
>                 -comp.lang.perl.misc newsgroup posting
>
> ------------------------------------------------------------------------
> * Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
> * DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
> ------------------------------------------------------------------------



--
-----------------------------------------------------------------
|************** Wageningen Agricultural University. ************|
|  Department of Information Management and Datacommunication   |
-----------------------------------------------------------------
Hendrik Klompmaker: Senior Technologist
Internet          : Hendrik.Klompmaker@Net.IenD.Wau.Nl
X400              : c=nl;a=400net;p=surf;o=wau;ou1=IenD
                  : ou2=Net;s=klompmaker;gi=hendrik
Phone             : +31 (0)317-484059
Fax               : +31 (0)317-482970
Snail             : Dreijenplein 2
                    6703 HB Wageningen / The Netherlands
--------------------------------------------------------




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

Date: Fri, 23 Jan 1998 13:54:19 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Junbiao Zhang <junzhang@athos.rutgers.edu>
Subject: Re: Finding the missing bracket?
Message-Id: <Pine.GSO.3.96.980123134723.17597Q-100000@user2.teleport.com>

On 22 Jan 1998, Junbiao Zhang wrote:

> 	I was modifying a fairly big perl script and accidentally missed a
> right bracket in a subroutine. 

> I ended up doing a binary search (inserting a right bracket at a place
> and compile) to identify the problem. 
> 
> 	Is there a better way to deal with such a problem? 

A programmers' text editor should be able to help you indent code properly
and to match up braces in pairs. Here's a technique that I like. When perl
complains that there's a missing right bracket at the end of the file, I
add one! (Sure, it's probably a mistake, but it's just temporary.) Then I
ask my editor to find its mate, and it almost always goes straight to some
construct that wasn't properly terminated. 

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: Fri, 23 Jan 1998 14:08:17 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Franklin L. Petersen" <orangutan@grungyape.com>
Subject: Re: Having Perl output to a specific html form field
Message-Id: <Pine.GSO.3.96.980123140622.17597T-100000@user2.teleport.com>

On Thu, 22 Jan 1998, Franklin L. Petersen wrote about a form's second
submit button:

> I'd rather have it print it to one of the current form boxes on the page
> without touching/erasing anything else.

If this can be done at all, there's nothing Perl-specific about it: You
could use the same technique from any other language you could write the
script in. If you can't find what you need in the docs for the protocol
you're using, check with a newsgroup about it. People there should be able
to give you better and more complete answers than we can here. Good luck! 

-- 
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: Fri, 23 Jan 1998 12:25:09 -0500
From: Douglas Clifton <doug1@weboneinc.com>
Subject: Re: Help w/ regexp
Message-Id: <34C8D275.E251DC33@weboneinc.com>

Martien Verbruggen wrote:

> In article <34C7CA6A.20B9D23B@weboneinc.com>,
>         Douglas Clifton <doug1@weboneinc.com> writes:
>
> > I'm trying to figure out a way to match a range of numbers.
> > I know about the [0-9] syntax, but the numbers would be
> > more like 15-31, [15-31] does not work.
>
> Are you trying to do this with a regexp? Why?
>
> > I know this is not that difficult to do, the problem is the
> > range is not known untill run-time and would be in
> > scalar variables like $beg and $end.
>
> if ($beg >= 15 and $end <= 31) { ... }

To be more to-the-point: given an array that has N
tab delimited fields ending in a number (day into the
year) I want to remove all lines not in the above
mentioned range. Rather than using a loop and split()
I thought it might be simplier to use grep():

@log = grep /[$beg-$end]\n$/, @log;

Back to the loop...

--
Douglas Clifton
Unix/C/Perl/CGI/HTML Programmer

===================
Web One Inc.
Website Development
Phone: 888-699-WEB1
Phone: 616-552-9999
Fax:   616-552-9920
sales@weboneinc.com
www.weboneinc.com
===================




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

Date: Fri, 23 Jan 1998 15:51:07 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Help with Stripping charactes from strings based upon patterns
Message-Id: <34C910CB.FB4672D3@houston.Geco-Prakla.slb.com>

Russell S. Virgilio wrote:
> 
> I have this string that looks like this, and I want to pull out everything
> after the .edu and also just the hm30_ leaving just the alias.  I am
> having trouble finding good documentation and would appreciate any help
> you gurus can dish out :)  Thanks in advance, here is a sample line
> 
> hme0  johnson.university.edu 255.255.255.255    07:00:20:8e:ef:5f
> 
First thought?

Split on whitespace and place in variables.  You can ignore any part
that you don't want/need (or substitute the same variable ($junk),
whatever).

$input = "hme0  johnson.university.edu 255.255.255.255   
07:00:20:8e:ef:5f";
$input =~ s/^\s+|\s+$//g;	# Remove all leading and trailing whitespace
($machine,$fqdn,$netmask,$IP) = split(/\s+/, $input, 4); # split on
whitespace
print "machine is:  $machine\n";	#print results
print "fqdn is:     $fqdn\n";
print "netmask is:  $netmask\n";
print "IP is:       $IP\n";


Prints out:
machine is:  hme0
fqdn is:     johnson.university.edu
netmask is:  255.255.255.255
IP is:       07:00:20:8e:ef:5f

You can do whatever you want to with it now.

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: 23 Jan 1998 21:49:17 GMT
From: cheung@cs.umn.edu (Hiu-Man Cheung)
Subject: Help!!! simple problem
Message-Id: <6ab38t$hv6@epx.cis.umn.edu>

Hi,

I want to write a perl script to do `man $cmd |less`
and my code will not stop at the first page, looks like `less`
never get executed. How to do this?

#!/usr/local/bin/perl -w
$cmd=$ARGV[0];
print (`man $cmd | less`);


--
Hiu-Man Cheung                     University of Minnesota 
email: cheung@cs.umn.edu     http://www.cs.umn.edu/~cheung
----------------------------------------------------------


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

Date: Fri, 23 Jan 1998 14:29:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dan Roberts <roberts_d@bms.com>
Subject: Re: HOw to check for file existence in each home directory of Unix users
Message-Id: <Pine.GSO.3.96.980123142926.17597Z-100000@user2.teleport.com>

On Thu, 22 Jan 1998, Dan Roberts wrote:

> What I need to do is check for the existence of a .forward file in each
> of my users homme directories.

Use the -f filetest. 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: Fri, 23 Jan 1998 22:23:39 GMT
From: John@3line.com
Subject: Looking to establish alliance with PERL programmer(s)
Message-Id: <6ab52p$cvj@bgtnsc02.worldnet.att.net>
Keywords: alliance partnership help $ relationship available

Hello All,

We are a small Web design firm in San Francisco with a ton of work. We
would like to expand our alliances with programmers. In the past our
process was as follows... we usually send an e-mail describing our
desired functionality (if necessary, we can call and talk one to one).
We then need a rough cost for proposal purposes. If we get the
contract, we will then confirm availability, timeline and payment
arrangements for project completion. 

If this sounds like a relationship you would like to establish, PLEASE
contact me to discuss further details. I'd like to stress that
dependability is very important.


Thank you for your time,

 ...JohnT
John@3line.com



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

Date: Fri, 23 Jan 1998 23:19:25 +0100
From: Hendrik Klompmaker <Hendrik.Klompmaker@net.iend.wau.nl>
Subject: Re: NS Communicator wrong filename extention with file download
Message-Id: <34C9176C.A7E3B652@net.iend.wau.nl>



Tom Phoenix wrote:

> On Thu, 22 Jan 1998, Hendrik Klompmaker wrote:
>
> [some Perl code snipped]
>
> > with IE3 and 4 and NS 3.0x this results in a download/open of the file
> > myfile.doc with the correct filename.
> > With Communicator 4.04 however it results in a download of myfile.exe
> > unless I shift-click on the link.
>
> If some browsers do what you want while another doesn't, the question is:
> Are you following the protocol? If you're not, it's your bug. If you are,
> it's the browser's bug. If you're not sure, you should re-check the
> protocol. If that doesn't tell you, you should ask in a newsgroup about
> the protocol. Good luck!
>

Lucky for me someone else replied by e-mail telling me this IS a NS bug. So I
don't have to find out the hard way ;-)

Hendrik

> --
> 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!



--
-----------------------------------------------------------------
|************** Wageningen Agricultural University. ************|
|  Department of Information Management and Datacommunication   |
-----------------------------------------------------------------
Hendrik Klompmaker: Senior Technologist
Internet          : Hendrik.Klompmaker@Net.IenD.Wau.Nl
X400              : c=nl;a=400net;p=surf;o=wau;ou1=IenD
                  : ou2=Net;s=klompmaker;gi=hendrik
Phone             : +31 (0)317-484059
Fax               : +31 (0)317-482970
Snail             : Dreijenplein 2
                    6703 HB Wageningen / The Netherlands
--------------------------------------------------------




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

Date: Fri, 23 Jan 1998 14:30:32 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Martin Osmundsvaag <martino@tor.hb.uib.no>
Subject: Re: Perl-script to binary?
Message-Id: <Pine.GSO.3.96.980123143016.17597a-100000@user2.teleport.com>

On 23 Jan 1998, Martin Osmundsvaag wrote:

> How to make a binary exe-file out of a perl script. 

Have you seen what the FAQ has to say about this?

-- 
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: Fri, 23 Jan 1998 14:28:55 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ilia  Lobsanov <lobsanov_family@email.msn.com>
Subject: Re: Please please help a beginner...
Message-Id: <Pine.GSO.3.96.980123142624.17597Y-100000@user2.teleport.com>

On Thu, 22 Jan 1998, Ilia  Lobsanov wrote:

> Hello, I'm new to Perl, and so my first program doesn't work...
> I would very much appreciate if you can tell me what is wrong with it.

What is it doing that you don't like?

> #!/usr/bin/perl

You should probably use warnings and 'use strict'.

> read(STDIN, $input, $ENV{'CONTENT_LENGTH'});

You should probably use CGI.pm (or a similar module).

> open (DATABASE, ">$database");

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

> @lines = <DATABASE>;

Hmmm... You opened that handle for output, but you're using it for input.

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: Fri, 23 Jan 1998 14:05:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: lbowen@vic.com
Subject: Re: possible reasons for broken pipe?
Message-Id: <Pine.GSO.3.96.980123135927.17597S-100000@user2.teleport.com>

On 22 Jan 1998 lbowen@vic.com wrote:

> the program usually stops running after the 10th loop (this varies
> somewhat) and I get a message from my Unix server of "broken pipe". 

That usually means that some of your output was going to a program which
was no longer listening to you. :-)

> I have a second question about the regexp:  I can't really understand
> the logic behind using the range [\w-\.]?  It seems as if just .* would
> serve the same purpose

   [\w-\.]	# matches letters, digits, underscore, hyphen, dot
   [\w\-.]	# perhaps a better way to write that
     .		# matches any non-newline (by default)

> --to match either www.aquafan.com, for example, or 209.50.230.65, for
> example.  However, I tried .* and it does not match anything.

Then you did it wrong. :-)

>        $AF_INET = 2;

It's a bad idea to hard-code constants that won't work on all systems. Use
the Socket module instead. (In fact, you should use LWP instead of doing
this all yourself. LWP is more-thoroughly debugged than your code. :-) 

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: Fri, 23 Jan 1998 14:25:53 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Michael Rocchetti <miker@miracle.net>
Subject: Re: relational operators and negative numbers
Message-Id: <Pine.GSO.3.96.980123142041.17597X-100000@user2.teleport.com>

On 23 Jan 1998, Michael Rocchetti wrote:

> I want to compare numbers and execute a bad_entry subroutine if b is greater
> than a.
> 
> The code looks like this:
> 
> &bad_entry if ($FORM{'b'} > $FORM{'a'});
> 
> this seems to work well when both a and b are positive numbers - but it 
> doesn't work when one or both of the numbers are negative.

Really? 

    sub bad_entry { 
	print "$FORM{b} seems to be greater than $FORM{a}\n"
    }
    $FORM{a} = -1;
    $FORM{b} = -5;
    # This should cause no action, since b isn't greater than a
    &bad_entry if ($FORM{'b'} > $FORM{'a'});
    $FORM{a} = -20;
    $FORM{b} = -7;
    # This should call the sub, since b is greater than a
    &bad_entry if ($FORM{'b'} > $FORM{'a'});

Works for me.

> Am I doing something wrong? 

Based on the evidence at hand, yes. :-)  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: 23 Jan 1998 22:37:12 GMT
From: darlenem@PAS.DE.SPAM.flash.net (Jeeves)
Subject: Re: Setting up a LaTeX->file->printer system...
Message-Id: <slrn6ci7va.gr2.darlenem@jeeves.flash.net>

Oops...someone wasn't looking where the slrn arrow was pointing. This should
have gone to comp.os.linux.misc. Sorry!



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

Date: Fri, 23 Jan 1998 17:05:26 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Simple Question - Hopefully!
Message-Id: <comdog-ya02408000R2301981705260001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34c8c658.0@news6.kcdata.com>, "Eric McClary" <eric@recordernews.com> posted:

>  I need to write a perl script that checks for a file (index.html) 
>in a certain directory and if it is not there jump to a subroutine.
>This should do it right?
>($rte= being the route)
>open(CHECK,$rte)||&nofile;                              
>But it doesn't work - any help would be appreciated.

why not something designed for the task:

   &nofile unless -e $file_name;

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>


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

Date: Fri, 23 Jan 1998 16:29:33 -0600
From: Ken Holm <rets@meta3.com>
To: Eric McClary <eric@recordernews.com>
Subject: Re: Simple Question - Hopefully!
Message-Id: <34C919CD.2781@meta3.com>

Eric McClary wrote:
> 
> Hi,
>   I need to write a perl script that checks for a file (index.html)
> in a certain directory and if it is not there jump to a subroutine.
> This should do it right?
> ($rte= being the route)
> open(CHECK,$rte)||&nofile;
> But it doesn't work - any help would be appreciated.
> 
> Eric McClary

Try this instead:

if (-T $rte) {
    open (IN, $rte);
    ...
} else {
    nofile();
}

exit;

-- 
Kennneth A Holm  |        META 3 - Webmaster        |webmaster@meta3.com
PO Box 1508      |----------------------------------|(601)718.1030 phone 
Jackson, MS 39215|PGP Key finger webmaster@meta3.com|(601)948.5999 (fax)


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

Date: 23 Jan 1998 16:57:11 -0500
From: Walt Sullivan  <walts@nortel.ca>
Subject: Re: Sys::Syslog
Message-Id: <yszhn2gmn9ag.fsf@bquah49f.ca.nortel.com>

Christoph Wernli <woerns@dwc.ch> writes:

> I've been trying to use the Sys::Sylog-module, but with no apparent
> reaction whatsover. 

> I don't get any output anywhere and, what strikes me odd, no complaints
> either. I checked for
> and they're all there.
> 
> And yes, I checked that I'm looking at the correct log file :-)
> 
> Any pointers as to where to start looking are greatly appreciated.

I'd check /etc/syslog.conf to see if syslogd is being told to store
"user" messages anywhere. If no line in /etc/syslog.conf starts with
"user", syslogd will silently log the messages to /dev/null. The
syslogd process is running, isn't it?

Also see "man 3 syslog" (the C function) and "man 1m syslogd".

I'm assuming you're on a *nix system, and using a good version of Perl
(you didn't say).

Walt



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

Date: Fri, 23 Jan 1998 14:19:59 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "N.A.F. McNelly" <nmcnelly@bu.edu>
Subject: Re: UNIX to %$$@! Win: Script Won't Go
Message-Id: <Pine.GSO.3.96.980123141812.17597W-100000@user2.teleport.com>

On Thu, 22 Jan 1998, N.A.F. McNelly wrote:

> Can't open first gif. at C:\perl\datef\test.pl
> line 9, <stdin> chunk 1.

> open (GIF,"start.gif") || die ("can't open first gif");

It would be nice if the error message told us why this is failing. :-)

    open GIF, "start.gif" or die "Can't open file 'start.gif': $!";

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: Fri, 23 Jan 1998 22:04:01 GMT
From: raul@homeontheweb.net (Raul Nohea Goodness)
Subject: Re: Win32 Perl date time ???
Message-Id: <34c90ef9.253797602@news.spacelab.net>

On Thu, 22 Jan 1998 16:59:07 GMT, Geoffrey Conner
<geoffrey.conner@gsc.gte.com> wrote:

>Anybody? -
>I am using build 314 of Active wares Perl port to Win 32.  I want to
>timestamp an entry to a log file as the entry is created.  I have a code
>snippet of using localtime to get the date information.  I am new to
>perl so am not exactly sure how to include the proper module to access
>this function, if it is something that is standard in the Active ware
>port, or is it a separate module that I must down load from another
>source.  Any help, guidance would be greatly appreciated.  Thanks in
>advance .
>
>Code Snippet:
<snip>
>use Time::localtime; 
<snip>
>when I run this using perl -w I get the following:
>Can't locate Time/localtime.pm in @INC .....


This is what I do. It works in any Perl, including ActiveWare. No
module declaration is needed.

($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
localtime(time);
$year = $year + 1900;

You can use the variable by name after that. Remember, $mday will be
the day of the month, and $year becomes the year - 100, thus the
second line.

This should be in PERL/DOCS/Perl/perlfunc.html under localtime in your
Perl for win32 distribution.

-Raul Goodness
raulg@escape.com




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

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

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