[9234] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2829 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 10 12:07:31 1998

Date: Wed, 10 Jun 98 09:00:24 -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, 10 Jun 1998     Volume: 8 Number: 2829

Today's topics:
        [META] hypersensitivity (was: Re: Command line substitu (Greg Bacon)
    Re: accessing a:\ (Clinton Pierce)
    Re: accessing a:\ <tchrist@mox.perl.com>
    Re: accessing a:\ (Ilya Zakharevich)
    Re: Capitalizing acronyms (Re: Is PERL case sensitive?) <jdporter@min.net>
    Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
    Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
    Re: Command line substitution thru subdirectories (Larry Rosler)
    Re: Command line substitution thru subdirectories (OS2 User)
    Re: Command line substitution thru subdirectories (Abigail)
    Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
    Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
    Re: Command line substitution thru subdirectories <tchrist@mox.perl.com>
    Re: Command line substitution thru subdirectories (Ilya Zakharevich)
    Re: END{} to dump object data. <hck@formalsys.ca>
    Re: How to "protect" cgi-bin scripts from view? <Unknown@perl.com>
    Re: localtime() and y2k <camerond@mail.uca.edu>
    Re: McCabe complexity analysis (John Moreno)
    Re: New module/pragma "enum.pm" (was "fields.pm") <zenin@bawdycaste.org>
    Re: open pipe? <aqumsieh@matrox.com>
    Re: pack/unpack seps <rs83@is7.nyu.edu>
    Re: Q? "print" directly to printer? <aqumsieh@matrox.com>
    Re: RADIUS Authentication w/ Perl <quentin@shaddam.amd.com>
        search problem in cgi script <beatrice.pastor@univ-brest.fr>
    Re: strings.. ptimmins@netserv.unmc.edu
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 10 Jun 1998 14:55:08 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: [META] hypersensitivity (was: Re: Command line substitution thru subdirectories)
Message-Id: <6lm6oc$4kr$2@info.uah.edu>

In article <6ll0it$l5n@mozo.cc.purdue.edu>,
	gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
: You know, there was a time when I used to auto-select your posts.
: 
: *plonk*

It's really disheartening to see such a high population of
hypersensitive crybabies in this newsgroup.  I'll be glad when the first
of July has come and gone.

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


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

Date: 10 Jun 1998 14:36:38 GMT
From: cpierce1@cp500.fsic.ford.com (Clinton Pierce)
To: steph@hotkey.net.au
Subject: Re: accessing a:\
Message-Id: <6lm5lm$oc59@eccws1.dearborn.ford.com>

In article <357E2477.36DF@hotkey.net.au>,
	Stephan Carydakis <steph@hotkey.net.au> writes:
>Clinton Pierce wrote:
>>
>>         opendir(DIR, "A:/") || die "Can't open A:/: $!\n";
>
>just a point, according to the camel, "or die" should be used instead of
>"|| die" because of precedence??

I stand by this code.

I learned to speak Perl under the regime of the Pink Camel.  I still 
use parens with my open()s and "or" is one of those new-fangled operators
that these yung-uns need.  Heck:

        opendir DIR, "A:/" or die "Can't open A:/: $!\n";

just looks so...so...disorganized.

The Blue Camel, however, doesn't say you "should" do it that way, anyways.

In the section on operators, the Camel says that "...you can safely use 
them after a list operator...".  That's a "can" and not a "should".  But,
back in the "Style" section, the authors clearly endorse the "or" instead
of "||" for use with list operators.  Or do they?  Back up two pages and
the example for "just because you can [...] doesn't mean you should":

	open(FOO, $foo) || die "Can't open $foo: $!";

On page 547.  Looks like at the time of the last editing, the authors were
still using the "open() || die" idiom, while somewhat endorsing the other.


-- 
+------------------------------------------------------------------------+
|  Clinton A. Pierce    |   "If you rush a Miracle Man,   | http://www.  |
|  cpierce1@ford.com    |     you get rotten miracles"    | dcicorp.com/ |
| fubar@ameritech.net   |--Miracle Max, The Princess Bride| ~clintp      |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P+++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*



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

Date: 10 Jun 1998 15:37:02 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: accessing a:\
Message-Id: <6lm96u$e1j$4@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, cpierce1@cp500.fsic.ford.com (Clinton Pierce) writes:
:	open(FOO, $foo) || die "Can't open $foo: $!";
:
:On page 547.  Looks like at the time of the last editing, the authors were
:still using the "open() || die" idiom, while somewhat endorsing the other.

I use ||.  Larry stands by or.  You heard both voices.

--tom
-- 
Someone who truly understands UNIX not only understands why "rm *"    
screws you, but understands why IT HAS TO BE THAT WAY.


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

Date: 10 Jun 1998 15:50:40 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: accessing a:\
Message-Id: <6lma0g$hhp$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Christiansen 
<tchrist@mox.perl.com>],
who wrote in article <6lm96u$e1j$4@csnews.cs.colorado.edu>:
>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, cpierce1@cp500.fsic.ford.com (Clinton Pierce) writes:
> :	open(FOO, $foo) || die "Can't open $foo: $!";
> :
> :On page 547.  Looks like at the time of the last editing, the authors were
> :still using the "open() || die" idiom, while somewhat endorsing the other.
> 
> I use ||.  Larry stands by or.  You heard both voices.

When I'm on a dumb terminal, I prefer reading `||'.  When
fontification is available, I prefer reading `or'.

Since most of the time I write (and quite often read) Perl code using
windowed Emacs, I write `or'.  ;-)

Ilya


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

Date: Wed, 10 Jun 1998 15:05:18 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Capitalizing acronyms (Re: Is PERL case sensitive?)
Message-Id: <357EA22C.5C84@min.net>

jimbo@soundimages.co.uk wrote:
> 
> Reuben remains correct. Although an acronym becomes a noun through
> common usage, which is a beautiful feature of English, it still
> retains it's origin as an acronym. This would certainly remain an

What do you know about English?
You put a superfluous apostrophe in "its".

John Porter


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

Date: 10 Jun 1998 13:18:16 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lm12o$6m9$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    xuming@email.unc.edu (Xuming Wang) writes:
:programmer.  but I am a newbie in programming and no one (until you,
:Uwe, thanks) told me where to get this non-Perl tool which is required

Perl comes from a tool-based worldview.  I have news for you: Perl is not
the answer to all programming problems.  The answer to virtually *all*
questions that begin, "Using Perl, can I write a program that does such
and such" is "Yes".  The answer to many of these is "Yes, but you don't
want to, because you should be using the toolbox."

If you don't have a toolbox, you have a problem.  You can't nearly
as productive.  Since you have nothing but a hammer, you start random
poundings, even on things that don't want to be pounded, which leaves
you screwed.

You cannot expect this newsgroup to tell you how to use the Hammer of
Perl to install a screw, clasp a glued-on bit till it sets, or sand off
a rough edge.  Hammers aren't the right answer here.  You need to get
other tools, too.  The monolith is wrong.  Build small things.

And no, I certainly didn't drink too much last night.  I am not much
of a drinker.  I doubt whether I've had a sip in the last month
or two.

--tom
-- 
     There is always a better way.
                     -- Thomas Edison


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

Date: 10 Jun 1998 13:38:40 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lm290$8ea$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
:You know, there was a time when I used to auto-select your posts.

Oh, I'm so very sorry.  I'll make sure to write someone a free text editor
next time they want to edit a file in perl, a free typsetter next time
they want to print a file in perl, a free webbrowser next time they want
to fetch something from the web in perl, a free directory lister next
time they want to scan a directory, a free syntax checker the next time
they want to compare C and C++ prototypes, a free spell checker the next
time they want to see whether they've got typos, a free grep program
next time they want to find a pattern in a file, and a free database
system next time they want quick access.

If you don't have tools, you can't program.  Don't make me use the
Hammer of Perl for things that you should be using the toolbox for.

CP/M et filii have no tools.  That's not my fault, and I am not going
to bust my butt emulating what every toolbox should have.  It's a waste
of my life.  

--tom
-- 
		"So much mail, so little time."  


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

Date: Wed, 10 Jun 1998 07:36:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <MPG.fe839aa59e403549896b1@nntp.hpl.hp.com>

[This followup was posted to comp.lang.perl.misc and a copy was sent to 
the cited author.]

In article <6lm290$8ea$1@csnews.cs.colorado.edu>, tchrist@mox.perl.com 
says...
 ...
> CP/M et filii have no tools.  That's not my fault, and I am not going
> to bust my butt emulating what every toolbox should have.  It's a waste
> of my life.  
 ...

Excellent toolboxes are available for Win32 systems.  They need to be 
located*, evaluated, purchased in many cases, and installed.

If I buy a car with a poor jack, I may not realize it until I try to fix 
a flat tire.  If the car then falls on me, it may be too late to correct 
the problem.

Similarly with command interpreters, text editors, or whatever.  Many of 
them come bundled with the OS, and users aren't aware that the tools are 
lame until they try to do real work. 

This is a matter of education.  We can help.  All we need is another 
acronym to go with RTFM and RTFFAQ :-)

* Not a commercial -- http://www.cygnus.com and http://www.mks.com are 
places to look.  MKS Toolkit is expensive (several hundred dollars!), but 
it or something like it is indispensable for a professional programmer 
seeking to be productive using Win32.

-- 
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com


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

Date: 10 Jun 1998 14:30:42 GMT
From: dsdapc03@DSDAPC03.okladot.state.ok.us (OS2 User)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lm5ai$555$1@artemis.backbone.ou.edu>

In article <6lkv4p$kvg$2@csnews.cs.colorado.edu> in comp.lang.perl.misc, dated 10 Jun 1998 03:39:05 GMT, Tom Christiansen (tchrist@mox.perl.com) wrote:
:  [courtesy cc of this posting sent to cited author via email]

: In comp.lang.perl.misc, 
:     xuming@email.unc.edu (Xuming Wang) writes:
: :C:\>find . -name '*.htm' | xargs perl -i.old -p -e "s/foo/bar/g"
: :FIND: Parameter format not correct
: :Bad command or file name

: Stop bitching about not having tools.  It's not our fault that you're
: too lazy, stupid, or rude to bother to install an operating system.
: You can't get any useful work done with your problem.  If you want
: to program, install a programming environment.  If you prefer to 
: watch MTV, you know where to find it.

<delurk mode="disgusted">

A really _great_ way to attract business to a Perl consultancy. 
Maybe you should go into advertising, too. And Human Relations
also might be a good choice.

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

"Courtesy" copy? I doubt it. Copy? probably. 

</delurk>

--
Mike Andrews
MAndrews@fd9ns01.okladot.state.ok.us



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

Date: 10 Jun 1998 15:07:09 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lm7et$id2$1@client3.news.psi.net>

Uwe Honekamp (uwe.honekamp@etas.de) wrote on MDCCXLIV September MCMXCIII
in <URL: news:01bd9431$4df397c0$931a0180@fe13803>:
++ 
++ Abigail <abigail@fnx.com> wrote in <6lkjq2$7vj$1@client3.news.psi.net>...
++ 
++ > $ find . -name '*.htm' | xargs perl -i.old -p -e "s/foo/bar/g"
++ 
++ On win32, however, you have to install a proper working find and xargs.
++ These (and more) can be found at www.cygnus.com/win32.

Of course. Or one uses Find::File to emulate find. I'm just pointing
out the algorithm. Porting to once specific OS is left as an exercise
for the reader.



Abigail
-- 
perl -pwle '$_ .= reverse'


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

Date: 10 Jun 1998 15:11:55 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lm7nr$e1j$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    dsdapc03@DSDAPC03.okladot.state.ok.us (OS2 User) writes:
:A really _great_ way to attract business to a Perl consultancy. 
:Maybe you should go into advertising, too. And Human Relations
:also might be a good choice.

I prefer to be a real person with real opinions who doesn't lie just
because it suits his pocket book and becomes a money-grubbing pig who
changes his words into lies to try to get more people to kiss his behind
and ante up.  I won't do that.  I do Perl because it's fun, not because
I want to become the next billgatesionaire.  If you can't take the heat,
get out of the kitchen.

--tom
-- 
    "The only reason for being a professional writer is that 
     you can't help it."
	--Wilson Mizner


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

Date: 10 Jun 1998 15:22:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lm8c8$e1j$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, abigail@fnx.com writes:
:Of course. Or one uses Find::File to emulate find. I'm just pointing
:out the algorithm. Porting to once specific OS is left as an exercise
:for the reader.

Moreover, the find2perl command takes arguments identical
to the standard find utility.

Why don't the C++ groups ever get questions like, "How do 
use C++ on all the files in all my directories recursively?"

Why don't the shell groups ever get questions like, "How do 
use the shell on all the files in all my directories recursively?"

Why don't the Fortran groups ever get questions like, "How do 
use Fortran on all the files in all my directories recursively?"

So why do we?  Are we special?  Who are we attracting?  Is it
time to change the honey?

--tom
-- 
"Though a program be but three lines long,
someday it will have to be maintained."


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

Date: 10 Jun 1998 15:26:10 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lm8ii$e1j$3@csnews.cs.colorado.edu>

In comp.lang.perl.misc, I wrote:
:Why don't the C++ groups ever get questions like, "How do 
:use C++ on all the files in all my directories recursively?"

On the other hand, I *do* note that the html groups get questions like,
"How do I html all the files in all my websites recursively?"

I begin to smell a connection.

--tom
-- 
: There may be 2 or three ways to perform a particular task, but there will
: not be 10,000 as there are in perl.
I think you may be exaggerating slightly.  Perl isn't that good yet.
        -- Larry Wall, 5 Jun 91 5:11:004GMT


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

Date: 10 Jun 1998 15:47:56 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Command line substitution thru subdirectories
Message-Id: <6lm9rc$h71$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Tom Christiansen 
<tchrist@mox.perl.com>],
who wrote in article <6lm8c8$e1j$2@csnews.cs.colorado.edu>:

> Why don't the C++ groups ever get questions like, "How do 
> use C++ on all the files in all my directories recursively?"
> 
> Why don't the shell groups ever get questions like, "How do 
> use the shell on all the files in all my directories recursively?"
> 
> Why don't the Fortran groups ever get questions like, "How do 
> use Fortran on all the files in all my directories recursively?"
> 
> So why do we?  Are we special?  Who are we attracting?  Is it
> time to change the honey?

Yes.  Perl is special.  Perl has pfind (looking into your examples of
using tcgrep, I see that it may have many similar features).

Ilya


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

Date: Wed, 10 Jun 1998 12:39:47 -0300
From: Colin Kilburn <hck@formalsys.ca>
Subject: Re: END{} to dump object data.
Message-Id: <357EA8C3.830B8217@formalsys.ca>

 I now have the answer I was looking for:  da,

sub DESTROY
{
  my $self = shift;
  $self->PutDataToDiskForReInitializingObjectOnNextInvocation();
}
__END__

I was confused because I didn't know that DESTROY{} can access the
calling object whereas END{} can't.

Simple when you know the answer.

Is there anything wrong with dumping the  object's data to disk this way?
ie. Just before the object goes out of scope .

Thanks for the help,
Colin

=================================================================
= Colin Kilburn   -  FSI Softwre Developer  -  hck@formalsys.ca =
= Fredericton NB  -  phone 506 433 0300     -  fax 506 433 0300 =
=================================================================





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

Date: Wed, 10 Jun 1998 14:28:35 +0100
From: Unknown <Unknown@perl.com>
Subject: Re: How to "protect" cgi-bin scripts from view?
Message-Id: <357E8A03.1B12@perl.com>

jr32@hotmail.com wrote:
> 
> Hi...
> 
> ...
> So my question is: How can I keep my scripts safe, so people can't pull
> up the contents of the cgi-bin in the browser window (eg: Open Location:
> http://www.mydomain.com/cgi-bin), look at the scripts and know such
> Best,
> 
> RF

Correct me if I am wrong - I'm sure someone will ;) - but files
in your cgi-bin will be executed by your web server when called, not
served as text. Hence people will only be able to run your scripts
when they call http://www.mydomain.com/cgi-bin/whatever 
not actually see the contents of the scripts. - this means you dont need 
to worry about .htaccess at all :)

Cheers,JC


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

Date: Wed, 10 Jun 1998 08:14:33 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
To: Chris <chris@bcadventure.com>
Subject: Re: localtime() and y2k
Message-Id: <357E86B8.3CFB7777@mail.uca.edu>

[cc'd to c]

Chris wrote:
> 
> The perl script command:
> localtime(time)
> 
> Will give a 2 digit date [yada, yada] Am I missing something here?
> Is there a better way to get the local year in a 4 digit format?

Well, if you want to make things completely general, you could use
conditionals:

if ($country eq "Israel") { $date = $date + $whatever_Hebrew}
if ($country eq "China") {$date = $date + $whatever_Chinese}

etc.

Of course, there probably are some locales in which the year should be
in a _5-digit_ format, so you have a y10k situation (yes, we've
discussed this before).

Cameron
camerond@mail.uca.edu


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

Date: Wed, 10 Jun 1998 14:27:32 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: McCabe complexity analysis
Message-Id: <1daekyh.1u7dghq3264akN@roxboro0-018.dyn.interpath.net>

Tom Christiansen <tchrist@mox.perl.com> wrote:

>  [courtesy cc of this posting sent to cited author via email]
> 
> In comp.lang.perl.misc, 
>     Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels) writes:
> :Why do even respected authors (and many more programming
> :standards documents) state that you should write (in 'C'):
> :
> : handle = fopen(file_name, mode);
> : if (handle == NULL) return -1;
> :
> :instead of the much more elegant:
> :
> : if ((handle = fopen(file_name, mode)) == NULL)
> :     return -1;
> 
> I wonder why these allegedly respected authors seem
> to thing there's some different between 
> 
>     if (p) 
> 
> and 
> 
>     if (p == NULL)
> 
> When of course, there isn't.

Well, one of the reasons is probably because it helps keep mistakes like
the above from happening.  :)

-- 
John Moreno


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

Date: 10 Jun 1998 13:10:37 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: New module/pragma "enum.pm" (was "fields.pm")
Message-Id: <897484726.861529@thrush.omix.com>

[posted & mailed]


Mike Stok <mike@stok.co.uk> wrote:
: >      use enum qw(One Two Three Four);
: >      # One == 1, Two == 2, etc
: How does it know that One is 1 yet Sun is 0 or is it a doc bug?

	Documentation bug.  There should be a Zero tag there unless One
	is forced to 1 with:

	use enum qw(One=1 Two Three Four);

	It's what I get for doing the documentation on almost no sleep. :-)

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Wed, 10 Jun 1998 11:24:08 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: open pipe?
Message-Id: <357EA518.A2B41CF1@matrox.com>

Ken Quinn wrote:

> #! /usr/local/bin/perl -w
> $user = <STDIN> ;

$user contains whatever the user entered, plus a carriage return character.
That is why your path is wrong! You should fix that first.

chomp($user = <STDIN>);

> open(DATA, '</root/dbfile') ;

Always check the result of your open()!!

> my @subs = <DATA> ;
> foreach my $line (@subs)
> {
> if($line =~/^$user\s/) {
> open(FILE, "|/home/$user/usr/local/bin/program.pl") ;

Again .. check the result of the open() ..

> print FILE "$line \n" ;
> close FILE ;

 .. and the close()!

> }
> }

 Hope this helps!

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





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

Date: Thu, 11 Jun 1998 11:39:17 -0400
From: Ruben I Safir <rs83@is7.nyu.edu>
Subject: Re: pack/unpack seps
Message-Id: <357FFA24.CAA1BAB8@is7.nyu.edu>

I started with the "CAMEL" book which did not explain the differences in
behavior I see.  In fact, I'm generally diappointed with it.
man perl is usually more detailed.

How many bits does a1 read as opposed to c.  They are definetely
interpreting things differently.  In addition, I think the question was
*****unpack which definetely behaves differently.



Ruben I Safir


Deva Seetharam wrote:

> Ruben I Safir wrote:
>
> > Does anyone know what the difference between
> > the a1 and c is in unpack?
> >
> > Ruben
>
> a - Ascii string, null padding.
> c - char value.
>
> pack "c2", 69,70;                    # "EF"
> pack "a6", "a", "b", "c", "d";      # "abcd\0\0" - Notice the null
> padding.
>
> Please refer to camel book, for complete list/discussion.
>
> Deva





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

Date: Wed, 10 Jun 1998 10:57:34 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Q? "print" directly to printer?
Message-Id: <357E9EDE.326FEA2F@matrox.com>

Brian Fritz wrote:

> I'm working on a script that is intended to format text files and
> print them directly to the printer. This script will be used on both NT
> (Win32) and Linux platforms.
>
> I didn't find any examples in my books, FAQs, and my two favorite Perl
> Wizards didn't know how to open a file handle to a printer either.
>
> Is there a way to open a file handle that is assigned to a parallel
> port for output?
>
> TIA,
>
> Brian

Not sure about winblows .... but on unix/linux you can do the following:

    open LPR, "| lpr" or die "Can't open LPR: $!\n";
    print LPR $whatever_you_want;
    close LPR or die "Can't close LPR: $!\n";;

--
Ala Qumsieh             |  No .. not just another
ASIC Design Engineer    |  Perl Hacker!!!!!
Matrox Graphics Inc.    |
Montreal, Quebec        |  (Not yet!)





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

Date: 10 Jun 1998 09:32:00 -0500
From: Quentin  Fennessy <quentin@shaddam.amd.com>
Subject: Re: RADIUS Authentication w/ Perl
Message-Id: <ximra0xjpjz.fsf@shaddam.amd.com>


>>>>> "EM" == Eric Mason <emason@shell.flinet.com> writes:
    EM> Does anyone have any subroutines for Perl to interact with
    EM> RADIUS.  Maybe a subroutine, or an idea of how to do it.  I

Check out CPAN for the RADIUS module.  They may help. Here are
a few lines from the pod docs in RADIUS-1.0:

     RADIUS::Packet - Object-oriented Perl interface to RADIUS
     packets

     RADIUS::Dictionary - RADIUS dictionary parser

-- 
Quentin Fennessy			AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals


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

Date: 10 Jun 1998 13:33:43 GMT
From: "bea" <beatrice.pastor@univ-brest.fr>
Subject: search problem in cgi script
Message-Id: <01bd9474$531145c0$243434c1@gea1.univ-brest.fr>

Hello

I'm new in programming CGI scripts in perl and I've a problem with one
called
"Internet Phonebook" from http://www.itm.com/cgicollection.

If you only write one or two characters for the search, your script searchs
all the words which contain those characters.

I'd like to know what is the syntax for a search only on the beginning of a
word.

For example : 
	Last name : "le"
	First name : ""
Result of the search : only the last names which begin by "le" and not
those which contain "le".

Many thanks for your help.



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

Date: Wed, 10 Jun 1998 14:04:34 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: strings..
Message-Id: <6lm3pi$e7i$1@nnrp1.dejanews.com>

In article <357e33a4.2122672@news.tc.umn.edu>,
  ames0009@tc.umn.edu (Todd C. Ames) wrote:
>
> On 10 Jun 1998 06:41:23 GMT, aajii@aajii.ton.tut.fi (Antti-Jussi
> Korjonen) wrote:
>
> >How would I easily determine, if a string contains only digits or
> >alphabets and nothing else?
> >
> >--
> >
>
> Depends what you are trying to do, but one way would be to use =~ with
>
> /D     matches anything other than a  digit
>
> if ($yourstring =~ /\D/) {
> 	do stuff;
>
>  #if the string contained any non-digit it would return true.
> so this would tell you whether or not the string contained only
> digits.
>
> if ($yourstring =~ /[^a-zA-Z]/) {
> 	do stuff;
>
> #this would return true if any non letter was matched,
> thus you would know that the string is NOT all letters.
>
> That's one way - I'm sure not the best.
>
> T. Ames
>
> >>>>>>>>>>>>>>>>>>>
> Todd C. Ames
> ames0009@tc.umn.edu
> University of Minnesota
>

Nee! ..... Nee!

This doesn't seem very useful in regard to the original question. The poster
wanted to know "How would I easily determine, if a string contains only
digits or alphabets and nothing else?" Both of your suggestions allow for
strings that contain digits plus other characters or letters plus other
characters (or letters and digits together, for that matter).

If someone asks you "What is the air speed velocity of a stone-laden swallow?"
and your response is "It's not yellow!", you'd be tossed into the gorge before
you knew what hit you. :)

One answer that works is:

if ($yourstring =~ /^\d+$/) {print "It's all numbers.\n";}
if ($yourstring =~ /^[a-zA-Z]+$/) {print "It's all letters.\n";}

Now, as a test: You must find us a ....
shrubbery!
(one that looks >
<input type=

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

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

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