[13609] in Perl-Users-Digest
Perl-Users Digest, Issue: 1019 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 8 06:05:36 1999
Date: Fri, 8 Oct 1999 03:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <939377111-v9-i1019@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 8 Oct 1999 Volume: 9 Number: 1019
Today's topics:
Re: Caliing method by reference with arrow operator <skilchen@swissonline.ch>
Re: Converting from Decimal to Binary (Larry Rosler)
Re: Das GlasPerlenspiel jmn.ac.delete@abanet.it
Data Inheritance and XS <crdevilb@mtu.edu>
Date variable hakanogren@my-deja.com
Re: Hash size limit ? (longish) <csaba.raduly@sophos.com>
Re: Hosts running Mason and ImageMagic (Abigail)
How to write an EOF in to a file? <linyong2000@990.net>
Re: html strip regexp error (ton)
Re: inserting new character <r42317@email.sps.mot.com>
Re: newbie help, module for changing date/time fromat t <nd@maths.uq.edu.au>
Re: Perl Doc.. (Abigail)
Re: Perl Doc.. (Martien Verbruggen)
Re: Perl Doc.. <crdevilb@mtu.edu>
Read email through web xyptilon@my-deja.com
Re: Searching an array (Abigail)
sendmail help (GHML)
Splash screen <edo@tin.it>
Re: STDERR output doesn't match $! (Abigail)
Re: Using a regexp in an index function, can it be done (Larry Rosler)
What is THE book for PERL? <jjyooi@dcs.qmw.ac.uk>
Re: Which Search engine script? <hydro@geminis.adi.uam.es>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 08 Oct 1999 07:30:45 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: Caliing method by reference with arrow operator
Message-Id: <F4hL3.22888$m4.84598563@news.magma.ca>
Abigail <abigail@delanet.com> wrote in:
news:slrn7vos6r.81.abigail@alexandra.delanet.com
>
[Abigail]
> ~~ > If you read the documentation carefully, you know you cannot have
> ~~ > a reference to a method. What you have is a reference to the
> ~~ > subroutine in appropriate class. Slight, but essential
> ~~ > difference.
> ~~
[me]
> ~~ Why? "subroutine in appropriate class" sounds very much like a
> ~~ definition of "method".
>
[Abigail]
> But it doesn't do inheritance.
>
By your definition?
In the following further modification of Greg's example (extended with
two methods to try out the syntax shown by Damian Conway) the
inheritance of the methodreference seems to be working. So what am i
missing?
#! /usr/bin/perl -w
use strict;
{
package Foo;
sub new {
my $class = shift;
my $startval = shift;
bless { COUNT => $startval } => $class;
}
sub increment {
$_[0]->{COUNT}++;
}
sub callmethod {
my $self = shift;
my $methodref = shift;
print "callmethod in $self: ",
$self->$methodref(), "\n";
}
sub callmethods1 {
my $self = shift;
my $methodtable = shift;
print "callmethods1 in $self: ",
$self->${\$methodtable->[0]}(), "\n";
}
sub callmethods2 {
my $self = shift;
my @methodtable = @_;
print "callmethods2 in $self: ",
$self->${\$methodtable[0]}(), "\n";
}
}
{
package Bar;
@Bar::ISA = qw/Foo/;
sub decrement {
--$_[0]->{COUNT};
}
}
package main;
my $methodref0 = \&Foo::increment;
my $foo = new Foo(555);
$foo->callmethod($methodref0);
my $methodref1 = $foo->can('increment');
$foo->callmethods2($methodref1, $methodref0);
my $bar = new Bar(444);
$bar->callmethod($methodref0);
$bar->callmethods1([$methodref0, $methodref1]);
$bar->callmethods1([$methodref1]);
$bar->callmethods2($methodref1);
my $methodref2 = $bar->can('increment');
$bar->callmethod($methodref2);
my $methodref3 = $bar->can('decrement');
$bar->callmethod($methodref3);
$bar->callmethod($methodref3);
------------------------------
Date: Thu, 7 Oct 1999 22:12:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Converting from Decimal to Binary
Message-Id: <MPG.12671cfd7d7e8e0f98a05c@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <Pine.GSO.4.10.9910080023460.14462-100000@crusoe.crusoe.net>
on Fri, 8 Oct 1999 00:25:44 -0400, Jeff Pinyan <jeffp@crusoe.net>
says...
> On Oct 8, Kenneth Rose blah blah blah:
> > I read the FAQs and saw the code for:
> > $binary_string = join('', unpack('B*', "\x29"));
> > in perlfaq4. But \x29 is a hex value. I want to convert from decimal.
>
> GAH! That hurts my brain.
>
> You DO realize that \x29 is the hexadecimal representation for a decimal
> number, right? It's not a special data type in Perl. And to avoid the
> quotes, use 0x29 notation (leading 0x or 0X means hex, leading 0 means
> octal). Numbers generally shouldn't have quotes around them.
>
> Anyway, did you TRY using a decimal number in the hexadecimal number's
> place? No, methinks.
GAH! What good would that do?
print unpack 'B*' => 112;
001100010011000100110010
This is hex 31 31 32. 'unpack' works on strings, not numbers.
Anyway, did you TRY using a decimal number in the hexadecimal number's
place? No, methinks.
I posted a correct solution already.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 8 Oct 99 08:09:19 GMT
From: jmn.ac.delete@abanet.it
Subject: Re: Das GlasPerlenspiel
Message-Id: <37fda6af.0@etsv0008>
>> David Cassell wrote in message <37FBB4AF.57D1A7FE@mail.cor.epa.gov>...
>BTW, there is a charter for this newsgroup if you want to look
>it up.
Where can I find it?
John.
------------------------------
Date: 6 Oct 1999 22:04:52 GMT
From: Colin R. DeVilbiss <crdevilb@mtu.edu>
Subject: Data Inheritance and XS
Message-Id: <7tgh24$dm5$1@campus3.mtu.edu>
I am using perl/Gtk to develop an interface, and I would like to create
a subclass of Gtk::Window which would have an ``attached'' data member
of my own class. My intention is to pass Foo::Gtk::BarWindow a reference
to a Foo::Bar at creation time so that user actions on the BarWindow can
affect the Foo::Bar.
Since a Gtk::Window is really a C struct hidden behind XS, I don't see
how to add a data member to it.
Solutions I have considered:
1) making Foo::Gtk::BarWindow a new aggregate data structure which
contains both a Foo::Bar and a Gtk::Window, but then the @ISA
relationship won't work unless there is some way (that I don't know)
to pass that information up the inheritance tree.
2) in Foo::Gtk::Barwindow::new, connecting all the signals (callbacks,
for those with different toolkit experience) to closures which
include the Foo::Bar object. Right now this solution seems like
probably the best, but it would be far preferable to actually
aggregate the Foo::Bar into the BarWindow if possible.
if anyone has ever dealt with a similar situation, I would appreciate
hearing about any considered or chosen solutions.
thank you for your time.
Colin R. DeVilbiss
crdevilb@mtu.edu
------------------------------
Date: Fri, 08 Oct 1999 09:19:02 GMT
From: hakanogren@my-deja.com
Subject: Date variable
Message-Id: <7tkctv$8js$1@nnrp1.deja.com>
Is there a Date variable in Perl and how do I use
it?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 08 Oct 1999 09:20:56 +0100
From: Csaba Raduly <csaba.raduly@sophos.com>
Subject: Re: Hash size limit ? (longish)
Message-Id: <37FDA968.222F8F46@sophos.com>
Csaba Raduly wrote:
>
> I've written a log file analyser used to test our new virus engine.
> Basically it checks that the right viruses are found in the various
> test files. The log files look like this:
> (first character is a \t : )
> M:\path...\filename
> >>> Virus 'Melissa' found in M:\path...\filename
>
> There's an HTML document describing which files contain which viruses.
> Another perl script parses it and produces perl include files
> with the following format:
> ----cut here-------------chapter32.exp----------
> %expected = (
> 'file1', 'virus1',
> 'file2', 'virus2',
> );
> ----cut here-------------chapter32.exp-end------
>
> The basename of the file is the same as the log file for the
> corresponding chapter (i.e. chapter23.log and chapter32.exp)
> The correct exp file is included via do $expfile
> (it used to be require, if you remember my previous post
> about "How to undo a require")
>
> During processing the filename is isolated and then used
> as a key into the hash, and the value (expected virus)
> is checked against the actual virus detected.
>
> Yesterday I decided that it's time to do things on a grand scale
> and took the log file generated by the "official" version run
> over the entire virus collection, and passed it through
> yet another perl script to generate a big exp file
> (and I mean big: it's over 3M in size)
> But when I try to include the big one using do,
> the hash appears to be empty.
> ( foreach $key (keys %expected){ print $key } does nothing )
> No error message is generated.
>
> I started to chop it down to see where it stops working.
> Apparently the limit is around 1761 lines or a file of 93500 bytes.
> I suspect the problem isn't some limit in the hash size;
> rather an input buffer size limit (?)
>
> I'm using perl 5.0 patchlevel 5 subversion 53 on OS/2
>
> Any ideas what's up ?
>
> Csaba
>
all right, it's all working now. I'll post the full report shortly,
but I'm curious if anyone can guess what happened. Think silly.
Hint #1 : I'm slapping my forehead :-)
Hint #2 : It's not OS/2 specific
Csaba
--
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/>GMU d- s:- a30 C++$ UL+ P+>+++ L++ E- W+ N++ o? K? w++>$ O++$ M-
V- PS PE Y PGP- t+ 5 X++ R* tv++ b++ DI+++ D++ G- e+++ h-- r-- !y+
-----END GEEK CODE BLOCK-----
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: 8 Oct 1999 00:13:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Hosts running Mason and ImageMagic
Message-Id: <slrn7vqvbu.1fk.abigail@alexandra.delanet.com>
Norman Bunn (norman.bunn@mci.com) wrote on MMCCXXVIII September MCMXCIII
in <URL:news:Zm7L3.5976$Bf6.75999@pm02news>:
?? Does anyone know of a web hosting company running Mason and/or ImageMagic?
And this has what to do with Perl?
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== 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: Fri, 8 Oct 1999 17:23:25 +0800
From: "Daniel Y.L." <linyong2000@990.net>
Subject: How to write an EOF in to a file?
Message-Id: <7tkdaf$gbk$1@news.ntu.edu.sg>
Hi,
I want to know how to write an EOF flag to a file?
My code is as follows:
# open an file to write some strings;
# .....
# open it again to read;
# undef $/;
# $contents = <FILEHANDLE>; # it only read one line, it is correct;
while (<FILEHANDLE>) {
$contents .= <FILEHANDLE>; # hang up, seems no EOF;
}
I also tried to clear the $INPUTY_RECROD_SEPARATOR, $/ to read the whole
file contents. But, it also hang up.
Any suggestions? Thanks in advanced.
Lin Yong
------------------------------
Date: 8 Oct 1999 07:31:09 GMT
From: no@email.com (ton)
Subject: Re: html strip regexp error
Message-Id: <7tk6jt$etg$1@enterprise.cistron.net>
In article <MPG.126684b89cf1872b98a056@nntp.hpl.hp.com>
lr@hpl.hp.com (Larry Rosler) wrote:
> In article <7ti8f9$8n7$1@enterprise.cistron.net> on 7 Oct 1999 13:50:33
> GMT, ton <no@email.com> says...
>> Via the FAQ I got this regexp to strip HTML tags:
>>
>> $val =~ s{<(?:[^>'"]*|".*?"'.*?')+>}{}gsx;
>>
>> I'm using this statement to strip HTML from a string.
>> In a CGI environment. Now I get servererrors:
>>
>> /<(?:[^>'"]*|".*?"'.*?')+>/: regexp *+ operand could be empty
>>
>> Can any help to fix the expression, because it's a bit abracadabra to me.
>
> There is an obvious error in the regex.
>
> $val =~ s{<(?:[^>'"]*|".*?"|'.*?')+>}{}gsx;
> ^
> ^
> But I don't know what FAQ you got that from. Mine (perlfaq9: "How do I
> remove HTML from a string?") has this regex:
>
> s/<(?:[^>'"]*|(['"]).*?\1)*>//gs
>
> The substantive change there is the final '*' instead of '+'.
>
> Perhaps that will fix your problem.
>
This last regexp gives me the same error.
The regexp I gave was the regexp used by
http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/striphtml.gz
as stated in the FAQ.
I don't want a perfect stripping of HTML code, I just want
to know IF there is any HTML code in a string.
Maybe the expression becomes much simpeler then.
Regards,
Ton
------------------------------
Date: Fri, 08 Oct 1999 15:49:49 +0800
From: Noira Hadi <r42317@email.sps.mot.com>
To: mgjv@comdyn.com.au
Subject: Re: inserting new character
Message-Id: <37FDA21C.C9FB9E1A@email.sps.mot.com>
Martien,
Thanks for the help. I modified your script to be something like below as
your script failed to open data file in my machine:
#!/usr/bin/perl -w
open(INF,"data") ;
use strict;
my $length;
my @buf;
while (<INF>)
{
chomp;
if ($_ =~ /D/)
{
$length = @buf unless defined $length;
push @buf, 'C' while(@buf < $length);
push @buf, $_;
print join(',', @buf), ",";
@buf = ();
}
else
{
push @buf, $_;
}
}
close(INF);
I understand that you are assuming the first set of B is the longest
length for the entire data, such as below:
A,B,B,B,B,B,B,B,B,B,B,D
A,B,B,B,B,C,C,C,C,C,C,D
A,B,B,C,C,C,C,C,C,C,C,D
Anyway, when the input data for 'B' is shorter than the rest, the output
will be like:
A,B,B,B,B,B,D
A,B,B,B,B,B,B,B,B,B,B,D
A,B,B,B,B,C,D
A,B,B,C,C,C,D
My question is:-
- Can I get column field allocated for B fixed(say 10), otherwise replace
with C when
B is less than 10, such as below:
A,B,B,B,B,B,C,C,C,C,C,D
A,B,B,B,B,B,B,B,B,B,B,B,D
A,B,B,B,B,C,C,C,C,C,C,D
A,B,B,C,C,C,C,C,C,C,C,D
Thanks and Regards,
hadi
------------------------------
Date: Fri, 08 Oct 1999 15:54:30 +1000
From: Nathan Dunn <nd@maths.uq.edu.au>
Subject: Re: newbie help, module for changing date/time fromat to single number.
Message-Id: <37FD8716.96C78961@maths.uq.edu.au>
Larry Rosler wrote:
>
> In article <37FAA01B.CBDEABB@maths.uq.edu.au> on Wed, 06 Oct 1999
> 11:04:27 +1000, christopher dawson <cmd@maths.uq.edu.au> says...
>
> ...
>
> > I assumed that you'll write 2000 as mm-dd-100
>
> Why do you assume that? No one will write it that way (except some
> defective Perl and C programs :-).
I can't justify that assumption, I'd add 100 like you did. Actually I'd
just use your code.
Chris.
------------------------------
Date: 8 Oct 1999 00:27:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Doc..
Message-Id: <slrn7vr04k.1fk.abigail@alexandra.delanet.com>
Bruno Kovac (bkovac@gmx.net) wrote on MMCCXXVIII September MCMXCIII in
<URL:news:7tiai8$q7d$1@as102.tel.hr>:
() where can I get list of perl commands and help for each command?
It's a secret. Part of the fun of learning Perl is to figure out which
commands there are, and how they work. It would be silly to include 1200+
pages of man pages, available as 'man perl'. That would be for wussies!
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: Fri, 08 Oct 1999 06:56:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl Doc..
Message-Id: <WAgL3.162$u83.8870@nsw.nnrp.telstra.net>
On 8 Oct 1999 00:27:07 -0500,
Abigail <abigail@delanet.com> wrote:
> Bruno Kovac (bkovac@gmx.net) wrote on MMCCXXVIII September MCMXCIII in
> <URL:news:7tiai8$q7d$1@as102.tel.hr>:
> () where can I get list of perl commands and help for each command?
>
> It's a secret. Part of the fun of learning Perl is to figure out which
> commands there are, and how they work. It would be silly to include 1200+
> pages of man pages, available as 'man perl'. That would be for wussies!
After all, the number of combinations of legal characters that could
make up a command is limited. Large, but limited. You could try them
all..
or you could read the perlfunc documentation.
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: 7 Oct 1999 17:16:31 GMT
From: "Colin R. DeVilbiss" <crdevilb@mtu.edu>
Subject: Re: Perl Doc..
Message-Id: <7tikhf$ihd$1@campus3.mtu.edu>
Bruno Kovac <bkovac@gmx.net> wrote:
> where can I get list of perl commands and help for each command?
if you have a proper installation of perl on your machine, the following
(or something like it) at the command line should provide you places to
start looking for help:
perldoc perl
perldoc perlfunc
perldoc perlfaq
HTH.
Colin DeVilbiss
crdevilb@mtu.edu
------------------------------
Date: Fri, 08 Oct 1999 09:04:08 GMT
From: xyptilon@my-deja.com
Subject: Read email through web
Message-Id: <7tkc24$7v9$1@nnrp1.deja.com>
Can somebody help me on how i should write a program that can
connect to a mailserver and read the mail from there ?
Can somebody please point me in the right direction ?
Thank you in advance.
Xyptilon
frenzyr@writeme.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Oct 1999 00:34:56 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Searching an array
Message-Id: <slrn7vr0j9.1fk.abigail@alexandra.delanet.com>
David Walford (davewal@echo.corp.sgi.com) wrote on MMCCXXIX September
MCMXCIII in <URL:news:7tjk91$gel$1@murrow.corp.sgi.com>:
.. This there a fast way to search through the elements of an array
.. and return the number of matches found without doing a
.. for loop.
..
.. Better way than this:
..
.. for (@array) {
.. count++ if ($_ eq $test_var);
.. }
$count = grep {$_ eq $test_var} @array;
Of course, that still loops.
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: 08 Oct 1999 08:35:20 GMT
From: ghml@aol.com (GHML)
Subject: sendmail help
Message-Id: <19991008043520.03798.00000481@ng-fb1.aol.com>
I need some help with forms and sendmail. I would like to tweak my cgi mail
script so that it does MORE than just the following:
foreach $key (keys(%FORM)) {
print MAIL "$key = $FORM{$key}\n"; }
That basically prints out whatever form elements you have specified in your
HTML code. This is very basic and very annoying. If a line is left blank, it
prints that line. For example, say the user leaves the comments section blank.
We get this:
Name: Johnny Smith
State: New York
Comments:
I'm sure there's some way to specify in the cgi script for it to omit blank
entries. Something like:
while $FORM{$key} is not equal to " " or zero or null, then don't print.
I am unclear as to what the exact syntax would be, but I'm sure there is a way.
Also, do you know of any way to present the email form data in exactly the same
order as it appeared on the HTML page? I know you can type in the cgi script
exactly what you want to appear like:
print MAIL "$somestring"
print MAIL "$someotherstring"
But that is very confining. I have one HTML page set up like so:
#1 Checkbox...then a TextField
#2 Checkbox...then a TextField
Name
Email Address
#3 Checkbox...then a TextField
#4 Checkbox...then a TextField
Submit Button
The generated email looks insane. For some reason the email address comes
first, then the #3 (blank) text field, then the name, then the #1 checkbox,
etc. There is no order whatsoever.
Can anyone help me with this? Or at least refer me to a website that deals with
precise email/sendmail formatting? Thanks in advance!
George
------------------------------
Date: Fri, 8 Oct 1999 10:28:39 +0200
From: Edo <edo@tin.it>
Subject: Splash screen
Message-Id: <nv9kt7.5b.ln@scatolinux.it>
Hi!
First of all, sorry for my English!!!
I'd like to know if it is possible, inside a perl script, to visualize a
splash screen.
Thanks
Edo
------------------------------
Date: 8 Oct 1999 00:42:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: STDERR output doesn't match $!
Message-Id: <slrn7vr11g.1fk.abigail@alexandra.delanet.com>
Natalya Barner (nbarner@uswest.com) wrote on MMCCXXVIII September
MCMXCIII in <URL:news:37FCD69A.E022B598@uswest.com>:
`` I'm trying to write some code which will output the OS error message if
`` a system call fails.
`` The problem I'm having is that the message going to STDERR is not the
`` same message that's getting stored in $!.
``
`` Here's the code:
`` #!/usr/local/bin/perl
`` $rc = system("mkdir mydir");
`` if ($rc)
`` {
`` print "couldn't do it: $!\n";
`` }
``
`` And here's the output:
`` mkdir: cannot create mydir: File exists
`` couldn't do it: No such file or directory
What makes you think that the command you are executing will
set $!? It won't.
Why don't you just use:
mkdir mydir => 0755 or print "couldn't do it: $!\n";
Abigail
--
split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};
-----------== 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, 7 Oct 1999 21:59:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Using a regexp in an index function, can it be done?
Message-Id: <MPG.12671a048564a3a198a05b@nntp.hpl.hp.com>
In article <7tjiaf$ah1$1@rguxd.viasystems.com> on 8 Oct 1999 01:44:47
GMT, lt lindley <ltl@rgsun40.viasystems.com> says...
> Larry Rosler <lr@hpl.hp.com> wrote:
> :>In article <Pine.SGI.4.10.9910071756520.262457-
> :>100000@prokofiev.fccc.edu> on Thu, 7 Oct 1999 18:07:54 -0400, Jonathan
> :>W. Arthur <jwarthur@prokofiev.fccc.edu> says...
> :>> I need to know the position that a particular regular expression first
> :>> occurs in a line of characters.
...
> :>/$pattern/g; # Add 'o' modifier if $pattern never changes
> :>print pos() - length $pattern, "\n";
...
> Obviously, the pattern must match a fixed number of characters (i.e.,
> no * ? + {,} quantifiers).
>
> Nice.
The improvement you and Rick Delaney suggested removes the limitation
and makes it complete.
> $_ = 'xyzxyzxyz';
> my $pattern = qr{((?:zxy)+)};
> if (/$pattern/g) {
> print pos() - length $1, "\n";
> }
What is the function of the '+' part of the regex? Isn't just /(zxy)/
(as Rick had it) enough? With the '+' it matches more, so is marginally
slower.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 08 Oct 1999 08:03:04 +0100
From: Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk>
Subject: What is THE book for PERL?
Message-Id: <37FD9728.257BC43@dcs.qmw.ac.uk>
Can anyone in the know tell me the _best_ book to read/buy for research
and reference into PERL?
--
Johnny Ooi. Aliases: Loopy, Tuxedo Mask, Quote Master.....
E-Mail : jjyooi@dcs.qmw.ac.uk or jjyooi@yahoo.com
WWW : http://www.dcs.qmw.ac.uk/~jjyooi/
ICQ No : 6155774
"Stay sane guys!"
===============================================================
------------------------------
Date: Fri, 08 Oct 1999 10:55:11 +0200
From: Hydro <hydro@geminis.adi.uam.es>
Subject: Re: Which Search engine script?
Message-Id: <37FDB16E.5AD2FA0E@geminis.adi.uam.es>
Try to use the technotrade's one at http://www.technotrade.com
Mario
van Weelden wrote:
> I have a homepage with information of different companies. Now I want
> to install a search engine on this homepage, but which script is the
> best and easy to use? It must be possible to search HTML pages with
> keywords. But it must also be possible to look for a specific company
> name, country, etc... If you know a good script, let me know. Thanks
> in advance! John
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 1019
**************************************