[25559] in Perl-Users-Digest
Perl-Users Digest, Issue: 7803 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 20 14:05:52 2005
Date: Sun, 20 Feb 2005 11:05:25 -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 Sun, 20 Feb 2005 Volume: 10 Number: 7803
Today's topics:
Can't get regex right <jazeker_b_nospamlalala@yahoo.co.uk>
Re: Can't get regex right <noreply@gunnar.cc>
Re: Can't get regex right <jazeker_b_nospamlalala@yahoo.co.uk>
Re: Can't get regex right <noreply@gunnar.cc>
Re: Can't get regex right <jazeker_b_nospamlalala@yahoo.co.uk>
Converting Word Control characters to an ASCII format <murali@muralichari.com>
Re: cperl-mode and emacs-21.4 brocken? <mike53@moocow.tu-bs.de>
Re: emacs AAAAAAAAAAAAAHHH!!! ioneabu@yahoo.com
Re: exercise: partition a list by equivalence bearophileHUGS@lycos.com
Re: How should I interpret this set of laptop specifica <richardcavell@mail.com>
Re: How should I interpret this set of laptop specifica <larry_wallet@yahoo.com>
Re: How to NOT use utf8. <pkaluski@piotrkaluski.com>
Re: Importing records with both space and quoted text q <1usa@llenroc.ude.invalid>
Re: Importing records with both space and quoted text q <ljames@apollo3.com>
Re: Importing records with both space and quoted text q <1usa@llenroc.ude.invalid>
Parameters in command line <joericochuyt@msn.com>
Re: Parameters in command line <nobull@mail.com>
Re: The Problem with Perl <tassilo.von.parseval@rwth-aachen.de>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 20 Feb 2005 16:02:29 GMT
From: Jazeker <jazeker_b_nospamlalala@yahoo.co.uk>
Subject: Can't get regex right
Message-Id: <pw2Sd.16432$Q84.1358959@phobos.telenet-ops.be>
Hello,
Been playing around with a regex that should help a substitute of part
of an html template. I can't seem to get it right though. Anyone sees
what I am doing wrong ? I might have been staring at it for too long
myself...
subsitute : $tmpl_cont =~ s/\[\[LIST\]\](.*)\[\[\/LIST\]\]/$token/g;
(the $tmpl_cont var holds a join of the template - I have checked that
already by printing it to the browser and inspecting the page source.
template = http://www.galleryscript.net/demo/layout/xlisttemplate.html
As I was not sure about the wildcard, I also tried :
subsitute : $tmpl_cont =~ s/\[\[LIST\]\]([.\n]*)\[\[\/LIST\]\]/$token/g;
Thanks for any help...
--
print <<EOF;
Just a noobish Perl hacker
EOF
------------------------------
Date: Sun, 20 Feb 2005 17:26:36 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Can't get regex right
Message-Id: <37rrubF5g76lkU1@individual.net>
Jazeker wrote:
> Been playing around with a regex that should help a substitute of part
> of an html template. I can't seem to get it right though. Anyone sees
> what I am doing wrong ? I might have been staring at it for too long
> myself...
>
> subsitute : $tmpl_cont =~ s/\[\[LIST\]\](.*)\[\[\/LIST\]\]/$token/g;
You probably need the /s modifier. If there may be more than one
occurrence of the [[LIST]] .. [[/LIST]] pair, you should also make the
regex non-greedy, i.e. .*? . Otherwise the /g modifier is redundant.
perldoc perlre
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 20 Feb 2005 16:30:02 GMT
From: Jazeker <jazeker_b_nospamlalala@yahoo.co.uk>
Subject: Re: Can't get regex right
Message-Id: <eW2Sd.16456$nW1.1316958@phobos.telenet-ops.be>
Gunnar Hjalmarsson wrote:
> Jazeker wrote:
>
>> Been playing around with a regex that should help a substitute of part
>> of an html template. I can't seem to get it right though. Anyone
>> sees what I am doing wrong ? I might have been staring at it for too
>> long myself...
>>
>> subsitute : $tmpl_cont =~ s/\[\[LIST\]\](.*)\[\[\/LIST\]\]/$token/g;
>
>
> You probably need the /s modifier. If there may be more than one
> occurrence of the [[LIST]] .. [[/LIST]] pair, you should also make the
> regex non-greedy, i.e. .*? . Otherwise the /g modifier is redundant.
>
> perldoc perlre
>
Thank you so much ! I wonder then why ([\n.]*) did not do the trick...
--
print <<EOF;
Just a noobish Perl hacker
EOF
------------------------------
Date: Sun, 20 Feb 2005 17:35:24 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Can't get regex right
Message-Id: <37rserF5fblk7U1@individual.net>
Jazeker wrote:
> Gunnar Hjalmarsson wrote:
>> You probably need the /s modifier.
>
> Thank you so much ! I wonder then why ([\n.]*) did not do the trick...
Because the . character is not special within a character class. [\n.]
represents only a newline or a literal dot.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 20 Feb 2005 16:34:15 GMT
From: Jazeker <jazeker_b_nospamlalala@yahoo.co.uk>
Subject: Re: Can't get regex right
Message-Id: <b_2Sd.16459$_y7.1077378@phobos.telenet-ops.be>
Gunnar Hjalmarsson wrote:
> Jazeker wrote:
>
>> Gunnar Hjalmarsson wrote:
>>
>>> You probably need the /s modifier.
>>
>>
>> Thank you so much ! I wonder then why ([\n.]*) did not do the trick...
>
>
> Because the . character is not special within a character class. [\n.]
> represents only a newline or a literal dot.
>
:-|
*starts beating himself very hard*
--
print <<EOF;
Just a noobish Perl hacker
EOF
------------------------------
Date: 20 Feb 2005 10:29:12 -0800
From: "Murali" <murali@muralichari.com>
Subject: Converting Word Control characters to an ASCII format
Message-Id: <1108924152.271594.263610@f14g2000cwb.googlegroups.com>
Hi,
I support a web application the customers use to update information
regarding various products.
A lot of times, they copy and paste from a Word Document into the
textbox in the provided form.
The cgi beind, reads in this data and stores it in an ASCCI text file.
When the product
information is updated, and this new information is displayed, all the
Word special
characters are displayed as ? (including the apostrophes, hyphens and
other stuff).
I tried dos2unix program to convert this, but it's not working. Is
there a Perl regular
expression out there which can do this job? So I clean up the text
before storing it in a
text file?
Thanks,
-Murali
------------------------------
Date: 20 Feb 2005 11:14:43 GMT
From: Mike Dowling <mike53@moocow.tu-bs.de>
Subject: Re: cperl-mode and emacs-21.4 brocken?
Message-Id: <slrnd1gs93.p0.mike53@moocow.localhost>
On Sat, 19 Feb 2005 22:28:08 +0000 (UTC), Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
> [A complimentary Cc of this posting was sent to
> Mike Dowling
><fake@tu-bs.de>], who wrote in article <slrnd1emgu.72g.mike53@moocow.localhost>:
>> > Maybe you are using "my" cperl-mode.el with 21.3, and "their" with
>> > 21.4? IIRC, with "their" version you need a different way to
>> > auto-associate, since it won't overwrite perl-mode...
>>
>> Perhaps! I used the cperl-mode that came with emacs ("theirs") but it
>> appeared to have been authored by you, but its probabale old. Where can
>> I get the latest version, could you perhaps post it here?
>
> One which comes with Emacs is a tiny bit dumbed down to be more
> compatible with the "common ideology" of the Emacs package. See
> ilyaz.org/software/emacs for the "point-and-shoot" version.
Great! Works out of the box! Just the gear!
> What do people think: is the presense of two versions hurting more
> than availability of a version "which just works" no matter what
> version of Emacs you are using (I use 19.33 ;-)?
Well, it hurts a bit. Obviously the version with emacs 21.4 is broken,
and that hurts.
As for the version, I always need the latest version of all useful Linux
software. This is because I have been developing my own Linux directly
from the sources ever since kernel version 0.7 (? I ferget exactly, but
it's close). If I ever stop continually upgrading to latest versions,
I'd be overwhelmed. I could then only catch up by reverting to a
distribution.
Cheers,
Mike Dowling
--
Sorry, after years of fighting spam, I've given in. I changed
my email address, and don't want to reveal it to spammers. I
understand any wrath therby incurred, but I'm no longer in any
position to continue the fight.
------------------------------
Date: 20 Feb 2005 06:04:52 -0800
From: ioneabu@yahoo.com
Subject: Re: emacs AAAAAAAAAAAAAHHH!!!
Message-Id: <1108908292.920981.252560@g14g2000cwa.googlegroups.com>
babydoe@mailinator.com wrote:
> wana writes:
> >
> > All I really wanted up front was to see my Perl syntax color coded
> > and to compile and run my Perl program from within emacs, just
> > to see it work.
> >
>
> I'll start you off :
...
> 7. You should now be able to run perl by typing 'ctrl-C c'
>
> 8. An aside, on win32, I use TEI Emacs : it's the duck's guts.
>
> http://www.tei-c.org/Software/tei-emacs/
>
> Also useful are some ported Unix tools (msys):
>
> http://www.mingw.org/msys.shtml
Thank you very much for this! And thanks to all for thoughts and
empathy. I do try to only work on little bite-size bits of code at a
time and I am not a professional, but I would like to get in on the
whole emacs thing eventually. I read that the creator of emacs has a
big book out and there is another big one on lisp for emacs. I'll try
and master the tutorial stuff little by little and when I'm ready, I'll
get the emacs book.
Thanks again!
wana (TEI Emacs download at 18%)
------------------------------
Date: 20 Feb 2005 03:31:33 -0800
From: bearophileHUGS@lycos.com
Subject: Re: exercise: partition a list by equivalence
Message-Id: <1108899093.340446.216420@o13g2000cwo.googlegroups.com>
John Machin:
>Perhaps I'm missing a posting of yours -- what are merge2 and merge4?
What is "this random pairs test"? What is xMax (nPairs isn't hard to
guess), and how are you generating your input data?<
merge2 and this random pairs test comes from the post by Brian Beck.
merge4 is the first in my last post. And merge3 isn't included (nor
tested) because it uses the original (slow) addArcs.
This is the simple test generator taken from his post:
xMax = 3000
nPairs = xMax*5
l = [[randint(0,xMax), randint(0,xMax)] for i in xrange(nPairs)]
For such high number of nPairs (arcs), the resulting graph usuall has
one big connected component, and few tiny debris... To produce a more
divided graph, nPairs have to be much smaller, like xMax*1.5.
>FWIW, my offering is attached. <
I'm sorry, I don't see the attach... (just the different title).
John Machin:
>Only David's uses stuff that's not in the Python 2.4 off-the-shelf
distribution.<
Well, using already mede functions and classes is good, it avoids you
to reinvent things each time. Some of my versions too use my graph
library (for a problem like this I usually don't create stand alone
versions like merge6 and merge7). And my original point was adding one
graph data structure to the standard Python library :-]
I haven't tested the speed of David Eppstein version...
Anyway, this is a simplified version of merge6, that uses an indirect
graph g, instead of the directed graph, and avoids the use of chain:
. from collections import deque
.
. def merge7(l):
. # Undirect graph g creation:
. g = {}
. for n1,n2 in l:
. if n1 not in g: g[n1] = {n2:0}
. else: g[n1][n2] = 0
. if n2 not in g: g[n2] = {n1:0}
. else: g[n2][n1] = 0
. # Connected components:
. result = []
. visited = set()
. for root in g.iterkeys():
. if root not in visited:
. component = [root]
. visited.add(root)
. Q = deque() # A queue
. Q.append(root)
. while Q:
. n1 = Q.popleft()
. for n2 in g[n1].iterkeys():
. if n2 not in visited:
. visited.add(n2)
. Q.append(n2)
. component.append(n2)
. result.append(component)
. return result
It's a bit shorter and a little faster than merge6, memory used is
similar (there is only one dictionary, so there is only one
ammortization overhead of the dictionary, but it contains the sum of
both arcs, so the ammortization can be twice as big, so... memory used
can be the same).
(Usually BFS and DFS memory requirements are a little different; this
implementation uses BFS, and I think it uses a bit less memory than
DFS, but for this problem/test the difference isn't significative.)
Bear hugs,
Bearophile
------------------------------
Date: Sun, 20 Feb 2005 22:28:44 +1100
From: Richard Cavell <richardcavell@mail.com>
Subject: Re: How should I interpret this set of laptop specifications?
Message-Id: <cv9rtj$jk9$1@nnrp.waia.asn.au>
On 20/2/05 5:02 PM, Francis Chee wrote:
> Hi, there:
>
> This is not C++, but I think it will get some quick response for my Laptop
> decision.
>
> I expect my notebook doesn't inhibit me from editing digital pictures due to
> LCD displays.
> What does the "Maximum Resolution1024x768" and "Max resolution (with max
> video
> RAM)2048x1536" mean?
The seller is overselling the ability of the machine. If the screen is
1024x768, it will never display anything higher than that on its on
screen. It may well be able to display 2048x1536 on its external
display, but you need to see how much video RAM it actually has. It's
pointless to state that the hardware is capable of more when it doesn't
have the RAM.
------------------------------
Date: 20 Feb 2005 05:49:19 -0800
From: "Larry" <larry_wallet@yahoo.com>
Subject: Re: How should I interpret this set of laptop specifications?
Message-Id: <1108907359.072760.75290@c13g2000cwb.googlegroups.com>
Francis Chee wrote:
> Hi, there:
>
> This is not C++, but I think it will get some quick response for my
Laptop
> decision.
>
> I expect my notebook doesn't inhibit me from editing digital pictures
due to
> LCD displays.
> What does the "Maximum Resolution1024x768" and "Max resolution (with
max
> video
> RAM)2048x1536" mean?
>
> If I order this machine with RAM upgraded to 512MB, will I get a
resolution
> of 2048x1536
> anyway?
>
> Thanks.
>
>
> -------------------------
> Display/MonitorExternal display supportedYesSimultaneous external
> displayYesScreen Type DescriptionTFTViewable Image Size (Diagonal)
> Inches15.0Screen IlluminationBacklitGrey Shades or Colours Max Built
in
> Screen16777216Maximum Resolution1024x768
>
> Graphics SubsystemDescriptionIntel Extreme Graphics 2TypeXGAVideo RAM
> typeDVMTMax resolution (with max video RAM)2048x1536 16777216
coloursMaximum
> Simultaneous Colours16777216Graphics bus interfaceDirect AGPVideo on
> PlanarYes
> -----------------------
>
perldoc -q screen
for potentially helpful Perl documentation.
You may want to try Radio Shack if there is one in your area. I
recommend you not ask this in comp.lang.c++ as it will be completely
off topic over there.
Get the extra ram anyway if you can afford it, and ask about battery
life. Regarding the battery, they have Acpi::Battery on cpan.org, but
it's just for Linux. Imagine if something like that could support all
platforms?
Larry
------------------------------
Date: Sun, 20 Feb 2005 18:10:20 +0100
From: pkaluski <pkaluski@piotrkaluski.com>
Subject: Re: How to NOT use utf8.
Message-Id: <cvagbf$qkc$1@atlantis.news.tpi.pl>
Anno Siegel wrote:
> pkaluski <pkaluski@piotrkaluski.com> wrote in comp.lang.perl.misc:
>
>>Hi,
>>I am under impression that my perl scripts crash due to some
>>incompatibilities with utf8.
>>I was looking in the documentation and I found out (correct me if I am
>>wrong) that perl 5.8.0 and higher use utf8 by default. I have also found
>>several hints on how to make unicode and non-unicode strings work together.
>>My question is: Is it possible (on Windows) to tell perl not to use
>>unicode at all. Not in the current lexical scope, in the current module.
>>Just not to use unicode at all. Only 8-bit character strings.
>>
>>Is it possible?
>
>
> You can find the answer in "perldoc perlrun". See also perlunicode and
> perluniintro.
>
> Anno
Oppss! I was so excited looking for an answer that I forgot to check in
perlrun :). Thanks!
--
Piotr Kaluski
"It is the commitment of the individuals to excellence,
their mastery of the tools of their crafts, and their
ability to work together that makes the product, not rules."
("Testing Computer Software" by Cem Kaner, Jack Falk, Hung Quoc Nguyen)
------------------------------
Date: Sun, 20 Feb 2005 14:36:09 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Importing records with both space and quoted text qualifiers...
Message-Id: <Xns960361AF285BBasu1cornelledu@127.0.0.1>
"L. D. James" <ljames@apollo3.com> wrote in
news:111gqh5aese1j98@corp.supernews.com:
> Thank you, Brian.
For what? Oh, you are top-posting. Please don't do that.
> I'm aware that a standard (of is it all)
???
> The example I found in the faq works perfect with comma separated
> records. I'm spending time now trying to figure out which commas to
> remove from the following to replace with what would specify the
> separator as a space.
The Text::CSV_XS module allows you to specify various separators etc. The
module is mentioned in the FAQ you claim to have read. I would suggest
reading the docs for the said module, and saving yourself some trouble.
Oh, by the way, please do read the posting guidelines for this group.
Sinan,
------------------------------
Date: Sun, 20 Feb 2005 11:41:36 -0500
From: "L. D. James" <ljames@apollo3.com>
Subject: Re: Importing records with both space and quoted text qualifiers...
Message-Id: <111hfe4hn7ero80@corp.supernews.com>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns960361AF285BBasu1cornelledu@127.0.0.1...
> "L. D. James" <ljames@apollo3.com> wrote in
> news:111gqh5aese1j98@corp.supernews.com:
>
>> Thank you, Brian.
>
> For what? Oh, you are top-posting. Please don't do that.
>
I thanked him for responding to my message, and mainly, as I mentioned
in my message for giving me definition to what I was trying to express.
>> I'm aware that a standard (of is it all)
>
> ???
>
>> The example I found in the faq works perfect with comma separated
>> records. I'm spending time now trying to figure out which commas to
>> remove from the following to replace with what would specify the
>> separator as a space.
>
> The Text::CSV_XS module allows you to specify various separators etc. The
> module is mentioned in the FAQ you claim to have read. I would suggest
> reading the docs for the said module, and saving yourself some trouble.
>
The faq mentions that TEXT:CSV_XS module. I guess I didn't make it
clear enough, but I thought I had expressed that an answer to how to
manipulate the example I posted would answer many questions about data
formatting.
I appreciate that you have taken the time to may your expressions. I
often point people to helping themselves when answering questions. I also
understand that something that is very clear to me might not be so clear to
someone else who reads the same time. Then if I take the time to express
the same thing in a slightly different way, some things (that was already in
the person's face) becomes clearer.
For your information, I not only did a lot of experimenting in trying
to decipher the FAQ, but I searched a lot though the message base before
posting. I was trying to find other examples where others might have asked
the same question. All the similar questions liked the missing link in my
mind, how to handle the space as the separator.
I didn't immediately explore the TEXT:CSV module because, I created an
example using the function I posted. I thought the function would have been
easy enough for a few gurus to read and respond on how to handle the white
spaces. This information would help me from other parts in my programs.
It'll actually answer quite a few questions that I haven't asked.
Again, I'm sure I'd eventually figure out how to change that function
from using the comma to using the SPACE as a separator. I thought of first
changing all the spaces to comma, then processing the line, then changing
the commas in the quoted fields back to spaces. Some of the problem with
that is there are actually commas in the quoted delaminated fields.
By the way, at present I found that changing most of the commas to a
string set as $sp="\s" was a start. However, it has glitches because I
can't tell which of the commas is a necessary part of the function or is the
designed delimiter.
I'm hoping that you (or someone will notice) that I am doing the
homework. I hope you'll remember when you got stuck while the answer was
right in you face. And if you know that answer, would actually post it.
The question is which of the commas in the following function should be
changed to the new delimiter, if for instance it was a colon, as in the
passwd file, or a space as in the web log file, or a comma as in a normal
csv file. In my current case can someone give me a suggestion on this
function?
(Where else should the $separator variable be placed?)
----------------
$separator = "\s";
@new = ();
push(@new, $+) while $text =~ m{
"([^\"\\]*(?:\\.[^\"\\]*)*)",? # groups the phrase inside the
quotes
| ([^,]+),?
| ,
}gx;
push(@new, undef) if substr($text,-1,1) eq '$separator';
----------------
Again, and as always, thanks in advance for anyone taking the time to
reply.
-- L. James
-------------------------
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames
------------------------------
Date: Sun, 20 Feb 2005 19:04:12 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Importing records with both space and quoted text qualifiers...
Message-Id: <Xns96038F203F1A1asu1cornelledu@127.0.0.1>
"L. D. James" <ljames@apollo3.com> wrote in
news:111hfe4hn7ero80@corp.supernews.com:
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns960361AF285BBasu1cornelledu@127.0.0.1...
>> "L. D. James" <ljames@apollo3.com> wrote in
>> news:111gqh5aese1j98@corp.supernews.com:
>>
>>> Thank you, Brian.
>
>>
>> For what? Oh, you are top-posting. Please don't do that.
>>
>
> I thanked him for responding to my message,
You can express your gratitude by choosing not to top-post.
>> The Text::CSV_XS module allows you to specify various separators etc.
>> The module is mentioned in the FAQ you claim to have read. I would
>> suggest reading the docs for the said module, and saving yourself
>> some trouble.
>>
>
> The faq mentions that TEXT:CSV_XS module. I guess I didn't make
> it clear enough, but I thought I had expressed that an answer to
> how to manipulate the example I posted would answer many
> questions about data formatting.
I am not sure what your purpose is: Do you want to solve your problem or
just rant?
use strict;
use warnings;
use Text::CSV_XS;
print "SSV:\n";
use constant SSV_STRING => q{one two "three, four" five six};
my $parse_ssv = Text::CSV_XS->new({ sep_char => ' '});
if( $parse_ssv->parse(SSV_STRING) ) {
my @fields = $parse_ssv->fields;
print qq{"$_"\n} for @fields;
}
__END__
D:\Home\asu1\UseNet\clpmisc> c
SSV:
"one"
"two"
"three, four"
"five"
"six"
> I appreciate that you have taken the time to may your
> expressions.
Don't take this the wrong way, show some respect, and try and compose
your messages in somewhat comprehensible English. I read and re-read
various parts of your messages, and I cannot even begin to imagine what
you mean by them.
> For your information, I not only did a lot of experimenting in
> trying to decipher the FAQ,
...
> I didn't immediately explore the TEXT:CSV module
Text::CSV_XS is what I suggested. There is no TEXT:CSV module. Text::CSV
is the pure Perl version of Text::CSV_XS.
> example using the function I posted. I thought the function would
> have been easy enough for a few gurus to read and respond on how to
> handle the white spaces.
Someone has already solved the problem you are trying to solve, and put
it in the Text::CSV_XS module. I have zero interest in even trying to
decipher that RegEx, because I like the transparency of being able to
say "this is the separator character I want to use" as in
my $p = Text::CSV_XS->new({ sep_char => ' '});
rather than fiddling with a multiline regex.
> delaminated fields.
De-lamination is probably the process of peeling off lamination from an
ID card. What you want to say is "delimited". I am only pointing this
out because of the consistency with which you refer to 'delaminated'
fields.
> By the way, at present I found that changing most of the commas
> to a
> string set as $sp="\s" was a start. However, it has glitches because
> I can't tell which of the commas is a necessary part of the function
> or is the designed delimiter.
>
>
> I'm hoping that you (or someone will notice) that I am doing the
> homework.
Please read the posting guidelines for suggestions on how to help others
help you.
> I hope you'll remember when you got stuck while the answer
> was right in you face.
Well, you were not there to help me, so I fail to see how this is
relevant to anything.
> And if you know that answer, would actually post it.
I did. I told you to look at the docs for Text::CSV_XS.
> The question is which of the commas in the following function
> should be changed to the new delimiter, if for instance it was a
> colon, as in the passwd file, or a space as in the web log file,
> or a comma as in a normal csv file.
This is exactly the kind of thing Text::CSV_XS deals with.
Sinan.
------------------------------
Date: Sun, 20 Feb 2005 11:31:51 -0500
From: "yusufdestina" <joericochuyt@msn.com>
Subject: Parameters in command line
Message-Id: <4950813903fc74147e398e2547f517fe@localhost.talkaboutprogramming.com>
Can someone point me to a direction for this?
I have an application that opens another perl execuatable file. [PAR]
How can I pass vars to the perl appl.?
ex: testfile.exe name=value ...
Tnx for ur time and help.
sorry for my poor english..
------------------------------
Date: Sun, 20 Feb 2005 17:12:14 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Parameters in command line
Message-Id: <cvag3b$pci$1@sun3.bham.ac.uk>
yusufdestina wrote:
> Can someone point me to a direction for this?
> I have an application that opens another perl execuatable file. [PAR]
> How can I pass vars to the perl appl.?
> ex: testfile.exe name=value ...
It it confusing to use an .exe suffix on a Perl script.
> Tnx for ur time and help.
> sorry for my poor english..
Then write Perl. Show us what you have tried.
You call external executables with argument using system(). RTFM for
details.
But the real answer is that you should probably not do it.
Do not have the first script call the second.
Cut out the guts of the second Perl script and make it into a module
that is used by both scripts.
------------------------------
Date: Sun, 20 Feb 2005 12:45:23 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: The Problem with Perl
Message-Id: <slrnd1gu2j.pn.tassilo.von.parseval@localhost.localdomain>
Also sprach Wes Groleau:
> Eric Bohlman wrote:
>> It can't. C requires that functions be called with the same number of
>> parameters they're declared with, and that can't be expressed in a CFG.
>
> However, is it still true (I haven't done C in ages)
> that in C you can compile a function call without first
> compiling the declaration? In which case the compiler
> will assume the result is int, and stack as many parameters
> as you give it. If it turns out to actually return a float,
> "that's life."
This is what happens, yes.
However, there are context-sensitive things in C which cannot be
circumvented. For example, you have to declare variables prior to first
usage.
> If it turns out to pop from the stack more params than
> it was called with, that's death. :-)
Not necessarily. The only thing guaranteed is that those additional
arguments contain garbage. The following will most likely not segfault.
It even compiles silently (unless additional compiler warnings are
explicitly switched on):
#include <stdio.h>
#include <string.h>
int main (int argc, char **argv) {
bla("string");
}
bla (int i, char *string) {
printf("%s\n", string);
string++;
printf("%s\n", string);
(*string)++;
printf("%s\n", string);
return strlen(string);
}
__END__
dùÿ¿
ùÿ¿
úÿ¿
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
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 7803
***************************************