[8501] in Perl-Users-Digest
Perl-Users Digest, Issue: 2117 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 17 14:08:19 1998
Date: Tue, 17 Mar 98 11:00:54 -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 Tue, 17 Mar 1998 Volume: 8 Number: 2117
Today's topics:
Re: "Premature End of Script Headers" (Richard Bellavance)
? retrieve meta tag information from a HTML document wi <fp@pmpcs.com>
Re: A matter of timing (Jeffrey R. Drumm)
Re: argh!! how do I overwrite part of a preexisting fil <jdf@pobox.com>
Re: argh!! how do I overwrite part of a preexisting fil <egwong@netcom.com>
Re: argh!! how do I overwrite part of a preexisting fil (Jason Gloudon)
How can Perl call Java classes? (Michael Blakeley)
Re: how to assign unix command options in perl schwern@starmedia.net
how to interpolate based on unix command (Lalit Jairath)
Re: Is there a "Newsgroup" for Newbies to Perl? <keithmur@mindspring.com>
Re: Is there a "Newsgroup" for Newbies to Perl? <cmargoli@world.northgrum.com>
is there a helpdesk? (was Re: Is there a "Newsgroup" fo <Russell_Schulz@locutus.ofB.ORG>
Julian Dates & Perl nealesh.patel@iss-oxygen.co.uk
Re: Julian Dates & Perl schwern@starmedia.net
Re: Julian Dates & Perl (Abigail)
Re: LDAP interface <norman.bunn@mci.com>
Re: More on how to slice an anonymous hash? <dboorstein@shopcfn.com>
Re: Multiple substitues (Ilya Zakharevich)
My first Perl Post I tried to make it worthy. <alz@inlink.com>
Need help parsing a text file <bbrown@sna.com>
net use G: \\foo\c$ <paul.cao@compaq.com>
Re: Newbie question: Allowing mismatches in expression (Kevin B Cohen)
Re: Newbie question: Allowing mismatches in expression <quentin@jihad.amd.com>
Re: Newbie question: Allowing mismatches in expression <dboorstein@shopcfn.com>
Output <edgar@pce.net>
Re: Output (Craig Berry)
Re: parsing perl [Pointer to www.perl.com et al] <rob@NOSPAMintr.net>
Re: parsing perl <rob@NOSPAMintr.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Mar 1998 12:08:11 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: "Premature End of Script Headers"
Message-Id: <6emalr$aid@stratus.CAM.ORG>
In article <350d1527.26893387@news.fas.harvard.edu>,
Lee Feigenbaum <feigenb@hcs.harvard.edu> wrote:
>I've got it printing out a header, (and it does print the header (as
>regular text) when run in offline debug mode:
>
>i get
>
>Content-Type: text/html
>
><HTML><HEAD>etc..
>
>That header should suffice... I'm not at all sure whta's going on...
>oh well
>
You probably have an error lurking somewhere in the script when called
from CGI. Here's a way to catche those:
Make a "wrapper" CGI script like this:
#! /path/to/perl
print "Content-type: text/plain\n\n";
exec '/path/to/your/perl_script';
On Win32, you might need to change the last line to:
exec '/path/to/perl', '/path/to/your/script';
And call this instead of your script.
HTH,
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: Tue, 17 Mar 1998 12:32:06 -0500
From: "Peter Perchansky" <fp@pmpcs.com>
Subject: ? retrieve meta tag information from a HTML document with Perl ?
Message-Id: <6embu1$mi6$1@usenet36.supernews.com>
Greetings:
I'm using the LWP modules to retrieve the actual HTML in a given HTML
document. My goal is to go through the document and pull out the "content"
portion of certain META tags.
If a string contains the following...
<meta name="keywords" content="stocks, 401K Rollovers, Financial Planning,
Mutual Funds, Retirement Planning, IRA Rollovers, 471, 402, Louisville,
Kentucky">
.... is there an easy / efficient way to just return the following?:
stocks, 401K Rollovers, Financial Planning, Mutual Funds, Retirement
Planning, IRA Rollovers, 471, 402, Louisville, Kentucky
Meaning, if I found the line by looking at "keywords" is there a way to just
get the content?
Thank you for your time. If it is convenient, please reply by email as
well.
--
===========================================================
Peter Perchansky, Computer Consultant & Microsoft FrontPage MVP
Dynamic Net, Inc. DBA PMP Computer Solutions
Providing Dynamic Databases, Design, & Electronic Commerce Solutions
FrontPage Web Hosting at http://www.pmpcs.com/services/fpwebhosting.htm
FrontPage Support http://www.pmpcs.com/support/frontpage.htm
------------------------------
Date: Tue, 17 Mar 1998 17:51:58 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: A matter of timing
Message-Id: <3510b72e.90574399@news.mmc.org>
[courtesy copy mailed to cited author]
On 17 Mar 1998 08:11:34 -0600, Quentin Fennessy <quentin@jihad.amd.com> wrote:
>>>>>> "D" == Daniel <rkdious@ix.netcom.com> writes:
>
> D> Hello I'm trying to find a way to delay my program for less
> D> than a second. The sleep() routine will only sleep for whole
>
>I suggest you try
>
> perldoc -q sleep.*second
>
Do you really think that will work (assuming the Cawley patch is applied)? I'd
figure the shell would expand the '*' . . . so maybe it would work, in an empty
directory (or on 95/NT) ;-)
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: 17 Mar 1998 13:15:01 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: argh!! how do I overwrite part of a preexisting file?
Message-Id: <d8flchga.fsf@news.concentric.net>
"Andy Lindeman" <andy.lindeman@digital.com> writes:
> I need to overwrite the first few characters in a preexisting file, but
> can't figure out what mode I should open the file in.
Argh!! That's a FAQ.
perlfaq5 : "How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the beginning of
a file?"
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Tue, 17 Mar 1998 18:20:36 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: argh!! how do I overwrite part of a preexisting file?
Message-Id: <egwongEpz6yC.52y@netcom.com>
Andy Lindeman <andy.lindeman@digital.com> wrote:
: Hi-
: I need to overwrite the first few characters in a preexisting file, but
: can't figure out what mode I should open the file in.
[ cut ]
Read/write mode ("+<") seems best.
open(F, "+<$filename") || die "Can't open $filename";
print F "0123456789";
You don't want to use "+>" since that'll clobber the entire
file. All this is in the perlfunc manpage under "open".
[ cc'd ]
------------------------------
Date: Tue, 17 Mar 1998 18:29:40 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: argh!! how do I overwrite part of a preexisting file?
Message-Id: <slrn6gtg60.54i.jgloudon@manitoba.bbn.com>
In article <6em02j$bf6@usenet.pa.dec.com>, Andy Lindeman wrote:
>Hi-
>
>I need to overwrite the first few characters in a preexisting file, but
>can't figure out what mode I should open the file in.
>
>It seems that when I:
>
>open(FILE, ">$file");
>seek(FILE,1,0);
>syswrite(FILE,$var,10,0);
man perlfunc and look at the open examples.
open(DBASE, '+<dbase.mine') # open for update
or die "Can't open 'dbase.mine' for update: $!";
Jason Gloudon
------------------------------
Date: 17 Mar 1998 10:25:03 -0800
From: mblakele@shell9.ba.best.com (Michael Blakeley)
Subject: How can Perl call Java classes?
Message-Id: <6emf5v$anl$1@shell9.ba.best.com>
Hi,
I'm trying to find a way to interface Perl with existing Java classes.
I've written a few custom XSUBs, and I'm not afraid of perlguts. But
DejaNews and Alta-Vista both drew blanks for me, and I'd like to know
if anyone else has worked on this problem.
thanks,
-- Mike
--
Michael Blakeley
mike@blakeley.com
PGP & more: <http://www.blakeley.com/>
------------------------------
Date: Tue, 17 Mar 1998 11:28:32 -0600
From: schwern@starmedia.net
To: ljairath@wright.aps.uoguelph.ca
Subject: Re: how to assign unix command options in perl
Message-Id: <6embob$m1u$1@nnrp1.dejanews.com>
Continuing the Anti-System-Call Crusade...
$month = (split(' ', gmtime, 3))[1];
Locale dependent, too. :) There's probably a much better way to do that, but
I can't think of it right now.
In article <6ek5jt$17g@ccshst05.uoguelph.ca>,
ljairath@wright.aps.uoguelph.ca (Lalit Jairath) wrote:
>
> Hi all,
>
> how can i assign unix command options in perl?
>
> i do the following:
>
> $_ = `date -u +%B`;
> print;
>
> it does not work. it just prints B.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 17 Mar 1998 15:29:42 GMT
From: ljairath@wright.aps.uoguelph.ca (Lalit Jairath)
Subject: how to interpolate based on unix command
Message-Id: <6em4t6$ndk@ccshst05.uoguelph.ca>
Hallo all,
i've a question here below, please respond if you've time.
Q: i've an HTML text file- ~/gev.html part of which looks like as below.
(the one after dotted lines......................)
Each month we put new genetic evaluation on internet and we have to
replace the value of the month (e.g. March here) to the current value
of month (e.g. in next month March will be replaced with April).
Also, we've to add another line for the replaced month
i.e. March (same as for Feb.). So, the new file should look like
as below. i've to do this several places in the file and for
several files. your help is and time is greatly appreciated!
Thanks,
Lalit
~~~~~~
you may pl. respond me at ljairath@wright.aps.uoguelph.ca
<input type="radio" name="-e" value="april1998" checked> April 1998<br>
<table>
<tr valign top>
<td>
<input type="radio" name="-e" value="march1998" > March 1998<br>
<input type="radio" name="-e" value="february1998" > February 1998<br>
.........................................................
text file: ~/gev.html
<input type="radio" name="-e" value="march1998" checked> March 1998<br>
<table>
<tr valign top>
<td>
<input type="radio" name="-e" value="february1998" > February 1998<br>
------------------------------
Date: Tue, 17 Mar 1998 12:11:29 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <350EBCD0.9CA9A637@mindspring.com>
Robert, there were people who didn't know that was in jest? The mind
boggles.
I guess it's the same people who think that Bjarne Stroustrup really is
saying that C++ was a scheme to create jobs, or buy into the phony VB6
posting...
Robert F. Harrison wrote:
>
> On 17 Mar 98 10:47:14 GMT, Robert F. Harrison <harrison@pixi.com> wrote:
> >
> > How dare he give something away free, with instructions, not to
> > mention coercing many people into aiding and abetting without
> > rendering it harmless first.
>
> I apologize to all for this message. It was meant in jest but sadly
> failed on all counts.
>
> To those who might have taken this not seriously, it was not, should
> not and cannot be interpreted as such. I did neglect to include a
> smiley to indicate jest and have paid the price for my ommission.
>
> Again, please ignore my sad attempt at humor. I sincerely apologize
> to all who have been offended and promise it will not happen again.
>
> Robert F. Harrison [as bad a perl hacker as he is a comedian.]
>
> --
> rfh harrison@pixi.com
------------------------------
Date: Tue, 17 Mar 1998 18:25:28 GMT
From: Charles Margolin <cmargoli@world.northgrum.com>
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <350EC018.2BE8@world.northgrum.com>
John Callender wrote:
> Makes you wonder if we could just solve all this mess without moderation,
> but merely by creating a "comp.lang.perl.wizards" group with a charter
> stating that it is explicitly intended as a newbie trap, where real
> wizards wouldn't be caught dead.
I think one already exists: we still get the old comp.lang.perl here,
and I have answered some questions there, but always with
encouragement to switch to c.l.p.m. Today there is a posting
from someone who said that he *prefers* comp.lang.perl because there
are too many postings in c.l.p.m. and he finds his answers in c.l.p.
I don't think I'll facilitate that attitude anymore.
--
Charles G. Margolin DSSD Internal Information Services
cmargoli@world.northgrum.com Northrop Grumman Corp. 0624/23
margolin@acm.org Hawthorne, California 90250-3277
------------------------------
Date: Tue, 17 Mar 1998 17:56:35 +0000
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: is there a helpdesk? (was Re: Is there a "Newsgroup" for N*wb**s to Perl?)
Message-Id: <19980317.175635.2i7.rnr.w164w_-_@locutus.ofB.ORG>
Mark P Stackhouse <stackhou@elk.cray.com> writes:
>> But don't you understand? This isn't a helpdesk.
>
> My point exactly! We need a "helpdesk"!
why didn't you ask for it, then? lots of excellent people will take
your money for answering perl questions, even if they're in the FAQ.
um, you WERE expecting to pay, right?
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Tue, 17 Mar 1998 11:04:41 -0600
From: nealesh.patel@iss-oxygen.co.uk
Subject: Julian Dates & Perl
Message-Id: <6emac3$keg$1@nnrp1.dejanews.com>
Is there a way of say converting a Julian Date in Perl to dd/mm/yyformat.
Any help would be much appreciated.
Regards,
Nealesh
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 17 Mar 1998 11:58:04 -0600
From: schwern@starmedia.net
Subject: Re: Julian Dates & Perl
Message-Id: <6emdfm$nuk$1@nnrp1.dejanews.com>
Time::JulianDay available at a CPAN near you!
http://www.perl.com/CPAN/modules/by-module/Time
In article <6emac3$keg$1@nnrp1.dejanews.com>,
nealesh.patel@iss-oxygen.co.uk wrote:
>
> Is there a way of say converting a Julian Date in Perl to dd/mm/yyformat.
> Any help would be much appreciated.Regards,Nealesh
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 17 Mar 1998 18:06:18 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Julian Dates & Perl
Message-Id: <6eme2q$s5p$1@client3.news.psi.net>
nealesh.patel@iss-oxygen.co.uk (nealesh.patel@iss-oxygen.co.uk) wrote on
MDCLIX September MCMCLIII in <URL: news:6emac3$keg$1@nnrp1.dejanews.com>:
++ Is there a way of say converting a Julian Date in Perl to dd/mm/yyformat.
++ Any help would be much appreciated.
Regards,
Nealesh
use Time::JulianDay;
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle 'print +(HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET", "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content)) =~ /(.*\))[-\s]+Additional/s) [0]'
------------------------------
Date: Tue, 17 Mar 1998 18:13:53 GMT
From: "Norman Bunn" <norman.bunn@mci.com>
Subject: Re: LDAP interface
Message-Id: <B3zP.1041$LN3.207350@news.internetMCI.com>
; wrote in message <6em2ue$28o$1@nntp.Stanford.EDU>...
>
>
>In article <isen017esf.fsf@godzilla.kiere.ericsson.se>,
>Calle Dybedahl <qdtcall@esb.ericsson.se> wrote:
>>"Norman Bunn" <norman.bunn@mci.com> writes:
>>
>>> Has anyone used LDAP with PERL? If so, how?
>>
>>Yes. The Netscape LDAP stuff and Net::LDAPapi from CPAN. I think the
>>README for the module contains a pointer to where to get the Netscape
libs.
>>--
>
>- - There are two modules for ldap. Net::LDAP and Net::LDAPapi. The first
>is an attempt to do ldap V3 from scratch in perl. I'd say it's currently
>experimental. The second is an interface to either the netscape LDAP SDK,
>or the umich ldapv3.3 libraries. I use it in production every day and
>have been extremely satisfied with the results.
>
>- - Booker C. Bense
>
Does this work under Apache on NT?
------------------------------
Date: Tue, 17 Mar 1998 11:45:04 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
To: smalunjk@cisco.com
Subject: Re: More on how to slice an anonymous hash?
Message-Id: <350EA890.98B24B74@shopcfn.com>
Sanjay Malunjkar wrote:
> #!/usr/local/bin/perl5
> $\="\n";
> $a='F::Scot::L::Tiger::C::Company name';
>
> @x= (split(/::/, $a))[2..5];
> print "slice of an anonymous array in x =@x"; #L Tiger C Company name
this is not technically an anonymous array, it is a list.
an anon. array would be:
@x= @{[split(/::/, $a)]}[2..5];
your end result here is the same, but there is most definitely a
difference.
> #Tiger
> print "Last name=",{split(/::/, $a)}->{'L'};
> #Question 1: why dont I have to prefix the above expression by $
> #to indicate a scalar value ?
because '->' does automatic dereferencing just as this does:
$aRef = \@array;
$aRef->[0]; # auto dereference
$$aRef[0]; # manual dereference
> #Question 2: why dont this work? I tried lots of variants of this
> #like putting a prefix of @, grouping to enforce precedence etc.
> print "Last,First name=", {split(/::/, $a)}->{'L','F'};
unfortunately you can only dereference a single element with '->', no
slices allowed. see page 261 of the blue camel.
> #Question 3:Following works, but does it mean ?
> #create a reference to a hash {split(/::/)}
> #dereference it {{split(/::/)}}
> #slice it {{split(/::/)}}{'L','C'}
well, you need the '@' sign on the front of your last two expressions,
but after that you've got it.
> #Question 4: I had to create a reference and then deref it etc. because
> #there is no direct way of representing a hash like (split(/::/, $a))
> #there is one for an array. Is this correct?
again, that is not really an anonymous array. it is a list. so you've
got:
(split(/::/, $a)) # a list
[split(/::/, $a)] # an anonymous array
{split(/::/, $a)} # an anonymous hash
try running your tests with warnings (i.e., -w) turned on, often it
will give you clues that aid in understanding the more complex data
structures.
hope this helps,
--
# dan boorstein <dboorstein@shopcfn.com>
seek DATA,0,0;print scalar<DATA>,__END__
Just another Perl hacker,
------------------------------
Date: 17 Mar 1998 17:58:13 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Multiple substitues
Message-Id: <6emdjl$r46$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to
<dfrench@aig.vialink.com>],
who wrote in article <6ehlmo$9t6$1@nnrp1.dejanews.com>:
> I would like to perform multiple substitues on a single line. For instance
> using "sed" the I can do the following:
>
> sed -e "s/A/a/g;s/B/b/g;s/C/c/g" filename
>
> The content of the substitutes above were just an example, but I would like to
> do the same kind of thing in perl. I would like to do multiple substitues in
> a single command, somthing like:
>
> $result = s/A/a/ && s/B/b/ && s/C/c/;
>
> does anybody know a way to do this?
To do *what*? To get an answer, you should first ask a question...
If you need to do *exactly* what you ask with //g modifier added, you
may do it as
s/[ABC]/\l$&/g;
If you need to translate "and" to "&&" and "or" to || (with an
arbitrary capitalization), then in *new enough* Perl you may do it as
s(and(?{ $result = '&&' })|or(?{ $result = 'I' }))($result)i;
In 5.006 it may become
s(and(?{ '&&' })|or(?{ 'I' }))($^R)i;
Ilya
------------------------------
Date: Tue, 17 Mar 1998 10:41:17 -0600
From: "ALz" <alz@inlink.com>
Subject: My first Perl Post I tried to make it worthy.
Message-Id: <6em7no$a4r$1@news1.inlink.com>
Gang,
I have a question regarding Perl and htaccess. In a directory I have a
database, in simple text. I have 15 administrators with their own
subdirectories who only have access to the things they entered in. I need
the directories to be secure, Is it possible to create a secure directory
and actually keep the userid and password entered in from htaccess and use
it to place them at a start page?
Something like this
index page with a login (Input taken and thrown into htaccess as well) and
after logged into index page, they are placed in their secure subdirectory?
I can only have them log in once though.
I had planned on a login and an htaccess login. No dice (Idea turned down).
So I need a way to capture and utilize the htaccess password so that a
different user ends up in a different subdirectory, or (in case of a
failure) out on his rear.
Think it over and let me know. If this is a stupid question please flame
accordingly.
Billy Ailshire
------------------------------
Date: Tue, 17 Mar 1998 10:28:17 -0800
From: Barry Brown <bbrown@sna.com>
Subject: Need help parsing a text file
Message-Id: <350EC0C1.713DADA6@sna.com>
Hello.
I'm writing a simple command interpreter. The commands are embedded in
a regular text file and are delimited with %{ }% tags. I want to split
the text file up into an array with the elements of the array pointing
to either blocks of text or program statements. Here's an example.
With these definititions:
$TEXT = 0;
$STMT = 1;
I want to turn this:
Some text
%{ statement 1 %}
Some more
text
%{ statement 2}%%{ statement 3 }%
%{multi-line
statement 4}%text%{ statement 5 }%
into an array, @prog, of array refs:
$prog[0] = [$TEXT, "Some text\n"]
$prog[1] = [$STMT, "statement 1"]
$prog[2] = [$TEXT, "\nSome more\ntext\n"]
$prog[3] = [$STMT, "statement 2"]
$prog[4] = [$STMT, "statement 3"]
$prog[5] = [$TEXT, "\n"]
$prog[6] = [$STMT, "multi-line\nstatement 4"]
$prog[7] = [$TEXT, "text"]
$prog[8] = [$STMT, "statement 5"]
$prog[9] = [$TEXT, "\n"]
(or something close to this)
I've tried an assortment of techniques to do so, but I always get stuck
on a couple of issues.
* Program statements can span multiple lines.
* Everything that's not contained withing %{ }% tags is considered text,
including newlines.
* Program statements need not be preceeded by text. In fact, a
statement
could be the first thing in a file. A file could also be composed
entirely of program statements.
Because of these, simple pattern matching with .*? doesn't work, since
"." never matches a newline. I tried a more complex match like
/((.|\n)*?)%{\s*((.|\n)*?)\s*}%/ after snarfing the entire file into a
variable, but the nested parentheses seem to confound the assignments to
$1 and $2. (Side note: Programming Perl doesn't seem to explain how $1,
$2, ... are assigned when parentheses are nested.) A RE like ([.\n]*?)
doesn't work, either.
I've also tried using loops with index and substr, but I end up with
icky boundary conditions that I haven't been able to resolve cleanly.
Is there an easier way? Or will I just have to slog through it and
maybe do something like split the file into an array of single
characters with @arr = split('', $_) so I can walk through it a
character at a time?
Thanks for any help you can provide!
--
Barry E. Brown Internet: bbrown@sna.com
Sacramento Network Access / Internet Network Technologies, Inc.
System Administrator/Technical Support/Engineering
Home page: http://dottie.sna.com/bbrown/
------------------------------
Date: Tue, 17 Mar 1998 16:43:03 GMT
From: "paulc" <paul.cao@compaq.com>
Subject: net use G: \\foo\c$
Message-Id: <Epz2Fn.6qs@twisto.eng.hou.compaq.com>
Hi all,
I'm trying to execute net use G: \\foo\c$ without
success. I did try to print out the command before
I execute, and it's OK. I run the comand that the
program print out and it runs OK. But the script gives
an error 67 Net Work name not found. The drive
on the other machine is hidden c$.
Help. thanks
PC
------------------------------
Date: 17 Mar 1998 11:01:50 -0500
From: kcohen@julius.ling.ohio-state.edu (Kevin B Cohen)
Subject: Re: Newbie question: Allowing mismatches in expression
Message-Id: <6em6pe$gtt@julius.ling.ohio-state.edu>
In article <350E9665.6B01@facstaff.wisc.edu>,
Mark Gosink <mmgosink@facstaff.wisc.edu> wrote:
>Hello Netters:
> I'm a relative new comer to PERL and I was wondering if there is
>a way to allow mismatches in a search expression.
not sure what you mean by "mismatch." do you mean something like
"given a string n characters in length, match at least n-1 of those
characters"?
if that was what i wanted to do, i guess i would split the string into
an array...
...and then do a match on each element...
...and increment a counter each time a match failed...
...or alternatively, define a boolean...
...and if the counter hit 2, or there was a failure when the boolean
was already defined, then i'd call that a total failure.
is that what you wanted???
kevin
------------------------------
Date: 17 Mar 1998 11:11:01 -0600
From: Quentin Fennessy <quentin@jihad.amd.com>
Subject: Re: Newbie question: Allowing mismatches in expression
Message-Id: <ximsoohb5ui.fsf@jihad.amd.com>
>>>>> "MG" == Mark Gosink <mmgosink@facstaff.wisc.edu> writes:
: qf@remington:~; perldoc -q approximate
=head1 Found in /tool/pandora/.package/perl-5.004/lib/perl/pod/perlfaq6.pod
=head2 How can I do approximate matching?
See the module String::Approx available from CPAN.
--
Quentin Fennessy AMD, Austin Texas
------------------------------
Date: Tue, 17 Mar 1998 13:43:04 -0500
From: Dan Boorstein <dboorstein@shopcfn.com>
To: Mark Gosink <mmgosink@facstaff.wisc.edu>
Subject: Re: Newbie question: Allowing mismatches in expression
Message-Id: <350EC438.6F64953A@shopcfn.com>
Mark Gosink wrote:
>
> Hello Netters:
> I'm a relative new comer to PERL and I was wondering if there is
> a way to allow mismatches in a search expression.
> For example:
>
> $string = "abcqef";
> if ($string=~/abcdef/) mismatches equal one
> { print "This is what I want!"}
well, i'm not sure how general of a solution you are looking for, but
if you are trying do something like see if a word exists in a sentence
but is off by one letter, you could do something like this.
$thing1 = 'there is a munkey on your head dear sir.';
$thing2 = 'monkey';
$fullRegex = join '|', map { $temp = $thing2;
$temp =~ s/(.{$_}).(.*)/\Q$1\E.\Q$2/;
$temp;
} (0 .. (length $thing2) - 1);
($thing1 =~ /$fullRegex/) && print "This is what I want!\n";
print $fullRegex, "\n";
basically the idea is to build a large, slow, alternating regex on the
fly. of course this is limited in that $thing2 can't get too long, and
it is not intended to handle sub-regexes in $thing2.
again, i don't know how well this will fit your needs, but it was fun
to code. :)
--
# dan boorstein <dboorstein@shopcfn.com>
seek DATA,0,0;print scalar<DATA>,__END__
Just another Perl hacker,
------------------------------
Date: Tue, 17 Mar 1998 11:22:28 -0500
From: "James R. Edgar" <edgar@pce.net>
Subject: Output
Message-Id: <350EA344.327E77D7@pce.net>
I have written a script that will take in information and lay it out
into an html document. My only problem is I am trying to figure out how
to ouput the file to a filename I choose.
If any one has any ideas it will be gladly appreciated.
I have only been doing Perl for six months.
James R. Edgar
------------------------------
Date: 17 Mar 1998 18:07:46 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Output
Message-Id: <6eme5i$8m2$1@marina.cinenet.net>
James R. Edgar (edgar@pce.net) wrote:
: I have written a script that will take in information and lay it out
: into an html document. My only problem is I am trying to figure out how
: to ouput the file to a filename I choose.
: If any one has any ideas it will be gladly appreciated.
: I have only been doing Perl for six months.
Six months, and you can't open a file for writing, and write to it? I'd
say you're going about things the wrong way. First, get _Learning Perl_
and read it, working through the examples. Then, do 'perldoc -f open'
and 'perldoc -f print' for the specifics on how to do what you need, if
_LP_ hasn't made it clear enough.
HTH...
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Tue, 17 Mar 1998 12:03:59 -0500
From: Rob Collins <rob@NOSPAMintr.net>
To: harrison@pixi.com
Subject: Re: parsing perl [Pointer to www.perl.com et al]
Message-Id: <350EACFE.204A3CD9@NOSPAMintr.net>
thank you for your help! i greatly appreciate it.
Robert F. Harrison wrote:
[snip]
> On Tue, 17 Mar 1998 07:12:24 -0500, Rob Collins <rob@NOSPAMintr.net> wrote:
> > I was wondering if anyone could direct me to a really good resource on
> > Perl's syntax? I am looking for some rules by which I can evaluate a
> > file and break it down into blocks, and break each block into
> > statements.
>
> The best resource on Perl's syntax instantly available (if installed)
> is:
>
> perldoc perlsyn
>
> ..distributed with every distribution of perl.
>
> The very best resource requiring a trip to the bookstore is:
>
> _Programming Perl_
> By Larry Wall, Tom Christiansen, & Randal Schwartz;
> 1-56592-149-6, 646 pages. 2nd Edition, September 1996
I have this book; it is a very good book. But, it does not address my interest
at all. I also have Advanced Perl Programming, which has been somewhat more
helpful (the section "Translator" starting on page 323 was the only thing that
I found which touched the subject). I'm looking for a whole chapter devoted to
what the "Translator" section's first paragraph mentions;
The translator converts a Perl script into a tree of opcodes.... It
comprises a ...
lexer ... the parser ... and the code generator. Regular expressions ...
are recognized in
toke.c [the lexer]....
Thanks to it, I'm pouring through perly.y now... hoping to derive some
knowledge at the end of all this.
So, to rephrase my question more intelligibly, is there any detailed
information on the rules of parsing Perl syntax? Like an equivilant to "How a
bill becomes a law", perhaps some documentation: "How a text file becomes an
op-code"? Or like Gisle Aas' "PerlGuts Illustrated"?
------------------------------
Date: Tue, 17 Mar 1998 11:45:27 -0500
From: Rob Collins <rob@NOSPAMintr.net>
To: Quentin Fennessy <quentin@jihad.amd.com>
Subject: Re: parsing perl
Message-Id: <350EA8A6.49DFED23@NOSPAMintr.net>
Thank you for the help!
By what you say below, do you mean there are no rules which, when applied to a
block of text, can determine if the syntax is correct? That is, are you saying
that syntax cannot be determined correct or incorrect until after the
text-block is converted to op-code?
That's really confusing because it suggests that any text block is
independently legal as perl code. It would seem that somehow syntax is really
only relevant to whatever the text-block translates into, and that those
op-code syntax-rules cannot for whatever reason be translated upstream, to perl
code/text.
Thank you again!
Quentin Fennessy wrote:
> >>>>> "RC" == Rob Collins <rob@NOSPAMintr.net> writes:
>
> RC> I was wondering if anyone could direct me to a really good
> RC> resource on Perl's syntax? I am looking for some rules by
> RC> which I can evaluate a file and break it down into blocks, and
> RC> break each block into statements.
>
> Perl is the only program that reliably parses perl.
>
> There are tools for module writers that can partition perl modules.
> Check out
>
> perldoc AutoSplit
>
> And from the FAQs:
>
> perldoc -q yacc
> =head1 Found in /tool/pandora/.package/perl-5.004/lib/perl/pod/perlfaq7.pod
>
> =head2 Can I get a BNF/yacc/RE for the Perl language?
>
> No, in the words of Chaim Frenkel: "Perl's grammar can not be reduced
> to BNF. The work of parsing perl is distributed between yacc, the
> lexer, smoke and mirrors."
>
> Perhaps there is more to your question -- why do you want to parse
> perl code, and once we know this we can help you further.
>
> --
> Quentin Fennessy AMD, Austin Texas
------------------------------
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 2117
**************************************