[22937] in Perl-Users-Digest
Perl-Users Digest, Issue: 5157 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 30 21:05:46 2003
Date: Mon, 30 Jun 2003 18:05:12 -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 Mon, 30 Jun 2003 Volume: 10 Number: 5157
Today's topics:
Re: Can the Repetition Operator Be Nested? <abigail@abigail.nl>
file name of file that reference to type glob points to <coo_t2-NO-LIKE-SPAM@yahoo.com>
Re: file name of file that reference to type glob point <krahnj@acm.org>
Re: foreach county <abigail@abigail.nl>
Re: foreach county <mgjv@tradingpost.com.au>
Re: How do you sort a 2D array with column headers? (Greg Bacon)
How would you mail yourself from XP <mee@home.com>
Re: How would you mail yourself from XP <abigail@abigail.nl>
Re: How would you mail yourself from XP <mee@home.com>
Re: How would you mail yourself from XP <asu1@c-o-r-n-e-l-l.edu>
Re: How would you mail yourself from XP <asu1@c-o-r-n-e-l-l.edu>
Re: How would you mail yourself from XP <abigail@abigail.nl>
Re: How would you mail yourself from XP <coo_t2-NO-LIKE-SPAM@yahoo.com>
Re: How would you mail yourself from XP (Tad McClellan)
Re: HTML::TableExtract Simple question (Avatar)
Re: Is there a good free/not so expensive Perl IDE for <usenet@NOSPAM.matthewb.org>
Re: Is there a good free/not so expensive Perl IDE for <abigail@abigail.nl>
Re: Is there a good free/not so expensive Perl IDE for <tassilo.parseval@rwth-aachen.de>
Re: Is there a good free/not so expensive Perl IDE for <minceme@start.no>
Re: Is there a good free/not so expensive Perl IDE for <abigail@abigail.nl>
letters in a scalar to array <sheltonNOSPAM@onr.com>
Re: letters in a scalar to array <bwalton@rochester.rr.com>
Re: letters in a scalar to array <mgjv@tradingpost.com.au>
Re: letters in a scalar to array <mgjv@tradingpost.com.au>
Re: letters in a scalar to array <krahnj@acm.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Jun 2003 19:31:49 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Can the Repetition Operator Be Nested?
Message-Id: <slrnbg1415.el.abigail@alexandra.abigail.nl>
MES (mesmith@mygfa.org) wrote on MMMDXC September MCMXCIII in
<URL:news:f6104297.0306300904.7285db79@posting.google.com>:
<> Thanks for the suggestions.
<>
<> I used the -w flag but misinterpreted the error message. I also
<> slightly misrepresented the problem. I should have used printf instead
<> of print. What I want to do is build a format string. This prints out
<> the format string I expect
<>
<> print (("This %s" x 2 . "\n") x 2);
<>
<> But this does not produce the results I expect from printf
<>
<> printf (("This %s" x 2 . "\n") x 2, "one", "two", "three", "four");
<>
<> I suspect that the second copy of the format string is being supplied
<> as the argument for the first %s. "one" is supplied as the argument
<> for the second %s. The remaining supplied arguments are discarded
<> because the end of the format string has been reached.
The arguments of print and printf are in list context. If the x operator
is in list context, and the left argument of x is inside parens, x will
return a list with more than one element (if the right operand is larger
than 1) instead of a single string. So, in list context,
("This %s" x 2 . "\n") x 2
equals
("This %sThis %s\n", "This %sThis %s\n")
and not
("This %sThis %s\nThis %sThis %s\n")
as you are expecting.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
Date: Mon, 30 Jun 2003 23:59:07 GMT
From: ed <coo_t2-NO-LIKE-SPAM@yahoo.com>
Subject: file name of file that reference to type glob points to
Message-Id: <m1j1gvk2gibk7qp1egca0fa7pm1b3biogm@4ax.com>
Hey all. This is probably a elementary question, but I can't
seem to be able to find a builtin function or combination of functions
that will let me achieve this.
I want to get the full path to a file that is pointed to from a
reference to a type glob.
Below is a simple example of what I want to do.
## start perl script ##
use strict;
use warnings;
open(FH, '<', './testees/noname4.html')
or die("can't open file: $!");
&doSomething(\*FH);
close FH;
sub doSomething
{ my $FH = shift;
# I need the name of the file that
# $FH points to, to do something!
# something like filename($FH) would be nice.
}
## end perl script ##
There's a few things I can do to get around this problem.
But now I'm just curious of how this could be done.
tia,
--ed
------------------------------
Date: Tue, 01 Jul 2003 00:40:15 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: file name of file that reference to type glob points to
Message-Id: <3F00D871.66611DD6@acm.org>
ed wrote:
>
> Hey all. This is probably a elementary question, but I can't
> seem to be able to find a builtin function or combination of functions
> that will let me achieve this.
>
> I want to get the full path to a file that is pointed to from a
> reference to a type glob.
> Below is a simple example of what I want to do.
>
> ## start perl script ##
> use strict;
> use warnings;
>
> open(FH, '<', './testees/noname4.html')
> or die("can't open file: $!");
> &doSomething(\*FH);
> close FH;
>
> sub doSomething
> { my $FH = shift;
> # I need the name of the file that
> # $FH points to, to do something!
> # something like filename($FH) would be nice.
> }
> ## end perl script ##
>
> There's a few things I can do to get around this problem.
> But now I'm just curious of how this could be done.
Why not just pass the file name to the sub and open it in the sub?
If you are running this on Linux then you can find the file name in the
/proc directory.
John
--
use Perl;
program
fulfillment
------------------------------
Date: 30 Jun 2003 19:34:11 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: foreach county
Message-Id: <slrnbg145j.el.abigail@alexandra.abigail.nl>
Todd Anderson (todd@asgweb.net) wrote on MMMDXC September MCMXCIII in
<URL:news:3F00692D.48B8C073@asgweb.net>:
%% Dear Persons,
%% The code below doesn't work on some computers.
Perhaps you should pay it more.
"Doesn't work" carries no useful meaning. Unless you tell us what it
does, and what you expect it to do, "doesn't work" is pretty useless.
Abigail
--
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: 30 Jun 2003 23:53:20 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: foreach county
Message-Id: <slrnbg1jbi.3er.mgjv@verbruggen.comdyn.com.au>
On Mon, 30 Jun 2003 10:51:08 -0600,
Todd Anderson <todd@asgweb.net> wrote:
> Dear Persons,
> The code below doesn't work on some computers. The county list isn't
> being displayed. I can't firgure out why it would on most computers but
> not on some. I say computer because it's intermittent on the same browsers.
> Any help is appreciated and thanks in advance.
What does "doesn't work" mean? Error messages? (If this runs as a CGI
program, check the error logs of the web server). Any warnings?
Are you using strict and warnings?
From your code example below, I'd wager a guess that you're not using
either.
> sub Chooser_page {
> if($name eq "Defaults"){ @counties = split (/\,/, $Defaults); }
> if($name eq "Trustees"){ @counties = split (/\,/, $Trustees); }
> if($name eq "Fsbos"){ @counties = split (/\,/, $Fsbos); }
No need to escape a comma in tregular expressions. It is not a special
character.
> &generic_header("Choose County");
>
> &pagesetup;
Don't call subroutines this way, unless you need to have the special
semantics that the leading ampersand impose. Read the perlsub
documentation to find out what that is.
> print qq~
><table width="100%"><tr><td align="center">
><font id="font20">Choose a $name County</font>
><P>~;
Have you checked the output of this program to make sure things are in
there that you expect to be in there? Have you made sure that what
comes out is valid HTML? Don't just check with a browser. Inspect the
HTML outside of a browser.
Have you read the Perl FAQ, section 9?
Anyway, there is no way for us to even start debugging this. We have
no clue on what's in those variables, and we have no clue on how you
got here.
Write a small stand-alone program that uses strict and warnings, and
that has the problem you describe. Submit that to this newsgroup for
inspection.
Martien
--
|
Martien Verbruggen |
Trading Post Australia | Curiouser and curiouser, said Alice.
|
------------------------------
Date: Mon, 30 Jun 2003 18:42:43 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: How do you sort a 2D array with column headers?
Message-Id: <vg11535tkqsa95@corp.supernews.com>
In article <20030630132321.238$lk@newsreader.com>,
<ctcgag@hotmail.com> wrote:
: mjd@plover.com (Mark Jason Dominus) wrote:
:
: > The details of the study are at
: > http://perl.plover.com/yak/flags/dollar-pound/. Here is the short
: > version. $#array is commonly used for five things:
: >
: > 1. Generating a list of indices for an array. (Your example above is
: > one of these; it is @{$m}[1..$#$m].)
:
: I wish the ".." operator, when occuring in a slice, were sufficiently
: magical to allow @{$m}[1..-1] to replace the above.
Amen! Almost anything other than big ugly $#{...} dereferences would
be nice.
: > 2. The upper bound of a C-style 'for' loop, as
: >
: > for ($i=0; $i <= $#array; $i++) {
: > do something with $array[$i];
: > }
:
: I use this very frequently when I have parallel arrays. Of course,
: that might not exactly fit in your criteria for inclusion in this
: category. I also use this when I want to change the length of @array
: during the loop.
When I find myself constructing parallel arrays, I almost always merge
them into arrays of either hashes or arrays.
Greg
--
Laws that forbid the carrying of arms ... make things worse for the assaulted
and better for the assailants; they serve rather to encourage than to prevent
homicides, for an unarmed man may be attacked with greater confidence than an
armed man. -- Thomas Jefferson
------------------------------
Date: Mon, 30 Jun 2003 14:45:40 -0700
From: "zoo" <mee@home.com>
Subject: How would you mail yourself from XP
Message-Id: <bdqas2$845$1@sun-news.laserlink.net>
I use this piece of code to mail myself but my operating system can't find
the mail command.
How would I make this command work with windows XP ?
open MAIL, "|mail zoo@/hotmail.com";
print MAIL "bad news: $somename guessed $someguess\n";
close MAIL;
'mail' is not recognized as an internal or external command,
operable program or batch file.
J.
------------------------------
Date: 30 Jun 2003 21:54:50 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: How would you mail yourself from XP
Message-Id: <slrnbg1cda.el.abigail@alexandra.abigail.nl>
zoo (mee@home.com) wrote on MMMDXC September MCMXCIII in
<URL:news:bdqas2$845$1@sun-news.laserlink.net>:
?? I use this piece of code to mail myself but my operating system can't find
?? the mail command.
?? How would I make this command work with windows XP ?
??
?? open MAIL, "|mail zoo@/hotmail.com";
?? print MAIL "bad news: $somename guessed $someguess\n";
?? close MAIL;
??
??
?? 'mail' is not recognized as an internal or external command,
?? operable program or batch file.
What makes you think that's a Perl question?
Abigail
--
BEGIN {$^H {q} = sub {$_ [1] =~ y/S-ZA-IK-O/q-tc-fe-m/d; $_ [1]}; $^H = 0x28100}
print "Just another PYTHON hacker\n";
------------------------------
Date: Mon, 30 Jun 2003 15:14:38 -0700
From: "zoo" <mee@home.com>
Subject: Re: How would you mail yourself from XP
Message-Id: <bdqcic$bc2$1@sun-news.laserlink.net>
Since I am trying to learn Perl and XP is a prevalent operating system I
figured there would be someone who would know the answer to this question.
its not entirely unrelated.
Could anyone be willing to help with this question. ?
J.
"Abigail" <abigail@abigail.nl> wrote in message
news:slrnbg1cda.el.abigail@alexandra.abigail.nl...
> zoo (mee@home.com) wrote on MMMDXC September MCMXCIII in
> <URL:news:bdqas2$845$1@sun-news.laserlink.net>:
> ?? I use this piece of code to mail myself but my operating system can't
find
> ?? the mail command.
> ?? How would I make this command work with windows XP ?
> ??
> ?? open MAIL, "|mail zoo@/hotmail.com";
> ?? print MAIL "bad news: $somename guessed $someguess\n";
> ?? close MAIL;
> ??
> ??
> ?? 'mail' is not recognized as an internal or external command,
> ?? operable program or batch file.
>
>
> What makes you think that's a Perl question?
>
>
>
> Abigail
> --
> BEGIN {$^H {q} = sub {$_ [1] =~ y/S-ZA-IK-O/q-tc-fe-m/d; $_ [1]}; $^H =
0x28100}
> print "Just another PYTHON hacker\n";
------------------------------
Date: 30 Jun 2003 22:24:58 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: How would you mail yourself from XP
Message-Id: <Xns93AABB573CF6asu1cornelledu@132.236.56.8>
"zoo" <mee@home.com> wrote in news:bdqas2$845$1@sun-news.laserlink.net:
> I use this piece of code to mail myself but my operating system can't
> find the mail command. How would I make this command work with
> windows XP ?
>
> open MAIL, "|mail zoo@/hotmail.com";
> print MAIL "bad news: $somename guessed $someguess\n";
> close MAIL;
>
>
> 'mail' is not recognized as an internal or external command,
> operable program or batch file.
BLAT might help: http://www.interlog.com/~tcharron/blat.html
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: 30 Jun 2003 22:32:19 GMT
From: "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
Subject: Re: How would you mail yourself from XP
Message-Id: <Xns93AABC966FC31asu1cornelledu@132.236.56.8>
"zoo" <mee@home.com> wrote in news:bdqcic$bc2$1@sun-news.laserlink.net:
> "Abigail" <abigail@abigail.nl> wrote in message
> news:slrnbg1cda.el.abigail@alexandra.abigail.nl...
>> zoo (mee@home.com) wrote on MMMDXC September MCMXCIII in
>> <URL:news:bdqas2$845$1@sun-news.laserlink.net>:
>> ?? I use this piece of code to mail myself but my operating system
>> ?? can't find the mail command.
...
>> What makes you think that's a Perl question?
>>
>> Abigail
>
> Since I am trying to learn Perl and XP is a prevalent operating system
> I figured there would be someone who would know the answer to this
> question. its not entirely unrelated.
>
> Could anyone be willing to help with this question. ?
First off, please do not top post. Second, your question is at best a CGI
question and at worst a question about where to find a specific tool for
a specific operating system, and as such not related to Perl. The fact
that you are piping Perl's output to a utility does not make the utility
relevant to Perl.
In any case, see my other post in this thread for a link to a utility
that might be of some help.
Sinan.
--
A. Sinan Unur
asu1@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uce@ftc.gov
------------------------------
Date: 30 Jun 2003 22:47:05 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: How would you mail yourself from XP
Message-Id: <slrnbg1ff8.el.abigail@alexandra.abigail.nl>
zoo (mee@home.com) wrote on MMMDXC September MCMXCIII in
<URL:news:bdqcic$bc2$1@sun-news.laserlink.net>:
`' Since I am trying to learn Perl and XP is a prevalent operating system I
`' figured there would be someone who would know the answer to this question.
`' its not entirely unrelated.
Since you are sitting on a chair while trying to call this utility
in Windows XP, I'd suggest trying the customer service department
of your local furniture dealer.
Make sure you insist on getting an answer when they first turn you down.
Abigail
--
perl -wle '(1 x $_) !~ /^(11+)\1+$/ && print while ($_ ||= 1) ++'
------------------------------
Date: Mon, 30 Jun 2003 22:54:43 GMT
From: ed <coo_t2-NO-LIKE-SPAM@yahoo.com>
Subject: Re: How would you mail yourself from XP
Message-Id: <2le1gvg2tvui1aqhc4ficao4bcldes296r@4ax.com>
On 30 Jun 2003 22:24:58 GMT, "A. Sinan Unur" <asu1@c-o-r-n-e-l-l.edu>
wrote:
>"zoo" <mee@home.com> wrote in news:bdqas2$845$1@sun-news.laserlink.net:
>
>> I use this piece of code to mail myself but my operating system can't
>> find the mail command. How would I make this command work with
>> windows XP ?
>>
>> open MAIL, "|mail zoo@/hotmail.com";
>> print MAIL "bad news: $somename guessed $someguess\n";
>> close MAIL;
>>
>>
>> 'mail' is not recognized as an internal or external command,
>> operable program or batch file.
>
>BLAT might help: http://www.interlog.com/~tcharron/blat.html
You may also wanna check out this link:
http://search.cpan.org/modlist/Mail_and_Usenet_News/Mail
Since you're on windows I would recommend the ActivePerl distribution
of Perl from ActiveState.
http://activestate.com/Products/ActivePerl/
Once you have that(if you don't already), you can use the "ppm" tool
from the command line to easily download and install any modules.
hth,
--ed
------------------------------
Date: Mon, 30 Jun 2003 17:54:50 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How would you mail yourself from XP
Message-Id: <slrnbg1ftq.47o.tadmc@magna.augustmail.com>
[ upside-down posting fixed by rearranging lines into a sensible order ]
zoo <mee@home.com> wrote:
> "Abigail" <abigail@abigail.nl> wrote in message
> news:slrnbg1cda.el.abigail@alexandra.abigail.nl...
>> zoo (mee@home.com) wrote on MMMDXC September MCMXCIII in
>> <URL:news:bdqas2$845$1@sun-news.laserlink.net>:
>> ?? 'mail' is not recognized as an internal or external command,
>> ?? operable program or batch file.
>>
>> What makes you think that's a Perl question?
[ snip quoted .sig, you are not supposed to quote those either ]
> Since I am trying to learn Perl
The most important thing to learn in troubleshooting a program,
regardless of what language you've chosen to use, is to be able
to "partition" the problem correctly.
If you partition it correctly, it becomes much easier to fix, as
you won't spin your wheels by looking for answers in the wrong place.
You are looking for answers in the wrong place, there is nothing
wrong with your Perl.
> and XP is a prevalent operating system I
> figured there would be someone who would know the answer to this question.
Yes, but they probably hang out in a newsgroup about XP rather than
in the dozens of programming languages that could be used with XP.
> its not entirely unrelated.
Yes it is. You have an opportunity to learn something very valuable here.
Your problem is NOT about Perl.
If you had chosen Python or Visual Basic, you would still not have
a 'mail' executable to call!
> Could anyone be willing to help with this question. ?
I'll bet someone in the right newsgroup could.
Try asking in the right newsgroup:
comp.os.ms-windows.*
comp.os.ms-windows.programmer.*
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 30 Jun 2003 12:13:15 -0700
From: ksu1wd@mit.edu (Avatar)
Subject: Re: HTML::TableExtract Simple question
Message-Id: <415d5171.0306301113.3fa49e7b@posting.google.com>
Hi again, I ran into some more problems. One has to do with the fact
that the tables I am extracting from have headers with whitespace in
them. So
my $te = new HTML::TableExtract( headers => [qw(header1 header 2
header3)] );
I want it to interpret them as only 3 headers, header1, header 2, and
header3,
but it will only give me the results under header1 and header3, and
I'm guessing no header matches 'header' or '2' and that's why nothing
is returned. I tried doing [('header1' 'header 2' 'header3')] but
that gave me
String found where operator expected at C:\Work\Scripts\practice.pl
line 9
Also, the problem is in the results as well. The table is designed
such that under each header, there are 3 columns. Like so:
Header 1 | Header 2 |
One Two Three |One Two Three |
| |
but on the headers that have no white space, it will only return
column one. Any suggestions to amend this would be greatly
appreciated. If I have left out any vital information, please send me
an email or repost here so I can correct it. Thanks
------------------------------
Date: Mon, 30 Jun 2003 16:52:21 +0100
From: "Matthew Browning" <usenet@NOSPAM.matthewb.org>
Subject: Re: Is there a good free/not so expensive Perl IDE for Linux
Message-Id: <pan.2003.06.30.15.52.18.195853@NOSPAM.matthewb.org>
On Mon, 30 Jun 2003 14:02:35 +0000, Abigail wrote:
> Two. Running the program can be done from within the editor with an
> appropriate macro. ;-)
>
>
> 2 store-macro
> save-file
> shell-command &cat "perl " $cfilname
> ~endm
>
> bind-key execute-macro-2 ^A-r
>
One.
M-x cperl-perldoc
Matthew Browning
------------------------------
Date: 30 Jun 2003 19:17:44 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Is there a good free/not so expensive Perl IDE for Linux
Message-Id: <slrnbg136o.el.abigail@alexandra.abigail.nl>
Greg Bacon (gbacon@hiwaay.net) wrote on MMMDXC September MCMXCIII in
<URL:news:vg0j3194i0of36@corp.supernews.com>:
|| In article <slrnbg0gnr.el.abigail@alexandra.abigail.nl>,
|| Abigail <abigail@abigail.nl> wrote:
||
|| : Tad McClellan (tadmc@augustmail.com) wrote on MMMDXC September MCMXCIII
|| : in <URL:news:slrnbg0df0.31u.tadmc@magna.augustmail.com>:
|| :
|| : ## Three xterms.
|| : ##
|| : ## One for the editor, one for executing the program, one for
|| : ## "checking stuff" such as the docs or the contents of files.
|| :
|| : Two. Running the program can be done from within the editor
|| : with an appropriate macro. ;-)
||
|| One. Reading docs and other files can be done from within the
|| editor. :-)
||
|| <esc>:!man perl
Oh, it can, but I want to see the documentation while typing.
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
Date: 30 Jun 2003 20:02:10 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Is there a good free/not so expensive Perl IDE for Linux
Message-Id: <bdq502$7e8$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Abigail:
> Greg Bacon (gbacon@hiwaay.net) wrote on MMMDXC September MCMXCIII in
><URL:news:vg0j3194i0of36@corp.supernews.com>:
>|| One. Reading docs and other files can be done from within the
>|| editor. :-)
>||
>|| <esc>:!man perl
>
>
> Oh, it can, but I want to see the documentation while typing.
:split
:-)
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Mon, 30 Jun 2003 21:04:56 +0000 (UTC)
From: Vlad Tepes <minceme@start.no>
Subject: Re: Is there a good free/not so expensive Perl IDE for Linux
Message-Id: <bdq8lo$srq$1@troll.powertech.no>
> Abigail <abigail@abigail.nl> wrote:
> Greg Bacon (gbacon@hiwaay.net) wrote on MMMDXC September MCMXCIII in
>||
>|| One. Reading docs and other files can be done from within the
>|| editor. :-)
>||
>|| <esc>:!man perl
Put man.vim (included with recent vims) in the plugins directory, and do
:Man perl
Much better. :-)
--
Vlad
------------------------------
Date: 30 Jun 2003 21:27:43 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Is there a good free/not so expensive Perl IDE for Linux
Message-Id: <slrnbg1aqe.el.abigail@alexandra.abigail.nl>
Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDXC
September MCMXCIII in <URL:news:bdq502$7e8$1@nets3.rz.RWTH-Aachen.DE>:
^^ Also sprach Abigail:
^^
^^ > Greg Bacon (gbacon@hiwaay.net) wrote on MMMDXC September MCMXCIII in
^^ ><URL:news:vg0j3194i0of36@corp.supernews.com>:
^^
^^ >|| One. Reading docs and other files can be done from within the
^^ >|| editor. :-)
^^ >||
^^ >|| <esc>:!man perl
^^ >
^^ >
^^ > Oh, it can, but I want to see the documentation while typing.
^^
^^ :split
Then I don't see enough of the documentation. ;-)
Abigail
--
#!/opt/perl/bin/perl -- # Remove trailing newline!
BEGIN{$SIG{__WARN__}=sub{$_=pop;y-_- -;print/".*(.)"/;
truncate$0,-1+-s$0;exec$0;}}//rekcaH_lreP_rehtona_tsuJ
------------------------------
Date: Mon, 30 Jun 2003 23:27:37 GMT
From: John E <sheltonNOSPAM@onr.com>
Subject: letters in a scalar to array
Message-Id: <JH3Ma.34637$hV.2124146@twister.austin.rr.com>
hello.
i'd like to take the letters in a scalar and make each of
them an element in an array.
here's what i've got so far....
#!/usr/bin/perl -w
$filename='test.pl';
$filename =~ s/.pl//;
@blah=split(/^?/,$filename);
foreach (@blah) { print $_."\n"; }
however, i also get this blunderful little warning....
Quantifier unexpected on zero-length expression before
HERE mark in regex m/^? << HERE / at ./asdf.pl line 4.
t
e
s
t
any advice on how to avoid that annoying warning (besides
just removing the w flag)?
Thanks,
~johnny
------------------------------
Date: Mon, 30 Jun 2003 23:39:58 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: letters in a scalar to array
Message-Id: <3F00CA43.10809@rochester.rr.com>
John E wrote:
...
> i'd like to take the letters in a scalar and make each of them an
> element in an array.
> here's what i've got so far....
>
> #!/usr/bin/perl -w
> $filename='test.pl';
> $filename =~ s/.pl//;
> @blah=split(/^?/,$filename);
> foreach (@blah) { print $_."\n"; }
>
> however, i also get this blunderful little warning....
>
> Quantifier unexpected on zero-length expression before HERE mark in
> regex m/^? << HERE / at ./asdf.pl line 4.
> t
> e
> s
> t
>
> any advice on how to avoid that annoying warning (besides just removing
> the w flag)?
Sure:
@blah=split //,$filename;
See
perldoc -f split
for details.
...
> ~johnny
...
--
Bob Walton
------------------------------
Date: 01 Jul 2003 00:25:01 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: letters in a scalar to array
Message-Id: <slrnbg1l6v.3er.mgjv@verbruggen.comdyn.com.au>
On Mon, 30 Jun 2003 23:27:37 GMT,
John E <sheltonNOSPAM@onr.com> wrote:
> hello.
> i'd like to take the letters in a scalar and make each of
> them an element in an array.
> here's what i've got so far....
>
> #!/usr/bin/perl -w
> $filename='test.pl';
> $filename =~ s/.pl//;
What if the filename is "results.plot.pl"? It's probably safer to anchor
the expression.
$filename = s/.pl$//;
> @blah=split(/^?/,$filename);
I'm not entirely sure what you're trying to express with this regular
expression.
> foreach (@blah) { print $_."\n"; }
>
> however, i also get this blunderful little warning....
>
> Quantifier unexpected on zero-length expression before
> HERE mark in regex m/^? << HERE / at ./asdf.pl line 4.
If I were the regex compiler, I'd probably have been less forgiving :)
> any advice on how to avoid that annoying warning (besides
> just removing the w flag)?
The documentation for split talks a little about this. Most people
would probably use the null pattern:
my @blah = split //, $filename;
or maybe this expresses the intent a bit more clearly:
my @blah = $filename =~ /(.)/g;
Martien
--
|
Martien Verbruggen |
Trading Post Australia | Hi, Dave here, what's the root password?
|
------------------------------
Date: 01 Jul 2003 00:32:30 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: letters in a scalar to array
Message-Id: <slrnbg1ll0.3er.mgjv@verbruggen.comdyn.com.au>
On 01 Jul 2003 00:25:01 GMT,
Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> On Mon, 30 Jun 2003 23:27:37 GMT,
> John E <sheltonNOSPAM@onr.com> wrote:
>> $filename =~ s/.pl//;
>
> What if the filename is "results.plot.pl"? It's probably safer to anchor
> the expression.o
ehrm...
Or even results_plot.pl, given that that . will match anything.
> $filename = s/.pl$//;
Correcting myself:
$filename = s/\.pl$//;
Martien
--
|
Martien Verbruggen | Freudian slip: when you say one thing but
Trading Post Australia | mean your mother.
|
------------------------------
Date: Tue, 01 Jul 2003 00:36:38 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: letters in a scalar to array
Message-Id: <3F00D797.88A404D9@acm.org>
John E wrote:
>
> i'd like to take the letters in a scalar and make each of
> them an element in an array.
> here's what i've got so far....
>
> #!/usr/bin/perl -w
You should use strict as well.
use strict;
> $filename='test.pl';
my $filename = 'test.pl';
> $filename =~ s/.pl//;
The dot is special in a regular expression, it matches any character
except newline. You have to escape it if you want to match a literal
dot character. Also you should anchor the regex to the end of the
string.
$filename =~ s/\.pl$//;
> @blah=split(/^?/,$filename);
^ is a special character that matches the beginning of a string and ?
means you want zero or one of the previous character but since every
string has a beginning you can't use a modifier with it.
my @blah = split //, $filename;
> foreach (@blah) { print $_."\n"; }
for ( split //, $filename ) { print "$_\n" }
Or even:
print "$_\n" for split //, $filename;
John
--
use Perl;
program
fulfillment
------------------------------
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 5157
***************************************