Re: split then match, regex better?

2008-01-09 Thread oryann9
Happy New Year. I have a series of values with the following form: TO_Chr10_final.txt I would like to obtain the value 10, for accounting purposes: my $chr = ( split /_/ , $value ) [ 1 ] ; $chr =~ /chr/i ; $chr = $' ; This seems convoluted. Could someone please criticize this approach or off

Re: More installing modules issues - using a local directory

2008-01-09 Thread yitzle
Done. Thanks! On Jan 9, 2008 5:11 PM, Tom Phoenix <[EMAIL PROTECTED]> wrote: > On Jan 9, 2008 1:38 PM, yitzle <[EMAIL PROTECTED]> wrote: > > > I installed LWP manually into a local directory (~/perl) > > When I try to install WWW::Mechanize, it finds the old version - not > > the new local version

Re: print a selection of a file

2008-01-09 Thread Rob Dixon
[EMAIL PROTECTED] wrote: Hello, I try to print (get) a specific text selection from a text file, but I don't know how to do it: What I try todo is to open a file search a string and print the follow lines from that string until he found a white line. then he need to stop. so c

Re: Q: how to push into array

2008-01-09 Thread John W. Krahn
ciwei wrote: HI, a quetion from a newbie to perl. I have a program that extract some fields: #!/usr/bin/perl -w use strict; my ( $host, $hba, $storage, $fa ,$initiator , $target ) ; It appears that you don't really need those variables in file scope. my %wwn = (); while ( ) { next unles

Re: split then match, regex better?

2008-01-09 Thread John W. Krahn
Kevin Viel wrote: Happy New Year. I have a series of values with the following form: TO_Chr10_final.txt I would like to obtain the value 10, for accounting purposes: my $chr = ( split /_/ , $value ) [ 1 ] ; $chr =~ /chr/i ; $chr = $' ; This seems convoluted. Could someone please criticize

Re: split then match, regex better?

2008-01-09 Thread Chas. Owens
On Jan 9, 2008 1:07 PM, Kevin Viel <[EMAIL PROTECTED]> wrote: > Happy New Year. > > I have a series of values with the following form: > > TO_Chr10_final.txt > > I would like to obtain the value 10, for accounting purposes: > > my $chr = ( split /_/ , $value ) [ 1 ] ; > $chr =~ /chr/i ; > > $chr =

Re: Q: how to push into array

2008-01-09 Thread Chas. Owens
On Jan 9, 2008 4:12 PM, ciwei <[EMAIL PROTECTED]> wrote: snip >push $wwn{$initiator}, $1 if /WWN:\s+(1000\d{12})/; >push $wwn{$target} , $1 if /WWN:\s+(500\d{13})/; snip > Type of arg 1 to push must be array (not hash elem) at ./ > emc_parse_switch_zone.pl line 20, near "$1 if"

Q: how to push into array

2008-01-09 Thread ciwei
HI, a quetion from a newbie to perl. I have a program that extract some fields: #!/usr/bin/perl -w use strict; my ( $host, $hba, $storage, $fa ,$initiator , $target ) ; my %wwn = (); while ( ) { next unless /\s+([A-Z]\w+)[_-](HBA\d)[_-]([A-Z]\w+)[_-](\w+)\s+ ... WWN: \d\d\d\d\w{12}/; ( $host,

split then match, regex better?

2008-01-09 Thread Kevin Viel
Happy New Year. I have a series of values with the following form: TO_Chr10_final.txt I would like to obtain the value 10, for accounting purposes: my $chr = ( split /_/ , $value ) [ 1 ] ; $chr =~ /chr/i ; $chr = $' ; This seems convoluted. Could someone please criticize this approach or off

Re: find2perl

2008-01-09 Thread Tom Phoenix
On Jan 9, 2008 12:21 PM, oryann9 <[EMAIL PROTECTED]> quoted Randal Schwartz: > > You're misusing it. Set it within the wanted() routine when you're > Is this what you mean on line 9? I tried and it does not seem to work, > meaning it still descending. > > 1 sub find_me { > 2

Re: More installing modules issues - using a local directory

2008-01-09 Thread Tom Phoenix
On Jan 9, 2008 1:38 PM, yitzle <[EMAIL PROTECTED]> wrote: > I installed LWP manually into a local directory (~/perl) > When I try to install WWW::Mechanize, it finds the old version - not > the new local version - and fails. The new version needs to be the first one found by looking in the @INC d

More installing modules issues - using a local directory

2008-01-09 Thread yitzle
I installed LWP manually into a local directory (~/perl) When I try to install WWW::Mechanize, it finds the old version - not the new local version - and fails. > perl Makefile.PL -snip- > Warning: prerequisite LWP 5.802 not found. We have 5.79. The make test fails miserably. How do I modify the

Re: find2perl

2008-01-09 Thread oryann9
oryann9> No, but good point. My intent was to determine when -prune was set on oryann9> the CLI what the De-parsed code told me, 1==true, 0==false because oryann9> when I run this code below prune = 0 is not working, its descending oryann9> down "/". You're misusing it. Set it within the wan

Re: perl template toolkit - modify variable

2008-01-09 Thread perlmunky
Sorry, I am a fool. I found the methods in the VMethods section of the tt website. Sorry. I have used: name.0.remove('.*\.') to sort the problem On Jan 9, 2008 4:13 PM, perlmunky <[EMAIL PROTECTED]> wrote: > Hi list, > > I am trying to generate a web page containing a form which is constru

Re: Error installing a module - what do I do?

2008-01-09 Thread Chas. Owens
On Jan 9, 2008 10:50 AM, yitzle <[EMAIL PROTECTED]> wrote: snip > > > Can't locate Devel/Sysdump.pm in @INC (@INC contains: > >^ > > > > > $ make install > > > Installing /usr/lib/perl5/site_perl/5.8/Devel/Symdump.pm > > ^ sn

perl template toolkit - modify variable

2008-01-09 Thread perlmunky
Hi list, I am trying to generate a web page containing a form which is constructed automagically with catalyst. The variable which is passed to the template is an array ( [% column_names %] ) each element in the array looks like: foo.bar foo.baz oof.rab oof.zab ... As I loop over t

Re: Error installing a module - what do I do?

2008-01-09 Thread yitzle
On 1/9/08, Chas. Owens <[EMAIL PROTECTED]> wrote: > If you switch to a monospace font you will see that the caret > character is pointing to the third character in Sysdump and Symdump > respectively, not to the directory. Oops. OK. I guess its working now ;) Thanks, everyone, for the help! -- To

Re: Error installing a module - what do I do?

2008-01-09 Thread yitzle
>From before: $ make install Installing /usr/lib/perl5/site_perl/5.8/Devel/Symdump.pm (@INC contains: ... /usr/lib/perl5/site_perl/5.8 On 1/9/08, Peter Scott <[EMAIL PROTECTED]> wrote: > On Wed, 09 Jan 2008 10:06:51 -0500, yitzle wrote: > > It all seemed to have worked. Except I get an error whe

Re: Error installing a module - what do I do?

2008-01-09 Thread Peter Scott
On Wed, 09 Jan 2008 10:06:51 -0500, yitzle wrote: > It all seemed to have worked. Except I get an error when I try to use it: > __ERROR__ > Can't locate Devel/Sysdump.pm in @INC (@INC contains: ^ > $ make install > Installing /usr/lib/perl5/site_perl/5.8/Devel/Symdump.pm

Re: Error installing a module - what do I do?

2008-01-09 Thread yitzle
It all seemed to have worked. Except I get an error when I try to use it: __ERROR__ Can't locate Devel/Sysdump.pm in @INC (@INC contains: /usr/lib/perl5/5.8/cygwin /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/cygwin /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_

Re: print a selection of a file

2008-01-09 Thread Paul Lalli
On Jan 9, 4:36 am, [EMAIL PROTECTED] (Jonay Herrera) wrote: > Hello, > > I try  to  print (get)  a specific text selection from  a  text file, > but  I don't know  how to  do  it: > What I try  todo  is  to open a  file search  a string and  print > the  follow lines from that  string until he foun

Re: parsing post parameters

2008-01-09 Thread Paul Lalli
On Jan 9, 4:57 am, [EMAIL PROTECTED] (Perlmunky) wrote: > Hi list, > > I am working on a catalyst project and would have been attempting to create > a user page (form) that allows someone to create an sql query to hammer a > local DB (all secure-ish - maybe).  I have used a javascript function to >

Re: print a selection of a file

2008-01-09 Thread Martin Barth
> #!/opt/perl/bin/perl -w > use strict; > > #variable > > my @horcm_file; > > > sub readdata{ > open(HORCM, "/etc/horcm10.conf") || die ("File error"); > @horcm_file = ; > chomp(@horcm_file); > close(HORCM); > return(@horcm_file); > } > > my @pipo=readdata(); > > foreach (@pipo){ >

print a selection of a file

2008-01-09 Thread jonay . herrera
Hello, I try to print (get) a specific text selection from a text file, but I don't know how to do it: What I try todo is to open a file search a string and print the follow lines from that string until he found a white line. then he need to stop. so can i get the lines (stri

parsing post parameters

2008-01-09 Thread perlmunky
Hi list, I am working on a catalyst project and would have been attempting to create a user page (form) that allows someone to create an sql query to hammer a local DB (all secure-ish - maybe). I have used a javascript function to return the post options and used the catalyst method $c->request->