[21751] in Perl-Users-Digest
Perl-Users Digest, Issue: 3955 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 11 14:06:09 2002
Date: Fri, 11 Oct 2002 11: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)
Perl-Users Digest Fri, 11 Oct 2002 Volume: 10 Number: 3955
Today's topics:
Re: Any way around using the $& variable? <pinyaj@rpi.edu>
Re: Any way around using the $& variable? <usenet@tinita.de>
attach debugger to running process <pobugfix@peterlink.ru>
Re: attach debugger to running process (Peter Scott)
Displaying a browsers History using perl <elne13178@blueyonder.co.uk>
Re: grep list from a list (Helgi Briem)
Re: grep list from a list <depesz@depeszws.depesz.pl>
Re: grep list from a list <asimmons@mitre.org>
Re: How Can I Read a Single Line at a Time from an Open <usenet@atrixnet.com>
How to get perldb's x programmatically? <heather710101@yahoo.com>
Re: How to test for blessedness? <usenet@dwall.fastmail.fm>
HTTP Command help....? <bill@makingitdigital.com>
Is there a way (AGoodGuyGoneBad)
Re: Is there a way <asimmons@mitre.org>
Re: Is there a way <jurgenex@hotmail.com>
Re: Multiple Pings/Second <troc@netrus.net>
Re: Net::FTP: Unexpected EOF on command channel (jend)
Re: Net::FTP: Unexpected EOF on command channel (jend)
Perl code to delete a WMI Namespace (jose maria)
Re: Should -i eat my files? ctcgag@hotmail.com
simple logic Q (I think) <penny1482@attbi.com>
Re: simple logic Q (I think) (Tad McClellan)
STDOUT_TOP printing funny character (aaron smith)
Switching from Python to Perl <pan-newsreader@thomas-guettler.de>
Re: Switching from Python to Perl (Helgi Briem)
Re: Switching from Python to Perl <kondwani@cs.mun.ca>
Re: Switching from Python to Perl <usenet@atrixnet.com>
undef == true? <peter@nospam.calweb.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Oct 2002 11:23:04 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: "Peter J. Acklam" <pjacklam@online.no>
Subject: Re: Any way around using the $& variable?
Message-Id: <Pine.A41.3.96.1021011112110.85042A-100000@cortez.sss.rpi.edu>
[posted & mailed]
On 11 Oct 2002, Peter J. Acklam wrote:
>Tina Mueller <usenet@tinita.de> wrote:
>
>> s/($regex)/\e[36m$1\e[m/go;
>>
>> then you have to use '([oa]).*\2' instead of the \1
>
>Ok, so how to you shift all the backreferences in
>an arbitrary regex?
With a regex parser! YAPE::Regex. I'm afraid it's not very extensible at
the moment, though. I rewrote it (Regexp::Parser) but the laptop got
stolen before I could put it on CPAN, and I haven't rewritten it yet
(although it's almost entirely all in my brain).
You could use the @- and @+ arrays:
s/($regex)/"\e[36m" . substr($_, $-[0], $+[0] - $-[0]) . "\e[m"/ego;
if you have Perl 5.6+.
--
Jeff "japhy" Pinyan RPI Acacia Brother #734 2002 Acacia Senior Dean
"And I vos head of Gestapo for ten | Michael Palin (as Heinrich Bimmler)
years. Ah! Five years! Nein! No! | in: The North Minehead Bye-Election
Oh. Was NOT head of Gestapo AT ALL!" | (Monty Python's Flying Circus)
------------------------------
Date: 11 Oct 2002 15:43:37 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: Any way around using the $& variable?
Message-Id: <ao6rj9$jtrti$1@fu-berlin.de>
Peter J. Acklam <pjacklam@online.no> wrote:
> Tina Mueller <usenet@tinita.de> wrote:
>> s/($regex)/\e[36m$1\e[m/go;
>>
>> then you have to use '([oa]).*\2' instead of the \1
> Ok, so how to you shift all the backreferences in
> an arbitrary regex?
i'm not sure if i understand you right.
i'd say, instead of \1 use \2, for \2 use \3 and so on.
just treat the regex as if there's one extra couple of parens
around it.
or use the original regex as a parameter and do:
$regex =~ s/\\(\d+)/"\\".($1+1)/eg;
hth, tina
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/ \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Fri, 11 Oct 2002 20:03:10 +0400
From: "Andrew V. Tkachenko" <pobugfix@peterlink.ru>
Subject: attach debugger to running process
Message-Id: <ao6sgs$hdt$1@news.sovam.com>
Hello All.
Is it possible to debug already running perl program? I mean in a way as
I usually do with gdb - attaching debugger to a process by its pid?
Thanks for advance, Andrew
------------------------------
Date: Fri, 11 Oct 2002 17:39:57 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: attach debugger to running process
Message-Id: <N1Ep9.512175$Ag2.19953608@news2.calgary.shaw.ca>
In article <ao6sgs$hdt$1@news.sovam.com>,
"Andrew V. Tkachenko" <pobugfix@peterlink.ru> writes:
>Hello All.
>Is it possible to debug already running perl program? I mean in a way as
> I usually do with gdb - attaching debugger to a process by its pid?
No.
--
Peter Scott
http://www.perldebugged.com
------------------------------
Date: Fri, 11 Oct 2002 17:47:22 +0100
From: "tony liddane" <elne13178@blueyonder.co.uk>
Subject: Displaying a browsers History using perl
Message-Id: <ykDp9.88$pb4.7@news-binary.blueyonder.co.uk>
Hi
I used perl in the first year of uni to do basic cgi scripts, and other
relatively easy perl programs, and now in my final year at uni my project is
to create a program that displays a broswers history and favourites in a web
page.
could any one point me in the direction of any good PerlScript tutorials on
the web and any good books that are available, i already own Learning Perl
on Win32 systems by O'rielly
Any help is much apreciated
thanks
Tony
------------------------------
Date: Fri, 11 Oct 2002 15:40:30 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: grep list from a list
Message-Id: <3da6eeed.17782499@news.cis.dfn.de>
On Fri, 11 Oct 2002 17:01:01 +0200, "yossi shani"
<yossi_shani@yahoo.com> wrote:
>Greetings,
>
>Maybe you could shed some light into this matter...
>I have two lists, and I would like to find any of the components of the
>@match list from the @name list,
>I want to replace the hardcoded "(one|five)" with list.
Get perl to help you:
use warnings;
use strict;
>@name=qw(one two three four five);
my @name=qw(one two three four five);
>@match = qw( one four );
my @match = qw( one four );
># This is the working example but I would like to incorporate
>a list in theregex area
If that's really what you want to do, here's a way:
my $regex = join "|", @match;
if ( grep /^$regex$/, @name ) {
print "something...";
}
However, as the perl documentation would have
told you, had you used it, there is a better way:
perldoc -q intersect
Found in C:\Perl\lib\pod\perlfaq4.pod
How do I compute the difference of two arrays? How do I
compute the intersection of two arrays?
Use a hash. Here's code to do both and more. It assumes
that each element is unique in a given array:
@union = @intersection = @difference = ();
%count = ();
foreach $element (@array1, @array2) { $count{$element}++
}
foreach $element (keys %count) {
push @union, $element;
push @{ $count{$element} > 1 ? \@intersection :
\@difference }, $element;
}
Note that this is the *symmetric difference*, that is,
all elements in either A or in B but not in both. Think
of it as an xor operation.
--
Regards, Helgi Briem
helgi AT decode DOT is
A: Top posting
Q: What is the most irritating thing on Usenet?
- "Gordon" on apihna
------------------------------
Date: Fri, 11 Oct 2002 17:37:07 +0200
From: hubert depesz lubaczewski <depesz@depeszws.depesz.pl>
Subject: Re: grep list from a list
Message-Id: <slrn.pl.aqds13.ev6.depesz@depeszws.depesz.pl>
W artykule <1034348478.98823@sj-nntpcache-3> yossi shani napisa³(a):
> @name=qw(one two three four five);
> @match = qw( one four );
$sMatch = "\\Q".join("\\E|\\Q", @match)."\\E";
if (grep {/($sMatch)/} @name) {
}
depesz
--
hubert depesz lubaczewski http://www.depesz.pl/
------------------------------------------------------------------------
Mój Bo¿e, spraw abym milcza³, dopóki siê nie upewniê, ¿e naprawdê mam
co¶ do powiedzenia. (c) 1998 depesz
------------------------------
Date: Fri, 11 Oct 2002 12:27:06 -0400
From: "Aaron Simmons" <asimmons@mitre.org>
Subject: Re: grep list from a list
Message-Id: <ao6u3r$i63$1@newslocal.mitre.org>
See changes below.
--
Aaron Simmons
G066-Software Systems Eng, Lead
(703) 883-3394
AaronSimm1 (AIM)
"Helgi Briem" <helgi@decode.is> wrote in message
news:3da6eeed.17782499@news.cis.dfn.de...
> On Fri, 11 Oct 2002 17:01:01 +0200, "yossi shani"
> <yossi_shani@yahoo.com> wrote:
>
> >Greetings,
> >
> >Maybe you could shed some light into this matter...
> >I have two lists, and I would like to find any of the components of the
> >@match list from the @name list,
> >I want to replace the hardcoded "(one|five)" with list.
>
> Get perl to help you:
>
> use warnings;
> use strict;
>
> >@name=qw(one two three four five);
>
> my @name=qw(one two three four five);
>
> >@match = qw( one four );
>
> my @match = qw( one four );
>
> ># This is the working example but I would like to incorporate
> >a list in theregex area
>
> If that's really what you want to do, here's a way:
>
> my $regex = join "|", @match;
>
> if ( grep /^$regex$/, @name ) {
> print "something...";
> }
To be safe, you should do this:
if ( grep /^($regex)$/, @name ) {
print "something...";
}
Without the parenthesis you will get substring matches.
>
> However, as the perl documentation would have
> told you, had you used it, there is a better way:
>
> perldoc -q intersect
>
> Found in C:\Perl\lib\pod\perlfaq4.pod
> How do I compute the difference of two arrays? How do I
> compute the intersection of two arrays?
>
> Use a hash. Here's code to do both and more. It assumes
> that each element is unique in a given array:
>
> @union = @intersection = @difference = ();
> %count = ();
> foreach $element (@array1, @array2) { $count{$element}++
> }
> foreach $element (keys %count) {
> push @union, $element;
> push @{ $count{$element} > 1 ? \@intersection :
> \@difference }, $element;
> }
>
> Note that this is the *symmetric difference*, that is,
> all elements in either A or in B but not in both. Think
> of it as an xor operation.
> --
> Regards, Helgi Briem
> helgi AT decode DOT is
>
> A: Top posting
> Q: What is the most irritating thing on Usenet?
> - "Gordon" on apihna
------------------------------
Date: Fri, 11 Oct 2002 12:07:26 -0500
From: Tommy Butler <usenet@atrixnet.com>
To: Jim <play.ball@usa.net>
Subject: Re: How Can I Read a Single Line at a Time from an Open File?
Message-Id: <3DA7054E.9040305@atrixnet.com>
Jim wrote:
> This may be simple but I am struggling. I am parsing through a file and once
> I match a single pattern. I want to process the following lines individually
> until I reach another pattern.
>
> I am looking for something like a read statement except it will read the
> entire line.
>
> Any help would be appreciated,
>
> Jim
>
>
readline(FILEHANDLE);
-[or]-
while (<FILEHANDLE>) {
# ...do something
}
--
-Tommy Butler
see if I'm online »http://ooopps.sourceforge.net/online
Tommy Butler <tommy@atrixnet.com>
phone: (817)-468-7716
6711 Forest Park Dr
Arlington, TX
76001-8403
Download my résumé in PDF, MS Word, HTML, text
http://www.atrixnet.com/
the ooOPps Code Library
http://ooopps.sourceforge.net/pub/
------------------------------
Date: Fri, 11 Oct 2002 16:24:30 +0000 (UTC)
From: Da Witch <heather710101@yahoo.com>
Subject: How to get perldb's x programmatically?
Message-Id: <ao6tvu$c37$1@reader1.panix.com>
I prefer the formatting used by Perl's debugger's "x" command than
that produced by Data::Dumper. Where is the code responsible for
generating the output of the "x" command?
Thanks,
h
------------------------------
Date: Fri, 11 Oct 2002 16:11:05 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: How to test for blessedness?
Message-Id: <Xns92A47BF335FE7dkwwashere@216.168.3.30>
Da Witch <heather710101@yahoo.com> wrote on 10 Oct 2002:
> I'm sure this is much simpler than I'm making it, but I can't see
> it... Is there a better (i.e. more direct) way to test for
> blessedness than something like
>
> sub is_blessed { eval { (shift)->isa(0) }; !$@ }
Have you tried dropping it on an altar or seeing if your pet will walk over
it?
--
David K. Wall - usenet@dwall.fastmail.fm
"You cannot take off the duncecap. It appears to be cursed."
------------------------------
Date: Fri, 11 Oct 2002 17:45:42 GMT
From: "AB" <bill@makingitdigital.com>
Subject: HTTP Command help....?
Message-Id: <a7Ep9.3308$F53.3093088@newssvr28.news.prodigy.com>
I have an application that accepts http commands that I am interfacing with
perl.
the url I want to pass to access the application is something like this:
http://127.0.0.1:<application_port>command?varible=example
the problem is, that when I enter the above url/command into a browser it
returns results.
I have built an application that returns information but I only know how to
produce an http command with:
print "Location:
http://127.0.0.1:<application_port>command?varible=example";
the problem is that this command redirect the user and return the
application results
is there another command or line of code I can use that wont redirect the
user but will still request an HTTP or GET ?
keep in mind I am a noob without a programming background.
thanks in advance,
-ab
------------------------------
Date: 11 Oct 2002 15:51:48 GMT
From: agoodguygonebad@aol.com (AGoodGuyGoneBad)
Subject: Is there a way
Message-Id: <20021011115148.16668.00000793@mb-cn.aol.com>
Is there a way to submit or send a form, and then return back to the page
without the page being reprinted ?
I need to send the contents of a hidden field, text box, or anything I can
store data to, then return to the same page with new data in the field.
Thanks
------------------------------
Date: Fri, 11 Oct 2002 12:23:02 -0400
From: "Aaron Simmons" <asimmons@mitre.org>
Subject: Re: Is there a way
Message-Id: <ao6ts6$i53$1@newslocal.mitre.org>
If you want the same page "with new data in the field" -- what is wrong with
having the page be repainted?
If you really need to do this, you can, but it will be ugly. Here's the
basic logic:
Frame_A -- hidden frame with a form
Frame_B -- the frame with you form
You can implement the following a few different ways, here's some sample
logic:
Frame_B.formName.onsubmit = function() {
// Transfer all data from Frame_B's form to Frame_A
Frame_A.formName.submit();
// This will cancel the form submission on Frame_B
return false;
}
Then you will have to call another JavaScript function on the onLoad event
for Frame_B that transfers the data back:
Form_B.formName.elementName1.value = Form_A.formName.elementName1.value;
Form_B.formName.elementName2.value = Form_A.formName.elementName2.value;
Form_B.formName.elementName3.value = Form_A.formName.elementName3.value;
...
Like I said above, this is a lot of work. Are you sure you cannot have the
page reload?!?
--
Aaron Simmons
G066-Software Systems Eng, Lead
(703) 883-3394
AaronSimm1 (AIM)
"AGoodGuyGoneBad" <agoodguygonebad@aol.com> wrote in message
news:20021011115148.16668.00000793@mb-cn.aol.com...
> Is there a way to submit or send a form, and then return back to the page
> without the page being reprinted ?
>
> I need to send the contents of a hidden field, text box, or anything I can
> store data to, then return to the same page with new data in the field.
> Thanks
------------------------------
Date: Fri, 11 Oct 2002 10:11:32 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Is there a way
Message-Id: <3da70654$1@news.microsoft.com>
AGoodGuyGoneBad wrote:
> Is there a way to submit or send a form, and then return back to the
> page without the page being reprinted ?
>
> I need to send the contents of a hidden field, text box, or anything
> I can store data to, then return to the same page with new data in
> the field. Thanks
Perl does not have forms. Perl does not have submit or send.. Perl does not
have pages.
Perl does not have hidden fields or text boxes.
What is your Perl question/problem/issue/suggestion?
jue
------------------------------
Date: Fri, 11 Oct 2002 17:29:35 -0000
From: Rocco Caputo <troc@netrus.net>
Subject: Re: Multiple Pings/Second
Message-Id: <slrnaqe2jt.8ma.troc@eyrie.homenet>
On Fri, 11 Oct 2002 00:37:14 -0400, Benjamin Goldberg wrote:
> Rocco Caputo wrote:
>>
>> Another interesting bit: Since pingers all listen on socket 0, they
>> can hear each other's responses. To avoid collisions, the identifier
>> field (the 16 bits before the sequence number) usually holds a hash of
>> the pinger's process ID. Anything that doesn't match is discarded.
>
> Hmm, I was using the sequence number as a sortof assistant identifyer
> field.
>
> On windows 95, if you run two perl scripts, one after another, and no
> other processes start/die in between, it's quite likely that the pid
> will be reused from one process to the next. If you type:
> perl -e "print $$"
> twice in a row, it will print the same number, twice in a row.
>
> How harmful is that?
I expect it's minor to no harm done. Even if the identifiers collide
(same PID), you would not see false positives unless the sequence
numbers also collided. And then you would also see duplicate
responses, which might indicate interference or failure.
While unlikely, here is a scenario where you could interfere with a
pinger:
Most pingers I've seen use the least significant 16 bits of the
process ID for an identifier ($$ & 0xffff). There's a small chance
that these identifiers will collide if your OS uses PIDs wider than 16
bits.
If you can start two pingers with the same identifier at the same
time, they will encounter a lot of ID/seq collisions and interfere
with each other.
There's another, more reliable way to interfere with pingers, but it
involves abusing root privileges and I won't mention it here.
-- Rocco Caputo / troc@pobox.com / poe.perl.org / poe.sf.net
------------------------------
Date: 11 Oct 2002 10:03:01 -0700
From: dejen321@yahoo.com (jend)
Subject: Re: Net::FTP: Unexpected EOF on command channel
Message-Id: <cc028093.0210110903.3cff2a87@posting.google.com>
news@roaima.freeserve.co.uk wrote in message news:<eo86oa.9c8.ln@moldev.cmagroup.co.uk>...
> Villy Kruse <vek@station02.ohout.pharmapartners.nl> wrote:
> > There can also be a problem with statefull firewalls when you are
> > transferring big files. The firewall may notice that the command
> > channel is sitting completely idle for a long time and then determine
> > that the connection is in fact dead.
>
> Yes, I've been bitten by this in the past. IMO, I would call this a bug
> in the "statefulness" code; if it can handle active FTP then it should
> be able to realise that data flow on the data connection implies a
> (probably) idle command channel - and as such it shouldn't be timed out.
>
> Chris
Thanks for everyone's input, i think what i will do for the moment is
simply put it a 'retry' method and just keep trying until it works i
guess..
thanks much.. D.
------------------------------
Date: 11 Oct 2002 10:10:23 -0700
From: dejen321@yahoo.com (jend)
Subject: Re: Net::FTP: Unexpected EOF on command channel
Message-Id: <cc028093.0210110910.1b2728ca@posting.google.com>
jjchew@coxeter.math.toronto.edu (John J. Chew III) wrote in message news:<ao5jng$s7d$1@news.math.toronto.edu>...
> In article <cc028093.0210101130.5fc8d9c1@posting.google.com>,
> jend <dejen321@yahoo.com> wrote:
> >i have this basic Net::FTP script that goes out to pull a file
> >everynight.
> >It has been working reliability for the past year until recently we
> >switch
> >to PASSIVE FTP. So what I did is set env variable FTP_PASSIVE to 1
> >and Net::FTP picks up the passive mode from there.
> >
> >Now the script still works probably 4 or 5 days of the week, but
> >fails 2 or 3 times per week saying:
> [...]
> >Net::FTP: Unexpected EOF on command channel at ./data_pull.pl line 52
> >Could not get 'daily_file.gz', skipped: Bad file number at
>
> You probably saw the thread that I started on this topic on 2001-12-30,
> which can be found in groups.google.com, e.g. by searching for Net::FTP
> and Chew. The gist of it then was that no one knows what's causing it,
> but that the problem can be caused or exacerbated by reduced bandwidth
> or increased network latency. When I have had the problem, I have tried
> turning passive mode on or off without effect, so I think that's a red
> herring. Is it possible that the quality of your network connection has
> been downgraded recently?
>
> John
this is very interesting, yes our network has have some issues lately and
i think its very possible that somehow there some network hiccup that just
breaks the connetion, but i think either way, i will just use a 'rety' method
if it fails.. thanks..
------------------------------
Date: 11 Oct 2002 08:49:31 -0700
From: scasjos@mixmail.com (jose maria)
Subject: Perl code to delete a WMI Namespace
Message-Id: <99071af2.0210110749.5feae1ff@posting.google.com>
Hello to everybody this it a perl code to erase a WMI namespace I hope
that this code help you
Perl Code
use Win32::OLE('in');
my $find='name_of_namespace_to_delete'; # for example 'Router'
# in this example namespace was under root be carefult with THAT
my $sobj = Win32::OLE->GetObject('winmgmts:\root')->Instancesof("__Namespace");
foreach my $names (in $sobj)
{
print "Name is " .$names->{Name},"\n"; #This line is only for debug
if (($names->{Name} eq "$find"))
{
.$names->Delete_; #Delete this namespace
}
}
Regards Jose Maria
------------------------------
Date: 11 Oct 2002 15:30:53 GMT
From: ctcgag@hotmail.com
Subject: Re: Should -i eat my files?
Message-Id: <20021011113053.349$T1@newsreader.com>
"John W. Krahn" <krahnj@acm.org> wrote:
>
> Can't do inplace edit without backup
> (F) You're on a system such as MS-DOS that gets con
> fused if you try reading from a deleted (but still
> opened) file. You have to say `-i.bak', or some such.
It sounded like his problem is that he didn't get this message,
when he should of, rather it just went ahead and munged his files.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service
------------------------------
Date: Fri, 11 Oct 2002 17:28:04 GMT
From: "Dick Penny" <penny1482@attbi.com>
Subject: simple logic Q (I think)
Message-Id: <ESDp9.4518$NW3.819@sccrnsc03>
In the following snippet, I am trying to concatenate a character onto a hash
value ONLY IF it is not there already. Can someone please tell/show me why
the following does not work? Herein, the subroutine "symb()" returns a
single character.
___________snippet
for my $i ($lo..$hi)
{ if ( exists $aray{$i} )
{ $aray{$i} .= symb($time) if( $aray{$i} !~ /symb($time)/ )}
else
{ $aray{$i} .= symb($time) }# this path is ALWAYS taken
}
Thanks.
--
Dick Penny
------------------------------
Date: Fri, 11 Oct 2002 12:43:06 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: simple logic Q (I think)
Message-Id: <slrnaqe3da.3aj.tadmc@magna.augustmail.com>
Dick Penny <penny1482@attbi.com> wrote:
> In the following snippet, I am trying to concatenate a character onto a hash
> value ONLY IF it is not there already. Can someone please tell/show me why
> the following does not work? Herein, the subroutine "symb()" returns a
> single character.
> ___________snippet
> for my $i ($lo..$hi)
my $ch = quotemeta symb($time);
> { if ( exists $aray{$i} )
> { $aray{$i} .= symb($time) if( $aray{$i} !~ /symb($time)/ )}
Patterns are "double quotish", they act like double-quoted strings.
You can not interpolate function calls[1], only scalars and arrays.
{ $aray{$i} .= symb($time) if $aray{$i} !~ /$ch/ }
or, probably better 'cause there's no need for quotemeta():
{ $aray{$i} .= symb($time) if index($aray{$i}, $ch) == -1 }
or
{ $aray{$i} .= symb($time) unless index($aray{$i}, $ch) >= 0 }
function arguments _are_ evaluated, so you can do away
with the temporary scalar now:
{ $aray{$i} .= symb($time) if index($aray{$i}, symb($time)) == -1 }
[1] That's a lie, but interpolating function calls uses such an
ugly trick that I will not propogate its use.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 11 Oct 2002 08:29:54 -0700
From: aaron.smith@rational.com (aaron smith)
Subject: STDOUT_TOP printing funny character
Message-Id: <829bb53b.0210110729.6b401906@posting.google.com>
Hi, the following code prints an ankh before "media [id]". I've also
tried a blank line first and it prints the ankh on the blank line. How
can I get rid of the extra character?
format STDOUT_TOP=
media media robot robot robot side/ ret size
status
ID type type # slot face level Kbytes
--------------------------------------------------------------------------------
.
format STDOUT=
@<<<<<< @<<<< @<<<< @||| @||| @||| @||| @<<<<<<< @<<<<<<<<<<<
$medID,$medType,$roType,$roNum,$roSlot,$sideFace,$retLevel,$sizeKb,$stat
.
TIA
Aaron
btw, I know it doesn't really line up. I need to get rid of the ankh
1st.
------------------------------
Date: Fri, 11 Oct 2002 18:28:49 +0200
From: Thomas Guettler <pan-newsreader@thomas-guettler.de>
Subject: Switching from Python to Perl
Message-Id: <pan.2002.10.11.18.28.48.602079.704@thomas-guettler.de>
Hi!
There are a lot of people who switched from
perl to python. Is there anyone who switched
from python to perl?
thomas
------------------------------
Date: Fri, 11 Oct 2002 16:32:31 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Switching from Python to Perl
Message-Id: <3da6fd10.21401934@news.cis.dfn.de>
On Fri, 11 Oct 2002 18:28:49 +0200, Thomas Guettler
<pan-newsreader@thomas-guettler.de> wrote:
>There are a lot of people who switched from
>perl to python. Is there anyone who switched
>from python to perl?
Who knows? Who cares?
--
Regards, Helgi Briem
helgi AT decode DOT is
A: Top posting
Q: What is the most irritating thing on Usenet?
- "Gordon" on apihna
------------------------------
Date: Fri, 11 Oct 2002 13:52:35 -0230
From: "Kondwani Spike Mkandawire" <kondwani@cs.mun.ca>
Subject: Re: Switching from Python to Perl
Message-Id: <ao6u8o$gma$1@coranto.ucs.mun.ca>
I'm trying to switch to Perl from Python...
Still in the process of learning though...
I was told by someone with great experience in
both that because Python is still young there
will be a lot of deprecation as the language is
continuously updated and as bugs are being fixed.
However Perl is 15 or so years old and has
already undergone a lot of fixes and updates
hence I was told ought to be more stable...
Anyone, was I misled?
"Thomas Guettler" <pan-newsreader@thomas-guettler.de> wrote in message
news:pan.2002.10.11.18.28.48.602079.704@thomas-guettler.de...
> Hi!
>
> There are a lot of people who switched from
> perl to python. Is there anyone who switched
> from python to perl?
>
> thomas
------------------------------
Date: Fri, 11 Oct 2002 12:40:26 -0500
From: Tommy Butler <usenet@atrixnet.com>
To: Kondwani Spike Mkandawire <kondwani@cs.mun.ca>
Subject: Re: Switching from Python to Perl
Message-Id: <3DA70D0A.10802@atrixnet.com>
Kondwani Spike Mkandawire wrote:
> I'm trying to switch to Perl from Python...
> Still in the process of learning though...
> I was told by someone with great experience in
> both that because Python is still young there
> will be a lot of deprecation as the language is
> continuously updated and as bugs are being fixed.
> However Perl is 15 or so years old and has
> already undergone a lot of fixes and updates
> hence I was told ought to be more stable...
>
> Anyone, was I misled?
I think that's advice you can safely ignore.
--
-Tommy Butler
see if I'm online »http://ooopps.sourceforge.net/online
Tommy Butler <tommy@atrixnet.com>
phone: (817)-468-7716
6711 Forest Park Dr
Arlington, TX
76001-8403
Download my résumé in PDF, MS Word, HTML, text
http://www.atrixnet.com/
the ooOPps Code Library
http://ooopps.sourceforge.net/pub/
------------------------------
Date: Fri, 11 Oct 2002 10:48:02 -0700
From: peter <peter@nospam.calweb.com>
Subject: undef == true?
Message-Id: <3DA70ED2.2000408@nospam.calweb.com>
I've encountered several cases where an undefined var or a var assigned
the value undef evaluated true or compared as true. Does anyone know
the reason behind this? I find it plain annoying.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 3955
***************************************