[8145] in Perl-Users-Digest
Perl-Users Digest, Issue: 1763 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 29 17:10:14 1998
Date: Thu, 29 Jan 98 14:00:24 -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 Thu, 29 Jan 1998 Volume: 8 Number: 1763
Today's topics:
Array and Split? <keefner@kinetic.com>
Re: ARRAYS of filehandles posssible ?!? <rootbeer@teleport.com>
Re: Check Variable type (Jeff Stampes)
Re: crypt() vs. htpasswd - what's the diff? (Joe McMahon)
De-FrontPage-itizing HTML (Home)
Re: delete function <rootbeer@teleport.com>
Re: Don't use signal handlers (was Re: Child processes) <tchrist@mox.perl.com>
Re: Help needed: I cannot seem to get this variable to (Richard Bellavance)
HELP REQUEST: Is there a better way the change my (and <andre_womble@hp.com>
Insecure Path <tsprang@mercury.net>
Re: Is there a WebRing Script? <rootbeer@teleport.com>
local() scoping rules - unusual results (D461-David_F_Haertig(Dave)83040)
Re: my (confusion) = deref'ing a hash of hashs <smalunjk@cisco.com>
Re: open in append mode <rootbeer@teleport.com>
Perl connection to Informix <rkrishna@iname.com>
Re: Perl output into html frame? <rootbeer@teleport.com>
Re: perl script -> secure webpage <rootbeer@teleport.com>
Re: Problems with strings (again) <rootbeer@teleport.com>
Re: Profiler for Perl4 (yup. Perl4) <*@qz.to>
Re: Profiler for Perl4 (yup. Perl4) <rootbeer@teleport.com>
Re: Re-using STDIN <rootbeer@teleport.com>
Re: regex with variables? <*@qz.to>
Sending data to a printer?? <hspecht@bytes.de>
Re: Survival Of perl (J. Blustein)
Re: Text Parsing and AI help <rootbeer@teleport.com>
Re: unzip utility for alpha NT? <beadles@nortel.com>
Up Loading Perl Files-Afraid! (Dick.Bolt)
Re: Why can't I unzip? <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 29 Jan 1998 14:26:03 -0600
From: "Craig A. Keefner" <keefner@kinetic.com>
Subject: Array and Split?
Message-Id: <34D0E5DB.7E1C2D0A@kinetic.com>
I want to run a dos program within perl and
generate a return list of search finds, read that data into array
and put it on the screen as formatted html. With just the print
it comes in as one long string, and I also wanted to "hide" the
part numbers which occur at the end.
If you can suggest the method I should learn/use to do this
I would be grateful and will continue to read the perlfaq4.
thanks
Craig
#!/usr/local/bin/perl
use CGI ':standard';
$part = "170";
$model = "ALAPACA";
$year = "88";
open(FINDSUBPART, "dospartfind.exe /p $part /m $model /s $year /w 70|") || error
("Could not open file /abc/data.txt");
@array = <FINDSUBPART>;
close(FINDSUBPART);
print (@array);
## Example returned list of values or @array
'85-89 S.W., moveable item1, w/zzzzz, heated............. 1A9-1573A
non-heated......... 1A9-1573C
w/o zzzzz; heated........... 1A9-1573B
non-heated....... 1A9-1573D
stationary itemb, heated.................... 1A9-1573E
non-heated................ 1A9-1573F
exc. S.W.......................................... 1A9-1234B
'90 (S.W.), moveable item1, w/zzzzz, heated........... 1A9-1573A
non-heated....... 1A9-1573C
w/o zzzzz; heated......... 1A9-1573B
non-heated..... 1A9-1573D
stationary itemb, heated.................. 1A9-1573E
non-heated.............. 1A9-1573F
The 9 digit numbers (1A9-1573B e.g.) are the ones I need to strip
off or hide. What I really want to do is put a radio button next to each
which when selected/entered, sends me the corresponding part number.
------------------------------
Date: Thu, 29 Jan 1998 13:36:12 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Claus van de Vlierd <vlierd@uni-oldenburg.de>
Subject: Re: ARRAYS of filehandles posssible ?!?
Message-Id: <Pine.GSO.3.96.980129133448.23664R-100000@user1.teleport.com>
On Thu, 29 Jan 1998, Claus van de Vlierd wrote:
> Subject: ARRAYS of filehandles posssible ?!?
There's some good info on this in the FAQ, section 5. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Jan 1998 19:06:24 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Check Variable type
Message-Id: <6aqjvg$29h$1@neocad.com>
Andrew Johnson (ajohnson@gpu.srv.ualberta.ca) wrote:
: Jeff Stampes wrote:
: ! print "How many beers do you want? ";
: ! my $input = <STDIN>;
: ! chomp $input;
: ! ($input =~ m{\D}) ?
: ! print "Not a number!\n" :
: ! print "$input beers, coming right up!\n";
: !
: ! If it matches a non-digit, it's not an integer
: !
: so you won't sell me 1e2 beer even if I promise not
: to drive?
: :-)
Right...and as TP pointed out to me, I won't sell you -3 beers either.
The assertion that TMTOWTDI stands, but obviously my verbatim code
will not fit the needs of the original poster.
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: Thu, 29 Jan 1998 15:56:57 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: crypt() vs. htpasswd - what's the diff?
Message-Id: <joe.mcmahon-2901981556570001@prtims.stx.com>
In article <mbudash-2101981522350001@d126.pm3.sonic.net>,
mbudash@sonic.net (Michael Budash) wrote:
> as far as the perlfunc man page, i am unfortunately laboring under a
> system with no shell access, though i do have a couple workarounds.
>
> **warning: potentially frustrating, if not stupid, question coming...
>
> if i had a command line, what would i enter to see such a page?
Not a problem. Try
ftp://ftp.rge.com/pub/languages/perl/doc/manual/html/pod/index.html
All of the Perl manpages are there.
--- Joe M.
------------------------------
Date: Thu, 29 Jan 1998 12:45:49 -0800
From: "Rick Brannan (Home)" <rbrannan#nospam#@oakharbor.net>
Subject: De-FrontPage-itizing HTML
Message-Id: <6aqq1m$lmt$1@gte1.gte.net>
Anyone out there have any experience with using Perl to strip all of the
MSFrontPage junk (JavaScript, Extensions, wacko formatting tricks, etc.) out
of FrontPage-generated HTML?
I've got some docs from an intranet that I'd like to strip down to a nice,
clean, subset of HTML, keeping structure, links, and basic character
formatting elements intact, so I can take that into a different DTD (via
Perl, of course) for other purposes. The more I can automate, the better off
I am, as it looks like this FrontPage-itized HTML may end up as the primary
source for many of these docs. Ugh.
I figure someone out there has pondered over the same problem, and might be
willing to share some caveats before I roll up my sleeves & get dirty.
BTW, I'm in Win95, so any modules referred to may or may not be appropriate
... I'm willing to give 'em a shot, but I've had very little luck with
modules & the ActiveState port of Perl I'm using. Apart from cgi.pm, I've
had no success.
Thanks.
_____________________
Rick Brannan
rbrannan-x@oakharbor.net
http://www.oakharbor.net/rbrannan
remove "-x" to email.
------------------------------
Date: Thu, 29 Jan 1998 12:34:26 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Justin <jwhite@thegrid.net>
Subject: Re: delete function
Message-Id: <Pine.GSO.3.96.980129122504.23664H-100000@user1.teleport.com>
On Wed, 28 Jan 1998, Justin wrote:
> I'm having a hard time understanding the delete function in perl.=A0 Some
> of the scripts that I have running on a BSDI machine require that I
> delete certain lines of a file.=A0 It seems that the delete function only
> likes to delete a specified key and associated value from a specified
> hash.=A0
That's what it's made to do; Don't let the name make you think that it can
be used for anything you want to delete. (Complaining that delete doesn't
delete lines from a file is like complaining that your copy of Wired
magazine doesn't have any wires! :-)=20
> If I have a file full of tilde delimited text, do I have to dump
> all of it into an associative array?=A0=20
I doubt that that would help at all. But the FAQ has some good information
about using Perl for updating text files. Hope this helps!
--=20
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Jan 1998 20:46:22 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Don't use signal handlers (was Re: Child processes)
Message-Id: <6aqpqu$c1t$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, chip@pobox.com writes:
:Don't use Perl signal handlers. Ever.
Now, kindly explain to the innocent bystanders
when, where, and why that position is untenable.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"* Unix is a footnote of AT&T Bell Laboratories."
--Barry Shein
------------------------------
Date: 29 Jan 1998 15:39:16 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: Help needed: I cannot seem to get this variable to substitute in this pattern
Message-Id: <6aqpdk$p86@stratus.CAM.ORG>
In article <34d2d278.17726993@news.cmc.ec.gc.ca>,
Sylvain Juneau <sjuneau@microtec.net> wrote:
>
> $count1=@client_prod_list;
> for($b=0;$b<=$count1;$b++)
> {
> open(PRODUCTFILE, ">> /usr/cmis/cmisx/prodfile") || die "Can't
>open:$!\n";
> @ARGV="/users/operator/cislist";
> while (<>)
> {
Insert this here:
print STDERR "client_prod_list[$b] = <", $client_prod_list[$b], ">\n";
and see what the output looks like...
> if(/^$client_prod_list[$b]/)
> {
> print PRODUCTFILE;
> }
> }
> }
Good luck !
Richard.
--
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: Thu, 29 Jan 1998 13:10:04 -0500
From: acw <andre_womble@hp.com>
Subject: HELP REQUEST: Is there a better way the change my (and child processes) environment?
Message-Id: <34D0C5FC.95FD0428@hp.com>
Hopefully this is a easy one for some one out there ....
I have gotten down to this level .....
%ENV=split(/[=\n]/,`. ./local_env ; env`);
OR,
%ENV=eval {
split(/[=\n]/,`. ./local_env ; env`)
};
What is the better way?
Many thanks in advance,
Andre
------------------------------
Date: Thu, 29 Jan 1998 14:56:14 -0500
From: Todd Sprang <tsprang@mercury.net>
Subject: Insecure Path
Message-Id: <34D0DEDE.C096E31A@mercury.net>
So, I've got this script that starts up pppd for me and logs into an
ISP--let's call it connect.pl. It runs until the session is closed:
--
#!/usr/bin/perl
$< = $>; # set effective uid to real uid.
system "setserial /dev/modem"; # Mount modem.
print "\nOpening connection to Mercury at 381-2500 (Gainesville)...\n";
system "exec pppd connect 'chat -v -f /etc/ppp/chatscript' -detach
crtscts modem defaultroute user tsprang /dev/modem 57600"; # Run
pppd w/chatscript.
print "\nConnection to Mercury closed.\n\n";
--
The program has setuid of 4754 so that users in the same group can
execute this script since you gotta be root to do it.
--
-rwsr-xr-- 1 root ops 542 Sep 26 17:31 /root/connect.pl
--
This all works just lovely. I log in as me (todd), I'm in the group
(ops), and I can run connect.pl. Great.
HOWEVER.
I wrote disconnect.pl, and it won't kill that process!
--
#!/usr/bin/perl
@pss = `ps -aux`; # system call -> array of processes
foreach $ps (@pss) { # loop through...
if ($ps =~ m/pppd/) { # find relevant pppd
($own, $pid, $foo) = split (" ", $ps, 3); # extract pid and..
}
}
exec "kill -9 $pid" || die "\nCouldn't kill ps $!\n"; # kill that
puppy.
--
I get this error:
--
Insecure $ENV{PATH} while running setuid at /root/umerc.pl line 5.
[line 5 is actually line 2 above--I edited]
--
I also have this (important?) tidbit of info:
--
: echo $PATH
/bin:/sbin:/usr/bin:/usr/sbin:/home/todd/bin:/usr/local/bin:/usr/X11R6/bin:/usr/bin/mh:/root
--
I'm at a complete loss. Any help would be appreciated. Thanks in
advance!
Reply to: mailto:tsprang@mercury.net?subject:pppd%20Problem please.
--
Todd Sprang
http://www.mercury.net/~tsprang/
"Madness takes its toll.
Please have exact change."
------------------------------
Date: Thu, 29 Jan 1998 13:47:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Walter Archie <warchie@att.net.hk>
Subject: Re: Is there a WebRing Script?
Message-Id: <Pine.GSO.3.96.980129134412.23664U-100000@user1.teleport.com>
On Wed, 28 Jan 1998, Walter Archie wrote:
> I am looking for a Perl script based on a webring. Please if you can
> help then okay. If not what does your reply have to do about Perl?
The answer by brian is helpful to both you and to the Perl community. It
told you of one possible place where you could find your software, and it
reminded you, perhaps too gently, that this newsgroup is not an archive of
free software.
If you have unanswered questions about how to write Perl scripts, this is
a good place to ask. But if you merely want free scripts, you should go
where free scripts are given away. I recommend that you search Yahoo or
someplace similar. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 29 Jan 1998 20:38:49 GMT
From: dfh@dwroll.lucent.com (D461-David_F_Haertig(Dave)83040)
Subject: local() scoping rules - unusual results
Message-Id: <EnKC0q.6qI@drnews.dr.lucent.com>
Keywords: local, scoping
Can anyone comment on whether:
(1) local() is breaking the "rules"? (See example below)
(2) My understanding of the "rules" is incorrect?
Thanks
--
Dave Haertig
haertig@lucent.com
==========================
Basic test program to verify local's scoping rules...
#!/usr/bin/perl
$XXX = 1;
print "<$XXX>\n";
{
local($XXX) = 2;
}
print "<$XXX>\n";
--- Output --- GOOD, local's scope limited to enclosing block
<1>
<1>
==========================
Now we add an "if (1)" to the local's block...
#!/usr/bin/perl
$XXX = 1;
print "<$XXX>\n";
if (1) {
local($XXX) = 2;
}
print "<$XXX>\n";
--- Output --- BAD, local's scope extends outside enclosing block
<1>
<2>
Why did "local($XXX) = 2" extend outside block? Optimizer too aggressive?
==========================
Now we add a "$Bogus++" to the local's "if (1)" block...
#!/usr/bin/perl
$XXX = 1;
print "<$XXX>\n";
if (1) {
local($XXX) = 2;
$Bogus++;
}
print "<$XXX>\n";
--- Output --- GOOD, local's scope limited to enclosing block
<1>
<1>
What could "$Bogus++" have to do with anything? Trick the optimizer?
==========================
Yes, this is a fairly new version of PERL...
$ /usr/bin/perl -v
This is perl, version 5.004_03
Copyright 1987-1997, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
==========================
--
Dave Haertig
haertig@lucent.com
------------------------------
Date: Thu, 29 Jan 1998 12:29:25 -0800
From: Sanjay Malunjkar <smalunjk@cisco.com>
To: brian.osborne@cadus.com
Subject: Re: my (confusion) = deref'ing a hash of hashs
Message-Id: <34D0E6A5.EFE63801@cisco.com>
following seems to be working for me:
#!/usr/local/bin/perl5
$myH{"a"}->{1} = "first";
$myH{"a"}->{2} = "second";
$myH{"a"}->{3} = "third";
$myName = "my" . "H";
@myA = sort keys %{$myH{"a"}}; #first tried to do it from actual Hash
#and then derived this by knowing the fact that name of the hash is in other
variable and
#substituted it
@myB = sort keys %{${$myName}{"a"}};
#@myA = sort keys %$myName{"a"};
print "@myA";
print "@myB";
hope this helps.
-sanjay malunjkar
brian.osborne@cadus.com wrote:
> To the group,
>
> I hope this letter finds you well. Here's an example of the thing
> that's haunting me (yes, I've read perlref and perldsc, though
> perhaps not well) :
>
> #!/usr/local/bin/perl -w
>
> $myH{"a"}->{1} = "first";
> $myH{"a"}->{2} = "second";
> $myH{"a"}->{3} = "third";
>
> $myName = "my" . "H";
>
> @myA = sort keys %$myName{"a"};
>
> print "@myA";
>
> You can see that I'm aiming at printing :
>
> 1 2 3
>
> What I see is the error :
>
> Can't use subscript on hash deref at ./tmp.pl line 14 near "};
> (Did you mean $ or @ instead of %?)
>
------------------------------
Date: Thu, 29 Jan 1998 13:11:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Chad R Cordero <ccordero@wiley.csusb.edu>
Subject: Re: open in append mode
Message-Id: <Pine.GSO.3.96.980129131032.23664N-100000@user1.teleport.com>
On Wed, 28 Jan 1998, Chad R Cordero wrote:
> open(FILE, ">>file");
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.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 29 Jan 1998 12:34:37 -0800
From: Ravi Krishna <rkrishna@iname.com>
Subject: Perl connection to Informix
Message-Id: <34D0E7DD.7E0D@iname.com>
This is the first time I am posting in this group , so pardon me if
I this is not the right forum to ask this question.
I want to know the site from where I can download DBperl or its
equivalent for perl to informix connection.
email to rkrishna@iname.com
thanks a lot.
------------------------------
Date: Thu, 29 Jan 1998 13:02:32 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Franklin L. Petersen" <orangutan@grungyape.com>
Subject: Re: Perl output into html frame?
Message-Id: <Pine.GSO.3.96.980129130042.23664L-100000@user1.teleport.com>
On Wed, 28 Jan 1998, Franklin L. Petersen wrote:
> I'd like to have my form submission return its perl values to a
> different html frame then the form itself.
You simply output the right information for the protocol you're using. In
this case, since I think you're using a protocol involving HTML frames,
the people in a newsgroup about CGI scripting or browsers may be able to
help you to find out the right output to use. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 29 Jan 1998 13:38:49 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: alex <alex@online.emap.com>
Subject: Re: perl script -> secure webpage
Message-Id: <Pine.GSO.3.96.980129133713.23664S-100000@user1.teleport.com>
On Thu, 29 Jan 1998, alex wrote:
> Is there anyway in which to create a perl script and the output from
> that page be displayed as a secure web page?
Sure. If you're looking to implement a secure server protocol, check with
the docs, FAQs, and newsgroups about that protocol. If you're needing help
with your server software, check with the docs, FAQs, and newsgroups about
your server. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 29 Jan 1998 13:13:56 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Stephen Howe <stephen@bcl.com>
Subject: Re: Problems with strings (again)
Message-Id: <Pine.GSO.3.96.980129131257.23664O-100000@user1.teleport.com>
On Thu, 29 Jan 1998, Stephen Howe wrote:
> Subject: Problems with strings (again)
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> if I have a line.. say
> "stephen howe" <stephen@bcl.com>
>
> I need to take away everything between and including the " " 's...
This sounds like a good job for a s/// substitution. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Jan 1998 20:59:37 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Profiler for Perl4 (yup. Perl4)
Message-Id: <qz$9801291547@qz.little-neck.ny.us>
Brendan Macmillan <bren@fangorn.cs.monash.edu.au> wrote:
> Try this lateral thinking test: what's a good reason to use perl4?
> Don't worry, if you fail, you probably won't notice.
>
> BTW, I did a little check over the general postings to this
> newsgroup, and found that whenever I was shocked at the rudeness,
> arrogance and stupidity of a response to an innocent question,
> each time it was the same people who belittle perl4.
Feel free to answer all the perl4 questions yourself. No one here is
going to stop you. *We* are not going to answer them because it is a
real nuissance to hobble oneself and try to think down to a buggy and
feature deficient version of perl after we have gotten used to the
latest and greatest. I sometimes have make the mistake of only testing
things in perl5.004 and overlook that they fail in 5.003. My entire
knowledge of perl4 comes from reading a CHANGES document. I have never
done active coding for perl4, occasionally I will rewrite regular
expressions to be perl4 compatible, but mostly because (1) I can and
(2) that will make them more directly mapable to non-perl regular
expressions. I do not even have a copy of perl 4 on this machine:
the system was installed off a standard linux distribution CD and did
not come with perl4. I would have to go out of my way to get a version
of perl4 to test any answer I want to provide.
Upgrading to the most recent version of perl is free. Getting help
from Usenet is free. If you cannot deal with Usenet on the terms
Usenetters want, you are welcome to look elsewhere.
Elijah
------
the division of labor here is not one that requires answers to do extra work
------------------------------
Date: Thu, 29 Jan 1998 12:58:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Brendan Macmillan <bren@fangorn.cs.monash.edu.au>
Subject: Re: Profiler for Perl4 (yup. Perl4)
Message-Id: <Pine.GSO.3.96.980129124730.23664K-100000@user1.teleport.com>
On 29 Jan 1998, Brendan Macmillan wrote:
> : The recommendation to upgrade to perl5 should not be construed
> : as a slight to perl4 users
>
> So how *should* these statements be construed?:
> "Or do you still use whale oil in your lamps?"
As the author of that statement, let me add one relevant detail: That
question was actually written like this:
Or do you still use whale oil in your lamps? :-)
Although not everyone knows this, the odd punctuation at the end,
sometimes called a "smiley" or "emoticon", is a shorthand intended to add
something to plain text. Since plain text can't show a facial expression
directly, and since the informality and brevity of email and Usenet
doesn't encourage lengthy discourses and explanation, a smiley can carry
some of that burden.
That smiley, which resembles a "happy face" when seen sideways, is saying,
"This is a joke, and not intended as sarcasm or cruelty. I'm trying to
make my point in a humorous fashion, and no offense is intended. Please
take what I'm saying in much the same way as if you could see my friendly
face smiling at you."
Please allow me to make one additional thing clear: I'm meaning this
message sincerely, and I'm not intending to be patronizing or sarcastic.
I'm only going on at such length about the smiley because you seem to not
have recognized it for what it is.
> Well, that's much clearer isn't it? And a bit nicer than
> "Well, I don't know the answer to your quesion.
> But I will say this: you are stupid."
Whoever said that should apologize. Was it really someone in this
newsgroup?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 29 Jan 1998 13:43:20 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Matteo Boschini <boschini@cilea.it>
Subject: Re: Re-using STDIN
Message-Id: <Pine.GSO.3.96.980129134011.23664T-100000@user1.teleport.com>
On Thu, 29 Jan 1998, Matteo Boschini wrote:
> I need to read STDIN without clearing it.
> at the end of the script, I need STDIN again , the same one as before,
> to be passed to another script ?
This is a system programming issue, rather than a Perl issue. But I'll try
to help anyway.
If your input stream is seek()able, you may be able to simply seek back to
the beginning when you're done. Usually STDIN isn't, so you should save
what you've read and pass it on to the other process's input stream,
probably through a pipe(). Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Jan 1998 21:17:12 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: regex with variables?
Message-Id: <qz$9801291557@qz.little-neck.ny.us>
Doug <doug@1dlabs.com> wrote:
> $searchaarea = "http:\/\/webserver\/home\/usr1";
Don't bother with those backslashes:
:r! perl -e 'print ($searchaarea = "http:\/\/webserver\/home\/usr1"),"\n";'
http://webserver/home/usr1
> @linesfromfile = grep /^$searcharea/, <INPUTFILE>;
Well, first off, you set "$searchaarea" and used "$searcharea". Second I
think your question is asking: How can I do this:
@linesfromfile = grep /^\Q$searcharea\E/, <INPUTFILE>;
Eg:
#!/usr/bin/perl -w
$pattern = 'http://my.string/+-*/';
@linesfromfile = grep /^\Q$pattern\E/, <DATA>;
$" = "\t";
print "Found: \n\t@linesfromfile\n";
__DATA__
http://my.string/+-*/good
http://myestring/+-*/bad
http://my.string/+-*/jfjfjfjfjfjfjfjfjj_good
http://my.string//--/bad
__END__
:r! perl -x %
Found:
http://my.string/+-*/good
http://my.string/+-*/jfjfjfjfjfjfjfjfjj_good
Elijah
------
thinks "perl -x" is nifty
------------------------------
Date: Thu, 29 Jan 1998 14:26:21 +0100
From: Hinrich Specht <hspecht@bytes.de>
Subject: Sending data to a printer??
Message-Id: <34D0837D.50A24A37@bytes.de>
Hi,
I have a problem since i am not very familiar with perl.
I have an existing perl script that sends data to a specified email
address. Now I want the data to be printed on a printer. Can anyone tell
me how I do that???
(Maybe it4s a stupid question but I haven4t got the time to learn pearl
at the moment....)
thanks in advance,
Hinrich Specht
------------------------------
Date: 29 Jan 1998 19:30:08 GMT
From: jamie@chaplin.csd.uwo.ca (J. Blustein)
Subject: Re: Survival Of perl
Message-Id: <6aqlc0$dtb@falcon.ccs.uwo.ca>
Keywords: brag
In article <eyhzpkh6cap.fsf@liddell.cstr.ed.ac.uk> Richard Caley
<rjc@liddell.cstr.ed.ac.uk> wrote:
>Basides real men use telnet as their browser don't they?
Well, I used to telnet to info.cern.ch to browse the WWW back in 1991.
I was already using perl by then though. Whether any of that makes me a
`real man' is open to debate :)
--
Jamie Blustein <jamie@CSD.uwo.ca> `Did you say "knives"?'
[Note new address] `*Rotating* knives, yes.'
------------------------------
Date: Thu, 29 Jan 1998 13:08:51 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: William Lapides <MetatonCSI@worldnet.att.net>
Subject: Re: Text Parsing and AI help
Message-Id: <Pine.GSO.3.96.980129130806.23664M-100000@user1.teleport.com>
On 29 Jan 1998, William Lapides wrote:
> Is anybody aware of any Text Parsing .Lib out there?
Perhaps you mean a module.
If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-) Hope this helps!
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 29 Jan 1998 15:09:30 -0600
From: "John T. Beadles" <beadles@nortel.com>
To: Brian Raven <Brian.Raven@liffe.com>
Subject: Re: unzip utility for alpha NT?
Message-Id: <34D0F00A.74D8@nortel.com>
Brian Raven wrote:
>
> On Tue, 27 Jan 1998 19:02:59 +0800, angyny@interport.net wrote:
>
> >Does anyone know which unzip utility tool that I can use to unzip
> >the Perl installation file on alpha NT?
> >(I try WinZip and info-zip, they don't work on alpha NT)
>
> IIRC the Intel DOS version of PKZIP works on alpha NT, but you don't
> get long filename support..
> Alternatively, there is a package somewhere on Dec's web server that
> emulates Intel win32, so you may be able to get WinZip to work.
Try:
http://www.cdrom.com/pub/infozip/Zip.html
This is the home of InfoZip, a project to produce
a "unix-style" zip package on virtually all
operating systems while maintaining pkzip
compatibility. I'm running it from within a perl
script under NT to store a set of daily data
files. Works fine, and they have an alpha flavor.
------------------------------------------------
John T. Beadles Nortel CDMA RF Design
Office: 972-685-7813 Fax: 972-684-3767
Email (office): beadles@removethis.nortel.com
Any opinions are mine and to do not represent
those of my employer
------------------------------------------------
------------------------------
Date: Thu, 29 Jan 1998 15:43:06 -0400
From: rbolt@pop300.gsfc.nasa.gov (Dick.Bolt)
Subject: Up Loading Perl Files-Afraid!
Message-Id: <rbolt-2901981543060001@dbolt2.gsfc.nasa.gov>
Want to put Guest Book up. Read instructions several times. I changed
Matts script to match providers best I can. Crossing fingers!
Using a Mac, can I just FTP them into my cgi-bin file as "chmod775GuestBook.cgi"
as file in ASCII name?
Its the "Chomd in" thats scarry! FTP is NOT scarry.
Dick
--
Statements made are not likely the position of anyone at NASA other than myself.
------------------------------
Date: Thu, 29 Jan 1998 12:38:35 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: PaulJCase <pauljcase@aol.com>
Subject: Re: Why can't I unzip?
Message-Id: <Pine.GSO.3.96.980129123654.23664I-100000@user1.teleport.com>
On 29 Jan 1998, PaulJCase wrote:
> Subject: Why can't I unzip?
>
> I just downloaded latest.tar and I can't for the life of me get it open?
> why?
Perhaps you have a utility for working with only zip files, but you're
using it with a tarfile. Of course, the file latest.tar.gz contains the
sources for Perl; if your machine is (as I suspect) a Windows-type
machine, you probably want the precompiled binary. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
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 1763
**************************************