[24073] in Perl-Users-Digest
Perl-Users Digest, Issue: 6268 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 17 06:05:41 2004
Date: Wed, 17 Mar 2004 03:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 17 Mar 2004 Volume: 10 Number: 6268
Today's topics:
Re: ActivePerl and WSH debugger - Does it work? (Graham)
Re: browser tries to download perl code (Ki)
Re: Can anybody help me use Perl to login to my account <jboes@qtm.net>
format printing (Brian)
Re: format printing <noreply@gunnar.cc>
Re: format printing (Anno Siegel)
Re: Having problems with with the s/// substitution <krahnj@acm.org>
Re: Having problems with with the s/// substitution <uri@stemsystems.com>
how to execute two commands? <Jimroos@uunet.be>
Re: how to execute two commands? (Anno Siegel)
Re: how to execute two commands? <Jimroos@uunet.be>
Re: how to execute two commands? (Anno Siegel)
Re: How to use select to wait for input (Heinrich Mislik)
Re: incrementing a string by a certain value <segraves_f13@mindspring.com>
Re: incrementing a string by a certain value <dwall@fastmail.fm>
paniconographic have you ever tried this? (christinA eijkhout)
Re: paniconographic have you ever tried this? <uri@stemsystems.com>
PAR, perlglob, and Windows (2000) (D. Jackson)
Re: PAR, perlglob, and Windows (2000) <krahnj@acm.org>
Re: PAR, perlglob, and Windows (2000) <astewart1@cox.net>
Re: recognizing hidden INPUT TYPE within HTML <*@eli.users.panix.com>
Re: SOAP::Lite help with nested XML please <no@no.no>
Re: system(...) does not produce output using 5.8.* (Manzoor Ilahi)
Re: system(...) does not produce output using 5.8.* <roel-perl@st2x.net>
Re: system(...) does not produce output using 5.8.* <ittyspam@yahoo.com>
Re: using backquote or system with perl -ne in perl 5.8 <mahesha@mahesha.net>
Re: using backquote or system with perl -ne in perl 5.8 <NOSPAM.Jmc.NOSPAM@NOSPAM.web.de>
Re: What is that tab char? <mbroida@fake.domain>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 16 Mar 2004 20:41:44 GMT
From: graham@nospam.steelworks.org.uk (Graham)
Subject: Re: ActivePerl and WSH debugger - Does it work?
Message-Id: <40563356.5381716@news.freenetname.co.uk>
Hi Robert,
If you are on Windows XP, there IS a Perl debugger much as you
describe for JScript. Find it at
http://sourceforge.net/projects/open-perl-ide/
It has one or two bugs in it, and several quirks, but they do not
affect execution and you can live with them. It has increased my Perl
productivity no end.
Regards,
Graham
On Sat, 13 Mar 2004 01:09:02 -0800, Robert K. Young <NoOne@None.Com>
wrote:
>I'm now moving most of my "stuff" to an XP pro box. I have ActiveState
>Perl (5.8.3) installed and I can execute perl script as extected with:
>
>C:\Src\Perl>perl myscript.pls
>
>of course I can also debug with:
>
>C:\Src\Perl>perl -d myscript.pls
>
>The problem is that the perl debugger is a little limmited comparred
>to the really nice debugger available for VBScript or JScript running
>under WSH.
>
--
Graham Steel: graham@nospam.steelworks.org.uk
Web: http://www.steelworks.org.uk
------------------------------
Date: 16 Mar 2004 19:18:22 -0800
From: docskky@yahoo.com (Ki)
Subject: Re: browser tries to download perl code
Message-Id: <935d4411.0403161918.4f0312c0@posting.google.com>
Thanks, folks.
You are very helpful.
BTW, please do not blame me for writing that poor code.
I've just handed in someone else's project.
Thanks a lot. :)
- Ki
------------------------------
Date: Wed, 17 Mar 2004 03:12:27 GMT
From: Jeff Boes <jboes@qtm.net>
Subject: Re: Can anybody help me use Perl to login to my account?
Message-Id: <92ebf284ea4658c629d8a43c02fcc52f@news.teranews.com>
At some point in time, sallybonbons@yahoo.com (S. Brown) wrote:
>I am trying to login and grab information from my account on espn.com
>so I can track my progress. Problem is I can't login and handle
>cookies the right way. I have the following code. The out.html page
>just shows a login screen with my username already filled in. So, it
>identifies my POST variables, but it won't log me in. Any help?
You might want to check out WWW::Mechanize.
--
~~~~~~~~~~~~~~~~| Genius may have its limitations, but stupidity is not
Jeff Boes | thus handicapped.
jboes@qtm.net | --Elbert Hubbard (1856-1915), American author
------------------------------
Date: 17 Mar 2004 01:44:34 -0800
From: leetiger_cn@hotmail.com (Brian)
Subject: format printing
Message-Id: <b5e6fb4e.0403170144.42cf8675@posting.google.com>
Hello everyono
Here is a question, how to print out the elements of a array according
to a format? For example, print out the arry consists of float
numbers, 6 numbers in every line?
Thanks alot.
Brian
------------------------------
Date: Wed, 17 Mar 2004 10:52:03 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: format printing
Message-Id: <c397gp$24v6q8$1@ID-184292.news.uni-berlin.de>
Brian wrote:
> Here is a question, how to print out the elements of a array
> according to a format? For example, print out the arry consists of
> float numbers, 6 numbers in every line?
Check out the printf() and sprintf() functions.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 17 Mar 2004 10:12:10 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: format printing
Message-Id: <c3989q$9vt$1@mamenchi.zrz.TU-Berlin.DE>
Brian <leetiger_cn@hotmail.com> wrote in comp.lang.perl.misc:
> Hello everyono
> Here is a question, how to print out the elements of a array according
> to a format? For example, print out the arry consists of float
> numbers, 6 numbers in every line?
What do you mean by "format"? A Perl format in the technical sense?
A printf format? Something else? Do you just want lines of six each,
or should the columns be aligned? Do you want a fixed field width,
or should the width adapt to the data? Should there be separators
between the columns?
Explain what you want to do. Here is how to print an array @x in
groups of six:
print join( ", ", splice @x, 0, 6), "\n" while @x;
If you want more, say what it is you want.
Anno
------------------------------
Date: Tue, 16 Mar 2004 21:00:00 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Having problems with with the s/// substitution
Message-Id: <40576AC6.78FC6E69@acm.org>
Tore Aursand wrote:
>
> On Tue, 16 Mar 2004 08:01:44 -0800, Hakan Bacakoglu wrote:
> > Please help me out with this:
> > [...]
>
> It's extremely helpful if you post an extract of what you're trying to
> parse.
>
> > line 1 while (<WEBINP>){
> > line 2
> > line 3 while (m{(\D)(\d{4})(\D)}g){
> > line 4 $l = find($2,@list);
> > line 5 s/$2/$l/; }
> > line 6
> > line 7 print WEBOUT $_;
> > line 8 }
>
> Why do you set $1? From the code above, $1 will always be set by the
> script to a non-digit value.
Put your reading glasses on Tore. :-) The OP is using a lower case L,
not the digit one.
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 17 Mar 2004 01:21:45 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Having problems with with the s/// substitution
Message-Id: <x7brmwp8t2.fsf@mail.sysarch.com>
>>>>> "BM" == Brian McCauley <nobull@mail.com> writes:
BM> s/(?<=\D)(\d{4})(?=\D)/find("$1",@list)/eg;
BM> s/(?<!\d)(\d{4})(?!\d)/find("$1",@list)/eg;
BM> (Note: passing $digit as an argument is a situation where the normal
BM> useless use of quotes rule does _not_ apply).
on the contrary!
the code in the replacement with a single /e is compile time just like
eval BLOCK. it is not a string and it has normal perl syntax. look at
this script:
#!/usr/local/bin/perl
while( <DATA> ) {
s/(.*)/foo( $1 )/e ;
print ;
}
sub foo {
return uc shift ;
}
__DATA__
foo bar
more spaces
perl ~/perl/test/sexec.pl
FOO BAR
MORE SPACES
as you can see, the spaces were passed in fine in $1 and no quotes were
needed.
maybe you were thinking about /ee where the replacement must be a
expression (usually a string) to be evaled and which the result will
then also be eval'ed. the best thing there is to use qq or q to wrap the
inner stuff if it has to have quotes.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 17 Mar 2004 09:06:50 GMT
From: "Jim roos" <Jimroos@uunet.be>
Subject: how to execute two commands?
Message-Id: <KyU5c.37996$Kq.2163807@phobos.telenet-ops.be>
Hi there,
I have this script but how can i append : date > /usr/local/$example
Now it will only execute `cp /usr/share/icons/green.gif /var/www/$which`
Should i add: my $example; and `date > /usr/local/$example` to my
script?
Here's my working and original script:
#!/usr/bin/perl
use MIME::Parser;
use strict;
my $parser = new MIME::Parser;
$parser->output_under("/tmp");
my $entity = $parser->parse(\*STDIN) or die "parse failed\n";
my $head = $entity->head;
my $which;
for ($head->get('from')) {
if(/info\@domain.com/i) { $which='info-status.gif' }
elsif(/sales\@domain.com/i) { $which='sales-status.gif' }
elsif(/me\@domain.com/i) { $which='me-status.gif' }
`cp /usr/share/icons/green.gif /var/www/$which`
}
THX!
------------------------------
Date: 17 Mar 2004 09:43:13 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to execute two commands?
Message-Id: <c396jh$847$1@mamenchi.zrz.TU-Berlin.DE>
Jim roos <Jimroos@uunet.be> wrote in comp.lang.perl.misc:
> Hi there,
>
> I have this script but how can i append : date > /usr/local/$example
> Now it will only execute `cp /usr/share/icons/green.gif /var/www/$which`
You shouldn't use backticks when you don't need the program output.
Use "system" instead. See "perldoc -q 'using backticks'" for an
explanation.
> Should i add: my $example; and `date > /usr/local/$example` to my
> script?
You would also have to give "$example" a value. The command should
be run by "system" like the other. But see below.
> Here's my working and original script:
>
>
> #!/usr/bin/perl
> use MIME::Parser;
> use strict;
> my $parser = new MIME::Parser;
> $parser->output_under("/tmp");
> my $entity = $parser->parse(\*STDIN) or die "parse failed\n";
> my $head = $entity->head;
> my $which;
>
> for ($head->get('from')) {
>
> if(/info\@domain.com/i) { $which='info-status.gif' }
> elsif(/sales\@domain.com/i) { $which='sales-status.gif' }
> elsif(/me\@domain.com/i) { $which='me-status.gif' }
>
> `cp /usr/share/icons/green.gif /var/www/$which`
>
> }
You don't need external commands to copy a file, or to write a date
to a file. The File::Copy module does the first, the builtin
localtime() gives you the date.
Anno
------------------------------
Date: Wed, 17 Mar 2004 10:50:07 GMT
From: "Jim roos" <Jimroos@uunet.be>
Subject: Re: how to execute two commands?
Message-Id: <z3W5c.38080$KP2.2344039@phobos.telenet-ops.be>
Hi Anno,
Sorry, but i am very new to perl.
How can i write the date into a specific file? date > file
Every time i execute the cp (or copy) line i like to write the date into a
file.
Thx Anyway!
"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> schreef in bericht
news:c396jh$847$1@mamenchi.zrz.TU-Berlin.DE...
> Jim roos <Jimroos@uunet.be> wrote in comp.lang.perl.misc:
> > Hi there,
> >
> > I have this script but how can i append : date > /usr/local/$example
> > Now it will only execute `cp /usr/share/icons/green.gif /var/www/$which`
>
> You shouldn't use backticks when you don't need the program output.
> Use "system" instead. See "perldoc -q 'using backticks'" for an
> explanation.
>
> > Should i add: my $example; and `date > /usr/local/$example` to my
> > script?
>
> You would also have to give "$example" a value. The command should
> be run by "system" like the other. But see below.
>
> > Here's my working and original script:
> >
> >
> > #!/usr/bin/perl
> > use MIME::Parser;
> > use strict;
> > my $parser = new MIME::Parser;
> > $parser->output_under("/tmp");
> > my $entity = $parser->parse(\*STDIN) or die "parse failed\n";
> > my $head = $entity->head;
> > my $which;
> >
> > for ($head->get('from')) {
> >
> > if(/info\@domain.com/i) { $which='info-status.gif' }
> > elsif(/sales\@domain.com/i) { $which='sales-status.gif' }
> > elsif(/me\@domain.com/i) { $which='me-status.gif' }
> >
> > `cp /usr/share/icons/green.gif /var/www/$which`
> >
> > }
>
> You don't need external commands to copy a file, or to write a date
> to a file. The File::Copy module does the first, the builtin
> localtime() gives you the date.
>
> Anno
------------------------------
Date: 17 Mar 2004 10:59:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to execute two commands?
Message-Id: <c39b3a$9vt$2@mamenchi.zrz.TU-Berlin.DE>
Jim roos <Jimroos@uunet.be> wrote in comp.lang.perl.misc:
> Hi Anno,
>
> Sorry, but i am very new to perl.
Not only to Perl, but also to Usenet, it seems. Please place your reply
in context, don't insert it at the beginning.
> How can i write the date into a specific file? date > file
> Every time i execute the cp (or copy) line i like to write the date into a
> file.
Use localtime() to get the date. Use open() to access the file.
Use print() to write the date to the file. These functions are
documented in perlfunc. To see the documentation for localtime,
for instance, type "perldoc -f localtime".
When you have specific questions, write again and show what you have
tried.
[TOFU snipped]
Anno
------------------------------
Date: 17 Mar 2004 10:12:42 GMT
From: Heinrich.Mislik@univie.ac.at (Heinrich Mislik)
Subject: Re: How to use select to wait for input
Message-Id: <40582499$0$16036$3b214f66@usenet.univie.ac.at>
In article <c33vt3$pil$2@mamenchi.zrz.TU-Berlin.DE>, anno4000@lublin.zrz.tu-berlin.de says...
>Joe <jbstick@aol.com> wrote in comp.lang.perl.misc:
>> I am trying to wait until some commands are appended to a text file.
>> I tried using select as in the script below, but find that select always
>> returns immediately, even if the file is empty or at end of file.
>> What am I missing??
[code skipped]
>Select is used for streams like sockets, terminals and the like. For
>a disk file, read to the end, sleep some time, reset EOF with
>seek( $fh, 0, 1) and repeat. See recipe 8.5 in the _Perl Cookbook_.
Or even better: use File::Tail.
--
Heinrich Mislik
Zentraler Informatikdienst der Universitaet Wien
A-1010 Wien, Universitaetsstrasse 7
Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140
------------------------------
Date: Wed, 17 Mar 2004 00:30:58 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: incrementing a string by a certain value
Message-Id: <6%M5c.6519$GQ3.651@newsread3.news.atl.earthlink.net>
"C3" <gned@telsmonopolytradotcom.remove.monopoly)> wrote in message
news:4056c215$0$8356$afc38c87@news.optusnet.com.au...
> Hi everyone,
>
> How do I shift a string n letters up/down the alphabet?
>
TIMTOWDI.
One way is to use the translation operator, tr/// (see The Camel Book)
> e.g. if n = -1
> "hello" becomes "gdkkn"
$_ = "hello";
#$_="IBM"; #another string to try for this one
tr/a-zA-Z/za-yZA-Y/;
print;
> or if n = 2, "jgnnq"
>
$_ = "hello";
tr/a-zA-Z/c-za-bC-ZA-B/;
print;
> Ideally, I would like a wrap-around of the letters, so for n=3 and the
> string "you", the output should be "brx".
$_ = "you";
tr/a-zA-Z/d-za-cD-ZA-C/;
print;
Now, you may wish to automate the above. I found several ways to do it, one
with a circular list using push and shift, another using splice, and
finally, one using substr. In each case, the use of tr/// was the same,
i.e.,
$_ = $word;
eval "tr/a-zA-Z/$lc$uc/";
print;
Note: In the above, $lc and $uc are simply lower-case and upper-case
alphabets (strings), respectively, rotated by the amount of the increment by
which the alphabets are shifted.
My script duplicates all of your results, as well as giving the following
well-known result:
perl rot_arb_v4.pl word=IBM incr=-1
HAL
Cheers.
--
Bill Segraves
------------------------------
Date: Wed, 17 Mar 2004 02:59:46 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: incrementing a string by a certain value
Message-Id: <Xns94AEDFC088C51dkwwashere@216.168.3.30>
Josef Möllers <josef.moellers@fujitsu-siemens.com> wrote:
> C3 wrote:
>> Hi everyone,
>>
>> How do I shift a string n letters up/down the alphabet?
>>
>> e.g. if n = -1
>> "hello" becomes "gdkkn"
>> or if n = 2, "jgnnq"
>>
>> Ideally, I would like a wrap-around of the letters, so for n=3 and the
>> string "you", the output should be "brx".
>
> Standard answer: what have you tried so far, where did you fail, when is
> the homework due?
>
> I'd probably use a hash and some form of the map operator.
Yeah, me too. The following seems a bit clunky, but I wanted to preserve
case. Much easier if it's all one case: then it's just straight
application of mod 26 addition.
use strict;
use warnings;
my $offset = 13;
my %convert;
@convert{'a'..'z',0..25} = (0..25,'a'..'z');
while (<DATA>) {
print join '',
map {
my $is_upper = /[A-Z]/;
$_ = lc $_;
$_ = $convert{ ($convert{$_} + $offset) % 26 } if /[a-z]/;
$is_upper ? uc $_ : $_;
}
split //, $_;
}
__DATA__
Hello.
Keep your powder dry.
Sheesh.
------------------------------
Date: Wed, 17 Mar 2004 00:13:11 GMT
From: mumke@xs4all.nl (christinA eijkhout)
Subject: paniconographic have you ever tried this?
Message-Id: <d67sd2rwhmrct6bktq38du70d2f4hmfctu@4ax.com>
paniconographic have you ever tried this?
This month, on the meeting of Sunday 28 March the Werfkelder organises
a workshop BDSM for beginners. Most likely it will take place before
the normal starting time. If desired the acquired skills can be brought
in practice during the ordinary meeting. On the programme in any case
"bondage" and "whips" stand. A vast notice follows in the regular
invitation for the meeting itself,but we request interested people to
send an email in advance. send mail to: mumke@xs4all.nl
and of course the date to note:-)
Dorobo boose scorbutus
------------------------------
Date: Wed, 17 Mar 2004 02:10:27 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: paniconographic have you ever tried this?
Message-Id: <x7ad2gi5pr.fsf@mail.sysarch.com>
>>>>> "ce" == christinA eijkhout <mumke@xs4all.nl> writes:
ce> a workshop BDSM for beginners. Most likely it will take place before
excuse me, perl is not a B&D language. you will find java and python
over there -->
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 16 Mar 2004 20:49:15 -0800
From: dwj314@yahoo.com (D. Jackson)
Subject: PAR, perlglob, and Windows (2000)
Message-Id: <678927d2.0403162049.51e7ea8d@posting.google.com>
I have the following snippet of code that I would like to use to
generate a list of image files in the current directory. If I run
this under ActiveState's perl (v5.8.0 built for
MSWin32-x86-multi-thread) it runs perfectly. However, if I convert it
to an EXE using "pp -o gtest.exe gtest.pl" I get no output. It does
not work if perlglob.exe is in the same directory either.
Any insight would be greatly appreciated!
-dennis.
ex.pl:
#!/usr/bin/perl -w
use strict;
my $jpgTypeStr = "*.[jJ][pP][gG] *.[jJ][pP][eE][gG]";
my $gifTypeStr = "*.[gG][iI][fF]";
my $pngTypeStr = "*.[pP][nN][gG]";
my $fileTypeStr = "$jpgTypeStr $gifTypeStr $pngTypeStr";
my @files = glob( $fileTypeStr );
foreach my $f ( @files )
{
print $f . "\n";
}
------------------------------
Date: Wed, 17 Mar 2004 05:32:41 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: PAR, perlglob, and Windows (2000)
Message-Id: <4057E2EA.31AB1DF4@acm.org>
"D. Jackson" wrote:
>
> I have the following snippet of code that I would like to use to
> generate a list of image files in the current directory. If I run
> this under ActiveState's perl (v5.8.0 built for
> MSWin32-x86-multi-thread) it runs perfectly. However, if I convert it
> to an EXE using "pp -o gtest.exe gtest.pl" I get no output. It does
> not work if perlglob.exe is in the same directory either.
>
> Any insight would be greatly appreciated!
>
> ex.pl:
>
> #!/usr/bin/perl -w
> use strict;
>
> my $jpgTypeStr = "*.[jJ][pP][gG] *.[jJ][pP][eE][gG]";
> my $gifTypeStr = "*.[gG][iI][fF]";
> my $pngTypeStr = "*.[pP][nN][gG]";
>
> my $fileTypeStr = "$jpgTypeStr $gifTypeStr $pngTypeStr";
>
> my @files = glob( $fileTypeStr );
>
> foreach my $f ( @files )
> {
> print $f . "\n";
> }
Try it with opendir/readdir/closedir instead:
opendir DIR, '.' or die "Cannot open the current directory: $!";
my @files = grep /\.(?:jpe?g|gif|png)$/i, readdir DIR;
closedir DIR;
foreach my $f ( @files )
{
print $f . "\n";
}
John
--
use Perl;
program
fulfillment
------------------------------
Date: Tue, 16 Mar 2004 21:57:37 -0800
From: Alan Stewart <astewart1@cox.net>
Subject: Re: PAR, perlglob, and Windows (2000)
Message-Id: <tqpf50dvledboo1rlor8shcv1eqgmmma3a@4ax.com>
On 16 Mar 2004 20:49:15 -0800, dwj314@yahoo.com (D. Jackson) wrote:
>I have the following snippet of code that I would like to use to
>generate a list of image files in the current directory. If I run
>this under ActiveState's perl (v5.8.0 built for
>MSWin32-x86-multi-thread) it runs perfectly. However, if I convert it
>to an EXE using "pp -o gtest.exe gtest.pl" I get no output. It does
>not work if perlglob.exe is in the same directory either.
>
>Any insight would be greatly appreciated!
>
>-dennis.
>
>ex.pl:
>
>#!/usr/bin/perl -w
>
>use strict;
>
>my $jpgTypeStr = "*.[jJ][pP][gG] *.[jJ][pP][eE][gG]";
>my $gifTypeStr = "*.[gG][iI][fF]";
>my $pngTypeStr = "*.[pP][nN][gG]";
>
>my $fileTypeStr = "$jpgTypeStr $gifTypeStr $pngTypeStr";
>
>my @files = glob( $fileTypeStr );
>
>foreach my $f ( @files )
>{
> print $f . "\n";
>}
use File::Glob qw(:globally :nocase);
although you don't need the :nocase or all those bracketted pairs if
you are only running on Win32. The OS is case blind.
Alan Stewart
------------------------------
Date: Wed, 17 Mar 2004 00:51:55 +0000 (UTC)
From: Eli the Bearded <*@eli.users.panix.com>
Subject: Re: recognizing hidden INPUT TYPE within HTML
Message-Id: <eli$0403161951@qz.little-neck.ny.us>
In comp.lang.perl.misc, Martin L. <mjpliv@eastlink.ca> wrote:
> If I open FILEHANDLE and read in an HTML file, short of a complex
> search pattern, how do I extract the <INPUT TYPE = "hidden"> data into
> the script? When the HTML files were created there were several of
> these tags embedded in to code for future use.
Example code for extracting all form elements:
http://www.cpan.org/authors/id/E/EL/ELIJAH/extract-form
Elijah
------
hope you don't consider hidden form elements secure or anything like that
------------------------------
Date: Tue, 16 Mar 2004 17:45:20 -0600
From: ItNerd <no@no.no>
Subject: Re: SOAP::Lite help with nested XML please
Message-Id: <105f4clgd7pui7a@news.supernews.com>
Ah, yes. Thank you. Your suggestion worked beautifully.
Cheers!
J. Gleixner wrote:
> ItNerd wrote:
>
>> use SOAP::Lite +autodispatch =>
>> uri => 'http://www.allconsuming.net/AllConsumingAPI',
>> proxy => 'http://www.allconsuming.net/soap.cgi';
>>
>> my $AllConsumingObject = AllConsumingAPI->new ();
>
>
> The best way to go about this is to use Data::Dumper and display the
> data structure, then you can access the data structure.
>
------------------------------
Date: 16 Mar 2004 13:53:19 -0800
From: sbix650@hotmail.com (Manzoor Ilahi)
Subject: Re: system(...) does not produce output using 5.8.*
Message-Id: <68b0f42a.0403161353.17c7c84@posting.google.com>
Roel van der Steen <roel-perl@st2x.net> wrote in message
.....
> > I run this on an NT machine using Cygwin. Using Perl 5.6.1, I get the
> > "$command"'s output on the screen. But with Perl 5.8.* I do not see
> > any output.
>
> Are you sure $command still gets executed?
Yes, the $command is getting executed. I can see it running in the
Task Manager and in the files that get created.
sb
------------------------------
Date: 17 Mar 2004 00:28:40 GMT
From: Roel van der Steen <roel-perl@st2x.net>
Subject: Re: system(...) does not produce output using 5.8.*
Message-Id: <slrnc5f6uf.t9q.roel-perl@localhost.localdomain>
On Tue, 16 Mar 2004 at 21:53 GMT, Manzoor Ilahi <sbix650@hotmail.com> wrote:
> Roel van der Steen <roel-perl@st2x.net> wrote in message
>
> .....
>
>> > I run this on an NT machine using Cygwin. Using Perl 5.6.1, I get the
>> > "$command"'s output on the screen. But with Perl 5.8.* I do not see
>> > any output.
>>
>> Are you sure $command still gets executed?
>
> Yes, the $command is getting executed.
Strange. My little test (see below) runs as expected. But I don't use Cygwin.
Why don't you try to catch the output using a pipe, or even backticks?
--
Little sample:
#!/usr/bin/perl
use strict;
use warnings;
sub foo {
return (system("dir try.pl") == 0);
}
sub bar {
return (system("fails") == 0);
}
print '==>', foo, "\n"; # prints ==>1
print '==>', bar, "\n"; # prints ==>
__END__
------------------------------
Date: Tue, 16 Mar 2004 17:38:12 -0500
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: system(...) does not produce output using 5.8.*
Message-Id: <20040316173228.C21521@dishwasher.cs.rpi.edu>
On Mon, 15 Mar 2004, Manzoor Ilahi wrote:
> Hi
>
> I have a program that contains the following code
>
> log_message("executing system($command)");
> return (system("$command") == 0);
>
> I run this on an NT machine using Cygwin. Using Perl 5.6.1, I get the
> "$command"'s output on the screen. But with Perl 5.8.* I do not see
> any output.
>
Why are you using system() for output? You have no control over what
happens to the output with a simple system() call. Try using backticks
instead...
log_message ("Executing $command");
my $output = `$command`;
print $output;
return $? >> 8;
($? contains the exit status of the last backtick, system, or closed pipe,
along with the signal, which is why we shift it 8 bits).
This way you can do whatever you like with the output, as I've just
printed it to STDOUT here.
Paul Lalli
------------------------------
Date: Tue, 16 Mar 2004 14:47:35 -0800
From: Mahesha <mahesha@mahesha.net>
Subject: Re: using backquote or system with perl -ne in perl 5.8
Message-Id: <105f108t10m5712@corp.supernews.com>
Jean-Marie Clément wrote:
> Hi,
>
> we face following problem using activestate perl 5.8 (build 806) under
> XP. Constructs of the form:
>
> cleartool find [...] | perl -ne "print `clearvtree $_`;"
% cleartool find . -type f -print | /depot/perl-5.8.0/bin/perl -pe
'print `cleartool lsvtree $_`'
worked for me (with single-quotes). Besides isn't it similar to what can
be done in clearecase natively?
% cleartool find . -type f -exec 'cleartool lsvtree $CLEARCASE_PN'
--
M
------------------------------
Date: Wed, 17 Mar 2004 11:35:17 +0100
From: =?ISO-8859-1?Q?Jean-Marie_Cl=E9ment?= <NOSPAM.Jmc.NOSPAM@NOSPAM.web.de>
Subject: Re: using backquote or system with perl -ne in perl 5.8
Message-Id: <c399l5$mkj$1@news.mch.sbs.de>
Mahesha wrote:
> Jean-Marie Clément wrote:
>
>> Hi,
>>
>> we face following problem using activestate perl 5.8 (build 806) under
>> XP. Constructs of the form:
>>
>> cleartool find [...] | perl -ne "print `clearvtree $_`;"
>
>
> % cleartool find . -type f -exec 'cleartool lsvtree $CLEARCASE_PN'
>
> --
> M
In this case yes, I simplified the construct. I typically use it with
e.g. lsco, which does not have the exec arg.
However, here the status: this is a bug from (at least) ActiveState perl
5.8 806; it has been solved in newer versions; it now works for me with
5.8 809
( http://bugs.activestate.com/show_bug.cgi?id=23683 )
It can be reproduced in following way:
dir | perl.exe -ne "chomp;print `echo \"$_\"`;"
only returns part of the dir entries.
Seems that not so much people are using this construct, as there are
very few reports around, and even fewer answers...
JM.
PS: to reply, remove first and last NOSPAM. from email.
------------------------------
Date: Tue, 16 Mar 2004 22:16:12 GMT
From: MPBroida <mbroida@fake.domain>
Subject: Re: What is that tab char?
Message-Id: <40577CAC.A8517F9F@fake.domain>
Jill wrote:
>
> When I create a tab delimited file form perl it is fine and I use the /t
> char to designate a tab.
> the code in the web page works fine and I can import into my excel
> spreadsheet.
>
> I am trying to do the same with html code.
> how can I create the same ascii char or control char by using just html.
You could try 	 which is the ASCII "horizontal tab"
character. But the browser renderer may not do the "right
thing" with that character, and it might not be "copy-and-
paste"-able as a true tab character.
Mike
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 6268
***************************************