[28481] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9845 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 13 18:05:38 2006

Date: Fri, 13 Oct 2006 15:05:05 -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, 13 Oct 2006     Volume: 10 Number: 9845

Today's topics:
    Re: 500 Chunked must be last Transfer-Encoding 'identit <glex_no-spam@qwest-spam-no.invalid>
    Re: openGL 0.5 perl module problem, again <nospam-abuse@ilyaz.org>
        Primal Script/Komodo/ASE vs Ultra Edit users: With no b samiam@mytrashmail.com
        Primal Script/Komodo/ASE vs Ultra Edit users: With no b samiam@mytrashmail.com
    Re: Primal Script/Komodo/ASE vs Ultra Edit users: With  samiam@mytrashmail.com
    Re: Primal Script/Komodo/ASE vs Ultra Edit users: With  <sbryce@scottbryce.com>
    Re: Primal Script/Komodo/ASE vs Ultra Edit users: With  <sbryce@scottbryce.com>
    Re: Reading substitution patterns from file <nobull67@gmail.com>
    Re: Reading substitution patterns from file <nobull67@gmail.com>
    Re: Reading substitution patterns from file <sherm@Sherm-Pendleys-Computer.local>
    Re: Reading substitution patterns from file <wahab@chemie.uni-halle.de>
    Re: Reading substitution patterns from file <sherm@Sherm-Pendleys-Computer.local>
    Re: replace variable with same variable <bik.mido@tiscalinet.it>
    Re: replace variable with same variable <bik.mido@tiscalinet.it>
    Re: replace variable with same variable <bik.mido@tiscalinet.it>
    Re: Research Collaboration Request usenet@DavidFilmer.com
        using the first variable on the command line inside a p <mark.leeds@morganstanley.com>
    Re: using the first variable on the command line inside usenet@DavidFilmer.com
    Re: using the first variable on the command line inside <glex_no-spam@qwest-spam-no.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 13 Oct 2006 15:07:07 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: 500 Chunked must be last Transfer-Encoding 'identity'
Message-Id: <452ff187$0$601$815e3792@news.qwest.net>

carmstrong@cbamedia.com wrote:
> I'm trying to use the tor proxy with LWP. I keep getting the message:
> 
> "500 Chunked must be last Transfer-Encoding 'identity'"
> 
> Does anybody know what that means and how to solve that. (FYI the tor
> proxy works fine with a browser).

Does anybody know how to use a search engine, given an error message, to 
try to find an answer or at least try to research possible solutions? :-)

It appears that you should upgrade libwww-perl.




------------------------------

Date: Fri, 13 Oct 2006 21:14:42 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: openGL 0.5 perl module problem, again
Message-Id: <egovk2$19jp$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
J. Gleixner
<glex_no-spam@qwest-spam-no.invalid>], who wrote in article <452fad39$0$25773$815e3792@news.qwest.net>:
> > and then i met messages.....

> > Note (probably harmless): No library found for -lGLUT
> > Note (probably harmless): No library found for -lGLX
> > Note (probably harmless): No library found for -lMesaGLU
> > Note (probably harmless): No library found for -lMesaGLUT
> > Note (probably harmless): No library found for -lMesaGLX
> > Note (probably harmless): No library found for -lXIE
> > 
> > how can i solve this problem? help...

> That isn't a perl question.

It is; more correctly, it would be, if there was a problem...

Hope this helps,
Ilya


------------------------------

Date: 13 Oct 2006 11:42:05 -0700
From: samiam@mytrashmail.com
Subject: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <1160764925.604487.266970@h48g2000cwc.googlegroups.com>

Primal Script/Komodo/ASE vs Ultra Edit users: With no built in
debugger, what do you use to test your scripts?
Hi,

I am just starting out in Perl and I benefit from the syntax checking,
project workspace features, and most of all the quick gui "Debug"
options of Perl IDE's.

I am a long time fan of Ultra Edit and it does do Perl syntax.
However, there doesn't seem to be a debugger and by debugger, I mean a
little window where the output of your script shows up along with any
errors when you hit a F7 or F5 type "Run Script" feature.

UE has the best, by far, Workspace features in that it literally shows
every file (and there's a filter too) in a folder that's added to a
workspace. I just keep my work in this folder and I'm done!

With Primal Script and Komodo - one has to create an empty virtual
folder and then manually add all the files into it and it's not very
graceful at all in Primal Script. Worse, Primal Script has no Perl
option in "add new item" to workspace and so I have to add a vbscript
or class and then rename it to *.pl.  Sometimes however PS will not
take the name and renames it back to the vbscript extension and name.

Admin Script Editor is my favorite, but it doesn't do Perl.  I am not
undualy biased by experience with any of them as I just started testing
them all out
at the same time. The support ASE gives is INSTANTANEOUS and they are
quick to add requested features. But again...it's great for vbscript
but no Perl support.

So I've concluded that Ultra Edit is the best editor by far, and it
doesn't crash like both Primal Script and Komodo do beneath my LIMITED
use. Ultra Edit hasn't crashed in 10 years of use.

When programs crash in just a few days of testing - check your QA
department.

The only thing that keeps me from using UE for my perl coding is I
can't just hit F5 of F7 like in Komodo or Primal Script.  HOWEVER  I
know many of you use UE as your Perl IDE - so is there a clean, easy,
efficient way you debug your code?

Not leaving the IDE like in Komodo and Primal Script is great- but with
UE, I guess I have to leave the IDE, but then what? How many more
steps, windows, and carpel tunnel inducing mouse clicks will Ultra Edit
cost me to debug my
perl files?

Thanks for sharing your experience and input!

L,
Sam



------------------------------

Date: 13 Oct 2006 11:46:01 -0700
From: samiam@mytrashmail.com
Subject: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <1160765161.203084.286860@h48g2000cwc.googlegroups.com>

Hi,

I am just starting out in Perl and I benefit from the syntax checking,
project workspace features, and most of all the quick gui "Debug"
options of Perl IDE's.

I am a long time fan of Ultra Edit and it does do Perl syntax. However,
there doesn't seem to be a debugger and by debugger, I mean a little
window where the output of your script shows up along with any errors
when you hit a F7 or F5 type "Run Script" feature.

UE has the best, by far, Workspace features in that it literally shows
every file (and there's a filter too) in a folder that's added to a
workspace. I just keep my work in this folder and I'm done!

With Primal Script and Komodo - one has to create an empty virtual
folder and then manually add all the files into it and it's not very
graceful at all in Primal Script. Worse, Primal Script has no Perl
option in "add new item" to workspace and so I have to add a vbscript
or class and then rename it to *.pl.  Sometimes however PS will not
take the name and renames it back to the vbscript extension and name.

Admin Script Editor is my favorite, but it doesn't do Perl.  I am not
undualy biased by experience with any of them as I just started testing
them all out at the same time. The support ASE gives is INSTANTANEOUS
and they are quick to add requested features. But again...it's great
for vbscript but no Perl support.

So I've concluded that Ultra Edit is the best editor by far, and it
doesn't crash like both Primal Script and Komodo do beneath my LIMITED
use. Ultra Edit hasn't crashed in 10 years of use.

When programs crash in just a few days of testing - check your QA
department.

The only thing that keeps me from using UE for my perl coding is I
can't just hit F5 of F7 like in Komodo or Primal Script.  HOWEVER  I
know many of you use UE as your Perl IDE - so is there a clean, easy,
efficient way you debug your code?

Not leaving the IDE like in Komodo and Primal Script is great- but with
UE, I guess I have to leave the IDE, but then what? How many more
steps, windows, and carpel tunnel inducing mouse clicks will Ultra Edit
cost me to debug my perl files?

Thanks for sharing your experience and input!

L, 
Sam



------------------------------

Date: 13 Oct 2006 12:44:36 -0700
From: samiam@mytrashmail.com
Subject: Re: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <1160768676.447093.200130@m7g2000cwm.googlegroups.com>

Thanks for the F9 tip. Works great!  It opens a new window each
iteration - is this optional/configurable?

Do you prefer Komodo, Primal Script or UE? I am just beginning but
would like to start out using the IDE I will stick with so as not to
waste time learning more than one. I think only someone with experience
using them is postioned to give a fair opinion of which is preferable
and why.  I say this to head off those who inevitably say, "Try 'em and
find out," which is cousin to, "Each person must decide for
themselves."

In my opinion, a Porsche is qualitatively better if not more costly,
but if you simply want to go fast and live around fast corners, this is
clearly an objectively superior car than a Toyota Corolla.  But the
latest Corolla's look very much like racey fast cars, so a newbie could
be fooled very easily if he didn't know better.

Komodo is the most expensive, it claims to be the Porsche of IDE's but
only the experienced would know for sure. Hope I've qualified my
questions enough to get productive answers.

Regarding off topic:

Sorry...didin't realize it was off topic. Can you direct me to the
comp.lang.perl.misc.ide group? I can't seem to find it, hence my post
here.  I would have thought the "misc" in comp.lang.perl.misc would
have included Perl IDE's and comparing one to another, or asking about
Perl IDE recommendations.

Is discussion about Perl debuggers, IDE's and such precluded by the
group charter or FAQ?

Does the "misc" not mean miscellaneous but have an unspoken "code only"
subtext?

Thanks again for your input :)

L,
Sam



Scott Bryce wrote:
> samiam@mytrashmail.com wrote:
>
> > I am a long time fan of Ultra Edit and it does do Perl syntax.
> > However, there doesn't seem to be a debugger and by debugger, I mean
> > a little window where the output of your script shows up along with
> > any errors when you hit a F7 or F5 type "Run Script" feature.
>
> This is off-topic here but...
>
> F9.
>
> Enter "perl %f" as the command and "%p" as the working directory.
>
> And if running a Perl script was the last thing you did using F9, then
> control-F9.



------------------------------

Date: Fri, 13 Oct 2006 13:08:25 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <5KadnesJD_-1ebLYnZ2dnUVZ_vCdnZ2d@comcast.com>

samiam@mytrashmail.com wrote:

> I am a long time fan of Ultra Edit and it does do Perl syntax. 
> However, there doesn't seem to be a debugger and by debugger, I mean
> a little window where the output of your script shows up along with
> any errors when you hit a F7 or F5 type "Run Script" feature.

This is off-topic here but...

F9.

Enter "perl %f" as the command and "%p" as the working directory.

And if running a Perl script was the last thing you did using F9, then 
control-F9.


------------------------------

Date: Fri, 13 Oct 2006 14:34:14 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Primal Script/Komodo/ASE vs Ultra Edit users: With no built in debugger, what do you use to test your scripts?
Message-Id: <AuidnWQgnq_YZbLYnZ2dnUVZ_sGdnZ2d@comcast.com>

samiam@mytrashmail.com wrote:

> Thanks for the F9 tip. Works great!  It opens a new window each 
> iteration - is this optional/configurable?

I don't know. You could check the UE help file.

> Do you prefer Komodo, Primal Script or UE?

I have only used UE.

> I say this to head off those who inevitably say,
> "Try 'em and find out," which is cousin to, "Each person must decide
> for themselves."

We all have our own preferences.

> Regarding off topic:
> 
> Sorry...didin't realize it was off topic. Can you direct me to the 
> comp.lang.perl.misc.ide group? I can't seem to find it, hence my post
> here.  I would have thought the "misc" in comp.lang.perl.misc would 
> have included Perl IDE's and comparing one to another, or asking
> about Perl IDE recommendations.

I won't try to decide if a discussion of Perl IDE's is on-topic or 
off-topic. What was off-topic is how to perform a specific task in UtraEdit.

> Is discussion about Perl debuggers, IDE's and such precluded by the 
> group charter or FAQ?

I don't believe so, but your question was about the functionality of a 
particular text editor that is not exclusive to Perl. The answer would 
have been the same if you were using UE to write code in some other 
scripting language.


> Does the "misc" not mean miscellaneous but have an unspoken "code
> only" subtext?

The misc means that this group is for misc perl questions. Your question 
was about the functionality of a particular text editor that may or may 
not be used to write Perl scripts. You could have found the answer in 
the UE help file.

There are posting guidelines posted to this group (clpm) twice a week. 
If you read the posting guidelines, you may get a better feel for what 
is or is not on-topic here.


------------------------------

Date: 13 Oct 2006 11:19:59 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Reading substitution patterns from file
Message-Id: <1160763599.272326.290900@i42g2000cwa.googlegroups.com>



On Oct 13, 10:32 am, "Orangutan" <maciej.ogrodnic...@gmail.com> wrote:
> Hello,
>
> I would like to read the substitution patterns from file - and I cannot
> get it working. The problem is identical to the one which was already
> asked here long time ago by Fotis Jannidis (cited below), but has not
> been answered yet.

QASFTBMGALTAI ! 

[ Google that for an explaination :-) ]



------------------------------

Date: 13 Oct 2006 11:25:08 -0700
From: "Brian McCauley" <nobull67@gmail.com>
Subject: Re: Reading substitution patterns from file
Message-Id: <1160763908.407511.33840@m73g2000cwd.googlegroups.com>



On Oct 13, 10:32 am, "Orangutan" <maciej.ogrodnic...@gmail.com> wrote:
> Hello,
>
> I would like to read the substitution patterns from file - and I cannot
> get it working. The problem is identical to the one which was already
> asked here long time ago by Fotis Jannidis (cited below), but has not
> been answered yet.

QASFTBMGALTAI ! 

[ Google that for an explaination :-) ]



------------------------------

Date: Fri, 13 Oct 2006 14:35:14 -0400
From: Sherm Pendley <sherm@Sherm-Pendleys-Computer.local>
Subject: Re: Reading substitution patterns from file
Message-Id: <m2bqogawt9.fsf@Sherm-Pendleys-Computer.local>

"Brian McCauley" <nobull67@gmail.com> writes:

> On Oct 13, 10:32 am, "Orangutan" <maciej.ogrodnic...@gmail.com> wrote:
>> Hello,
>>
>> I would like to read the substitution patterns from file - and I cannot
>> get it working. The problem is identical to the one which was already
>> asked here long time ago by Fotis Jannidis (cited below), but has not
>> been answered yet.
>
> QASFTBMGALTAI !
>
> [ Google that for an explaination :-) ]

Um... OK.

"Your search - QASFTBMGALTAI - did not match any documents."

I didn't pay much attention to the original question, but now I'm curious.
What can I say, I'm ex-military, I have a weakness for acronyms. :-)

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: Fri, 13 Oct 2006 20:40:41 +0200
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Reading substitution patterns from file
Message-Id: <egomsd$2p1$1@mlucom4.urz.uni-halle.de>

Thus spoke Sherm Pendley (on 2006-10-13 20:35):
> "Brian McCauley" <nobull67@gmail.com> writes:
>> QASFTBMGALTAI !
> "Your search - QASFTBMGALTAI - did not match any documents."

http://groups.google.com/groups?q=QASFTBMGALTAI&start=0&hl=en&filter=0

> I didn't pay much attention to the original question, but now I'm curious.
> What can I say, I'm ex-military, I have a weakness for acronyms. :-)

That means, nowadays military is no fun anymore?

Regards

M.




------------------------------

Date: Fri, 13 Oct 2006 15:17:42 -0400
From: Sherm Pendley <sherm@Sherm-Pendleys-Computer.local>
Subject: Re: Reading substitution patterns from file
Message-Id: <m27iz4auuh.fsf@Sherm-Pendleys-Computer.local>

Mirco Wahab <wahab@chemie.uni-halle.de> writes:

> Thus spoke Sherm Pendley (on 2006-10-13 20:35):
>> "Brian McCauley" <nobull67@gmail.com> writes:
>>> QASFTBMGALTAI !
>> "Your search - QASFTBMGALTAI - did not match any documents."
>
> http://groups.google.com/groups?q=QASFTBMGALTAI&start=0&hl=en&filter=0

Aha! Google Groups. I was searching plain old Google.

sherm--

-- 
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net


------------------------------

Date: 13 Oct 2006 20:50:03 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: replace variable with same variable
Message-Id: <hinvi25vlg0vhe6dvsftn5l1b5a9o8uuhs@4ax.com>

On Wed, 11 Oct 2006 13:59:38 -0400, Uri Guttman <uri@stemsystems.com>
wrote:

>beyond the slowdown (which will affect every s/// which grabs and each
>time they run so it can add up), those vars are implicit while () and $1
>are explicit. you can also have multiple $1 grabs but only the 3 parts
>of $& and friends. also $& is rarely used (especially by experienced
>perl hackers) so it isn't as easily understood by newbies or at first

Personally of all the (good) reasons why $& is discouraged I find this
to be the wakest one. Indeed it may be an underused feature, and as
far as understandability st first glance by newbies goes, the same
issue affects quite a lot of stuff in Perl. In which case we live
happily with the fact that newbies just have to get acquainted with
it.

>glance. $1 is much clearer and more uniform. there is actually no need
>for $& as it can be done with () and $1. in fact i believe perl6 dropped
>those (but then again p6's rules are parsecs beyond p5's regexes).

It has a capture object which one can access through $/, and since it
can be used as an array, if it is then its entries are the numbered
captures, and also has good ol' numbered captures $1, $2,... which
happen to be shortcuts to $/[1], $/[2],...

>so use $& as you wish. but most others don't like it and won't use it.

Indeed.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: 13 Oct 2006 21:01:06 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: replace variable with same variable
Message-Id: <eunvi2hkjhp34tlrk4dgra8crc6but6cdv@4ax.com>

On 11 Oct 2006 10:16:48 -0700, "Bart Van der Donck" <bart@nijlen.com>
wrote:

>> Please don't do that.  Using the $&, $', and $` variables slow down ALL
>> regular expressions in the entire program even if you only use any of
>> them once.
>>
>> $line =~ /(PILOT_INC=[2-8])/$1 NGHBR_SRCH_MODE = 0,/g;
>
>Any idea how many milliseconds will be lost ? :-)

Either many or insignificantly few. But that's not the only point, as
others have explained you. Now I'd like to add that there are indeed
good reasons why the use of these variables is discouraged.
Nevertheless implementation details apart (one can imagine that there
*must* be ways to avoid the slowdown) I agree with you on the
*logical* usefulness of $&. Of course you can workaround with a
capture, but as most pleonastic things it has a distasteful flavour.
Certainly a substitution means "substitute this with that". Now,
depending on the nature of "that" the phrase may actually sound like
"search this and do this with *it*". Now when you say "it", you name a
pronoun. $& is the pronoun. Prematch and postmatch may be occasionally
useful, but that's a whole different story. However, if one asked me,
I would go as far as arguing that the pronoun should even $_ in the
substituion part of s///, since $_ Perl's typical "it" and based on
the principle of least surprise chances are much rarer to need the
actual string being matched there. As mentioned in another thread, in
Perl6 it will be quite a different story, and a positive one in this
sense, for it will have a $/ match *object* from which you may get
many different info through methods and shortcuts to them: i.e. it may
be used as a scalar in string context, as an array, as a hash, etc.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: 13 Oct 2006 21:03:24 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: replace variable with same variable
Message-Id: <9jovi29nkiaamg3vunvaj48tfuj02nfdvp@4ax.com>

On 11 Oct 2006 12:07:24 -0700, "Bart Van der Donck" <bart@nijlen.com>
wrote:

>My tests seem to indicate the opposite:
>
>---------------------------------------------------------------
>
>    #!/perl
>    use strict;
>    use warnings;
>    use Time::HiRes qw (time);

Your test is flawed. For one thing it is generally not reliable to use
T::H to time stuff like that. But even using Benchmark.pm, some care
must be taken in working out a test like this particular one. Because
the point is, just one use of the "incriminated" variables slows down
all of the other regexen.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


------------------------------

Date: 13 Oct 2006 13:31:21 -0700
From: usenet@DavidFilmer.com
Subject: Re: Research Collaboration Request
Message-Id: <1160771480.967037.288360@e3g2000cwe.googlegroups.com>

bekijkfotos@gmail.com wrote:
> Abstract:
> J.F.A. Jansen, J.M. Hakum=E4ki, L. Ifeanyi, M. Shamblott, J. Gearhart
> and P.C.M. van Zijl
> 1H-NMR spectroscopy of stem cells in vitro demonstrates high
> proliferation state.
> Proc. Int. Soc. Mag. Reson. Med. 10, Honolulu, Hawaii, USA, May 2002:
> 131
>
> Paper:
> Jacobus F.A. Jansen, Michael J. Shamblott, Peter C.M. van Zijl, Kimmo
> K. Lehtim=E4ki, Jeff W.M. Bulte, John D. Gearhart, and Juhana M.
> Hakum=E4ki
> Stem Cell Profiling by Nuclear Magnetic Resonance Spectroscopy.
> Magnetic Resonance in Medicine 56 (3): 666-670 SEP 2006
>
> Although both the abstract and the paper describe essentially the same
> research, the title has changed, and the authors are different. It
> requires a relative sophisticated search algorithm to find the paper
> based on the information from the abstract, and to consider it as a match

Hmmm. The authors are different, but there is significant overlap (the
last names Jansen, Shamboltt, Gearhart, van Zijl occur in both
publications).

It wouldn't be difficult to identify similarities based on some
percentage of name matching. This may possibly be sophisticated enough
to meet the requirement in a large percentage of cases.

If you want to try to find similarities in the titles you will have
MUCH more trouble. You're talking about natural language parsing -
very, very, very hard to do.

--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)



------------------------------

Date: 13 Oct 2006 13:52:07 -0700
From: "markpark" <mark.leeds@morganstanley.com>
Subject: using the first variable on the command line inside a perl program
Message-Id: <1160772727.614006.24220@f16g2000cwb.googlegroups.com>

I want to do something extremely simple but I can't get it to work and
I've spent 3 hours so i think it's time to ask someone.

i run my perl program by typing ( or in a shell script )

leedsmar/src/currency.pl   r_driver_file

so, r_driver_file is a file that i want to be able to refer to inside
currency.pl

so, right in  first line of the main part of my program ( i don't use a
main() like c or c++. i
hope i don't need that ) i have :

unless defined( my $1) }
die "need a driver file argument to run currency analyzer properly "
}

this gives me "Can't use global $1 in my at currency_analyzer.pl line
200, near "my $1".

in python , it works as

if ( len(sys.argv)  < 1 ) but i just cannot figure out how to do this
in perl. i'm sure there must
be a way. thanks a lot.

i really would like to avoid the use of Getopt:Long because I used that
for something else
a few days ago and it was really difficult to get it to work and I
still don't really get how it works.
without this list, i never would have gotten it to work. thanks a lot.



------------------------------

Date: 13 Oct 2006 14:01:55 -0700
From: usenet@DavidFilmer.com
Subject: Re: using the first variable on the command line inside a perl program
Message-Id: <1160773315.506981.291440@i42g2000cwa.googlegroups.com>

markpark wrote:

> using the first variable on the command line inside a perl program

The commandline arguments are passed to Perl in a special array @ARGV.
The shift function defaults to this array (unless in a subroutine).

#!/usr/bin/perl
   use strict;   use warnings;

   my $filename = shift or die "No filename specified\n";
   print $filename;

__END__


--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)



------------------------------

Date: Fri, 13 Oct 2006 16:09:02 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: using the first variable on the command line inside a perl program
Message-Id: <4530000a$0$596$815e3792@news.qwest.net>

markpark wrote:
> I want to do something extremely simple but I can't get it to work and
> I've spent 3 hours so i think it's time to ask someone.
> 
> i run my perl program by typing ( or in a shell script )
> 
> leedsmar/src/currency.pl   r_driver_file
> 
> so, r_driver_file is a file that i want to be able to refer to inside
> currency.pl

my $filename = $ARGV[0];
print "The first argument to my script is $filename\n";



------------------------------

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 9845
***************************************


home help back first fref pref prev next nref lref last post