[12967] in Perl-Users-Digest
Perl-Users Digest, Issue: 377 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 5 02:07:25 1999
Date: Wed, 4 Aug 1999 23:05:10 -0700 (PDT)
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, 4 Aug 1999 Volume: 9 Number: 377
Today's topics:
-DMULTIPLICITY and POP* (no pun intended) (Amos Blackman)
A matter of style? <mhammer@execpc.com>
Re: Cannot get pws to run perl scripts -- GOT IT!!! (elephant)
Re: eliminating a / in a word (elephant)
Re: embedding C in Perl? (Abigail)
finding arguments to fns. (Vardhan Varma)
Re: finding arguments to fns. (Martien Verbruggen)
Re: Get Executables path (Abigail)
Re: Help with form input to ouput in another frame? (Abigail)
Re: HELP: How to program command line args (Abigail)
Installing PERL (Brandon Fisher)
Re: Installing PERL (Eric Bohlman)
Re: Installing PERL (elephant)
Re: Invalid cross link error message (Abigail)
Re: low memory (Abigail)
MP3 Link Extraction wired2000@my-deja.com
Need some PERL/CGI thinkers please! <kalexa2@_NOSPAM_mindspring.com>
Re: Newbie: @INC problem with non-super-user installati (Martien Verbruggen)
Re: Newbie: how do I send shell script output to my per (Abigail)
Re: Perl Penetration Data (Abigail)
Re: Perl script as a FTP client (Abigail)
Re: Perl vs HTML (Larry Rosler)
Re: Please Help with regex (Martien Verbruggen)
Re: Please Help with regex (Abigail)
Re: reading in multiple unknown files and writing to it (Abigail)
Re: unus sed leo <tchrist@mox.perl.com>
Re: Useless error when {} unbalanced (Abigail)
Re: while loop teminates too early (Abigail)
Re: Why is it.... (Greg Andrews)
Re: working with = sign in a directory name - please he (Abigail)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Aug 1999 04:40:08 GMT
From: blackman@ice4.fas.harvard.edu (Amos Blackman)
Subject: -DMULTIPLICITY and POP* (no pun intended)
Message-Id: <slrn7qi5dq.b2m.blackman@ice4.fas.harvard.edu>
Keywords: MULTIPLICITY, multiple interpreters, stack
I'm really in a bind here, and I can't figure it out for the life of me.
I'm embedding multiple interpreters, and all my code is straightforward enough
that until I have to create a second interpreter, it doesn't matter whether or
not I compile with -DMULTIPLICITY. BUT, if I do compile with -DMULTIPLICITY
(which I will have to for the finished code), when I try to POP returns off
the stack, it dumps core. If I compile without -DMULTIPLICITY, it works fine,
exact same code. I've embedded single interpreters before and I'm positive
that my code for manipulating the stack is right.
Any ideas why -DMULTIPLICITY is causing the stack to get clobbered and how I
might fix it?
Thanks!
-amos
------------------------------
Date: Wed, 04 Aug 1999 23:25:07 -0500
From: Mike Hammernik <mhammer@execpc.com>
Subject: A matter of style?
Message-Id: <7ob3mg$hj3@newsops.execpc.com>
Every user on a portion of my system has a .config file. The file looks
like this
UserName: 'mhammer';
HostName: '';
DBHostName: 'paradox';
DBName: 'servicedb100';
Since I'm not a programmer, I rely on examples from the books that I
have. My solution, mostly using the Perl Cookbook works up to a point.
If for some reason the UserName is blank , I can't find any examples in
any book that show me how to stick a value between two single quotes. I
admit I may have overlooked the correct page and my vendor did not leave
Perl docs on these boxes, curse the fiend!!
#!/usr/bin/perl -w
system ("clear");
print "\n Select from the following: \n\n";
print " 0 = Switch paradox to active\n";
print " 1 = Switch singularity to active\n"
chomp ($N = <STDIN>);
opendir(DIR, "/home/";
while ( defined ($dirname = readdir DIR) )
next if $dirname =~ /lost\+found/;
next if $dirname =~ /^\.\.?$/; # skip . and .. directories
$cnf = "/home/$dirname/.config";
$rep = "/home/$dirname/.config.new;
$cnf_bck = "/home/$dirname/.config_bck;
open(FILE, "<$cnf") or die "Cannot open $cnf : $!";
open(REP, ">$rep") or die "Can't create $rep : $!";
select(REP);
while (<FILE>) {
if ($N == 0) {
s/singularity/paradox/;
} if ($N == 1) {
s/paradox/singularity/;
}
print REP $_ or die "Can't write to $rep : #!";
}
rename($cnf, $cnf_bck) or die "Can't rename $cnf to $cnf_bck : $!";
rename($rep, $cnf) or die "Can't rename $rep to $cnf : $!";
system("chown $dirname:user $cnf");
}
close(FILE);
close(REP);
closedir(DIR);
So this program does work except I have to write the whole file to
change one word. I looked at seek but that seemed too hard to use for
this problem. How can I get to a particular line, either UserName or
DBHostName since those are most likely to change or be wrong. I might
be better off to remove what's between quotes and insert the $dirname
which is really the user but my style of programming hinders me from
accomplishing that at this time.
How can I insert something between two single quotes and how to I go to
a specific line to do so?
My apologies for the rather long post and my gratitude and thanks in
advance for your help.
Hammer
------------------------------
Date: Thu, 5 Aug 1999 15:13:15 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Cannot get pws to run perl scripts -- GOT IT!!!
Message-Id: <MPG.1213c87a39b5c8dc989be7@news-server>
Kevin and Andrea Werner writes ..
>Try using a .plx extension instead of a .pl extension.
>
>It worked for me, but I don't know why. Can anyone explain why .plx works
>and .pl doesn't?
probably because you correctly set the .plx mapping up but didn't
correctly set the .pl mapping up
alternatively .. maybe there are versions of PWS out there that only talk
to DLLs .. although that sounds stupid - but Microsoft are involved - so
anything's possible
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Thu, 5 Aug 1999 15:09:55 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: eliminating a / in a word
Message-Id: <MPG.1213c7ae43ab9b19989be6@news-server>
Uri Guttman writes ..
>>>>>> "e" == elephant <elephant@squirrelgroup.com> writes:
> e> perldoc perlre
>
> e> it's got all your answers
>
>to eliminate a single char tr/// is better.
yes .. you're right .. I guess I direct these sorts of queries to regex
because for perl infants (1) s/// is easier to understand and (2) s/// is
generally more useful
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: 4 Aug 1999 23:35:32 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: embedding C in Perl?
Message-Id: <slrn7qi53f.tec.abigail@alexandra.delanet.com>
jfried@my-deja.com (jfried@my-deja.com) wrote on MMCLXIV September
MCMXCIII in <URL:news:7oa3pd$s4q$1@nnrp1.deja.com>:
()
() I need to find a way to make a C function call from within my
() perlscript. Any suggestions would be appreciated.
There are several manpages dealing with this.
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 5 Aug 1999 04:05:21 GMT
From: Vardhan Varma@basant.cadence.com (Vardhan Varma)
Subject: finding arguments to fns.
Message-Id: <1@basant>
I've to find all arguments to c function 'hello(arg)' in a set of
c files. arg will always be a string.
i cooked up this:
------------------------------------------------------------
#!/util/bin/perl -n
## We have a line, containing 0 or 1 or n mc_scan_plusargs
$x = 'hello[\ \t]*\([\ \t]*\"([-A-Za-z0-9_+]+)\"[\ \t]*\)';
study $_;
while ( ($a) = s/$x// ) {
print "+$a ";
}
-------------------------------------------------
hello can be invoked twice on same line also so i need to
replace first find on line with null, and try again.
This is not working, for some obious reasons, i'm overlooking.
Is there better way to do it
--
{ Vardhan Varma -- }
( Internal mailto: vardhan, phoneto: 4123 ) }
{ External mailto: Vardhan@Bitsmart.com phoneto:+91-118-562482 }
------------------------------
Date: Thu, 05 Aug 1999 04:59:48 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: finding arguments to fns.
Message-Id: <8T8q3.289$Qj2.11396@nsw.nnrp.telstra.net>
In article <1@basant>,
Vardhan Varma@basant.cadence.com (Vardhan Varma) writes:
>
> I've to find all arguments to c function 'hello(arg)' in a set of
> c files. arg will always be a string.
> $x = 'hello[\ \t]*\([\ \t]*\"([-A-Za-z0-9_+]+)\"[\ \t]*\)';
> while ( ($a) = s/$x// ) {
Didn't you say that you wanted to have a look at all the arguments?
Where do you capture them? And why are you using the s/// operator
when all you want to do is match? And you don't really allow newlines
anywhere.
I don't really think it's possible to do that. Constructions like:
rc = hello ( bar1, bar2(12), bar3);
if ((aa = hello ( baz1, baz2(bar1), baz3)) == NULL)
{
}
Will make your life terribly difficult if not impossible. There's
actually a FAQ related to this:
# man perlfaq6
Can I use Perl regular expressions to match balanced text?
And you need to balance the brackets after the function call, because
they can contain more brackets. And you need to exclude comments. Not
simple at all.
Maybe you can use something like cscope to do the hard work for you.
or maybe they know of tools on a C language group. I would give up on
the regexp, especially the single one. You may be able to do something
with multiple regexes.
Martien
--
Martien Verbruggen |
Interactive Media Division | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: 4 Aug 1999 23:46:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Get Executables path
Message-Id: <slrn7qi5n4.tec.abigail@alexandra.delanet.com>
Thomas Schmickl (schmickl@magnet.at) wrote on MMCLXIV September MCMXCIII
in <URL:news:37A8A952.9D4B3D37@magnet.at>:
^^ How can I determine (In the _BEGIN_ of the script-execution)
^^ in which directory the executet perl-script is ?
What if the script is in multiple directories?
Abigail
--
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 4 Aug 1999 23:57:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help with form input to ouput in another frame?
Message-Id: <slrn7qi6ct.tec.abigail@alexandra.delanet.com>
hads6307@my-deja.com (hads6307@my-deja.com) wrote on MMCLXIV September
MCMXCIII in <URL:news:7o9k39$fgb$1@nnrp1.deja.com>:
&& Can somebody help me with this problem? I need to take input from a
&& single textbox in a form and output the data into another frame. Can
&& somebody help with the framework below.
Someone else asked this off topic question today as well. His email
address is hads6307@my-deja.com, perhaps you can mail him and ask what
he found out. But don't discuss it in this group, as it's off topic here.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 4 Aug 1999 23:47:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: HELP: How to program command line args
Message-Id: <slrn7qi5pd.tec.abigail@alexandra.delanet.com>
Ala Qumsieh (aqumsieh@matrox.com) wrote on MMCLXIV September MCMXCIII in
<URL:news:x3ypv13culu.fsf@tigre.matrox.com>:
{}
{} % podgrep command line argument
{} /opt/GNUperl5.004_04/lib/pod/perlsec.pod:command line arguments, environment variables, locale information (see
{} /opt/GNUperl5.004_04/lib/pod/perlvar.pod:The array @ARGV contains the command line arguments intended for the
GNUperl?
How bizarre.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 05 Aug 1999 04:23:52 GMT
From: bf4kh@aol.comnospam (Brandon Fisher)
Subject: Installing PERL
Message-Id: <19990805002352.10606.00004787@ng-fq1.aol.com>
Hey,
I am learning PERL, and I download the stable release from the perl.com web
site. I have no idea how to "make" and "build" all of this source to use it.
Can someone please help me? I am running Windows 98. Thanks.
Brandon Fisher
http://members.aol.com/BF4KH/index.htm
------------------------------
Date: 5 Aug 1999 05:10:21 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Installing PERL
Message-Id: <7ob6bt$j35@dfw-ixnews5.ix.netcom.com>
Brandon Fisher (bf4kh@aol.comnospam) wrote:
: I am learning PERL, and I download the stable release from the perl.com web
: site. I have no idea how to "make" and "build" all of this source to use it.
: Can someone please help me? I am running Windows 98. Thanks.
At your present level of knowledge, you'd be much better off going to
<URL:http://www.activestate.com> and downloading a pre-compiled binary
version of perl (as of Perl 5.005, the ActiveState ports are generated
from the standard source code, so you're not missing out on the ability
to use modules like you were with the 5.003 ports).
------------------------------
Date: Thu, 5 Aug 1999 15:19:06 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Installing PERL
Message-Id: <MPG.1213c9d0cf317f62989be8@news-server>
Brandon Fisher writes ..
>I am learning PERL, and I download the stable release from the perl.com web
>site. I have no idea how to "make" and "build" all of this source to use it.
>Can someone please help me? I am running Windows 98. Thanks.
www.activestate.com has done all the work for you .. and then some - get
their binary version
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: 5 Aug 1999 00:02:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Invalid cross link error message
Message-Id: <slrn7qi6l2.tec.abigail@alexandra.delanet.com>
Gary Nielson (gnielson@charlotte.infi.net) wrote on MMCLXIV September
MCMXCIII in <URL:news:37A83C4C.8ACD77A5@charlotte.infi.net>:
%% Trying to figure out a problem with a perl script I am writing.
%% Basically, it seems to work fine when I run it from the command line but
%% when run as a cron job I get the error message:
%%
%% Invalid cross-device link at line 109.
That's an error from your system. It's not a Perl error; the fact
this happens in a Perl script is irrelevant. You try to do something
that's forbidden in your system. Don't do that, and go to a Unix
group to find out more about this problem.
%% system(`/bin/rm $LastGoodOneStored`);
system *and* `` ? Now that's obfuscated.... Specially since everyone
else would first grab for unlink....
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]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 5 Aug 1999 00:04:39 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: low memory
Message-Id: <slrn7qi6q3.tec.abigail@alexandra.delanet.com>
Steve Barrera (stbarr.wnt.sas.com) wrote on MMCLXIV September MCMXCIII in
<URL:news:37a840fe.405600692@newshost.unx.sas.com>:
''
'' I know PerlMongers aren't supposed to care about memory, but what
'' happens when you suddenly do?
Ever seen "One Flew Over the Cuckoo's Nest"?
Abigail
--
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 05 Aug 1999 05:07:28 GMT
From: wired2000@my-deja.com
Subject: MP3 Link Extraction
Message-Id: <7ob66c$kfb$1@nnrp1.deja.com>
Hi,
I'm looking for an easy way to extra HTTP and FTP links from a webpage
which end in .mp3 or .mp2 or .XXX (whatever I choose to define). To
date, the easiest way I have found was to use the LinkExtor routine and
then try to weed out those links it found which I don't want. Is there
an easier way anyone can think of (please include sample code if
possible) as to how to grab all links on a webpage which have an http://
or ftp:// and end in .mp3 or .mp2 or .XXX (whatever I choose to define).
Thank
Pat
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 5 Aug 1999 00:29:13 -0500
From: "Kevin Alexander" <kalexa2@_NOSPAM_mindspring.com>
Subject: Need some PERL/CGI thinkers please!
Message-Id: <7ob7ff$hvl$1@nntp2.atl.mindspring.net>
I'm not that unfamiliar with perl or CGI, but I recently moved to a new host
from another -- and it takes me time to adjust.
Below is a perl program "puttran.cgi" I wrote called by the line
<!--#include virtual="/cgi-bin/puttran.cgi"-->
in a .shtml page.
Originally it was supposed to add something into a form based on the
QUERY_STRING passed to it.
It seems like all the %ENV variables are not being passed to the program. Is
there a reason that they wouldn't?
For example if I called the shtml page with a "test.shtml?test123" I'll get
a "BAD!!" for entry (there is no $ENV('QUERY_STRING') value set) and the
$ENV{'REMOTE_HOST') isn't set either.
Any suggestions as to why?
-- begin code --
#!/usr/local/bin/perl
#
$uname=$ENV{'QUERY_STRING'};
print "Content-type: text/html\n\n";
print "+ $ENV{'REMOTE_HOST'} + == this is host<br>\n";
if ($uname eq "")
{
print "<input type=\"hidden\" name=\"transaction_no\" value=\"BAD!!\">";
}
else
{
print "<input type=\"hidden\" name=\"transaction_no\"
value=\"$uname\">";
}
--end perl--
--
Kevin Alexander
Shameless plug: http://www.aLawyerForMe.com
Bringing legal advice to the masses.
------------------------------
Date: Thu, 05 Aug 1999 04:34:56 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Newbie: @INC problem with non-super-user installation
Message-Id: <Qv8q3.276$Qj2.10544@nsw.nnrp.telstra.net>
In article <7o8n4q$2ck@netnews.hinet.net>,
"Pierre Mart" <pierremart@hotmail.com> writes:
> I just installed perl5.004_05. I am not super-user.
Why? The currently stable version is 5.005_03. Why install an old version?
> I followed the INSTALL document and sucessfully
> installed it to local directory, say "/usr/home/pierre/perl5".
>
> The default @INC seemed not to be modified accordingly.
> When I "use MakeMaker;", I got the message:
>
> Can't locate MakeMaker.pm in @INC
> (@INC contains: /usr/local/lib/perl5/i386-freebsd/5.00405
> /usr/local/lib/perl5 /usr/local/lib/perl5/site_perl/i386-freebsd
> /usr/local/lib/perl5/site_perl .) at - line 1.
You didn't follow the instructions in INSTALL unless the coders
removed sensible advice from that file between 5.004_04 and 5.004_05.
From the 5.004_04 INSTALL:
=head2 Installation Directories
The installation directories can all be changed by answering the
appropriate questions in Configure. For convenience, all the
installation questions are near the beginning of Configure.
[snip]
If you specify a prefix that contains the string "perl", then the
directory structure is simplified. For example, if you Configure with
-Dprefix=/opt/perl, then the defaults are
I would read INSTALL again, and see whether a recompile with this new
knowledge helps.
Martien
--
Martien Verbruggen |
Interactive Media Division | In a world without fences, who needs
Commercial Dynamics Pty. Ltd. | Gates?
NSW, Australia |
------------------------------
Date: 5 Aug 1999 00:07:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Newbie: how do I send shell script output to my perl program?
Message-Id: <slrn7qi6v4.tec.abigail@alexandra.delanet.com>
Russell Zah (russell.zah@tellabs.com) wrote on MMCLXIV September MCMXCIII
in <URL:news:37A87CB3.F1804D4B@tellabs.com>:
``
`` How do I send a shell script's output to my perl program for processing?
Read up on open.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 5 Aug 1999 00:38:58 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Penetration Data
Message-Id: <slrn7qi8qd.tec.abigail@alexandra.delanet.com>
Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXIV September
MCMXCIII in <URL:news:37a8c59f@cs.colorado.edu>:
!! [courtesy cc of this posting mailed to cited author]
!!
!! In comp.lang.perl.misc,
!! abigail@delanet.com writes:
!! :According to perlhist, 5.004_03 dates from September 1997.
!!
!! Well, the question wasn't well worded, so the answers are
!! funny. What I *meant* was
!!
!! What is the currently shipped version of Perl?
!!
!! When did the company first start shipping any version
!! of Perl at all?
That makes sense, but considering the amount of 1999 dates, I'm not
sure if everyone realized that.
Abigail
--
perl -wlne '}print$.;{' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 5 Aug 1999 00:08:53 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl script as a FTP client
Message-Id: <slrn7qi720.tec.abigail@alexandra.delanet.com>
Craig (cmd@nospam_altnews.com.au) wrote on MMCLXIV September MCMXCIII in
<URL:news:37A85DC5.FB07603E@nospam_altnews.com.au>:
**
** I found a Perl script a while ago which could be used as a FTP client to
** do things such as make dirs, delete & upload etc....
**
** Does anyone know where I could find this script?
You found it, then lost it again... Did you check your lost+found
directories?
Abigail
--
perl -we '$_ = q ?4a75737420616e6f74686572205065726c204861636b65720as?;??;
for (??;(??)x??;??)
{??;s;(..)s?;qq ?print chr 0x$1 and \161 ss?;excess;??}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 4 Aug 1999 21:04:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl vs HTML
Message-Id: <MPG.1212ad1cc8b85dc8989dda@nntp.hpl.hp.com>
In article <WL7q3.247$Qj2.9513@nsw.nnrp.telstra.net> on Thu, 05 Aug 1999
03:43:50 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
> In article <37A8A2D9.234B53D0@kawo2.rwth-aachen.de>,
> Alex Farber <alex@kawo2.rwth-aachen.de> writes:
> > YANG Tong wrote:
> >> The problem is the symbol " or ' or nothing ...
> >
> > ["']?
>
> is identical in behaviour to ("|'|) which is in the original try, even
> though it is more elegant/customary.
... and much faster.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 05 Aug 1999 04:21:56 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Please Help with regex
Message-Id: <Ej8q3.271$Qj2.10544@nsw.nnrp.telstra.net>
[Please consider trimming your signature. Normally accepted signature
lengths are 4 lines or less.]
In article <PRVL304011EEFC@prevalent.nl>,
"Pieter Brouwer" <p.brouwer@prevalent.nl> writes:
> I'm trying to strip a piece of text out of a string. The text that need to
> be stripped from the string should start with "/*" and ends with "*/". This
> can be nested and spanning multiple lines.
Are these pieces of text maybe .... C comments????
# perldoc -tq comment
Found in /usr/local/lib/perl5/5.00502/pod/perlfaq6.pod
How do I use a regular expression to strip C style comments from a file?
Since you were already working with regexps, maybe you should have
read the perl regexp faq.. perlfaq6.
Martien
--
Martien Verbruggen |
Interactive Media Division | That's funny, that plane's dustin'
Commercial Dynamics Pty. Ltd. | crops where there ain't no crops.
NSW, Australia |
------------------------------
Date: 5 Aug 1999 00:19:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Please Help with regex
Message-Id: <slrn7qi7lb.tec.abigail@alexandra.delanet.com>
Ala Qumsieh (aqumsieh@matrox.com) wrote on MMCLXIV September MCMXCIII in
<URL:news:x3ylnbrcola.fsf@tigre.matrox.com>:
**
** "Pieter Brouwer" <p.brouwer@prevalent.nl> writes:
**
** > I'm trying to strip a piece of text out of a string. The text that need to
** > be stripped from the string should start with "/*" and ends with "*/". This
** > can be nested and spanning multiple lines.
**
** Your question is a FAQ. From perlfaq6:
**
** How do I use a regular expression to strip C style comments
** from a file?
No, his question is _not_ a FAQ. At least, not this one. There is a subtle,
but fatal, difference in the specification of the strings he wants to remove,
and C style comments.
It's the word "nested" that you overlooked.
** Always consult the FAQs first.
Always read the question carefully first. ;-)
Now, there's one thing that's important. Can the delimiters be escaped?
That is, is \*/ an end delimiter or not? Is \/* a starting delimiter?
If not, it's just a matter of finding a balanced expression, with
a variation on the parens. You can do this with the new featurs of
perl5.005 regexes.
If delimiters can be escaped, things get more complicated. You'd need
to combine the entry in the FAQ with the regex for matching balanced
expressions. Which will be tricky, hairy and error phrone. And that's
without loop unrolling for speed. In that case, you might be better off
with a couple of small regexes, and a simple state machine.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 5 Aug 1999 00:24:41 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: reading in multiple unknown files and writing to it
Message-Id: <slrn7qi7vk.tec.abigail@alexandra.delanet.com>
quyluu@my-deja.com (quyluu@my-deja.com) wrote on MMCLXIV September
MCMXCIII in <URL:news:7oa4j1$sm1$1@nnrp1.deja.com>:
..
..
..
.. Hi Im trying to open all *.txt files in a directory and append to
.. the beginning of the file. I know my appending part is not correct,
.. but I cannot seem to be able to open *.txt files in a dir, for writing,
.. just raeding.
..
.. Here is one of the things i've tried:
..
.. while(open(FILE,<*.txt>)) {
.. print ("Opening works!\n");
..
.. seek FILE,0,0; #this statement doesnt seem tow ork
What's the return value of seek? What's $!?
.. write(FILE,"IT WORKS!"); #this doesn't cuz i can't open it for
.. #writing
Why not? What happens when you try to open if for writing?
.. close(FILE);
.. }
..
.. I've tried...doing open(FILE,">*.txt") doesn't work
What makes you think you can open many files in a single open() statememt?
There's no globbing in open.
..
.. Any help is GREATLY Appreciated!
..
.. Kevin
..
..
..
.. Sent via Deja.com http://www.deja.com/
.. Share what you know. Learn what you don't.
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 4 Aug 1999 22:56:21 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: unus sed leo
Message-Id: <37a91975@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
That took three minutes to propagate from thee to me. What
is the world coming to?
In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
:> "Unus sed leo", says the lioness, meaning "One, but [it is] a lion."
:
:How very clever of the animals in Aesop the Greek's fables to speak
:Latin!
Ah, but I've no Greek to read it thus.
Here's a more extensive quote from The Latin Reader at
http://www.slu.edu/colleges/AS/languages/aes-h.html
Vulpes et Leaena.
Vulpes leaenam exprobrabat, quod non nisi unum catulum
pareret. Huic dicitur respondisse, unum, sed leonem.
Which just goes to show you that vulpine exprobration of lions is
not always going to elicit the answer one was hoping for.
Apparently the Romans so appreciated the sentiment that they took the
phrase to heart and have gone on repeating it as a standard catch-phrase
for the next couple millennia, even after they decided that the name of
their tongue was no longer Latin, but Italian. Search for it and you'll
come up with some odd and interesting things, like this
http://rai-enac.it/volabilita/precedenti/35-36/art08.htm
One more lion bit: I've recently heard tell that the lions of Greece
and Asia Minor had no great manes as have their African cousins due
to a lack of hyenas to apply evolutionary pressure to let develop such
large protective neckware. Apparently this is the African male lions'
main/mane job.
:Indeed. And then if anything useful (like Unix or C, for example)
:emerged, they threw it over the wall to my lab, where scores of non-
:lions (drones, I see you call them) did source control, documentation,
Actually, the drones in the tales told to me were sometimes rather more
of the mainframe dataprocessing flavor.
:(ObPerl: vide Perl!)
I was thinking that, too, but didn't think "vide margaritam" would come
out as trippingly.
--tom, who hopes that one can infer the appropriate emoticons peppered
throughout this overly late-night posting of supersillinesses.
--
Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to megatons
several minutes ago. We don't need no stinkin' tactical nukes.
(By the way, do you have change for 10 million people?) --lwall
------------------------------
Date: 5 Aug 1999 00:28:32 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Useless error when {} unbalanced
Message-Id: <slrn7qi86q.tec.abigail@alexandra.delanet.com>
Jerome O'Neil (jeromeo@atrieva.com) wrote on MMCLXIV September MCMXCIII
in <URL:news:7o9mka$8r7$2@brokaw.wa.com>:
** In article <7o8om2$9g3$1@usenet01.srv.cis.pitt.edu>,
** fmgst+@pitt.edu (Filip M. Gieszczykiewicz) writes:
** > URGH! The longer my scripts get, the more annoying the perl error for
** > unbalanced {} is getting. Missing { is informative:
** >
** > Oh gurus, what's the answer?
**
** When you start a new block, always put the closing bracket in before
** you do anything else.
But that breaks your flow of typing.
Besides, 90% of my unbalanced {} errors come from too many closing }s.
And if you read Filips question, you see his problem was a missing {,
not a missing }.
Abigail
--
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} # Yet Another silly JAPH by Abigail
sub A::FETCH {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 5 Aug 1999 00:31:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: while loop teminates too early
Message-Id: <slrn7qi8bu.tec.abigail@alexandra.delanet.com>
Andy Collado (acollado@uiuc.edu) wrote on MMCLXIV September MCMXCIII in
<URL:news:37A89BC0.E073F6EC@uiuc.edu>:
?? I have a while loop that should verify that a user is valid, but it will
?? only validate whoever is the first user in the user file.
?? Here's the block of code that I'm using:
??
?? open (USERS, "C:/www/users");
?? while($line=<USERS>) {
?? if ($line=~/^$user/) {
?? ✓
?? }
?? else {
?? &goaway;
?? }
?? exit;
?? }
Well, considering you put an exit in the loop that's executed all the
time, what do you expect?
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 4 Aug 1999 21:18:40 -0700
From: gerg@shell.ncal.verio.com (Greg Andrews)
Subject: Re: Why is it....
Message-Id: <7ob3b0$cfc$1@shell1.ncal.verio.com>
Chris Goodwin <archer7@mindspring.com> writes:
>
>why is it that I, who have only been hacking Perl for ~3 days, can read
>through the documentation and the previous newsgroup postings (7000+ of them
>on my server) and write up a 122-line program that does what I want it to do
>(which is turn my text into my HTML -- not *entirely* finished yet, but the
>rest is details -- I've gotten over my hurdles), all *without* having to ask
>anyone for help, while other people around here, who apparently have been
>hacking Perl for longer than I, have to come in and ask the same questions
>over and over?
>
Welcome to Level Three.
-Greg
--
::::::::::::::::::: Greg Andrews gerg@wco.com :::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
------------------------------
Date: 5 Aug 1999 00:34:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: working with = sign in a directory name - please help!
Message-Id: <slrn7qi8h2.tec.abigail@alexandra.delanet.com>
Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMCLXIV September
MCMXCIII in <URL:news:7o9pdf$cp4$1@lublin.zrz.tu-berlin.de>:
"" Timothy J Flynn <tflynn@iastate.edu> wrote in comp.lang.perl.misc:
"" >I'm sorry but I never saw where you addressed my problem. Does anyone know
"" >why perl can't work with the = sign at the beginning of the directory name?
"" >I posted examples like you asked with no response...
""
"" I think I replied to that one before. The answer is, that Perl doesn't
"" care if there's a '=' in a directory name. What makes you think it does?
Perhaps Perl is thinking there's pod to be found, can waits till you cut?
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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 V9 Issue 377
*************************************