[31187] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2432 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 21 16:09:44 2009

Date: Thu, 21 May 2009 13: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           Thu, 21 May 2009     Volume: 11 Number: 2432

Today's topics:
    Re: ampersand subroutine <news123@free.fr>
    Re: ampersand subroutine <nat.k@gm.ml>
    Re: ampersand subroutine <nat.k@gm.ml>
    Re: ampersand subroutine <uri@StemSystems.com>
    Re: ampersand subroutine <nat.k@gm.ml>
    Re: ampersand subroutine <uri@StemSystems.com>
    Re: Archive::Zip and correct extension (mixture of Word <bart.lateur@pandora.be>
    Re: FAQ needed for PERL/PERL5 modules and paths <brian.d.foy@gmail.com>
    Re: Is PERL good for a linguist new to programming? <cartercc@gmail.com>
    Re: Is PERL good for a linguist new to programming? p.podmostko@googlemail.com
    Re: Is PERL good for a linguist new to programming? <tadmc@seesig.invalid>
    Re: problems with writing to an output file <jurgenex@hotmail.com>
        regex help <paulATseymourworldDOTcoDOTuk>
    Re: regex help <cartercc@gmail.com>
    Re: regex help <nat.k@gm.ml>
    Re: regex help <glex_no-spam@qwest-spam-no.invalid>
    Re: regex help <hfollmann@itcfollmann.com>
    Re: regex help <jurgenex@hotmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 21 May 2009 15:17:36 +0200
From: News123 <news123@free.fr>
Subject: Re: ampersand subroutine
Message-Id: <4a155470$0$21815$426a34cc@news.free.fr>

Nathan Keel wrote:
> Uri Guttman wrote:
> 
>>>>>>> "SP" == Sherm Pendley <spamtrap@dot-app.org> writes:
>> SP> News123 <news123@free.fr> writes:
>>>>  In the latter case I'd suggest an explicit exit() statement before
>> the >> function definitions in order to signal to a person reading the
>> code, >> that no more code outside of function definitions will follow
>>
>> SP> If you're communicating to a person, comments are far clearer:
>>
>> SP> # End main code body
>> SP> # Function definitions follow
>>
>> SP> Use exit() for its intended purpose, explicitly returning an exit
>> code SP> to the parent process.
>>
>> i disagree. in my top level programs i always put an explicit exit()
>> after the main line code ends.
> 
> If it's Perl code you're talking about, why not use something better
> suited for that, if you might have code/routines/comments that could
> create problems?  exit() isn't the best method for preventing that
> problem, as much as I agree that it's not a bad idea for the same
> reasons, exit() isn't what I'd suggest.
What other command stops execution of a perl script non fatally and
without error?

For me this is exit() or exit(0)

For me exit() is the promise to the reader, that the script ends here.

What would you suggest as clearer less confusing method to indicate,
that one hasn't to look for any further top code snippets?



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

Date: Thu, 21 May 2009 10:44:08 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: ampersand subroutine
Message-Id: <IpgRl.40206$BZ3.16079@newsfe12.iad>

Uri Guttman wrote:

>>>>>> "NK" == Nathan Keel <nat.k@gm.ml> writes:
> 
>   NK> Uri Guttman wrote:
>   >> 
>   >> i disagree. in my top level programs i always put an explicit
>   >> exit() after the main line code ends.
> 
>   NK> If it's Perl code you're talking about, why not use something
>   NK> better suited for that, if you might have code/routines/comments
>   NK> that could create problems?  exit() isn't the best method for
>   NK> preventing that problem, as much as I agree that it's not a bad
>   NK> idea for the same reasons, exit() isn't what I'd suggest.
> 
> huh?? use what is better? exit is to exit and also tell the reader
> than no more main line code will be executed. it serves a dual
> purpose. not much else can do that.
> 
> uri
> 

How about __END__? 


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

Date: Thu, 21 May 2009 10:44:22 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: ampersand subroutine
Message-Id: <XpgRl.40208$BZ3.28428@newsfe12.iad>

News123 wrote:

> Nathan Keel wrote:
>> Uri Guttman wrote:
>> 
>>>>>>>> "SP" == Sherm Pendley <spamtrap@dot-app.org> writes:
>>> SP> News123 <news123@free.fr> writes:
>>>>>  In the latter case I'd suggest an explicit exit() statement
>>>>>  before
>>> the >> function definitions in order to signal to a person reading
>>> the code, >> that no more code outside of function definitions will
>>> follow
>>>
>>> SP> If you're communicating to a person, comments are far clearer:
>>>
>>> SP> # End main code body
>>> SP> # Function definitions follow
>>>
>>> SP> Use exit() for its intended purpose, explicitly returning an
>>> exit code SP> to the parent process.
>>>
>>> i disagree. in my top level programs i always put an explicit exit()
>>> after the main line code ends.
>> 
>> If it's Perl code you're talking about, why not use something better
>> suited for that, if you might have code/routines/comments that could
>> create problems?  exit() isn't the best method for preventing that
>> problem, as much as I agree that it's not a bad idea for the same
>> reasons, exit() isn't what I'd suggest.
> What other command stops execution of a perl script non fatally and
> without error?
> 
> For me this is exit() or exit(0)
> 
> For me exit() is the promise to the reader, that the script ends here.
> 
> What would you suggest as clearer less confusing method to indicate,
> that one hasn't to look for any further top code snippets?


How about __END__? 



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

Date: Thu, 21 May 2009 14:01:02 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: ampersand subroutine
Message-Id: <87ab56pc81.fsf@quad.sysarch.com>

>>>>> "NK" == Nathan Keel <nat.k@gm.ml> writes:

  NK> Uri Guttman wrote:
  >>>>>>> "NK" == Nathan Keel <nat.k@gm.ml> writes:
  >> 
  NK> Uri Guttman wrote:
  >> >> 
  >> >> i disagree. in my top level programs i always put an explicit
  >> >> exit() after the main line code ends.
  >> 
  NK> If it's Perl code you're talking about, why not use something
  NK> better suited for that, if you might have code/routines/comments
  NK> that could create problems?  exit() isn't the best method for
  NK> preventing that problem, as much as I agree that it's not a bad
  NK> idea for the same reasons, exit() isn't what I'd suggest.
  >> 
  >> huh?? use what is better? exit is to exit and also tell the reader
  >> than no more main line code will be executed. it serves a dual
  >> purpose. not much else can do that.

  NK> How about __END__? 

you fell into the trap. what about the subs you want to put after the
top level main line code? if they are after __END__ they won't be
parsed. the issue is to notify the reader than main line code has ended
and to explicitly return a value to end the process. exit() is correct
here.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Thu, 21 May 2009 11:17:27 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: ampersand subroutine
Message-Id: <XUgRl.50944$Rf7.24589@newsfe21.iad>

Uri Guttman wrote:

>>>>>> "NK" == Nathan Keel <nat.k@gm.ml> writes:
> 
>   NK> Uri Guttman wrote:
>   >>>>>>> "NK" == Nathan Keel <nat.k@gm.ml> writes:
>   >> 
>   NK> Uri Guttman wrote:
>   >> >> 
>   >> >> i disagree. in my top level programs i always put an explicit
>   >> >> exit() after the main line code ends.
>   >> 
>   NK> If it's Perl code you're talking about, why not use something
>   NK> better suited for that, if you might have code/routines/comments
>   NK> that could create problems?  exit() isn't the best method for
>   NK> preventing that problem, as much as I agree that it's not a bad
>   NK> idea for the same reasons, exit() isn't what I'd suggest.
>   >> 
>   >> huh?? use what is better? exit is to exit and also tell the
>   >> reader than no more main line code will be executed. it serves a
>   >> dual purpose. not much else can do that.
> 
>   NK> How about __END__?
> 
> you fell into the trap.

Not really.

> what about the subs you want to put after the 
> top level main line code?

You said you put an exit() at the end in case any comments or code you
didn't want executed followed it.  In fact, invalid syntax following an
exit will still fail anyway.  Which did you mean then?

> if they are after __END__ they won't be 
> parsed.

Yes, that is correct, so I must have misread your reasoning for using
exit()?  Why do you use exit again?

> the issue is to notify the reader than main line code has 
> ended and to explicitly return a value to end the process. exit() is
> correct here.

How about a comment that that's the end, or no further code, or?  I get
what you mean about they know anything that follows is sub routines,
comments, documentation, etc., so I guess that's what you meant then. 
I'd just throw in a commment if I felt it was needed, but I'm not
claiming your method isn't fine, I just don't think it's necessary.





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

Date: Thu, 21 May 2009 14:26:57 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: ampersand subroutine
Message-Id: <87ws8anwge.fsf@quad.sysarch.com>

>>>>> "NK" == Nathan Keel <nat.k@gm.ml> writes:

  NK> Uri Guttman wrote:
  >>>>>>> "NK" == Nathan Keel <nat.k@gm.ml> writes:
  >> 
  NK> Uri Guttman wrote:
  >> >>>>>>> "NK" == Nathan Keel <nat.k@gm.ml> writes:
  >> >> 
  NK> Uri Guttman wrote:
  >> >> >> 
  >> >> >> i disagree. in my top level programs i always put an explicit
  >> >> >> exit() after the main line code ends.
  >> >> 
  NK> If it's Perl code you're talking about, why not use something
  NK> better suited for that, if you might have code/routines/comments
  NK> that could create problems?  exit() isn't the best method for
  NK> preventing that problem, as much as I agree that it's not a bad
  NK> idea for the same reasons, exit() isn't what I'd suggest.
  >> >> 
  >> >> huh?? use what is better? exit is to exit and also tell the
  >> >> reader than no more main line code will be executed. it serves a
  >> >> dual purpose. not much else can do that.
  >> 
  NK> How about __END__?
  >> 
  >> you fell into the trap.

  NK> Not really.

yes you did. sorry to tell you that.

  >> what about the subs you want to put after the 
  >> top level main line code?

  NK> You said you put an exit() at the end in case any comments or code you
  NK> didn't want executed followed it.  In fact, invalid syntax following an
  NK> exit will still fail anyway.  Which did you mean then?

i said no more mainline code will be executed after the exit(). the subs
are to be put after the exit. they are not mainline code. learn the difference.

  >> if they are after __END__ they won't be 
  >> parsed.

  NK> Yes, that is correct, so I must have misread your reasoning for using
  NK> exit()?  Why do you use exit again?

read my posts again.

  >> the issue is to notify the reader than main line code has 
  >> ended and to explicitly return a value to end the process. exit() is
  >> correct here.

  NK> How about a comment that that's the end, or no further code, or?
  NK> I get what you mean about they know anything that follows is sub
  NK> routines, comments, documentation, etc., so I guess that's what
  NK> you meant then.  I'd just throw in a commment if I felt it was
  NK> needed, but I'm not claiming your method isn't fine, I just don't
  NK> think it's necessary.

comments can lie. i said that before. code doesn't lie.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Thu, 21 May 2009 16:58:54 +0200
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Archive::Zip and correct extension (mixture of Word and PowerPoint files)?
Message-Id: <3qqa15lh5ma4m20748lhs4d5t9dpub2ioc@4ax.com>

Geoff Cox wrote:

>That seemed fine until I remembered that about 170 of the zipped files
>contain a single PowerPoint file so I need to give these files the
>same name as the zipped file but with a .ppt extension!

You've got some people who save Powerpoint files with a .doc extension?

Tell them to stop it. They're doing it wrong. 

-- 
	Bart.


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

Date: Thu, 21 May 2009 10:47:12 -0400
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ needed for PERL/PERL5 modules and paths
Message-Id: <210520091047129994%brian.d.foy@gmail.com>

In article <gv36g9$tm$1@online.de>, Charles T. Smith
<cts.private@yahoo.com> wrote:

> Can someone direct me to an explanation of the difference between
> - perl

I think you want to perlfaq8, which has:

   *  How do I keep my own module/library directory?
   *  How do I add the directory my program lives in to the
module/library search path?
   *  How do I add a directory to my include path (@INC) at runtime?

http://faq.perl.org/perlfaq8.html


The perlrun documentation explains the environment variables that you
can set and the command line switches you can use:

http://perldoc.perl.org/perlrun.html


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

Date: Thu, 21 May 2009 06:18:46 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: Is PERL good for a linguist new to programming?
Message-Id: <1666d98e-58c3-4d7f-a041-39739d7288e0@l28g2000vba.googlegroups.com>

On May 21, 6:52=A0am, p.podmos...@googlemail.com wrote:
> Just wanted to know the opinion of PERL users if it makes sense to
> start to learn it now. I have several ideas regarding linguistics-
> related programs and wanted that language to help me create them and,
> maybe in the future, write my PhD dissertation.

Perl is simply a tool, nothing more and nothing less, like all
languages.

Like other tools, Perl is optimized for a certain range of tasks, like
a hammer for nails or a screwdriver for screws or a wrench for bolts.

The range of tasks that Perl is optimized for is text and data
processing, especially dealing with strings. Other examples are Java
in dealing with very large applications, the .NET languages for
dealing with (mindless) RAD, C and assembly for dealing with hardware
and bits, Lisp for artificial intelligence, Erlang for telecom
applications, and so on.

I'm a database guy, and I use Perl for dealing with large globs of
ASCII data. The reason I use Perl is because it allows me to easily do
what would be much harder in other languages, like transforming data.
I use Perl to spit out reports in a variety of formats: HTML, XML,
PDF, RTF, csv, txt, and so on.

David Cross write a little book a number of years ago entitled 'Data
Munging with Perl.' This can be had cheaply and quickly from
Amazon.com or half.com - best used price is $12.95. I don't
necessarily recommend this as a good book, but it does a good job at
illustrating the kinds of jobs that Perl excels at. You might want to
spend the $13.00 to get it, scan through it, and decide for yourself.

I like to see Perl as a fat, warty, ugly, old woman who will cook your
meals, wash your clothes, clean your house, take care of you, and be a
good companion for your life's journey. If getting the job done
appeals to you, Perl is worth a good, hard look.

CC


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

Date: Thu, 21 May 2009 08:58:20 -0700 (PDT)
From: p.podmostko@googlemail.com
Subject: Re: Is PERL good for a linguist new to programming?
Message-Id: <52981f4c-4bd8-4c99-aa6d-734f36de7866@g20g2000vba.googlegroups.com>

Thanks all for your answers!

I might need to clarify because this point has come up thrice already
during this conversation. I just used a wrong word.

I don't want Perl to write the dissertation FOR ME. I just want Perl
to be the tool to assist me in creating something which will be the
subject of that dissertation. I should've known that I'm talking to
programmers and that I should choose words more carefully :)


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

Date: Thu, 21 May 2009 14:22:53 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Is PERL good for a linguist new to programming?
Message-Id: <slrnh1bagd.f5s.tadmc@tadmc30.sbcglobal.net>

p.podmostko@googlemail.com <p.podmostko@googlemail.com> wrote:
> Thanks all for your answers!
>
> I might need to clarify because this point has come up thrice already
> during this conversation. I just used a wrong word.
>
> I don't want Perl to write the dissertation FOR ME. I just want Perl
> to be the tool to assist me in creating something which will be the
> subject of that dissertation. I should've known that I'm talking to
> programmers and that I should choose words more carefully :)


You haven't even started yet...

 ... but you've learned something already!

:-)


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


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

Date: Thu, 21 May 2009 09:24:21 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: problems with writing to an output file
Message-Id: <1hua159pctsper42qekdksfgt773etfr6k@4ax.com>

Ameya <ameya.r.sathe@gmail.com> wrote:
>On May 15, 3:37 pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>> Ameya <ameya.r.sa...@gmail.com> wrote:
>>
>> [writing to a file]
[...]
>> you snipped), but we cannot analyse something that we cannot see. Please
>> post a minimal, but complete program, strict and warnings clean, that we
>> can run and that demonstrates your problem.
>>
>> jue- Hide quoted text -
>> - Show quoted text -

I wrote neither of those last 2 lines above

>I have made opened all the file Ids necessary for reading and writing.
>As I said this is not the complete code but a part of it. Following is
>the complete code:

Better, but
- its still not a minimal example, in other words there is a lot of
unwanted baggage in this code that cunfuses and distracts from the
problem.
- we still cannot run it because we don't have any sample data to run it
with. Best way is to add a short _DATA_ section the the code.

>****************************************************************
>#!/usr/bin/perl
>use strict; # Variable declaration is required before use
>use warnings;

General comment: I really like your style; you are using all the
recommended tips and tricks to get as much help from the compiler and
runtime system as possible, including warnings, stricts, checking if IO
succeeded, etc.

>[...]
>open my $fout, '>', $yawFile or die "could not open file '$yawFile'
>$!";

Ok, so you are opening $fout for output and checking the result. Looks
ok to me.

>[...]
>  if ($tStatus == 3) {
>    print "Status = $tStatus\n";
>    $meanYaw = eval(join("+", @yawDir)) / @yawDir;

Uhhh that looks ugly. Have a look at the sum() function from List::Util.

>    print "$meanYaw\n";
>    print $fout "%.3f\n", $meanYaw or die "Can't print in the file
>$yawFile: $!";

And this appears to be the only place where you are trying to write to
$fout.

I created a standalone minimal program

use warnings; use strict;
my $meanYaw = 3.456;
my $yawFile = 'temp.txt';
open my $fout, '>', $yawFile or die "could not open file '$yawFile' $!";
print $fout "%.3f\n", $meanYaw; 

and couldn't reproduce your problem. The number was written into the
file just fine.
On a side note: I don't know why you are printing this "%.3f\n", but
it's probably not doing what you think it is doing.

My best guess at this time would be that maybe $tStatus does not equal 3
and therefore the if-case is not executed. I cannot check that because I
don't have any sample data.

jue


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

Date: Thu, 21 May 2009 18:50:52 +0100
From: Paul <paulATseymourworldDOTcoDOTuk>
Subject: regex help
Message-Id: <2009052118505275249-paulATseymourworldDOTcoDOTuk@news.eclipse.co.uk>

Hello,

Wonder if any regex wizards could help out here.

I need to be able to extract from  entries in a file:-
1,Question,1,Select,"_location","Location to Deploy","London Pod 
1=>LOCATION_London_-_Test_Lab","London Pod 
2=>LOCATION_London_-_Test_Lab2"

What I need to feed into an array is the bits between => and  the " at 
the end of the field. The LOCATION_London_-_Test_Lab and the 
LOCATION_London_-_Test_Lab2 entries.

Been scratching my head on this for a while now.

Thanks
Paul
 



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

Date: Thu, 21 May 2009 11:17:12 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: regex help
Message-Id: <3c52ae09-7b79-4b40-8dbf-c0882ab059c9@h2g2000yqg.googlegroups.com>

On May 21, 1:50=A0pm, Paul <paulATseymourworldDOTcoDOTuk> wrote:

> I need to be able to extract from =A0entries in a file:-
> 1,Question,1,Select,"_location","Location to Deploy","London Pod
> 1=3D>LOCATION_London_-_Test_Lab","London Pod
> 2=3D>LOCATION_London_-_Test_Lab2"

----------code---------------
while (<DATA>)
{
   $_ =3D~ /=3D>([^"]*)"/;
   print $1, "\n";;
}

__DATA__
1=3D>LOCATION_London_-_Test_Lab","London Pod
2=3D>LOCATION_London_-_Test_Lab2"
3=3D>LOCATION_Peoria, Ill. _-_Test_Lab4,365,345","Peoria Testing
Facility

------------output----------------
C:\PerlLearn>perl RE_test.plx
LOCATION_London_-_Test_Lab
LOCATION_London_-_Test_Lab2
LOCATION_Peoria, Ill. _-_Test_Lab4,365,345


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

Date: Thu, 21 May 2009 11:18:10 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: regex help
Message-Id: <CVgRl.50945$Rf7.20915@newsfe21.iad>

Paul <paulATseymourworldDOTcoDOTuk> wrote:

> Hello,
> 
> Wonder if any regex wizards could help out here.
> 
> I need to be able to extract from  entries in a file:-
> 1,Question,1,Select,"_location","Location to Deploy","London Pod
> 1=>LOCATION_London_-_Test_Lab","London Pod
> 2=>LOCATION_London_-_Test_Lab2"
> 
> What I need to feed into an array is the bits between => and  the " at
> the end of the field. The LOCATION_London_-_Test_Lab and the
> LOCATION_London_-_Test_Lab2 entries.
> 
> Been scratching my head on this for a while now.
> 
> Thanks
> Paul

What's your code you're trying now look like?


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

Date: Thu, 21 May 2009 13:32:49 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: regex help
Message-Id: <4a159e51$0$48226$815e3792@news.qwest.net>

Paul wrote:
> Hello,
> 
> Wonder if any regex wizards could help out here.
> 
> I need to be able to extract from  entries in a file:-
> 1,Question,1,Select,"_location","Location to Deploy","London Pod 
> 1=>LOCATION_London_-_Test_Lab","London Pod 2=>LOCATION_London_-_Test_Lab2"

use Text::CSV;

> 
> What I need to feed into an array is the bits between => and  the " at 
> the end of the field. The LOCATION_London_-_Test_Lab and the 
> LOCATION_London_-_Test_Lab2 entries.

Then it'd be a simple split or string substitution, on the value
of the column you're interested in.


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

Date: Thu, 21 May 2009 14:33:53 -0400
From: Henning Follmann <hfollmann@itcfollmann.com>
Subject: Re: regex help
Message-Id: <87vdnu8fvy.fsf@newton.itcfollmann.com>

Paul <paulATseymourworldDOTcoDOTuk> writes:

> Hello,
>
> Wonder if any regex wizards could help out here.
>
> I need to be able to extract from  entries in a file:-
> 1,Question,1,Select,"_location","Location to Deploy","London Pod
> 1=>LOCATION_London_-_Test_Lab","London Pod
> 2=>LOCATION_London_-_Test_Lab2"
>
> What I need to feed into an array is the bits between => and  the " at
> the end of the field. The LOCATION_London_-_Test_Lab and the
> LOCATION_London_-_Test_Lab2 entries.
>
> Been scratching my head on this for a while now.
>

It looks like the file is a csv.
Why don't you use Text::CSV to parse that file and then extract from 
that field?
Or split?

/\d*=>([-_a-zA-Z]+)\"/

The first sub regex should include that string.


HTH
Henning

-- 
Henning Follmann           | hfollmann@itcfollmann.com
it consultant              | www.itcfollmann.com


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

Date: Thu, 21 May 2009 12:16:44 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: regex help
Message-Id: <70ab15ln5n0uumokrnujk6lict1nc6d3la@4ax.com>

Paul <paulATseymourworldDOTcoDOTuk> wrote:
>Wonder if any regex wizards could help out here.

Why do you want to go a complicated route when there is a simple
solution?

>I need to be able to extract from  entries in a file:-
>1,Question,1,Select,"_location","Location to Deploy","London Pod 
>1=>LOCATION_London_-_Test_Lab","London Pod 
>2=>LOCATION_London_-_Test_Lab2"
>
>What I need to feed into an array is the bits between => and  the " at 
>the end of the field. The LOCATION_London_-_Test_Lab and the 
>LOCATION_London_-_Test_Lab2 entries.

use Text::CSV;

grab the seventh element, split() at the '=>', and grab the second
element.

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


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