[7933] in Perl-Users-Digest
Perl-Users Digest, Issue: 1558 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 31 16:07:24 1997
Date: Wed, 31 Dec 97 13:00:25 -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 Wed, 31 Dec 1997 Volume: 8 Number: 1558
Today's topics:
Re: 'flock'ing <tcm@tcmd.com>
Re: Hashes - Heres my try, can you help me to tidy it u <jims@online-marketing.com>
Re: Hashes and reverse-lookup (Josh Kortbein)
Help with Filehandles <ramirez@doc.mssm.edu>
How Do I Determine A Variable's Type? (Gary Affonso)
Re: How Do I Determine A Variable's Type? <jims@online-marketing.com>
Re: How to get unique list value <jdporter@min.net>
Re: importing subroutines <jdporter@min.net>
instructions for using curses library <dev@sgi.net>
Re: instructions for using curses library (Mike Stok)
Re: Newbie question <alecto@pe.mungedaddr.net>
Re: Newbie question <pjach@erac.com>
Re: Novice needs advice <jdporter@min.net>
Re: Perl 5 and Win95 (Troy Denkinger)
perl bug or feature? (Lloyd Vancil)
Re: Perl editor needed scott@softbase.com
Re: Perl location (Jonathan Stowe)
Re: Perl5 on NT4 with IIS4 <scott_clark@merck.com>
Re: reading in passwords <eryq@zeegee.com>
Screen Resolution <alphamorgan@hotmail.com>
Re: Screen Resolution (brian d foy)
Search and replace questions (Pete Holsberg)
Re: Search and replace questions (Pete Holsberg)
Re: SSI and FrontPage98 under IIS3 <scott_clark@merck.com>
Re: Stripping non-alphanum's from within string? (Jonathan Stowe)
Re: Testing for null and spaces <jdporter@min.net>
Re: timing subroutines <dev@sgi.net>
Re: undefined value snailgem@aol.com
What does tr|A-Za-z0-9+/| -_| do? <altitude@ren.us.itd.umich.edu>
Re: What does tr|A-Za-z0-9+/| -_| do? (Mike Stok)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 31 Dec 1997 13:58:48 -0500
From: "Ernie Johnson" <tcm@tcmd.com>
Subject: Re: 'flock'ing
Message-Id: <68e48i$pc0$1@nr1.toronto.istar.net>
>> after following some flock implemenations I set it into use, but within a
>> few hours, had erased data...
>>
>The problem is that, *between* the open and the flock, another process may
>have written to the file. You need to make sure that you are actually at
the
>end of the file when you append. The Camel has an example on page 166 -
>something like:
>
>open the file
>flock handle, 2 # now you're in control
>seek handle, 0, 2 # so make sure you're really at the end
>write new data
>close file
Actually, I forgot to indicate that I have tried the process with the seek
in place.. still no luck.
In response to a direct email I received on the problem, here is part of it:
>> *) your file is accessed through NFS (flock() don't work well with NFS)
NFS? Isn't that a file system of the drive?
Anyway, anyone have a good, and reliable solution for non-flock on unix
sytems? Right now, I'm back to a timed loop to see if a lock file clears
and if so, proceed with its work, but if it doesn't clear after 15 seconds
it wipes out the lock in case of a prior crash of sorts and continues.
Ernie Johnson
TCM Online
tcm@tcmd.com
------------------------------
Date: Wed, 31 Dec 1997 14:15:20 -0500
From: Online Marketing Company <jims@online-marketing.com>
Subject: Re: Hashes - Heres my try, can you help me to tidy it up !
Message-Id: <34AA99C8.5320@online-marketing.com>
Jerry Pank wrote:
>
> I am trying to do a basic search through a document counting duplicated
> words and display the results in (repeat count) order.
>
> There must be a way to sort the hash on values displaying :
> keys,values in value order (in a better way than I have).
Of course if you want something readable... :)
#! /usr/bin/perl5
use strict ;
my ( %hash ) ;
$_ = "egg egg bacon bread egg fried chips"; # its early morning !
map { $hash{$_}++ } split ;
map { print "$hash{$_} $_\n" } sort { $hash{$b} <=> $hash{$a} } keys
%hash ;
------------------------------
Date: 31 Dec 1997 18:09:49 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Hashes and reverse-lookup
Message-Id: <68e1pd$508$1@news.iastate.edu>
Tom Phoenix (rootbeer@teleport.com) wrote:
: On 24 Dec 1997, Josh Kortbein wrote:
: > I've tried both a normal array and an associative array for my
: > dictionary/string table, but neither seems to do what I want. The
: > problem I've encountered is that I need to be able to lookup elements
: > both by key and by value,
: I think your table needs to map small integers to strings - is that right?
: In that case, you could probably keep an array for the forward mapping and
: a hash for the reverse. Whenever you add an element, you'll want to add it
: to both, maybe something like this.
: $newstring = 'str';
: $rev{$newstring} = @fwd; # add number to hash
: push @fwd, $newstring; # add string to array
: Now, you can find the index for 'str' by evaluating $rev{'str'}. If you
: look under that index in @fwd, you'll get 'foo'.
A followup, for anyone actually interested:
It turns out that my code -> string mapping was in fact one-to-one, so
I was able to maintain two tables, a "normal" table and a reversed
table, for (suprise, suprise) reverse lookups. This turned out to be
FAR faster than my old method.
I actually did this based just on Tom's suggestion to keep two tables, one
for reverse lookups - I failed to notice that he used a normal list for
one of the tables. In retrospect, that should work just as well, and
there may be a speed/memory difference when one table is a simple list.
The downside is that Tom's way forces you to think of this string-lookup
in a manner that deviates slightly from the way my compression code
algorithm expects you to. The confusion clears up in a minute or so,
though, so Tom's method is clearly better if it performs more
efficiently. :)
Thanks to everyone who offered suggestions.
Josh
--
___________________________________________________________________________
"So, would you say it's about time for our viewers to... crack each others'
heads open and feast on the goo inside?"
"Yes. Yes I would, Kent."
------------------------------
Date: Wed, 31 Dec 1997 15:15:07 +0000
From: "Edwin S. Ramirez" <ramirez@doc.mssm.edu>
Subject: Help with Filehandles
Message-Id: <34AA617B.70218AEF@doc.mssm.edu>
Hello,
I am having problems implementing an event driven program which blocks
until data arrives in one of its file handles (STDIN or socket). I
tried to use the fcntl function to set the F_SETOWN flag which claims
that it will signal with a SIGIO but it does not work.
fcntl(fileno(STDIN), F_SETOWN, $$); -- Bad File Number
I have set a function to be triggered on SIGIO and SIGURG but neither
one is triggered when input is sent.
Does anyone have any ideas?
Thanks,
Edwin S. Ramirez
------------------------------
Date: Wed, 31 Dec 1997 11:05:25 -0800
From: garya@printingcontrol.com (Gary Affonso)
Subject: How Do I Determine A Variable's Type?
Message-Id: <garya-3112971105250001@204.57.193.68>
Here's my problem:
I have a subroutine that takes a Hash as input. The values corresponding
to each of the Hash keys can be of varying types. Some of the values in
the hash could be scalars, others could be lists. The subroutine that
processes this hash needs to react differently based on the type of value
associated with each key. I've looked through the Camel book, the Perl
FAQ and through this newsgroup and haven't found anything that talks about
how to determine a variable's type.
Apologies if this information is obviously available and I've simply
failed to find it.
Thanks in advance for any help!
Gary Affonso
Printing Control Services, Inc.
------------------------------
Date: Wed, 31 Dec 1997 14:20:45 -0500
From: Online Marketing Company <jims@online-marketing.com>
To: Gary Affonso <garya@printingcontrol.com>
Subject: Re: How Do I Determine A Variable's Type?
Message-Id: <34AA9B0C.1FDD@online-marketing.com>
Gary Affonso wrote:
>
> Here's my problem:
>
> I have a subroutine that takes a Hash as input. The values corresponding
> to each of the Hash keys can be of varying types. Some of the values in
> the hash could be scalars, others could be lists. The subroutine that
> processes this hash needs to react differently based on the type of value
> associated with each key. I've looked through the Camel book, the Perl
> FAQ and through this newsgroup and haven't found anything that talks about
> how to determine a variable's type.
>
> Apologies if this information is obviously available and I've simply
> failed to find it.
>
> Thanks in advance for any help!
>
> Gary Affonso
> Printing Control Services, Inc.
try the ref command
------------------------------
Date: Wed, 31 Dec 1997 15:01:21 -0500
From: John Porter <jdporter@min.net>
Subject: Re: How to get unique list value
Message-Id: <34AAA491.3C37@min.net>
Terry Michael Fletcher - PCD ~ wrote:
>
> i thought using a hash slice (mmm, tasty) seemed pretty cool:
>
> @uniq = keys %{ local @temp{@list} = @list; \%temp };
>
> but i can't get rid of the %temp hash. anyone know how to declare an
> anonymous hash slice? it seems there's no way to tell perl that the curly
> braces are actually indexing a hash, without naming the hash. too bad
> this doesnt work:
>
> @uniq = keys %{ { ->{@list} = @list } };
>
> or this:
>
> @uniq = keys %{ ({}->{@list}) = @list };
>
Or, in general, using an anonymous thingy twice, in two or more
different
ways. These statements compile without complaint:
{}->{'a'} = 0;
{}->{'b','c'} = ( 1, 2 );
[]->[0] = 'a';
[]->[1,2] = ( 'b', 'c' );
To make use of the hash-ref or array-ref after assignments like these,
the expression would have to evaluate to the reference; and these
assignments don't.
Also,
@{ [] } = ( 1, 2 );
compiles, and even though
%{ {} } = ( a => 1, b => 2 );
does not, this does, and is probably "right":
%{ +{} } = ( a => 1, b => 2 );
See page 247 of the Camel.
Seems to me that typeglobs might be useful here; but I don't know how
to get the symbol table entry of a temporary anonymous reference.
John Porter
jporter@logicon.com
------------------------------
Date: Wed, 31 Dec 1997 14:31:26 -0500
From: John Porter <jdporter@min.net>
Subject: Re: importing subroutines
Message-Id: <34AA9D8E.5FDB@min.net>
John Tannahill wrote:
>
> I have just spent quite a while trying to figure out how to call a perl
> subroutine that is
> in one file from a perl program in another file. I have tried various
> "use" commands,
> but I keep getting the following error message:
>
> Undefined subroutine &main::seait ...
>
> There must be a simple way to do what I want?
>
> Thanks,
> John Tannahill
>
That's wierd -- I have *never* gotten that error message! ;-)
(Ok, I have too much time on my hands...)
------------------------------
Date: Wed, 31 Dec 1997 19:21:42 GMT
From: "Devin P. Anderson" <dev@sgi.net>
Subject: instructions for using curses library
Message-Id: <34AA9BEC.1FEE@sgi.net>
Where can I get some good instructions on how to use the curses module?
All I want to do is read in some test for a password without it being
echoed back. I just need a listing or something of the functions.
Thanks-
--- @
Devin P. Anderson Happy Holidays * *
Webmaster, Systems Administrator from * ' *
Stargate Industries, Inc. Network Operations * ',` *
http://www.sgi.net/ *', `,
*
Phone: 412.930.STAR (7827) ext. 241
***********
F a x: 412.930.7110 ***
&& ***
&&
#=#=#=#=#=#=#=#=#=#=#
"Prehaps today *is* a good day to die. Ramming speed."
-Lt. Worf
-----PGP PUBLIC KEY AVAILABLE-----
------------------------------
Date: 31 Dec 1997 15:19:10 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: instructions for using curses library
Message-Id: <68e9bu$abm$1@stok.co.uk>
In article <34AA9BEC.1FEE@sgi.net>, Devin P. Anderson <dev@sgi.net> wrote:
>Where can I get some good instructions on how to use the curses module?
>All I want to do is read in some test for a password without it being
>echoed back. I just need a listing or something of the functions.
There should be a file called demo in the distribution, the function names
seem to be similar to thise described in the (n)curses manual page. There
is a routine called Curses::noecho, and the @EXPORT array in the Curses.pm
file contains a list of things it exports.
Hope thie 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@colltech.com | Collective Technologies (work)
------------------------------
Date: 31 Dec 1997 20:21:20 GMT
From: alecto <alecto@pe.mungedaddr.net>
Subject: Re: Newbie question
Message-Id: <68e9g0$p6c$1@nntp.pe.net>
Blaine Owens <bowens@eastman.com> wrote:
>I have a perl script which reads a file and parses out particular fields to
>produce a report. One of the fields is like "(45.0%)" but I would like for
>it to be just "45.0" in the report. What is the best way to strip the
>leading "(" and the trailing "%)"? Thanks.
try:
#! /usr/bin/perl -w
$foo = "(45.0%)" ;
$foo =~ s/[()%]//g;
print "$foo\n";
------------------------------
Date: Wed, 31 Dec 1997 14:36:45 -0600
From: "Phil Jach" <pjach@erac.com>
Subject: Re: Newbie question
Message-Id: <34aaacdf.0@news1.ibm.net>
Try this
$var = "(45.0%)";
print "$var\n";
$var = substr($var, 1, 7);
print "$var\n";
$var = substr($var, 0, 4);
print "$var\n";
That's how I strip characters out. There might be a better way but this
works for me in the programs I write. I use it a little differently. I use
it with arrays and such but this should be a starting point.
Blaine Owens wrote in message
<01bd15ef$35d720a0$13e288a8@PC83610221.kpt.emn.com>...
>I have a perl script which reads a file and parses out particular fields to
>produce a report. One of the fields is like "(45.0%)" but I would like for
>it to be just "45.0" in the report. What is the best way to strip the
>leading "(" and the trailing "%)"? Thanks.
>--
>Blaine Owens
>bowens@eastman.com
------------------------------
Date: Wed, 31 Dec 1997 14:21:28 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Novice needs advice
Message-Id: <34AA9B38.4A32@min.net>
David Perdue wrote:
>
> while (($FST,$LST) = each(%ARR))
> {
> print(LIST "$FST:$LST"); # write the record
> }
> close(LIST);
>
I bet you want a \n in the above print statement, which the
one below has.
>
> while (($FST,$LST) = each(%ARR))
> {
> print(LIST "$FST:$LST\n");
> close(LIST);
> open(LIST, ">>listfile");
> }
------------------------------
Date: Wed, 31 Dec 1997 19:27:14 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: Perl 5 and Win95
Message-Id: <68e6q2$a7v$1@nntp3.interaccess.com>
cc'ed via email
In article <34A96AB1.9016E51E@wenet.com>, amazon@wenet.com wrote:
[snip]
>Question is: what are my best options? I'm finding
>lots of downloads for Perl on Win32, and I've been
>told Win32==Win95....yet another doc I've found
>says that Perl has problems with Win95, and one has
>to hand-edit several files to get it to function.
Go to your local CPAN site and look in
/pub/lang/perl/CPAN/authors/id/GSAR and you'll find Perl 5.004_02
where you will find a binary distribution for Win32.
I've installed this on both W95 and NT and had no problems except in
the pTk modules, which I'm working on fixing. I do believe that some
facets of Perl will not be available to you on W95, but you should
have more than enough to do CGI stuff.
Regards,
Troy Denkinger
------------------------------
Date: Wed, 31 Dec 1997 19:34:05 GMT
From: lev@dartm.com (Lloyd Vancil)
Subject: perl bug or feature?
Message-Id: <34aa9cdc.245721681@news.pacbell.net>
If a file handle is opened but not closed
and the script does not have a specific exit line
it appears that the file handle stays in memory
Perl 5004 Solaris 2.6
I have a random graphic selector for my web site. After
several thousand runs, the IPC service respondes with
too many files open error.
Adding a Close (filehandle); to the script seems to have
cleared the problem, but it seems to this old head
that since the pid of the sript exits and the pid
of that instantation of perl exits the filehandle should die.
What am I missing here?
L.
------------------------------
Date: 31 Dec 1997 17:03:19 GMT
From: scott@softbase.com
Subject: Re: Perl editor needed
Message-Id: <68dtsn$m96$4@mainsrv.main.nc.us>
James Hurd (jhurd@indiana.edu) wrote:
> : Learning Emacs is a good
> : investment in your programming career...
> When I first began writing Perl and Java, I resisted
> learning Emacs.When I finally broke-down andd beganb toi learn it;
> it made things so much easier.
Emacs is particularly good for beginners in various languages,
particularly Perl, because its syntax highlighting and autoindent
modes help you notice screwups sooner. When something turns
the *wrong* color, or the indention starts getting really
weird looking, you know you made a syntx error somewhere
in your source. Since Perl has more syntax and more funny
punctuation than a lot of languages, it's more important.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: 31 Dec 1997 20:17:50 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl location
Message-Id: <68e99e$1mu$1@uranium.btinternet.com>
In article <Pine.SOL.3.96.971231090137.14986B-100000@dsysadm01>,
s9ulzf@fnma.com says...
>
>Hi,
>
>Is it possible to ask a perl program to search for perl in multiple
>locations? For example,
> try
> #!/user/local/perl
>
> first and if not found then try
>
> #!/usr/opt/bin/perl?
>
In certain environments (such as the gnu bash shell) it would be possible to
just do:
#!perl
and the shell will search the PATH to find the executable but this cannot be
relied on for all platforms. It might I suppose be possible to write
another version of the invocation you might use if you had a system that
wont do #! ( you know the one that goes:
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}
if $you_have_a_lousy_shell;
)
But it has to be valid code for both perl and your shell and I'd rather not
think about that kind of stuff right now - I want to have a good night out.
Happy New Year | Hogmanay | 1 January | whatever
Jonathan
------------------------------
Date: Wed, 31 Dec 1997 15:31:30 -0800
From: scott clark <scott_clark@merck.com>
Subject: Re: Perl5 on NT4 with IIS4
Message-Id: <34AAD5D2.B3F@merck.com>
Mario Abela wrote:
>
> Can anyone help me setting up Perl5 to run under IIS4 on NT or from where I
> can get the info to set it up?
>
I'll assume you already have Perl5 running command line scripts...
Believe it or not Microsoft has a good Article on the subject:
try this the following URL...
http://support.microsoft.com/support/kb/articles/Q150/6/29.asp
-scottyc
The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, Merck & Co., Inc. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
------------------------------
Date: Wed, 31 Dec 1997 12:39:22 -0500
From: Eryq <eryq@zeegee.com>
To: "Devin P. Anderson" <dev@sgi.net>
Subject: Re: reading in passwords
Message-Id: <34AA834A.6D72@zeegee.com>
Devin P. Anderson wrote:
>
> How can you read from STDIN and not display what is being typed on the
> screen? Like a password. Is this possible though a socket?
I think you want the Curses module from the CPAN.
Try http://www.perl.com/CPAN , and get a copy of the Perl5
Module List.
HTH,
--
___ _ _ _ _ ___ _ Eryq (eryq@zeegee.com)
/ _ \| '_| | | |/ _ ' / President, Zero G Inc: http://www.zeegee.com
| __/| | | |_| | |_| | "Talk is cheap. Let's build." - Red Green.
\___||_| \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
|___/ |______/ of the homeless: http://www.streetwise.org
------------------------------
Date: 31 Dec 1997 19:21:11 GMT
From: "AlphaMorgan" <alphamorgan@hotmail.com>
Subject: Screen Resolution
Message-Id: <01bd1621$3841a540$4a024ad1@default>
I'm designing a high school web page and it needs to be able to determine
what resolution the client is using. I believe that there are environment
varibles for this, but i'm not sure. Eventually i would like to be able to
automatically load the main page that works w/ their current resolution.
Could someone out there please tell me how to do this?
--
-christopher morgan
-alphamorgan@hotmail.com
-ICQ UIN 1688728
------------------------------
Date: Wed, 31 Dec 1997 14:34:31 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Screen Resolution
Message-Id: <68e6ba$7dt@bgtnsc03.worldnet.att.net>
Keywords: just another new york perl hacker
In article <01bd1621$3841a540$4a024ad1@default>, "AlphaMorgan" <alphamorgan@hotmail.com> posted:
> I'm designing a high school web page and it needs to be able to determine
> what resolution the client is using. I believe that there are environment
> varibles for this, but i'm not sure. Eventually i would like to be able to
> automatically load the main page that works w/ their current resolution.
> Could someone out there please tell me how to do this?
besides having nothing to do with Perl, it's a pointless pursuit. screen
resolution is not browser window size, which is the information that
you are after.
--
brian d foy <http://computerdog.com>
------------------------------
Date: 31 Dec 1997 15:07:34 -0500
From: pjh@mccc.edu (Pete Holsberg)
Subject: Search and replace questions
Message-Id: <68e8m6$fsv@tecoma.mccc.edu>
Happy New Year to everyone!
I have a file that has lines like this:
<FONT SIZE=+1>AC 106 Office Accounting I 3</FONT>
<FONT SIZE=+1>EG 222 Literature II 3</FONT>
etc.
I would like to change them to:
<FONT SIZE=+1><a href="/cgi-bin/pick.cgi?AC106">AC 106</a> Office Accounting I 3</FONT>
<FONT SIZE=+1><a href="/cgi-bin/pick.cgi?EG222">EG 222</a> Literature II 3</FONT>
But I haven't found an elegant way to do this...and I keep
running into problems with that darned "?"!!
I tried to isolate "(SIZE=+1)" and "([A-Z]{2}) (\d{3})" as
three variables. And I have defined
my $cgivar = quotemeta('<a href="/cgi-bin/pick.cgi?');
but substituting has stumped me.
Would some kind soul please help? Thanks.
Pete
------------------------------
Date: 31 Dec 1997 15:23:40 -0500
From: pjh@mccc.edu (Pete Holsberg)
Subject: Re: Search and replace questions
Message-Id: <68e9kc$g3o@tecoma.mccc.edu>
In article <68e8m6$fsv@tecoma.mccc.edu>, Pete Holsberg <pjh@mccc.edu> wrote:
=Happy New Year to everyone!
=
=I have a file that has lines like this:
=
=<FONT SIZE=+1>AC 106 Office Accounting I 3</FONT>
=<FONT SIZE=+1>EG 222 Literature II 3</FONT>
=
=etc.
=
=I would like to change them to:
=
=<FONT SIZE=+1><a href="/cgi-bin/pick.cgi?AC106">AC 106</a> Office Accounting I 3</FONT>
=<FONT SIZE=+1><a href="/cgi-bin/pick.cgi?EG222">EG 222</a> Literature II 3</FONT>
FLASH! I discovered a better CGI string! No "?". So the new
lines should look like this:
<FONT SIZE=+1><a
href="/cgi-bin/htgrep.cgi/isindex=AC106&file=/SCHED/spr/msched.html&style=pre">AC106</a>
Office Accounting I 3</FONT>
<FONT SIZE=+1><a
href="/cgi-bin/htgrep.cgi/isindex=EG222&file=/SCHED/spr/msched.html&style=pre">EG222</a>
Literature II 3</FONT>
=But I haven't found an elegant way to do this...and I keep
=running into problems with that darned "?"!!
=
=I tried to isolate "(SIZE=+1)" and "([A-Z]{2}) (\d{3})" as
=three variables. And I have defined
=
= my $cgivar = quotemeta('<a href="/cgi-bin/pick.cgi?');
=
=but substituting has stumped me.
=
=Would some kind soul please help? Thanks.
Thanks,
Pete
------------------------------
Date: Wed, 31 Dec 1997 15:07:55 -0800
From: scott clark <scott_clark@merck.com>
Subject: Re: SSI and FrontPage98 under IIS3
Message-Id: <34AAD04B.3282@merck.com>
Moises G. Solis wrote:
>
> I don't know where to turn for help. Please point me in the right
> direction.
>
> I'm trying to execute a perl script from within an HTML page using SSI.
> The goal is to use a FP theme while providing the document content from a
> perl script. This will allow me to use the existing page theme without
> having to code it within my perl script.
>
> Is there a FAQ somewhere?
>
> Moises.
I just recently configured SSI on IIS and it was quite easy after
consulting the following post on the newsgroup:
microsoft.public.inetserver.iis
the Subject text was:
Subject: Re: HELP! PLEASE! Server Side Includes and IIS
(you can try searching dejanews http://www.dejanews.com)
When creating the Registry key I used the Ssinc.dll as my SSI DLL which
was located in \WINNT\system32\inetsrv directory...
good luck...
-scottyc
The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, Merck & Co., Inc. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
------------------------------
Date: 31 Dec 1997 20:40:30 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Stripping non-alphanum's from within string?
Message-Id: <68eaju$2i7$1@uranium.btinternet.com>
In article <68du0h$m4c@bgtnsc02.worldnet.att.net>,
hagani@worldnet.att.net says...
>
>Anyone know how to accomplish this seemingly simple and common task?
>
>Let's say I have: $string = "P#E!$R- L"
>
something like:
$tt =~ s/[^a-zA-Z0-9]//g ;
perhaps (I havent tried it tho'.
Jonathan
------------------------------
Date: Wed, 31 Dec 1997 14:27:02 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Testing for null and spaces
Message-Id: <34AA9C86.46D1@min.net>
Andy Squires wrote:
>
> I'm trying to test whether or not a variable is blank or null and can't figure out why the following doesn't work.
>
> str1=" ";
>
> if(str1=~ /^\s*$/) {
> print "The field does not contain data\n";
> } else {
> print "The field does contain data\n";
> }
>
> Sorry if this is a nuby question, but I couldn't
> seem to figure it out from the FAQ or the man pages.
>
The question itself is relevant (if novice-level), but
the way you asked it is nuby.
What do you mean "it doesn't work"? What behavior did
it give, and what did you expect?
For starts, str1 is a "bareword". To be a string variable,
you need a $ (dollar) in front of every occurence of it.
John Porter
jporter@logicon.com
------------------------------
Date: Wed, 31 Dec 1997 19:59:53 GMT
From: "Devin P. Anderson" <dev@sgi.net>
Subject: Re: timing subroutines
Message-Id: <34AAA4DF.5D70@sgi.net>
brian d foy wrote:
>
> In article <34AA6353.5D52@sgi.net>, "Devin P. Anderson" <dev@sgi.net> posted:
>
> > Is there a way to time a subroutine so that if it doesn't complete in a
> > certain time period it returns an error?
>
> does alarm() do what you want?
>
> --
> brian d foy <http://computerdog.com>
Well, I'm not sure. See, I have this subroutine that checks to see if a
webserver is running ny opening a connection to it and getting it index
file. However, sometime the server can be running, the perl script can
connect to it, but the script hangs while waiting to get the index file
becasue the server isn't working properly. So I need some way to aviod
that 'lockup' situtation.
THANKS!!
--- @
Devin P. Anderson Happy Holidays * *
Webmaster, Systems Administrator from * ' *
Stargate Industries, Inc. Network Operations * ',` *
http://www.sgi.net/ *', `,
*
Phone: 412.930.STAR (7827) ext. 241
***********
F a x: 412.930.7110 ***
&& ***
&&
#=#=#=#=#=#=#=#=#=#=#
"Prehaps today *is* a good day to die. Ramming speed."
-Lt. Worf
-----PGP PUBLIC KEY AVAILABLE-----
------------------------------
Date: Wed, 31 Dec 1997 14:40:14 -0500
From: snailgem@aol.com
Subject: Re: undefined value
Message-Id: <34AA9F9D.1ABE@aol.com>
To answer your questions:
>1.) Where is "$this_htm" being assigned a value?
In the ##stuff initialized here part of the code ;-).
> 2.) Which line, specifically is line 84? With only 10 lines of code
> its hard to guess. :)
My code has only about 70 lines, but if you look closely at the
warning, it refers to l.84 in the Copy module.
As I said, the code works, it just prints this curious warning.
Thanks.
Derek Balling wrote:
>
> snailgem@aol.com wrote:
> >
> > This is driving me crazy:
> >
> > #!/usr/local/bin/perl -w
> > use diagnostics;
> > use File::Copy;
> >
> > ##stuff initialized here
> >
> > $from_file = "$common_dir/$this_htm";
> > $to_file = "$common_dir/copy_$this_htm";
> >
> > copy ("$from_file", "$to_file");
> >
> > The only new file here is $to_file. The code works ($to_file is
> > created),
> > but it generates the following warning that I'd like to get rid of:
> >
> > Use of uninitialized value at /usr/local/lib/perl5/File/Copy.pm line 84
> > (#1)
> > (W) An undefined value was used as if it were already defined. It
> > was
> > interpreted as a "" or a 0, but maybe it was a mistake. To suppress
> > this
> > warning assign an initial value to your variables.
>
> A few questions:
>
> 1.) Where is "$this_htm" being assigned a value?
> 2.) Which line, specifically is line 84? With only 10 lines of code
> its hard to guess. :)
------------------------------
Date: 31 Dec 1997 20:13:26 GMT
From: Alex Tang <altitude@ren.us.itd.umich.edu>
Subject: What does tr|A-Za-z0-9+/| -_| do?
Message-Id: <68e916$5cp$1@newbabylon.rs.itd.umich.edu>
Hi folks.
I was reading some stuff on how to decode Base64, and I saw this (from
perlfaq9):
How do I decode a MIME/BASE64 string?
The MIME-tools package (available from CPAN) handles this
and a lot more. Decoding BASE64 becomes as simple as:
use MIME::base64;
$decoded = decode_base64($encoded);
A more direct approach is to use the unpack() function's
"u" format after minor transliterations:
tr#A-Za-z0-9+/##cd; # remove non-base64 chars
tr#A-Za-z0-9+/# -_#; # convert to uuencoded format
$len = pack("c", 32 + 0.75*length); # compute length byte
print unpack("u", $len . $_); # uudecode and print
I was trying to figure out what the line:
tr#A-Za-z0-9+/# -_#;
does. Does " -_" have special meaning? If so, what?
I couldn't find any other references to " -_" in any other docs.
Thanks!
...alex...
--
| altitude@umich.edu
Alex Tang |
| "Who would you help in a fight, Jesus or Santa Claus?"
------------------------------
Date: 31 Dec 1997 15:44:05 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: What does tr|A-Za-z0-9+/| -_| do?
Message-Id: <68eaql$adg$1@stok.co.uk>
In article <68e916$5cp$1@newbabylon.rs.itd.umich.edu>,
Alex Tang <altitude@ren.us.itd.umich.edu> wrote:
>Hi folks.
>
>I was reading some stuff on how to decode Base64, and I saw this (from
>perlfaq9):
>I was trying to figure out what the line:
>
> tr#A-Za-z0-9+/# -_#;
>
>does. Does " -_" have special meaning? If so, what?
>
>I couldn't find any other references to " -_" in any other docs.
No, the tr is using # as a delimiter, it could be written as
tr/A-Za-z0-9\// -_/;
and the / -_/ is a range of characters (assuming ASCII here) from chr (32)
to chr (95) (63 characters which happens to be the number of characters in
A-Za-z (52) 0-9 (10) \ (1))
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@colltech.com | Collective Technologies (work)
------------------------------
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 1558
**************************************