[30680] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1925 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 15 14:09:46 2008

Date: Wed, 15 Oct 2008 11:09:11 -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           Wed, 15 Oct 2008     Volume: 11 Number: 1925

Today's topics:
    Re: Comparing audio files <tzz@lifelogs.com>
    Re: Comparing audio files <RedGrittyBrick@spamweary.invalid>
        crisis Perl <cartercc@gmail.com>
    Re: crisis Perl <josef.moellers@fujitsu-siemens.com>
    Re: crisis Perl <tzz@lifelogs.com>
    Re: crisis Perl <RedGrittyBrick@spamweary.invalid>
        Filehandle Adapter for String? <bugbear@trim_papermule.co.uk_trim>
    Re: Filehandle Adapter for String? <smallpond@juno.com>
    Re: Filehandle Adapter for String? <john@castleamber.com>
        Good reference for Math::MatrixReal? mike_l_rossREMOVE@REMOVEcomcast.net
    Re: Help: How to process output of a program xhoster@gmail.com
    Re: mod_perl: sharing data across httpd childs ? xhoster@gmail.com
    Re: Perl script: String comparison Ignoring spaces <fawaka@gmail.com>
    Re: Perl script: String comparison Ignoring spaces <mushtaqk921@gmail.com>
    Re: Perl script: String comparison Ignoring spaces <jurgenex@hotmail.com>
    Re: Perl script: String comparison Ignoring spaces <josef.moellers@fujitsu-siemens.com>
    Re: Perl script: String comparison Ignoring spaces <tzz@lifelogs.com>
    Re: Perl script: String comparison Ignoring spaces <tadmc@seesig.invalid>
    Re: Text::CSV problem (fidokomik\)
    Re: Text::CSV problem <bugbear@trim_papermule.co.uk_trim>
    Re: Text::CSV problem <1usa@llenroc.ude.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 15 Oct 2008 10:49:41 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Comparing audio files
Message-Id: <86r66hhn8q.fsf@lifelogs.com>

On Wed, 15 Oct 2008 12:15:47 +0100 RedGrittyBrick <RedGrittyBrick@spamweary.invalid> wrote: 

R> Surely there's an Acme::ESP and Acme::PSI in CPAN?

I put PSI::ESP in this article but IBM screwed up the link (made it
lowercase):
http://www.ibm.com/developerworks/linux/library/l-perl1/

The real link is:
http://www.ibm.com/developerworks/linux/library/l-perl1/ESP.pm

Ted


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

Date: Wed, 15 Oct 2008 18:58:49 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: Comparing audio files
Message-Id: <gd5b0q$hj4$1@registered.motzarella.org>


Ted Zlatanov wrote:
> On Wed, 15 Oct 2008 12:15:47 +0100 RedGrittyBrick <RedGrittyBrick@spamweary.invalid> wrote: 
> 
> R> Surely there's an Acme::ESP and Acme::PSI in CPAN?
> 
> I put PSI::ESP in this article but IBM screwed up the link (made it
> lowercase):
> http://www.ibm.com/developerworks/linux/library/l-perl1/
> 
> The real link is:
> http://www.ibm.com/developerworks/linux/library/l-perl1/ESP.pm
> 

Nice article!

I admit I was thinking of things like this:
http://search.cpan.org/~tyemq/Acme-ESP-1.002007/ESP.pm

-- 
RGB


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

Date: Wed, 15 Oct 2008 06:53:09 -0700 (PDT)
From: cartercc <cartercc@gmail.com>
Subject: crisis Perl
Message-Id: <ca123b2f-06c4-409a-8768-6141ccf1f82b@r15g2000prh.googlegroups.com>

Over the past four years, I've written a fair amount of Perl. Some of
it has been 'crisis Perl'. This results in scripts that solve a
problem but are thrown together in a hurry with inefficient, untested,
and confusing code. When the crisis resolved, I wanted to go back, do
real testing, and rewrite the script, but have been told on almost
every occasion to leave it alone. The fact that it seemed to worked
was good enough, and most of this code found its way into production.

In the past month or so, I've had to look at four scripts I have
written this way. One script was over two years old, and the newest
was several months old. Needless to say, dealing with confusing,
uncommented, and inefficient code is a problem! It would have been
much easier to clean up the code when it was written than to rewrite
it months after the fact.

I actually knew better than to not clean up the code, but it was
easier at the time not to pick a fight with my managers. This isn't an
excuse, but an explanation.

How do you deal with a manager who tells you to leave a script alone,
when you know good and well that it's such poorly written code that it
will be extremely hard to maintain, and perhaps will be buggy as well?
Getting another job isn't an option, and firing the manager isn't an
option, either.

CC


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

Date: Wed, 15 Oct 2008 16:09:54 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: crisis Perl
Message-Id: <gd4tjb$gp9$1@nntp.fujitsu-siemens.com>

cartercc wrote:

> How do you deal with a manager who tells you to leave a script alone,
> when you know good and well that it's such poorly written code that it
> will be extremely hard to maintain, and perhaps will be buggy as well?
> Getting another job isn't an option, and firing the manager isn't an
> option, either.

Just give it to him in writing. If you later get into trouble, at least 
you told him before! Maybe one day he'll listen.

Josef
-- 
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html


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

Date: Wed, 15 Oct 2008 10:42:25 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: crisis Perl
Message-Id: <86zll5hnku.fsf@lifelogs.com>

On Wed, 15 Oct 2008 06:53:09 -0700 (PDT) cartercc <cartercc@gmail.com> wrote: 

c> How do you deal with a manager who tells you to leave a script alone,
c> when you know good and well that it's such poorly written code that it
c> will be extremely hard to maintain, and perhaps will be buggy as well?
c> Getting another job isn't an option, and firing the manager isn't an
c> option, either.

This is why you should not write poor, unclear code even in a crisis.
The real problem happened during the crisis, when you compromised the
quality of your work.  The situation now was inevitable after the choice
you made back then.

The best you can do is build a convincing case for the necessity of a
rewrite.  Focus on the bugs in the code, not its beauty.  It will make
you look bad, though, since it was your code anyhow.

Next time, don't give in to the pressure of "do it now."  Besides the
consequences you see above, it's also a great way to get into an even
deeper crisis if you write buggy code in haste.

Ted


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

Date: Wed, 15 Oct 2008 16:54:18 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: crisis Perl
Message-Id: <48f6122f$0$24337$db0fefd9@news.zen.co.uk>


cartercc wrote:
> Over the past four years, I've written a fair amount of Perl. Some of
> it has been 'crisis Perl'. This results in scripts that solve a
> problem but are thrown together in a hurry with inefficient, untested,
> and confusing code. When the crisis resolved, I wanted to go back, do
> real testing, and rewrite the script, 
> 
> How do you deal with a manager who tells you to leave a script alone,
> when you know good and well that it's such poorly written code that it
> will be extremely hard to maintain, and perhaps will be buggy as well?
> Getting another job isn't an option, and firing the manager isn't an
> option, either.

Firstly, I'd try to practice Perl more frequently so that when a crisis 
occurs, I am better able to write good Perl under pressure.

Secondly, I'd make it my aim, that in a crisis, I'd stay calm, take my 
time, and attempt to write clear well-documented Perl from the start. 
This is, of course, much easier said than done. However, I think that if 
you make this a goal and remind yourself of it regularly, then you are 
more likely to be able to achieve a result closer to your goal.

If the above is achievable then your aims won't come into conflict with 
those of your manager and there won't be a problem.

It's also worth bearing in mind that your manager probably has 
legitimate concerns that you don't. For example he or she might have a 
budgetary or priority driven need to avoid spending resources polishing 
something that is already operational and performing adequately. I'd 
find out what my managers concerns were, then go away and think about 
other ways those concerns might be addressed. Then you might be able to 
propose some approach that meets both your concerns. At the end of the 
day though, the manager has the duty and authority to manage. You have 
to accept that.

Just my ¤0.02 worth.

-- 
RGB


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

Date: Wed, 15 Oct 2008 17:02:20 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Filehandle Adapter for String?
Message-Id: <3u-dneoP8ouQiWvVnZ2dneKdnZydnZ2d@posted.plusnet>

It is quite common for modules to be able to handle
files, or filehandles, but not strings.

In order to ease some of the uses I have for
such modules, in an age where a 1 Mb scalar
is reasonable, I would quite like to have a class/module
that Implements FileHandle, but is (really)
a scalar(string).

A readonly version of this would present
the string as a readable FileHandle, and a writeonly
version would allow writing/printing to a string,
which could be picked up later.

This is by close analogy with ByteArrayInputStream
http://java.sun.com/j2se/1.4.2/docs/api/java/io/ByteArrayInputStream.html
and ByteArrayOutputStream
http://java.sun.com/j2se/1.4.2/docs/api/java/io/ByteArrayOutputStream.html

in Java.

Does such a Module exist? I tried to search CPAN
but didn't really know what search terms to use.

   BugBear


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

Date: Wed, 15 Oct 2008 09:29:45 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: Filehandle Adapter for String?
Message-Id: <5b2075db-e834-4c53-ab68-d7d7b1957bdb@b1g2000hsg.googlegroups.com>

On Oct 15, 12:02 pm, bugbear <bugbear@trim_papermule.co.uk_trim>
wrote:
> It is quite common for modules to be able to handle
> files, or filehandles, but not strings.
>
> In order to ease some of the uses I have for
> such modules, in an age where a 1 Mb scalar
> is reasonable, I would quite like to have a class/module
> that Implements FileHandle, but is (really)
> a scalar(string).
>
> A readonly version of this would present
> the string as a readable FileHandle, and a writeonly
> version would allow writing/printing to a string,
> which could be picked up later.
>
> This is by close analogy with ByteArrayInputStreamhttp://java.sun.com/j2se/1.4.2/docs/api/java/io/ByteArrayInputStream....
> and ByteArrayOutputStreamhttp://java.sun.com/j2se/1.4.2/docs/api/java/io/ByteArrayOutputStream...
>
> in Java.
>
> Does such a Module exist? I tried to search CPAN
> but didn't really know what search terms to use.
>
>    BugBear


Looks like IO::String is close to what you want.


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

Date: 15 Oct 2008 16:51:08 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Filehandle Adapter for String?
Message-Id: <Xns9B3878936552Ecastleamber@130.133.1.4>

bugbear <bugbear@trim_papermule.co.uk_trim> wrote:

> It is quite common for modules to be able to handle
> files, or filehandles, but not strings.
> 
> In order to ease some of the uses I have for
> such modules, in an age where a 1 Mb scalar
> is reasonable, I would quite like to have a class/module
> that Implements FileHandle, but is (really)
> a scalar(string).
> 
> A readonly version of this would present
> the string as a readable FileHandle,

my $yourstring = "hello, world";
open my $fh, '<', \$yourstring or ...


> and a writeonly
> version would allow writing/printing to a string,
> which could be picked up later.

open my $fh, '>', \$yourstring or ...

"
Since v5.8.0, perl has built using PerlIO by default. Unless                               
you've changed this (i.e. Configure -Uuseperlio), you can open                             
file handles to "in memory" files held in Perl scalars via:
"

perldoc -f open


-- 
John    http://johnbokma.com/ - Hacking & Hiking in Mexico

Perl help in exchange for a gift:
http://johnbokma.com/perl/help-in-exchange-for-a-gift.html


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

Date: Wed, 15 Oct 2008 11:29:15 -0500
From: mike_l_rossREMOVE@REMOVEcomcast.net
Subject: Good reference for Math::MatrixReal?
Message-Id: <mcGdnY5PIpvAh2vVnZ2dnUVZ_uSdnZ2d@comcast.com>

I found the man pages for the Math::MatrixReal module somewhat lacking in
code examples.  Does anyone know of a better source of reference info for
this module?  Book, web page, I'll take anything showing me how to properly
declare the variables used for the arrays.  Thanks for any pointers.

Mike Ross


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

Date: 15 Oct 2008 18:06:31 GMT
From: xhoster@gmail.com
Subject: Re: Help: How to process output of a program
Message-Id: <20081015140514.603$uL@newsreader.com>

Tim Greer <tim@burlyhost.com> wrote:
>
> Also, IPC::Open2 does work on Win32 or am I mistaken?

Based on my test, I'd say it doesn't work on Win32, or at least not
well.

use strict;
use warnings;
use IPC::Open2;
$|=1;
warn open2 my $in, my $out, q{sort};
print $out qq{$_\n} foreach (1..100);
close $out or die;
print while (<$in>);

This works on Linux, but hangs on Windows.  It hangs at the while (<$in>).
Since sort needs to read all input before generating any output,
deadlock should not be an issue.  It also leaves sort.exe hanging around.

(I actually starting using "cat"/"type", using the >& to redirect to
another filehandle to avoid deadlocks, but I couldn't figure out how to
make Window's "type" read from its stdin.  So I switched to sort.  Then
once using sort, I realized I no longer needed >& so simplified it.  None
of these steps worked on windows).

This is perl, v5.8.8 built for MSWin32-x86-multi-thread
(with 25 registered patches, see perl -V for more detail)

Copyright 1987-2006, Larry Wall

Binary build 817 [257965] provided by ActiveState
http://www.ActiveState.com Built Mar 20 2006 17:54:25

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: 15 Oct 2008 18:07:35 GMT
From: xhoster@gmail.com
Subject: Re: mod_perl: sharing data across httpd childs ?
Message-Id: <20081015140618.960$TT@newsreader.com>

howa <howachen@gmail.com> wrote:
>
> By stress testing the test.cgi, I found memory is not shared at all,
> using the top command, e.g.
>
> >> top -bc -n 1 | grep httpd
>
> 11290 web       25   0  100m  23m 1620 R   47  0.3   0:00.29 /usr/
> local/apache_1.3.41/bin/httpd
> 11247 web       20   0  101m  23m 1628 R   41  0.3   0:05.15 /usr/
> local/apache_1.3.41/bin/httpd
>
> As you can see, each httpd is using 23m, and 1620bytes shared, which I
> belive the much data is shared....
>
> Any idea?

In addition to what the other post said, it should be pointed out that
the SHR column of the "top" command does not reflect all modes of memory
sharing.  For example, Copy-On-Write sharing does not seem to accounted
for as shared.  I think it reflects only shared libraries (*.so files) and
not any kind of data sharing.  It would be nice if the "man top" did a
better job of explaining this.  You need a better way of diagnosing how
much memory is actually being used.

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: 15 Oct 2008 13:10:13 GMT
From: Leon Timmermans <fawaka@gmail.com>
Subject: Re: Perl script: String comparison Ignoring spaces
Message-Id: <48f5ebb5$0$183$e4fe514c@news.xs4all.nl>

On Wed, 15 Oct 2008 05:43:59 -0700, khan wrote:
> 
> Please let me know a solution to compare string variables ignoring
> spaces around the variables.
> 
> Thanks,
> -Mushtaq Khan

Fist of all, please don't use split in void or scalar context. It's 
considered confusing and is deprecated.

The easiest solution is to just remove them during the splitting. 
Something like this:

my @cols = split /\s?:\s?/;
if ($cols[1] eq "jack") {
    ...
}

Assuming there are no spaces at the start or end of the line, obviously.

Regards,

Leon Timmermans


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

Date: Wed, 15 Oct 2008 06:21:21 -0700 (PDT)
From: khan <mushtaqk921@gmail.com>
Subject: Re: Perl script: String comparison Ignoring spaces
Message-Id: <91d41cf2-0c18-4284-a6a3-0c5d7b3e64d4@v13g2000pro.googlegroups.com>

On Oct 15, 6:10=A0pm, Leon Timmermans <faw...@gmail.com> wrote:
> On Wed, 15 Oct 2008 05:43:59 -0700, khan wrote:
>
> > Please let me know a solution to compare string variables ignoring
> > spaces around the variables.
>
> > Thanks,
> > -Mushtaq Khan
>
> Fist of all, please don't use split in void or scalar context. It's
> considered confusing and is deprecated.
>
> The easiest solution is to just remove them during the splitting.
> Something like this:
>
> my @cols =3D split /\s?:\s?/;
> if ($cols[1] eq "jack") {
> =A0 =A0 ...
>
> }
>
> Assuming there are no spaces at the start or end of the line, obviously.
>
> Regards,
>
> Leon Timmermans

Thanks, Leon for replying. It's working fine.


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

Date: Wed, 15 Oct 2008 06:41:42 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perl script: String comparison Ignoring spaces
Message-Id: <rlsbf49ihl1vlfrnbv42nu1fqpuavoo5os@4ax.com>

khan <mushtaqk921@gmail.com> wrote:
>Please let me know a solution to compare string variables ignoring
>spaces around the variables.

See 'perldoc -q sapce':
	 How do I strip blank space from the beginning/end of a string?

jue 


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

Date: Wed, 15 Oct 2008 15:46:38 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Perl script: String comparison Ignoring spaces
Message-Id: <gd4s7m$c6g$1@nntp.fujitsu-siemens.com>

khan wrote:
> Hi,
> 
> Iam new to Perl Script, am writing a perl script to read a
> configuration file and take some actions accordingly. I read each line
> of file, split the line in to variables and compare against the
> predefined tokens. Comparison fails if variable in file has some
> spaces around it.
> 
> Eg: Line read from file
>     Jhon: jack:hill;
>     spilt(/:/);
>     if("jack" eq "$_[1])
>     #Above comparison fails as $_[1] value is " jack"
> 
> Please let me know a solution to compare string variables ignoring
> spaces around the variables.

Maybe you could use a regular expression:

if ($_[1] =~ /^\s*jack\s*$/) {
     print "It's Jack all right\n";
}

If you must compare with a string contained in a variable, use the \Q 
and \E qualifiers:

if ($_[1] =~ /^\s*\Q$name\E\s*$/) {
     print "It's $name all right\n";
}

Oh ... TMTOWTDI:

split(/\s*:\s*/);
will take care of the colon as well as surrounding white space.
Then you can just use simple string comparisons with "eq" and "ne".

HTH,

Josef

-- 
These are my personal views and not those of Fujitsu Siemens Computers!
Josef Möllers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html


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

Date: Wed, 15 Oct 2008 10:46:39 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Perl script: String comparison Ignoring spaces
Message-Id: <86vdvthnds.fsf@lifelogs.com>

On 15 Oct 2008 13:10:13 GMT Leon Timmermans <fawaka@gmail.com> wrote: 

LT> Fist of all, please don't use split in void or scalar context. It's 
LT> considered confusing and is deprecated.

Why is split in scalar context considered confusing and deprecated?  It
seems like a decent way to count the tokens in a word:

my $token_count = split ' ', $data;

You can do something similar with m/(\S+)/g I guess but it gets more
complicated when a token is not as easy to define as the token
separator sequence.

Ted


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

Date: Wed, 15 Oct 2008 10:25:25 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Perl script: String comparison Ignoring spaces
Message-Id: <slrngfc2r5.atp.tadmc@tadmc30.sbcglobal.net>

khan <mushtaqk921@gmail.com> wrote:

>     spilt(/:/);
>     if("jack" eq "$_[1])


Please post real Perl code.



-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Wed, 15 Oct 2008 16:16:52 +0200
From: "Petr Vileta \(fidokomik\)" <stoupa@practisoft.cz>
Subject: Re: Text::CSV problem
Message-Id: <gd4vrg$9h8$1@aioe.org>

Natxo Asenjo wrote:
> hi,
> 

Try this:

#!/usr/bin/perl
use warnings;
use strict;
 
 my $csv_file = "c:/tmp/dump.csv";
open (CSV, "<", $csv_file) or die "$!\n" ;
while  (my $line = <CSV>) 
        {
        chomp $line;             # remove \n
        next unless($line);    # skip blank lines
        my @columns = split(',', $line);
        print join(" ", @columns), "\n";
        }
close CSV;

-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail.
Send me your mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>



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

Date: Wed, 15 Oct 2008 16:25:41 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Text::CSV problem
Message-Id: <TbCdnWe0d_rrlmvVnZ2dnUVZ8vqdnZ2d@posted.plusnet>

Natxo Asenjo wrote:
> hi,
> 
> I need to check the status of some schedule tasks in a windows server. At
> my $JOB we use nagios, so I thouth, let's write a plugin (I could not
> find anything at the nagiosexchange).

I had "issues" with Parse::CSV earlier this year:

> I think the "binary" flag (passed on to the underlying Text::CSV_XS
> module) simply does not work. The documentation for Text::CSV_XS points
> out that you pretty much HAVE to use the getline() function in
> Text::CSV_XS when you;'re accepting binary fields, especially quoted
> binary fields with linefeeds in them.
> 
> Despite this, Parse::CSV uses it's own _getline to get a line, before
> using parse() from Text::CSV_XS to parse it.
> 
> This fails in the circumstances outlined above. 

You may be having some issues related to this; I note that some
of your fields contain "interesting" characters, including backslash.

My cure (I'm afraid) was to bypass PARSE::CSV and use Text::CSV_XS directly
to get my project working.

   BugBear


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

Date: Wed, 15 Oct 2008 15:25:53 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Text::CSV problem
Message-Id: <Xns9B3874476A521asu1cornelledu@127.0.0.1>

Natxo Asenjo <natxete@asenjo.nl.invalid> wrote in
news:48f5e447$0$183$e4fe514c@news.xs4all.nl: 

> (2nd line)
> "server","jobname","09:00:00, 16-10-2008","","Interactive
> only","09:00:00, 07-10-2008","0","user","At 09:00
> every day, starting 18-01-2008","C:\Program Files\SQLyog
> Enterprise\sja.exe "afdgroep_progbeh.xml" -l"C:\Documents and
> Settings\user\Application Data\SQLyog\sja.log"
> -s"C:\Documents and Settings\user\Application
> Data\SQLyog\sjasession.xml"","N/A","N/A","Enabled","Daily
> ","09:00:00","18-01-2008","N/A","Everyday","N/A",

 ...

> I think it has to do with the long paths in the task to run field,
> because when I try the same code at another machine with a 'normal'
> (shorter) path to run, I get the desired output.

Do adopt the habit of reading the documentation for the module(s) you 
are using:

http://search.cpan.org/~makamaka/Text-CSV-1.09/lib/Text/CSV.pm

<blockquote>
allow_loose_quotes

    By default, parsing fields that have quote_char characters inside an 
unquoted field, like

     1,foo "bar" baz,42

    would result in a parse error. Though it is still bad practice to 
allow this format, we cannot help there are some vendors that make their 
applications spit out lines styled like this.

    In case there is really bad CSV data, like

     1,"foo "bar" baz",42

    or

     1,""foo bar baz"",42

    there is a way to get that parsed, and leave the quotes inside the 
quoted field as-is. This can be achieved by setting allow_loose_quotes 
AND making sure that the escape_char is not equal to quote_char.
</blockquote>

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

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


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