[30742] in Perl-Users-Digest
Perl-Users Digest, Issue: 1987 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 17 03:09:43 2008
Date: Mon, 17 Nov 2008 00:09:10 -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 Mon, 17 Nov 2008 Volume: 11 Number: 1987
Today's topics:
Re: atoi/atof <nospam-abuse@ilyaz.org>
File operation and Concatenation <gokul.bits@gmail.com>
Re: File operation and Concatenation <jurgenex@hotmail.com>
Re: File operation and Concatenation <sbryce@scottbryce.com>
Re: Huge files manipulation <tadmc@seesig.invalid>
new CPAN modules on Mon Nov 17 2008 (Randal Schwartz)
Subroutine on Mutation of Codons carriehecker@gmail.com
Re: Subroutine on Mutation of Codons <jurgenex@hotmail.com>
Re: Subroutine on Mutation of Codons <someone@example.com>
Re: Subroutine on Mutation of Codons xhoster@gmail.com
Re: Subroutine on Mutation of Codons sln@netherlands.com
why cmd can not catch @ARGV? <abbypan@gmail.com>
Re: why cmd can not catch @ARGV? <jurgenex@hotmail.com>
Re: why cmd can not catch @ARGV? <abbypan@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 16 Nov 2008 22:06:11 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: atoi/atof
Message-Id: <gfq5gj$2mms$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
<sln@netherlands.com>], who wrote in article <ci21i4p5et9priv2p0o2ed7un17a38rp0c@4ax.com>:
> On Sat, 15 Nov 2008 19:37:00 +0100, "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote:
> >I'm almost sure the OP's code is even buggier, though. String/number
> >conversions aren't trivial.
> ">>>strings to integers/floats is iffy on perl (compared to C). "
> Aren't trivial?
Yes.
> So ANSI C++ hasn't got it right yet?
What has C++ got to do with it? (And which particular runtime library
would you mean anyway? AFAIK, ANSI does not produce any compiler...)
> Perl had to bypass.
For some unfathomable reasons, Perl (starting from about 5.8.1?)
bypasses CRTL routines...
> Its the other way around, number to string isin't trivial.
??? Do not know what makes you think so. One is decimal-to-binary,
another is binary-to-decimal; both require higher precision (IIRC, 3
extra binary digits) than what the target conversion format can hold...
Yours,
Ilya
------------------------------
Date: Sun, 16 Nov 2008 21:46:48 -0800 (PST)
From: Gokul <gokul.bits@gmail.com>
Subject: File operation and Concatenation
Message-Id: <d00f8bca-81e9-402c-b731-976e9c0ba409@a3g2000prm.googlegroups.com>
Hi all,
I need to perform a concatenation with the contents of a file(s) after
opening the file(s).
I am pretty new to PERL and learning its potentials.
The operation I need to perform is outlines as follows:
File A has the following contents:[abc,def, ghi .... etc are strings
listed one by one in the file]
abc
def
ghi
jkl
mno
File B has the following contents:[Test_1,Test_2 .... etc are strings
listed one by one in the file]
Test_1
Test_2
Test_3
Test_4
Test_5
I want PERL to concatenate and generate strings for me as follows:[We
can create a new file, write strings to it and save it]
Test_1 abc def ghi jkl mno
Test_2 abc def ghi jkl mno
Test_3 abc def ghi jkl mno
Test_4 abc def ghi jkl mno
Test_5 abc def ghi jkl mno
Please help me through this.
Thanks
------------------------------
Date: Sun, 16 Nov 2008 22:37:35 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: File operation and Concatenation
Message-Id: <pj32i4l2mtav1rh905au7d8hangpbqq0b6@4ax.com>
Gokul <gokul.bits@gmail.com> wrote:
>I need to perform a concatenation with the contents of a file(s) after
>opening the file(s).
>I am pretty new to PERL and learning its potentials.
>
>The operation I need to perform is outlines as follows:
>
>File A has the following contents:[abc,def, ghi .... etc are strings
>listed one by one in the file]
>
>abc
>def
>ghi
>jkl
>mno
>
>File B has the following contents:[Test_1,Test_2 .... etc are strings
>listed one by one in the file]
>
>Test_1
>Test_2
>Test_3
>Test_4
>Test_5
>
>I want PERL to concatenate and generate strings for me as follows:[We
>can create a new file, write strings to it and save it]
>
>Test_1 abc def ghi jkl mno
>Test_2 abc def ghi jkl mno
>Test_3 abc def ghi jkl mno
>Test_4 abc def ghi jkl mno
>Test_5 abc def ghi jkl mno
>
>
>Please help me through this.
open(*) file A, slurp in the whole file into a string(**) and
replace(***) the newlines with a space.
Then simply open(*) file B, loop (****) through it line by line
(*****)and after chomp'ing (******)each line write (*******) it, the
combined line from A, and a new newline into your target file.
*: perldoc -f open
**: perldoc -q "read in an entire file"
***: perldoc -f s
****: perldoc perlsyn (and look for while())
*****: perldoc perlop, section I/O operators, <>
******: perldoc -f chomp
*******: perldoc -f print
jue
------------------------------
Date: Sun, 16 Nov 2008 23:47:13 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: File operation and Concatenation
Message-Id: <gfr424$fvl$1@news.motzarella.org>
Gokul wrote:
<problem description snipped>
> Please help me through this.
http://tinyurl.com/6l9mwh
Give it your best shot. Post what doesn't work. Someone here will be
happy to help you fix it. Or did you think we were going to write the
code for you?
------------------------------
Date: Sun, 16 Nov 2008 17:36:41 -0600
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Huge files manipulation
Message-Id: <slrngi1bk9.kms.tadmc@tadmc30.sbcglobal.net>
sln@netherlands.com <sln@netherlands.com> wrote:
> I can do this for you with custom algorithym's.
^^
^^
Your algorithym (sic) possesses something?
> Let me know if your interrested, post a contact email address.
^^^^
^^^^
Put in apostrophe's where they are not needed, leave them out
where theyre needed. Interresting.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 17 Nov 2008 05:42:23 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Nov 17 2008
Message-Id: <KAGqIn.EIu@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Acme-CorpusScrambler-0.04
http://search.cpan.org/~shelling/Acme-CorpusScrambler-0.04/
An Acme way doing Lorem Ipsum.
----
App-CamelPKI-0.06
http://search.cpan.org/~grm/App-CamelPKI-0.06/
A multi-purpose PKI.
----
App-HistHub-0.01
http://search.cpan.org/~typester/App-HistHub-0.01/
Sync shell history between multiple PC.
----
App-VideoMixer-0.02
http://search.cpan.org/~corion/App-VideoMixer-0.02/
a simple video mixer using OpenGL
----
App-ZofCMS-Plugin-HTMLFactory-0.0101
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-HTMLFactory-0.0101/
notes for modules in App::ZofCMS::Plugin::HTMLFactory:: namespace
----
App-ZofCMS-Plugin-HTMLFactory-Entry-0.0101
http://search.cpan.org/~zoffix/App-ZofCMS-Plugin-HTMLFactory-Entry-0.0101/
plugin to wrap content in three divs used for styling boxes
----
App-ZofCMS-PluginReference-0.0104
http://search.cpan.org/~zoffix/App-ZofCMS-PluginReference-0.0104/
docs for all plugins in one document for easy reference
----
Bot-BasicBot-Pluggable-WithConfig-0.03
http://search.cpan.org/~kitano/Bot-BasicBot-Pluggable-WithConfig-0.03/
initialize bot instance with YAML config
----
CGI-Lazy-1.02
http://search.cpan.org/~vayde/CGI-Lazy-1.02/
----
CLI-Dispatch-0.01
http://search.cpan.org/~ishigaki/CLI-Dispatch-0.01/
simple CLI dispatcher
----
Config-Settings-0.00_01
http://search.cpan.org/~berle/Config-Settings-0.00_01/
----
Config-Settings-0.00_02
http://search.cpan.org/~berle/Config-Settings-0.00_02/
Parsing pleasant configuration files
----
DVD-Read-0.02
http://search.cpan.org/~nanardon/DVD-Read-0.02/
libdvdread perl binding
----
DVD-Read-0.03
http://search.cpan.org/~nanardon/DVD-Read-0.03/
libdvdread perl binding
----
Data-Util-0.20
http://search.cpan.org/~gfuji/Data-Util-0.20/
A selection of utilities for data and data types
----
EV-Stream-1.0.0
http://search.cpan.org/~powerman/EV-Stream-1.0.0/
ease non-blocking I/O streams based on EV
----
EV-Stream-Crypt-RC4-1.0.0
http://search.cpan.org/~powerman/EV-Stream-Crypt-RC4-1.0.0/
Crypt::RC4 plugin for EV::Stream
----
EV-Stream-MatrixSSL-1.0.0
http://search.cpan.org/~powerman/EV-Stream-MatrixSSL-1.0.0/
Crypt::MatrixSSL plugin for EV::Stream
----
EV-Stream-Proxy-HTTPS-1.0.0
http://search.cpan.org/~powerman/EV-Stream-Proxy-HTTPS-1.0.0/
HTTPS proxy plugin for EV::Stream
----
HTML-Parser-3.57
http://search.cpan.org/~gaas/HTML-Parser-3.57/
HTML parser class
----
HTML-WikiConverter-MoinMoin-0.54
http://search.cpan.org/~diberri/HTML-WikiConverter-MoinMoin-0.54/
Convert HTML to MoinMoin markup
----
Language-Befunge-4.08
http://search.cpan.org/~jquelin/Language-Befunge-4.08/
a generic funge interpreter
----
Log-Handler-0.49
http://search.cpan.org/~bloonix/Log-Handler-0.49/
Log messages to several outputs.
----
NetHack-Item-0.03
http://search.cpan.org/~sartak/NetHack-Item-0.03/
parse and interact with a NetHack item
----
NetHack-ItemPool-0.01
http://search.cpan.org/~sartak/NetHack-ItemPool-0.01/
represents a universe of NetHack items
----
Parse-Gnaw-0.20
http://search.cpan.org/~gslondon/Parse-Gnaw-0.20/
Define a grammar and create a parser by calling nothing but perl subroutines.
----
Parse-MediaWikiDump-0.54
http://search.cpan.org/~triddle/Parse-MediaWikiDump-0.54/
Tools to process MediaWiki dump files
----
Perlwikipedia-1.3.8
http://search.cpan.org/~dcollins/Perlwikipedia-1.3.8/
a Wikipedia bot framework written in Perl
----
Rubyish-Attribute-0.04
http://search.cpan.org/~shelling/Rubyish-Attribute-0.04/
provide ruby-like accessor builder: attr_accessor, attr_writer and attr_reader.
----
TVDB-API-0.32
http://search.cpan.org/~behanw/TVDB-API-0.32/
API to www.thetvdb.com
----
Task-App-ZofCMS-0.0106
http://search.cpan.org/~zoffix/Task-App-ZofCMS-0.0106/
bundle of ZofCMS core and all of its plugins
----
Test-Timer-0.05
http://search.cpan.org/~jonasbn/Test-Timer-0.05/
a test module to test/assert response times
----
Text-Markdown-1.0.24
http://search.cpan.org/~bobtfish/Text-Markdown-1.0.24/
Convert Markdown syntax to (X)HTML
----
Video-Filename-0.32
http://search.cpan.org/~behanw/Video-Filename-0.32/
Parse filenames for information about the video
----
WWW-HatenaStar-0.01
http://search.cpan.org/~woremacx/WWW-HatenaStar-0.01/
perl interface to Hatena::Star
----
WWW-HatenaStar-0.02
http://search.cpan.org/~woremacx/WWW-HatenaStar-0.02/
perl interface to Hatena::Star
----
WWW-Netflix-API-0.06
http://search.cpan.org/~davidrw/WWW-Netflix-API-0.06/
Interface for Netflix's API
----
WWW-Search-PharmGKB
http://search.cpan.org/~arun/WWW-Search-PharmGKB/
Search and retrieve information from the PharmGKB database
----
WWW-Wikipedia-TemplateFiller-0.05
http://search.cpan.org/~diberri/WWW-Wikipedia-TemplateFiller-0.05/
Fill Wikipedia templates with your eyes closed
----
Waft-JS-0.01
http://search.cpan.org/~tamashiro/Waft-JS-0.01/
JavaScript extensions for Waft
----
Waft-StashAccessor-0.01
http://search.cpan.org/~tamashiro/Waft-StashAccessor-0.01/
Make accessor for Waft::stash
----
Waft-jQuery-0.01
http://search.cpan.org/~tamashiro/Waft-jQuery-0.01/
jQuery extensions for Waft
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Sun, 16 Nov 2008 13:43:32 -0800 (PST)
From: carriehecker@gmail.com
Subject: Subroutine on Mutation of Codons
Message-Id: <17abac59-95d8-4ed1-b752-6ae5245c2174@b38g2000prf.googlegroups.com>
I am trying to write a subroutine for the mutation of only the third
nucleotide in a series of three. I don't really know perl all that
well, so I was hoping someone would be able to tell me where I am
going wrong, and why I am getting a lot of errors when I edit my code.
Here is my subroutine:
sub strategy2
{
# split on the empty pattern; returns individual letters
my @nucleotides = split ( //, $origDNASeq );
my $nuc = (@nucleotides);
my $nucFile = "hsp70_nuc.fasta.txt";
open ($origDNASeq, '<', $nucFile);
# build new sequence
my $newDNASeq = "";
while ($origDNASeq = <$nucFile>)
{
if ($origDNASeq =~ m/^((.)(.)(.).*)/)
{
if (rand(1) < $mutationRate)
{
# randomly mutate $nuc to a new nucleotide (A, C, G, T)
$newDNASeq = $newDNASeq . $1 . $2 . randNuc($nuc);
}
else
{
# append original nucleotide to new sequence
$newDNASeq = $newDNASeq . $1 . $2 . $3;
}
}
else
{
}
}
#print "$newDNASeq";
# translate new DNreadInDNA( $aaFile )A sequence to protein sequence
my $newProtSeq = translate( $newDNASeq );
# calculate the percent identity
my $identity = calcIdentity( $newProtSeq, $origProtSeq );
return $identity;
}
Could anyone provide some helpful hints on how to get this thing
working correctly? I'd be happy to answer any more questions if I
didn't make anything clear enough. Thanks so much for your time!
Carrie H.
------------------------------
Date: Sun, 16 Nov 2008 14:12:46 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Subroutine on Mutation of Codons
Message-Id: <ka61i4hgh51207m12p8utffg0c9v7otuaj@4ax.com>
carriehecker@gmail.com wrote:
>I am trying to write a subroutine for the mutation of only the third
>nucleotide in a series of three. I don't really know perl all that
>well, so I was hoping someone would be able to tell me where I am
>going wrong, and why I am getting a lot of errors when I edit my code.
[code snipped]
After declaring $origDNASeq, $mutationRate, and $origProtSeq your code
snippet compiles just fine and even runs without any error message. It
doesn't produce any output, but I guess that is to be expected
considering that I didn't have any input data.
>Could anyone provide some helpful hints on how to get this thing
>working correctly? I'd be happy to answer any more questions if I
>didn't make anything clear enough. Thanks so much for your time!
For further investigation you will have to provide more information like
e.g. the exact error messages (Copy&paste!!! Don't paraphrase or
retype!!!) or preferably a minimal self-contained program that we can
run.
jue
------------------------------
Date: Sun, 16 Nov 2008 14:17:29 -0800
From: "John W. Krahn" <someone@example.com>
Subject: Re: Subroutine on Mutation of Codons
Message-Id: <XZ0Uk.16567$WR6.15762@newsfe03.iad>
carriehecker@gmail.com wrote:
> I am trying to write a subroutine for the mutation of only the third
> nucleotide in a series of three. I don't really know perl all that
> well, so I was hoping someone would be able to tell me where I am
> going wrong, and why I am getting a lot of errors when I edit my code.
> Here is my subroutine:
>
> sub strategy2
> {
> # split on the empty pattern; returns individual letters
> my @nucleotides = split ( //, $origDNASeq );
> my $nuc = (@nucleotides);
You don't need to split. Change that to:
my $nuc = length $origDNASeq;
> my $nucFile = "hsp70_nuc.fasta.txt";
> open ($origDNASeq, '<', $nucFile);
You should *always* verify that the file opened correctly. You are
using the file name for the filehandle in the while loop but here you
are assigning the filehandle to $origDNASeq.
> # build new sequence
> my $newDNASeq = "";
>
> while ($origDNASeq = <$nucFile>)
open DNASEQ, '<', 'hsp70_nuc.fasta.txt' or die
"hsp70_nuc.fasta.txt: $!";
# build new sequence
my $newDNASeq = '';
while ( $origDNASeq = <DNASEQ> )
> {
> if ($origDNASeq =~ m/^((.)(.)(.).*)/)
You are capturing four strings from $origDNASeq but you only use three
of them so that can be simplified to:
if ($origDNASeq =~ m/^((.)(.).+)/)
> {
> if (rand(1) < $mutationRate)
> {
> # randomly mutate $nuc to a new nucleotide (A, C, G, T)
> $newDNASeq = $newDNASeq . $1 . $2 . randNuc($nuc);
> }
> else
> {
> # append original nucleotide to new sequence
> $newDNASeq = $newDNASeq . $1 . $2 . $3;
> }
> }
> else
> {
> }
> }
> #print "$newDNASeq";
> # translate new DNreadInDNA( $aaFile )A sequence to protein sequence
> my $newProtSeq = translate( $newDNASeq );
>
> # calculate the percent identity
> my $identity = calcIdentity( $newProtSeq, $origProtSeq );
>
> return $identity;
> }
>
>
> Could anyone provide some helpful hints on how to get this thing
> working correctly? I'd be happy to answer any more questions if I
> didn't make anything clear enough. Thanks so much for your time!
John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: 16 Nov 2008 22:35:08 GMT
From: xhoster@gmail.com
Subject: Re: Subroutine on Mutation of Codons
Message-Id: <20081116173546.942$Ea@newsreader.com>
carriehecker@gmail.com wrote:
> I am trying to write a subroutine for the mutation of only the third
> nucleotide in a series of three. I don't really know perl all that
> well, so I was hoping someone would be able to tell me where I am
> going wrong, and why I am getting a lot of errors when I edit my code.
There is a nearly infinite number of ways one could edit code that would
introduce errors. If you don't show us the errors, and don't show us the
edited code, it makes it rather difficult to help you.
Are you using "use strict" and "use warnings"?
> Here is my subroutine:
>
> sub strategy2
> {
> # split on the empty pattern; returns individual letters
> my @nucleotides = split ( //, $origDNASeq );
Where is $origDNASeq coming from?
> my $nuc = (@nucleotides);
Since @nucleotides doesn't seem to be used anywhere, you could just capture
the number of characters in $origDNASeq directly without creating an
intermediate variable by doing:
my $nuc = length $origDNASeq;
> my $nucFile = "hsp70_nuc.fasta.txt";
> open ($origDNASeq, '<', $nucFile);
opening a file to a "handle" which is a variable that has some arbitrary
data in it is not a good idea. And under "use strict", which is a very
good idea, it will fail. Maybe that is one of the errors you refer to?
You should also check to see if open succeeded.
open (my $seq_handle, "<", $nucFile) or die $!;
>
> # build new sequence
> my $newDNASeq = "";
>
> while ($origDNASeq = <$nucFile>)
$nucFile contains the *name* of the file. It does not have a file handle
in it, which is what you try to read from.
And what is going on with $origDNASeq? First you assume it starts out set
to something, we know not what. Then you try to make it a filehandle,
now you try to make it the line of text read from a file. Don't re-use
variables willy-nilly.
while (my $line = <$seq_handle>)
> {
> if ($origDNASeq =~ m/^((.)(.)(.).*)/)
This will only operate on the first codon of each line of the file. Maybe
that is what you want, but it seems odd to me.
Also, the entire line will be in $1; and the first three individual bases
will be in $2, $3, and $4. Drop the outermost capturing parenthesis. And
once you do there is not point in having the trailing .*
if ($origDNASeq =~ m/^(.)(.)(.)/)
> {
> if (rand(1) < $mutationRate)
> {
> # randomly mutate $nuc to a new nucleotide (A, C, G, T)
> $newDNASeq = $newDNASeq . $1 . $2 . randNuc($nuc);
This will copy all of $newDNASeq each time. If $newDNASeq gets quite
large, this will be slow. It would be faster (but not change the end
result) to tell Perl to append directly to the end of it.
$newDNASeq .= $1 . $2 . randNuc($nuc);
Xho
--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
------------------------------
Date: Sun, 16 Nov 2008 22:55:46 GMT
From: sln@netherlands.com
Subject: Re: Subroutine on Mutation of Codons
Message-Id: <8291i499i22em5stdr8hmrljkqrj742njl@4ax.com>
On Sun, 16 Nov 2008 14:12:46 -0800, Jürgen Exner <jurgenex@hotmail.com> wrote:
>carriehecker@gmail.com wrote:
>>I am trying to write a subroutine for the mutation of only the third
>>nucleotide in a series of three. I don't really know perl all that
>>well,
[snip]
You might wan't to ask your high school Biology teacher. Don't
expect me to be taking any pill produced from a Perl subroutine.
sln
------------------------------
Date: Sun, 16 Nov 2008 18:13:44 -0800 (PST)
From: lsyx <abbypan@gmail.com>
Subject: why cmd can not catch @ARGV?
Message-Id: <6dbe0d68-dd80-4392-98e5-d36162dd8b4d@z28g2000prd.googlegroups.com>
I use Active Perl on Windows and had set the %PATHEXT%=%PATHEXT
%;.PL;
When I use the script a.pl on cmd.exe,
"perl a.pl xxx" can work correctly.
"a xxx" can not catch @ARGV.
I don't know how to config it?
thanks very much.
-----------CMD---------
E:\tmp>perl a.pl xxx
a.pl start
xxx
a.pl end
E:\tmp>a.pl xxx
a.pl start
a.pl end
E:\tmp>a xxx
a.pl start
a.pl end
-----------CMD---------
------------------------------
Date: Sun, 16 Nov 2008 18:34:30 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: why cmd can not catch @ARGV?
Message-Id: <pml1i4petiielm66b3dmqrnldbh2931b9n@4ax.com>
lsyx <abbypan@gmail.com> wrote:
>I use Active Perl on Windows and had set the %PATHEXT%=%PATHEXT
>%;.PL;
>When I use the script a.pl on cmd.exe,
>"perl a.pl xxx" can work correctly.
>"a xxx" can not catch @ARGV.
>I don't know how to config it?
Let me paraphrase to make sure I understand your problem correctly.
When calling a Perl program using
perl a.pl xxx
then the parameter xxx is passed to the program correctly.
However when calling like
a.pl xxx
or like
a xxx
then the parameter xxx is no passed to the program.
The reason is a broken setting for the "Open" action for files of type
PL. The line for "Application used to perfom action" must end with
%*
in order for all the parameters to be passed from cmd to perl.
jue
------------------------------
Date: Sun, 16 Nov 2008 19:27:54 -0800 (PST)
From: lsyx <abbypan@gmail.com>
Subject: Re: why cmd can not catch @ARGV?
Message-Id: <ea5d4ebc-e052-4673-aac9-4ae8065e3ac5@t39g2000prh.googlegroups.com>
thanks a lot.
I fixed it In the Windows Explorer->Tools > Folder Options > File
Types tab > PL file type > advanced ...
On 11=D4=C217=C8=D5, =C9=CF=CE=E710=CA=B134=B7=D6, J=A8=B9rgen Exner <jurge=
...@hotmail.com> wrote:
> lsyx <abby...@gmail.com> wrote:
> >I use Active Perl on Windows and had set the %PATHEXT%=3D%PATHEXT
> >%;.PL;
> >When I use the script a.pl on cmd.exe,
> >"perl a.pl xxx" can work correctly.
> >"a xxx" can not catch @ARGV.
> >I don't know how to config it?
>
> Let me paraphrase to make sure I understand your problem correctly.
>
> When calling a Perl program using
> perl a.pl xxx
> then the parameter xxx is passed to the program correctly.
> However when calling like
> a.pl xxx
> or like
> a xxx
> then the parameter xxx is no passed to the program.
>
> The reason is a broken setting for the "Open" action for files of type
> PL. The line for "Application used to perfom action" must end with
> %*
> in order for all the parameters to be passed from cmd to perl.
>
> jue
------------------------------
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 V11 Issue 1987
***************************************