[15693] in Perl-Users-Digest
Perl-Users Digest, Issue: 3106 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 20 03:05:23 2000
Date: Sat, 20 May 2000 00: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)
Message-Id: <958806309-v9-i3106@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 20 May 2000 Volume: 9 Number: 3106
Today's topics:
Re: a wacky idea <zigouras@mail.med.upenn.edu>
ARGGH!HELP! Can't parse these characters ÿ þ <adsf@dsaf.com>
Re: Bug or Feature: Can't dereference array ref inside (Joe Petolino)
Re: Bug or Feature: Can't dereference array ref inside (Steve Leibel)
getgrnam function on Win32 <James.Francisco@bondhub.com>
Hash references and subroutines. (Egg J. LeFume)
Re: Hash references and subroutines. <sweeheng@usa.net>
Re: Hash references and subroutines. <blank666@bart.nagaputih.net>
Re: Hash references and subroutines. <mcguirk@incompleteness.net>
Re: matching question(s) <s0218327@unix1.cc.ysu.edu>
Re: Need Help with Child Processes (Steve Leibel)
Re: Net::Telnet & Sendmail <sweeheng@usa.net>
Re: Newbie asks how to split file by x number of lines? <y-o-y@home.com>
Re: Parse::RecDescent problem, $::RD_TRACE showing some <ocschwar@NOSPAM.mit.edu>
pc line breaks (Markus Svilans)
Perl for Win32 (Arthur Merar)
Re: Perl for Win32 <tony_curtis32@yahoo.com>
Re: Perl for Win32 <ervint@worldnet.att[remove_this_stuff].net>
Re: PPMFIX Doesn't Fix Anything <famouswizardNOfaSPAM@yahoo.com.invalid>
printing all variables! <sumengen@hotelspectra.com>
Re: Q: children, signals, etc... (Gwyn Judd)
Re: Regular Expressions help <uri@sysarch.com>
Resource Temporarily Unavailable <grichards@flashcom.net>
Re: the use of $_ <uri@sysarch.com>
Re: the use of $_ <mcdonabNO@SPAMyahoo.com>
Re: What is the CPAN module repository (url) name that (Robert White)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 19 May 2000 23:38:10 -0400
From: Nico Zigouras <zigouras@mail.med.upenn.edu>
Subject: Re: a wacky idea
Message-Id: <Pine.OSF.4.21.0005192336470.10453-100000@mail.med.upenn.edu>
Yes, you can do this two ways.
1. redirect your script to an image like:
print"Location: /images/my_image.gif\n\n";
2. Use a graphics module to create it on the fly.
See the GD.pm module on CPAN - it is a great tool.
hth.
- Nico.
On Fri, 19 May 2000, Jonah wrote:
> Date: Fri, 19 May 2000 18:06:48 -0400
> From: Jonah <nomail@nomail.com>
> Newsgroups: comp.lang.perl.misc
> Subject: a wacky idea
>
> Ok, is it possible to run a perl script from a graphic on a standard
> html page?
>
> Example.
> <img src="http://www.server.com/cgi-bin/image.cgi">
>
> The script will display an image, (1x1 pixel) but before it does that, maybe
> it
> can do other stuff, like, say, save the query string to a file.
>
> Is this possible or am I a total nutjob for even thinking about it?
>
>
>
>
>
------------------------------
Date: Fri, 19 May 2000 19:52:26 -0600
From: fds <adsf@dsaf.com>
Subject: ARGGH!HELP! Can't parse these characters ÿ þ
Message-Id: <190520001952261163%adsf@dsaf.com>
I'm trying to do this
<snip>
@prods=split(/ÿ/,$value);
</snip>
Where $value would be something like
QtyþSKUþNameþNoTaxþPriceþTotalÿ1þ123þBig
Widgetþ1þ$10.00þ$10.00ÿ1þ456þWidget 2þ0þ$5.00þ$5.00
Then I was hoping to do
<snip>
foreach $morsel(@prods) {
($Q, $C, $D, $F,$P) = split(/þ/,$morsel);
<snip>
To get each tasty bit into a separate variable.
The problem seems to be those nasty little characters... ÿ þ.
I've looked everywhere for some solve but to no avail.
Is this some special unicode trick?
Please help. I'm desparate.
Ken Hare
------------------------------
Date: 20 May 2000 01:32:19 GMT
From: petolino@Eng.Sun.COM (Joe Petolino)
Subject: Re: Bug or Feature: Can't dereference array ref inside hash
Message-Id: <8g4pv3$bk6$1@engnews3.Eng.Sun.COM>
Steve Leibel <stevel@coastside.net> wrote:
> . . . In any event I'm now using
>square brackets for an array reference. I must say though that the
>distinction between lists and arrays is one of the more confusing features
>of Perl. . . .
>I would be grateful if someone could explain this distinction to me,
> . . . I still
>freely admit I don't understand the deeper meaning of "Odd number of
>elements in hash assignment" in response to
>
>$myhash = {
> whatever => (),
>};
I think the explanation is simpler than you expect, and it really doesn't
have anything to do with the distinction between an array and a list.
Rather, it's the distinction between a list and a reference to a list.
The code snippet above is exactly equivalent to
$myhash = { 'whatever' };
which obviously has an odd number (namely 1) of elements inside the {}.
What you probably intended to code was
$myhash = {
whatever => [],
};
which does contain the requisite even number (namely two) of elements
inside the {}.
() is an empty list, whereas [] is a *reference* to an empty list. All
references are scalars, so they're legal to use as hash values. A list,
however (like the () in your failing example), loses its identity when
placed inside another list - the contents of the inner list (nothing, in
this example) are simply inserted into the outer list (the hash literal,
in this example), sort of as if the inner parentheses weren't there.
Thus the failing statement isn't any different from
$myhash = {
whatever =>
};
or
$myhash = { 'whatever' };
If this is still confusing to you, try rereading 'perldoc perlref'.
-Joe
--
Joe Petolino petolino@eng.sun.com
------------------------------
Date: Fri, 19 May 2000 22:24:14 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Re: Bug or Feature: Can't dereference array ref inside hash
Message-Id: <stevel-1905002224140001@192.168.100.2>
In article <8g4pv3$bk6$1@engnews3.Eng.Sun.COM>, petolino@Eng.Sun.COM (Joe
Petolino) wrote:
> () is an empty list, whereas [] is a *reference* to an empty list.
Thank you much. That makes sense.
Steve L
------------------------------
Date: 19 May 2000 14:23:35 -0600
From: "James Francisco" <James.Francisco@bondhub.com>
Subject: getgrnam function on Win32
Message-Id: <3925a2c7@news.sisna.com>
Is the getgrnam function implemented in perl for Win32 and can anyone share
an example?
thanks
James Francisco
------------------------------
Date: Sat, 20 May 2000 04:56:32 GMT
From: eggie@REMOVE_TO_REPLYsunlink.net (Egg J. LeFume)
Subject: Hash references and subroutines.
Message-Id: <slrn8ic6p5.a3q.eggie@melody.mephit.com>
Hi.
I'm trying to find another solution to a problem I have with
passing hash references to subroutines. I have 'use strict' in my script
(a CGI script, actually), and accessing the hash directly from a
subroutine gives a "hash will not be shared" error in my logs, so I gotta
pass a reference instead. My problem is that the first subroutine calls a
second subroutine, which also needs to access the hash. The code I have
now is similar to this:
---------------------------
use strict;
....
my %bighash = ();
#%bighash is initialized here with no problems.
...
&sub1(\%bighash);
...
sub sub1 {
my $temp = shift;
my %hash = %$temp;
my $var = sub2("foo", "bar", \%hash);
...
}
sub sub2 {
my ($var1, $var2, $hashref) = @_;
my $tempvar = $hash->{$var1}{$var2};
...
}
-------------------
This works fine. But, do I need to dereference the hashref in
sub1, then make another reference to pass to sub2, like I've done above,
or is there a way to pass the hashref $temp directly to sub2 and
dereference it (twice) there somehow? I've tried all sorts of things,
with no luck. I'd appreciate any suggestions. Thanks in advance.
Jamie Kufrovich
--
FMSp3a/MS3a A- C D H+ M+ P+++ R+ T W Z+
Sp++/p# RLCT a+ cl++ d? e++ f h* i+ j p+ sm+
------------------------------
Date: Sat, 20 May 2000 13:25:26 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: Hash references and subroutines.
Message-Id: <8g56uo$cs0$1@coco.singnet.com.sg>
Egg J. LeFume <eggie@REMOVE_TO_REPLYsunlink.net> wrote in message
news:slrn8ic6p5.a3q.eggie@melody.mephit.com...
<--- SNIPPED --->
> use strict;
> ....
> my %bighash = ();
> #%bighash is initialized here with no problems.
You might want to consider using anonymous hash all the way, ie.
my $bighash = {};
That will save you the trouble of dereferencing and referencing. To access
the value of 'key' in $bighash, say $bighash->{'key'}.
> ...
> &sub1(\%bighash);
> ...
If you had used an anonymous hash, you will just say:
&sub1($bighash);
> sub sub1 {
> my $temp = shift;
> my %hash = %$temp;
> my $var = sub2("foo", "bar", \%hash);
Of course, it you want to stick to "normal" hashes, ie. %bighash = (), then
you can save yourself one derefence in the above by saying:
my $hash = shift;
my $var = sub2("foo", "bar", $hash);
> sub sub2 {
> my ($var1, $var2, $hashref) = @_;
> my $tempvar = $hash->{$var1}{$var2};
In the line above, do you mean
my $tempvar = $hashref->{$var1}{var2};
???
Last but NOT least, run "perldoc perlref" to learn more about references and
anonymous thingies.
Swee Heng
------------------------------
Date: Sat, 20 May 2000 01:33:41 -0400
From: blank666 <blank666@bart.nagaputih.net>
Subject: Re: Hash references and subroutines.
Message-Id: <Pine.LNX.4.10.10005200121220.753-100000@bart.nagaputih.net>
On Sat, 20 May 2000, Egg J. LeFume wrote:
> This works fine. But, do I need to dereference the hashref in
> sub1, then make another reference to pass to sub2, like I've done above,
> or is there a way to pass the hashref $temp directly to sub2 and
> dereference it (twice) there somehow? I've tried all sorts of things,
> with no luck. I'd appreciate any suggestions. Thanks in advance.
sub sub1 {
my $temp = shift;
my $var = sub2("foo", "bar", $temp);
# referred to as $temp->{'..'}{'..'}
...
}
sub sub2 {
my ($var1, $var2, $hashref) = @_;
my $tempvar = $hashref->{$var1}{$var2};
...
}
the above works fine for me; no need to deference it.
------------------------------
Date: 19 May 2000 23:46:47 -0700
From: Dan McGuirk <mcguirk@incompleteness.net>
Subject: Re: Hash references and subroutines.
Message-Id: <m3itw9afc8.fsf@mu.incompleteness.net>
eggie@REMOVE_TO_REPLYsunlink.net (Egg J. LeFume) writes:
> This works fine. But, do I need to dereference the hashref in
> sub1, then make another reference to pass to sub2, like I've done above,
> or is there a way to pass the hashref $temp directly to sub2 and
> dereference it (twice) there somehow? I've tried all sorts of things,
> with no luck. I'd appreciate any suggestions. Thanks in advance.
You don't need to dereference at all in sub1. Just pass the reference
directly through to sub2, then dereference it (only once). sub1 can
be written:
sub sub1 {
my $temp = shift;
my $var = sub2("foo", "bar", $temp);
...
}
--
Dan McGuirk <mcguirk@incompleteness.net>
Unbidden, but the way I found, it was a hand came down, and pow,
I got illuminated.
------------------------------
Date: Sat, 20 May 2000 00:39:17 -0400
From: NagaPutih <s0218327@unix1.cc.ysu.edu>
Subject: Re: matching question(s)
Message-Id: <Pine.A41.4.20.0005192353280.48328-100000@unix1.cc.ysu.edu>
On Fri, 19 May 2000, Larry Rosler wrote:
> > $_="@all_keys";
> > @valid_keys=grep(!/\b$badkey\b/,m/\b[a-z]{$len}\b/g);
>
> @valid_keys = grep !/\b$badkey\b/ => /\b[a-z]{$len}\b/g;
>
> @valid_keys = grep !/\b$badkey\b/ =>
> map /\b[a-z]{$len}\b/g => @all_keys;
>
> @valid_keys = grep $_ ne $badkey =>
> map /\b[a-z]{$len}\b/g => @all_keys;
thank's for answering my earlier question; appreciated it.
i tried your solutions with the same input data; and got the
same output from all of them. however, here's the comparison
of them in CPU seconds (using Benchmark):
1st - 48.93 (my original version)
2nd - 49.39
3rd - 211.15
4th - 185.00
then i modified it to:
$_="@all_keys";
@valid_keys=grep $_ ne $badkey => /\b[a-z]{$len}\b/g;
and turned out to be the fastest: 46.81
still though, could i do better? =)
thank's again!
------------------------------
Date: Fri, 19 May 2000 22:43:24 -0700
From: stevel@coastside.net (Steve Leibel)
Subject: Re: Need Help with Child Processes
Message-Id: <stevel-1905002243540001@192.168.100.2>
In article <vKgV4.21170$nm6.337951@news-east.usenetserver.com>, "Casey
Cato" <ctcato@aic-links.com> wrote:
> As I understand it what I want to do is accomplished by starting the
> subroutines as a child process, but I am unsure of how to do this. One
> thing I have to keep in mind is that one part of the menu allows the user to
> stop (kill) any process going on, so I am assuming that these child
> processes must all be started with their own PIDs so that I can get these
> and "kill" them when the user instructs the program to do so.
>
Casey,
As others will probably tell you, this is a Unix question and not a Perl
one, so it probably doesn't belong here. A good reference to fork() and
associated issues is Advanced Unix Programming by Marc Rochkind. Another
is Unix Network Programming by W. Richard Stevens. Anybody using sockets
should own a copy of Stevens. (Be warned though that the examples in both
books are in C, perhaps others can suggest some pure Perl references on
the topic).
Briefly, here is the basic model for forking. Once you have this logic
in your program, all you do is save the pids, and then you can kill them
using the Perl "kill" function. If you want the child processes to return
exit codes to the parent (to indicate success or failure, for example) you
will need to code a signal handler to catch the CHILD signal, and then
call wait() to get the return code.
#!/usr/local/bin/perl -w
use strict;
#
# Create a new process.
#
my $pid = fork();
#
# Following the fork, the parent's copy of $pid contains
# the pid of the child process.
#
if ($pid) {
print "this is the parent, child's pid = $pid\n";
}
#
# If $pid is defined and 0, this is the child. If you wanted, you could call
# one of your subroutines in here.
#
elsif ($pid == 0) {
print "this is the child\n";
}
#
# If $pid is undefined, a fork error occurred. This is very unusual,
# as it means the operating system can not create a process.
#
#
else {
print "fork error";
}
------------------------------
Date: Sat, 20 May 2000 12:25:27 +0800
From: "Swee Heng" <sweeheng@usa.net>
Subject: Re: Net::Telnet & Sendmail
Message-Id: <8g53hc$ccd$1@coco.singnet.com.sg>
DK <danout@oxnardsd.org> wrote in message
news:3925acaa.0@news.vcss.k12.ca.us...
> I am trying to get a printout of expnaded aliases
>
> I am having difficulty using net::telnet to do this
> <SNIPPED>
> My DUMP log reads
>
> > 0x00000: 45 58 50 4e 20 70 72 69 6e 63 69 70 61 6c 73 0d EXPN
> principals.
> > 0x00010: 0a
See the Net::Telnet docs regarding dump_log. It says:
==== begin ====
dump_log - log all I/O in dump format
$fh = $obj->dump_log;
$fh = $obj->dump_log($fh);
$fh = $obj->dump_log($filename);
This method starts or stops dump format logging of all the object's input
and output. The dump format shows the blocks read and written in a
hexadecimal and printable character format. This method is useful when
debugging, however you might want to first try input_log() as it's more
readable.
===== end =====
> This is what I am trying to capture into my array. How do I issue the
EXPN
> command correctly in net::telnet Then how do I issue the ^] escape
> sequence?
You might want to try the Net::SMTP module instead. It has an expand()
method. Something like:
use Net::SMTP;
$smtp = Net::SMTP->new($hostname);
@data = $smtp->expand('principals');
$smtp->quit;
print @data;
NOTE: I haven't verified the code above. But I think it will work.
------------------------------
Date: Sat, 20 May 2000 01:56:08 GMT
From: A <y-o-y@home.com>
Subject: Re: Newbie asks how to split file by x number of lines?
Message-Id: <YgmV4.200471$Tn4.1696326@news1.rdc2.pa.home.com>
In article <392548BF.DBA62C87@vpservices.com>, Jeff Zucker
<jeff@vpservices.com> wrote:
> A wrote:
> >
> > Hi folks,
> >
> > I was looking for a file splitter to split a 200+ mb file into files of
> > 50,000 (or x) lines each.
> >
> > Someone suggested MacPerl. But it's not what I thought. It could take
> > weeks just learning Perl.
>
> Ah, but they would be weeks well spent :-) And they would save you
> months of work on down the line :-)
Quite the diplomat!
> Not too hard. And there are options to split by lines rather than
> bytes, or to give specific names to the output files. It has limits
> though. It won't split any single file into more than 17,576 individual
> files. Bummer! :-)
You spoiled my day there, Jeff. LOL!
Thanks for the link!
Regards,
Andy
------------------------------
Date: Sat, 20 May 2000 01:20:49 -0400
From: Omri <ocschwar@NOSPAM.mit.edu>
Subject: Re: Parse::RecDescent problem, $::RD_TRACE showing something very odd.
Message-Id: <392620B1.FFAA1A9A@NOSPAM.mit.edu>
"Randal L. Schwartz" wrote:
>
> >>>>> "Omri" == Omri <ocschwar@NOSPAM.mit.edu> writes:
>
> Omri> It's only there because if it isn't I get this error message:
>
> Omri> Can't find string terminator "}" anywhere before EOF at www/decss.pl
> Omri> line 33.
>
> That probably means that the "brace balancer" is confused for the q{}
> string. Try using a here-doc instead. The odds of you having
> \nYOUR_END_TAG\n in the midst of your string are a lot less than you
> having unbalanced { and }, as you apparently have. :)
Switching to q[] then pointed to an error midway through the script.
Ilmari Karonen <iltzu@sci.invalid> said:
]I bet you have an extra _opening_ curly brace in there. In
]particular, I bet it's quoted or commented out so that RecDescent
]doesn't consider it a paired delimiter, but _perl does_.
]You might want to use some other string delimiter.
And indeed, the next error was because of a comment that contained a
quoted closing square bracket.
Thank you very much, everyone!
------------------------------
Date: Sat, 20 May 2000 03:34:06 GMT
From: bh447@freenet.carleton.ca (Markus Svilans)
Subject: pc line breaks
Message-Id: <39260764.12838232@news.ncf.carleton.ca>
Hi,
Does anyone know the regular expression to match PC line breaks? I'm
reading data in from a file that has PC linebreaks, and due to
circumstances it is not possible to convert the file to Unix format.
Thanks!
-Markus
--
Rainy days and automatic weapons always get me down.
------------------------------
Date: Sat, 20 May 2000 03:22:39 GMT
From: amerar@unsu.com (Arthur Merar)
Subject: Perl for Win32
Message-Id: <392604da.194963282@news.iwc.net>
Hello,
I am having trouble locating Perl for Windows 98. Where can I get a
copy?
Thanks,
Arthur
amerar@unsu.com
------------------------------
Date: 19 May 2000 22:16:42 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Perl for Win32
Message-Id: <87zoplap2d.fsf@limey.hpcc.uh.edu>
>> On Sat, 20 May 2000 03:22:39 GMT,
>> amerar@unsu.com (Arthur Merar) said:
> I am having trouble locating Perl for Windows 98. Where
> can I get a copy?
http://www.perl.com/
http://www.activestate.com/
hth
t
------------------------------
Date: Sat, 20 May 2000 03:38:26 GMT
From: Skip <ervint@worldnet.att[remove_this_stuff].net>
Subject: Re: Perl for Win32
Message-Id: <SMnV4.75149$WF.4202682@bgtnsc04-news.ops.worldnet.att.net>
And if you are trying to get it to run with Microsoft's Personal Web
Server and can't, go to Microsoft's site and do a search for 'Personal
Web Server Perl' for a registry entry you need to make.
Tony Curtis wrote:
> >> On Sat, 20 May 2000 03:22:39 GMT,
> >> amerar@unsu.com (Arthur Merar) said:
>
> > I am having trouble locating Perl for Windows 98. Where
> > can I get a copy?
>
> http://www.perl.com/
> http://www.activestate.com/
>
> hth
> t
------------------------------
Date: Fri, 19 May 2000 19:02:05 -0700
From: dreon <famouswizardNOfaSPAM@yahoo.com.invalid>
Subject: Re: PPMFIX Doesn't Fix Anything
Message-Id: <165eabc0.66aa8db1@usw-ex0102-016.remarq.com>
Here is how to make ActiveState PPM fix working :-)
(all this worked on Win NT 4.0, SP6, ActiveState Perl 613, Perl
version 5.6.0)
1) unzip PPMFIX.ZIP in, for example c:\temp\ppm. Change directory
to c:\temp\ppm
2) gzip -d ppm.tar.gz
3) tar -xvf ppm.tar
4) change directory c:\temp\ppm\blib (newly created)
5) run command
xcopy * /s c:\perl\site\lib\
(change "c:\perl" to your Perl isntallation directory)
6) edit c:\perl\bin\ppm.bat, deleting all lines between
"#!/usr/bin/perl" and "=cut" (including! delete these two lines
too!)
7) copy the content of c:\perl\site\lib\script\ppm.pl
8) paste it in the place of the deleted lines in
c:\perl\bin\ppm.bat
9) done!
After those steps I was able to install packages etc.
(for available packages - check
http://www.ActiveState.com/PPMPackages, browse to the appropriate
version)
Enjoy!
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Fri, 19 May 2000 21:03:44 -0700
From: "Baris" <sumengen@hotelspectra.com>
Subject: printing all variables!
Message-Id: <39260f78_1@goliath.newsfeeds.com>
Hello,
Can I print out all the global variables (or all variables) inside my perl
program at some point? Or can I get that info somehow?
Baris.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
------------------------------
Date: Sat, 20 May 2000 04:55:47 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Q: children, signals, etc...
Message-Id: <slrn8ier6o.u6.tjla@thislove.dyndns.org>
I was shocked! How could Tom Phoenix <rootbeer@redcat.com>
say such a terrible thing:
>On Fri, 19 May 2000, Elliot Finley wrote:
>
>> are signals reliable in Perl 5.005_03?
>
>Sure, signals are reliable - it's the signal handlers written in Perl that
>are the problem! :-)
>
>Any signal handler written in Perl will, sooner or later, crash. Sometimes
>that's acceptable, sometimes it's a problem.
You mean any correctly written signal handler (for some definition of
correctly written) will eventually crash? Why is that?
--
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
I never met a man I didn't want to fight.
-- Lyle Alzado, professional football lineman
------------------------------
Date: Sat, 20 May 2000 03:42:13 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Regular Expressions help
Message-Id: <x7bt21ga5n.fsf@home.sysarch.com>
>>>>> "m" == malverian <malverian@hotmail.com> writes:
m> When I use a regular expression to look for a variable, it reads it as
m> the number of characters, not the actual string.
huh? please use english.
m> $variable = "Wow this ^is^ really cool!";
m> $thing = "is";
m> if ($variable =~ /^$thing^/i) {
^
that is a regex metachar, and it anchors the string to match starting at
the beginning. so it will never find ^is^ as 'is' is not at the
beginning. read perlre to leanr about the metacharas and how to escape
them.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 19 May 2000 23:41:11 -0700
From: "Gabe" <grichards@flashcom.net>
Subject: Resource Temporarily Unavailable
Message-Id: <siccnd1cqod165@corp.supernews.com>
My program is dying after trying to connect. $! gives Resource Temporarily
Unavailable. Can anyone see why it's dying with that error?
my $driver = "mysql";
my $database = "cremeco_com";
my $dsn = "DBI:$driver:database=$database";
my $dbh = DBI->connect($dsn, $user, $password) || die &error;
Gabe
------------------------------
Date: Sat, 20 May 2000 03:36:08 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: the use of $_
Message-Id: <x7em6xgaft.fsf@home.sysarch.com>
>>>>> "KS" == Kiralynne Schilitubi <callgirl@la.znet.com> writes:
KS> Uri Guttman wrote:
>> and you are our local moron.
KS> (snipped further harassment)
KS> Mr. Guttman, one more incident of stalking
KS> and harassment of myself, I will file a
KS> series of formal complaints with both
KS> Hurricane Electric Internet Services and
KS> Media 1 Internet Services. These complaints
KS> will be countersigned by our family civil
KS> attorney for emphasis with a suggestion
KS> of litigious remedy.
calling you a perl moron in a newsgroup is not harassment, stalking or
anything other than delusions that you harbor. you have no grounds for
anything so please save your money and time and just leave this
group. you are not wanted here, not useful here and you don't know perl.
KS> Your posting history for the past five months,
KS> those posts directed at me, contain vulgarity,
KS> vile personal insults, libelous statements,
KS> threats of crime and other equally sociopathic
KS> statements. All of these postings are well
KS> documented, hard copied and in the hands of
KS> our family attorney along with being quite
KS> independently verifiable via archived articles
KS> online at various news providers.
threats of crime? you are way off base here. more delusions.
KS> One more incident of stalking and harassment
KS> Mr. Guttman, our family and our civil attorney,
KS> will pursue aggressive and appropriate actions
KS> against you personally, your com site, your
KS> internet account and we will give our blood money
KS> attorney the go ahead on a contingency basis to
KS> relieve you of whatever money he feels will be
KS> awarded as compensatory compensation for personal
KS> injury and libel.
spend your money. he can't do much with what has happened in public
forums. i have commented on your lack of perl skills which is a provable
fact, not libelous.
KS> As you know I recently filed criminal concerns
KS> with law enforcement regarding another actively
KS> participating within this group. I will be even
KS> more aggressive regarding you, especially in
KS> light of your past criminal conduct regarding
KS> our family, this is, threatening to commit
KS> crimes against our family, which in itself,
KS> is criminal, as is your stalking and harassment.
i don't even know your family nor do i care to. i have no interest in
them or you personally. i hang out in this group and like to help pthers
with perl stuff. you cause problems here which i have tried to fix. now
you are threatening frivolous lawsuits and criminal charges. i will
countersue for that and you will lose and pay all legal fees. i don't
think you want that.
KS> Kiralynne Schilitubi
KS> cc: abuse@mediaone.net
oh, they will do nothing as i have never emailed you or spammed you or
whatever. i have only posted here in perl stuff.
KS> cc: hostmaster@he.net
oh great! my web site too! what does that have to do with anything? you
are truly thick. that is a virtual web host and nothing on my site has
anything to do with you. i wouldn't sully its content my mentioning
you. this is just more fodder for the legal proof of you rlack of
understanding 'our internet'
yours in cackling laughter,
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Fri, 19 May 2000 21:28:41 -0700
From: "Brian McDonald" <mcdonabNO@SPAMyahoo.com>
Subject: Re: the use of $_
Message-Id: <8g54e5$v1p$1@slb2.atl.mindspring.net>
"Larry Rosler" <lr@hpl.hp.com> wrote in message
news:MPG.138f7dbe10f4a81098aaa1@nntp.hpl.hp.com...
> [Please don't quote the entire article you are responding to, especially
> not at the end of your post. Interleave your comments into the relevant
> quoted segments, as I have done below.]
>
thank you. advice taken.
> In article <8g4gqv$i6q$1@nntp9.atl.mindspring.net> on Fri, 19 May 2000
> 15:55:54 -0700, Brian McDonald <mcdonabNO@SPAMyahoo.com> says...
>
> > I'm getting a new error now, and I'm hard pressed to understand it. I
don't
> > mind if someone tells me just how to go about finding information on a
> > "keyword" such as "bareword" in the ActivePerl (or other) documentation.
I
> > see no master index and I cannot deduce the section to look in. I've
> > searched on "bareword" at deja and at perl.com and just get a lot of
fluff.
>
> I searched perldata for 'bare' and got this:
>
> A word that has no other interpretation in the grammar will be treated
> as if it were a quoted string. These are known as ``barewords''.
>
> > Here's the error:
> >
> > "Bareword found where operator expected at txt2xml.pl line 172, near "if
> > (/FIRSTNAME"
> > (Might be a run-away multi-line // string starting on line 153
> > Do you need to predeclare if?)
> > syntax error at txt2xml.pl line ...
> > "
> > "
> > Excution of txt2xml.pl aborted due to compilation errors."
> >
> > Here's the code:
> >
> > use strict;
> > ...
> > ...
> > # get next input file from ARGV array
> > foreach my $infile (@ARGV) {
> > # append new .xml extension to output file
> > my $outfile = $infile;
> > $outfile =~ s/.txt/.xml;
>
> I'll bet the line above is line 153, though you don't say so. The
> diagnostic tells you exactly what is wrong.
>
you are exactly right. as well as guesses made below.
i should've seen that.
thanks,
brian
------------------------------
Date: Sat, 20 May 2000 01:33:00 GMT
From: richly@samart.co.th (Robert White)
Subject: Re: What is the CPAN module repository (url) name that can be used for PPM/VPM?
Message-Id: <3925e65b.4993923@news.samart.co.th>
On 19 May 2000 11:44:43 -0500, ekliao@mediaone.net (Eric Liao) wrote:
>Does it exist? THanks.
PPM.pm exists. It comes with the ActiveState distribution.
Rob
http://bangkokwizard.com/
Social graces are the packet headers of everyday life
------------------------------
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 3106
**************************************